Equipment detection method, electronic equipment and storage medium
By detecting the synchronization word in the Bluetooth communication message to obtain the address and store the device information, and by combining the parallel reception of signals from broadband and WiFi receivers, the problems of high power consumption, slow speed and low accuracy in Bluetooth device detection are solved, and low power consumption and high accuracy device query are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2026-03-10
AI Technical Summary
Bluetooth devices are susceptible to interference in short-range communication. Existing detection methods suffer from high power consumption, slow query speed, low accuracy, and are prone to missing devices.
By detecting the synchronization word in the communication message, the Bluetooth address is obtained and the device information is stored. The detection accuracy is improved by using sliding window and decoding technology. The signal is received in parallel by combining a broadband receiver and a WiFi receiver, and the receiving bandwidth is flexibly selected to improve the detection efficiency.
It achieves low-power, high-precision Bluetooth device detection, reduces the probability of false identification, and improves the speed and accuracy of device lookup.
Smart Images

Figure CN121645196A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Bluetooth devices, and particularly relates to a device detection method, an electronic device and a storage medium. BACKGROUND
[0002] With the development of communication technology, the number of Bluetooth devices also increases rapidly. There are usually multiple other Bluetooth devices in the vicinity of a Bluetooth device, and the coexistence of these devices will be interfered by short-distance communication.
[0003] Therefore, in order to avoid the communication interference between Bluetooth devices and other problems, how to detect other Bluetooth devices in the vicinity of a Bluetooth device has become a technical problem to be solved. SUMMARY
[0004] In order to solve the above technical problems, the present application provides a device detection method, an electronic device and a storage medium. In the method, the first Bluetooth address can be obtained through the synchronization word in the communication message. Since each first Bluetooth address can mark a Bluetooth device, after storing the device information of the Bluetooth device corresponding to the first Bluetooth address, the accurate query of the Bluetooth device can be realized.
[0005] In a first aspect, the present application provides a device detection method. The device detection method is applied to a first Bluetooth device. The device detection method comprises: receiving a first communication message sent by a second Bluetooth device; detecting a synchronization word in the first communication message; in the case that the synchronization word is detected in the first communication message, determining a first Bluetooth address based on the synchronization word; and storing device information of a third Bluetooth device in a preset storage area. The third Bluetooth device is a Bluetooth device corresponding to the first Bluetooth address, and the preset storage area is used to store the device information of the Bluetooth device detected by the first Bluetooth device.
[0006] According to the embodiments of the present application, since the synchronization word field of the communication message of the classic Bluetooth device is generated according to the Bluetooth address of the device, the Bluetooth device can calculate the Bluetooth address of other classic Bluetooth devices through the synchronization word in the communication message after obtaining the communication message packet of other Bluetooth devices. Since each Bluetooth address can mark a Bluetooth device, after obtaining the Bluetooth address and storing the device information of the Bluetooth device corresponding to the Bluetooth address, the accurate query of the Bluetooth device can be realized.
[0007] Exemplarily, the first Bluetooth device can be a classic Bluetooth device, which can be a host device.
[0008] Exemplarily, the second Bluetooth device and the third Bluetooth device can be communication parties. Alternatively, the second Bluetooth device and the third Bluetooth device can be the same Bluetooth device.
[0009] Exemplarily, the first communication message can be a message for detection, such as the first communication message can be a Bluetooth data packet, such as a BR data packet or an EDR data packet, which conforms to a physical layer frame format.
[0010] Exemplarily, the first Bluetooth address can be a LAP address of the third Bluetooth device.
[0011] Exemplarily, the device information can include time-frequency information, i.e., can include a receiving time of the first communication message and a transmission frequency of the first communication message.
[0012] Exemplarily, the first Bluetooth address and the device information can be stored in a preset storage area in correspondence.
[0013] According to the first aspect, the synchronization word detection on the first communication message comprises: determining a first field in the first communication message, the first field being a probability value of a preamble being greater than zero; and determining a synchronization word in the first communication message based on position information of the first field in the first communication message.
[0014] In this way, the position of the synchronization word in the first communication message can be determined quickly and accurately by detecting the preamble, and the overall device detection efficiency is further improved.
[0015] Exemplarily, the first field can be a suspected preamble field. The first field can be 0101 or 1010.
[0016] Exemplarily, the suspected preamble field can be detected by means of self-correlation or cross-correlation.
[0017] According to the first aspect, or any one of the implementation manners of the first aspect, the determining of the synchronization word in the first communication message based on the position information of the first field in the first communication message comprises: determining a plurality of second fields based on the first communication message based on the position information of the first field in the first communication message, wherein each second field is a probability of a synchronization word being greater than zero; and determining the synchronization word in the plurality of second fields.
[0018] In this way, after detecting the suspected preamble, a plurality of suspected synchronization word signals can be found near the suspected preamble for synchronization word detection, and the detection reliability is improved.
[0019] According to the first aspect, or any one of the implementation manners of the first aspect, the determining of the plurality of second fields based on the first communication message comprises: determining a first position based on the position information; and obtaining a plurality of first signals by sliding a first window in the first communication message starting from the first position.
[0020] In this way, multiple first signals can be found through the sliding window, the multiple first signals are subjected to the synchronization word detection, the synchronization word can be accurately found, the missing detection probability is reduced, and the detection precision is improved.
[0021] Exemplarily, the position information can be moved to the left by a preset distance to obtain the first position. For example, the position information can be moved to the left by a length of a preset number of samples to obtain the first position.
[0022] Exemplarily, the first window can be a sliding window. The length of the first window is the length of the 64-bit digital signal.
[0023] Exemplarily, the first window can be moved to the right by a length of one sample each time. The right is the direction of the signal received later in the time dimension. Exemplarily, if multiple signal samples are performed in the process of receiving the first communication message, if the starting position of the first window is the signal position corresponding to the pth sample, the starting position after the first sliding is the signal position corresponding to the (p+1)th sample, and the like is sequentially deduced until the sliding is completed. Wherein, p can be any integer greater than or equal to 1.
[0024] Exemplarily, the demodulation can be performed in the GFSK mode.
[0025] According to the first aspect, or any one of the implementation forms of the above first aspect, based on the synchronization word, the first Bluetooth address is determined, including: based on the synchronization word, a code word is determined; the code word is decoded to obtain the position of the first bit of the code word, the first bit being an error bit; in the case that the number of the first bit is less than or equal to a preset number threshold, the first Bluetooth address is determined based on the code word.
[0026] In this way, since the code word has the characteristics of the BCH code, the position of the error bit can be determined by decoding the code word, and whether the synchronization word is reliable can be determined according to the number of error bits, thereby improving the detection precision.
[0027] Exemplarily, the code word can be determined and decoded for each second field, and the second field in which the number of error bits is less than a preset data threshold is determined as the synchronization word.
[0028] Exemplarily, the preset number threshold can be 5 or a value less than 5, which can be determined according to actual conditions, and no specific limitation is made thereto.
[0029] According to the first aspect, or any one of the implementation forms of the above first aspect, after storing the device information of the third Bluetooth device in the preset storage area, the method further includes: deleting the device information of the third Bluetooth device when the device information of the third Bluetooth device in the preset storage area is unchanged within a preset time length.
[0030] In this way, the device information of the incorrect LAP address can be deleted, the accuracy of the recorded information is improved, and the device information of the classic Bluetooth device can be deleted in time after the classic Bluetooth device is out of the Bluetooth search range or offline, thereby reducing the storage pressure of the device information.
[0031] For example, if the new device information of the third Bluetooth device is not received within the preset time length, the device information of the third Bluetooth device can be deleted.
[0032] For example, the electronic device can delete the device information of the third device when a difference between a current time and a first time is greater than or equal to a preset time length. The first time can be a maximum value of the receiving times in the device information of the third Bluetooth device.
[0033] According to the first aspect, or any one of the implementations of the first aspect, after the first Bluetooth address is determined based on the synchronization word, the method further includes: detecting whether the first communication message has been completely transmitted; receiving a second communication message sent by a fourth device in a case where the first communication message has been completely transmitted; in a case where the synchronization word is detected in the second communication message, determining a second Bluetooth address based on the synchronization word in the second communication message; and storing device information of a fifth Bluetooth device in a preset storage area, the fifth Bluetooth device being a Bluetooth device corresponding to the second Bluetooth address.
[0034] In this way, since the data (such as the payload part) after the Bluetooth data packet is not needed in the technical solution of the embodiment of the application after the LAP is obtained, the data after the Bluetooth data packet has a probability of triggering the detection of the suspected preamble. In this way, by judging that the first communication message has been completely received, the misidentification of the payload part can be prevented, and the calculation pressure is reduced.
[0035] For example, the average signal strength of the access code part of the first communication message can be calculated, and the first signal strength of the received signal can be obtained. In a case where a difference between the average signal strength and the first signal strength is greater than or equal to a preset difference, device detection is performed on the new second communication message.
[0036] In this embodiment, since the signal strength of the Bluetooth data packet is high, the superimposed signal strength is high during the reception of the Bluetooth data packet, and the superimposed signal strength is low after the reception is completed. Therefore, the processing can be continued after the transmission of the Bluetooth data packet is completed in the embodiment of the application, the probability of misidentification is reduced, and the calculation pressure is reduced.
[0037] According to a first aspect, or any possible implementation mode of the first aspect, the first Bluetooth device comprises a first receiver, the first receiver is configured to receive a Bluetooth signal, a bandwidth of the first receiver is greater than or equal to a bandwidth of the Bluetooth receiver; and the first Bluetooth device is configured to receive the first communication message sent by the second Bluetooth device, comprising: receiving, by the first receiver, the first signals of the J frequency channels in parallel, J is an integer greater than 1; and wherein, in a case that a frequency corresponding to any one of the J frequency channels is consistent with a transmission frequency of the first communication message, the first signal of the any one of the J frequency channels comprises the first communication message.
[0038] In this way, the signals of multiple frequency channels can be received in parallel for detection, and the detection efficiency is improved.
[0039] Exemplarily, the first receiver can be a wideband receiver. Exemplarily, the bandwidth of the first receiver can be 8MHz, 16MH, 32MH, 40MHz, etc.
[0040] According to the first aspect, or any possible implementation mode of the first aspect, after receiving, by the first receiver, the first signals of the J frequency channels in parallel, the first Bluetooth device is further configured to receive the first communication message sent by the second Bluetooth device, comprising: detecting the first communication message from the first signals of the J frequency channels, and obtaining the first communication message.
[0041] In this way, subsequent processing can be performed after the first communication message is detected, and the processing efficiency is improved.
[0042] According to the first aspect, or any possible implementation mode of the first aspect, detecting the first communication message from the first signals of the J frequency channels, comprises: down-converting the first signals of each of the J frequency channels to obtain second signals of the J frequency channels; superimposing the second signals of the J frequency channels to obtain a third signal; obtaining a signal strength of the third signal; and in a case that the signal strength is greater than or equal to a preset threshold, determining the third signal as the first communication message.
[0043] In this way, it can be quickly determined whether the first communication message exists by superimposition, and the scanning efficiency is improved.
[0044] According to the first aspect, or any possible implementation mode of the first aspect, the first Bluetooth device comprises a WiFi receiver, and the first Bluetooth device is configured to receive the first communication message sent by the second Bluetooth device, comprising: receiving, by the WiFi receiver, fourth signals of the K frequency channels in parallel, K is an integer greater than 1; and wherein, in a case that a frequency corresponding to any one of the K frequency channels is consistent with a transmission frequency of the first communication message, the signal of the any one of the K frequency channels comprises the first communication message.
[0045] In this way, the wideband capability of the WiFi receiver can be used to quickly scan the Bluetooth signal, and the detection efficiency is improved.
[0046] Exemplarily, the bandwidth of the WiFi receiver can be 20MHz, 40MHz, 80MHz, 160MHz, etc.
[0047] Exemplarily, in the case that the first Bluetooth device comprises the WiFi receiver, the fourth signals of the K channels can be received in parallel through the radio frequency part and the ADC of the WiFi receiver and then analog-to-digital converted.
[0048] According to the first aspect, or any one of the implementations of the first aspect, after receiving the fourth signals of the K channels in parallel through the WiFi receiver, the receiving of the first communication message sent by the second Bluetooth device further comprises: detecting the fourth signals of the K channels for the first communication message, and obtaining the first communication message.
[0049] According to the first aspect, or any one of the implementations of the first aspect, the detecting of the fourth signals of the K channels for the first communication message comprises: down-converting the fourth signals of each of the K channels to obtain fifth signals of the K channels; superimposing the fifth signals of the K channels to obtain a sixth signal; obtaining a signal strength of the sixth signal; and in the case that the signal strength is greater than or equal to a preset threshold, determining the sixth signal as the first communication message.
[0050] According to the first aspect, or any one of the implementations of the first aspect, the first Bluetooth device comprises the WiFi receiver and a first receiver, and the receiving of the first communication message sent by the second Bluetooth device comprises: in a first condition, receiving signals of the K channels in parallel through the WiFi receiver; and in a second condition, receiving signals of the J channels in parallel through the first receiver.
[0051] K is greater than J.
[0052] In this way, the receiving bandwidth can be flexibly selected according to actual conditions, and the flexibility and reliability of the receiving are improved.
[0053] Exemplarily, the signals of the J channels can be received in an environment with many people, and the signals of the K channels can be received in parallel in an environment with few people.
[0054] Exemplarily, the signals of the J channels can be received in a low-power mode.
[0055] Exemplarily, if two or more Bluetooth signals are scanned at the same time, the K channels can be switched to the J channels.
[0056] In a second aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors, one or more memories; the one or more memories are coupled to the one or more processors, and the one or more memories are configured to store computer program codes, the computer program codes comprising computer instructions, when the one or more processors execute the computer instructions, the electronic device is caused to perform the method in the first aspect.
[0057] In a third aspect, an embodiment of the present application provides a computer readable storage medium, comprising computer instructions, when the computer instructions are run on an electronic device, the electronic device is caused to perform the method in the first aspect.
[0058] In a fourth aspect, an embodiment of the present application provides a chip or chip system, comprising processing circuitry and interface circuitry, the interface circuitry is configured to receive code instructions and transmit to the processing circuitry, and the processing circuitry is configured to run the code instructions to perform the method in the first aspect.
[0059] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising computer programs, when the computer programs are run on a computer, the computer is caused to perform the method in the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0060] Figure 1 A scenario information of a classic Bluetooth device provided by an embodiment of the present application is shown;
[0061] Figure 2 A frequency diagram of Bluetooth communication provided by an embodiment of the present application is shown;
[0062] Figures 3-5 A schematic diagram of frequency hopping transmission of a query packet provided by an embodiment of the present application is shown;
[0063] Figure 6 A schematic diagram of an exemplary Bluetooth device address provided by an embodiment of the present application is shown;
[0064] Figure 7 A schematic diagram of a physical layer frame format of an exemplary BR data packet provided by an embodiment of the present application is shown;
[0065] Figure 8 A schematic diagram of a physical layer frame format of an exemplary EDR data packet provided by an embodiment of the present application is shown;
[0066] Figures 9A-9B A schematic diagram of an exemplary preamble field provided by an embodiment of the present application is shown;
[0067] Figure 10 A schematic diagram of a generation process of a synchronization word field provided by an embodiment of the present application is shown;
[0068] Figure 11 A schematic diagram of an exemplary Bluetooth communication system is shown;
[0069] Figure 12 A schematic diagram of an exemplary Bluetooth communication system is shown;
[0070] Figure 13 A schematic diagram of another exemplary Bluetooth communication system is shown;
[0071] Figure 14 A schematic diagram of a classic Bluetooth device is shown;
[0072] Figure 15 A circuit schematic diagram of a wireless communication module is shown;
[0073] Figure 16 A circuit schematic diagram of another wireless communication module is shown;
[0074] Figure 17A A circuit schematic diagram of yet another wireless communication module is shown;
[0075] Figure 17B A circuit schematic diagram of still another wireless communication module is shown;
[0076] Figure 18 A schematic diagram of a device detection circuit is shown;
[0077] Figure 19 A flow diagram of a device detection method is shown;
[0078] Figure 20 A schematic diagram of an exemplary signal superposition process is shown;
[0079] Figure 21 A schematic diagram of an exemplary sliding window detection of a synchronization word is shown;
[0080] Figure 22 A schematic diagram of error correction of a candidate synchronization word field is shown;
[0081] Figure 23 A schematic diagram of an exemplary time-frequency information storage space is shown;
[0082] Figure 24 A schematic diagram of an exemplary time-frequency information storage space is shown;
[0083] Figure 25 Fig. 1 shows a schematic diagram of an exemplary time-frequency information storage space provided by an embodiment of the present application;
[0084] Figure 26 Fig. 2 shows an architecture diagram of a Bluetooth protocol stack provided by an embodiment of the present application;
[0085] Figure 27 Fig. 3 is a software structure block diagram of an electronic device according to an embodiment of the present application;
[0086] Figure 28 Fig. 4 is another software structure block diagram of an electronic device according to an embodiment of the present application;
[0087] Figure 29 Fig. 5 shows a schematic block diagram of an apparatus according to an embodiment of the present application. DETAILED DESCRIPTION
[0088] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0089] The term "and / or" in the present application is only used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone.
[0090] The terms "first" and "second" and the like in the description and claims of the present application are used to distinguish different objects, and are not used to describe a specific order of the objects. For example, the first target object and the second target object are used to distinguish different target objects, and are not used to describe a specific order of the target objects.
[0091] In the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design presented as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or advantageous than other embodiments or design solutions. Rather, the use of "exemplary" or "for example" is intended to present concepts in a concrete manner.
[0092] In the description of the embodiments of the present application, unless otherwise specified, "a plurality of" means two or more. For example, a plurality of processing units means two or more processing units; a plurality of systems means two or more systems.
[0093] Bluetooth (BT) technology is an open global specification for wireless data communication, which is based on low-cost short-range wireless connection to establish a special wireless connection for the communication environment between devices. Because Bluetooth technology can enable electronic devices to communicate with each other without cables, it can be widely used in low-power Internet of Things devices, sensors, smart homes, wearable smart devices, wireless earphones, and the like.
[0094] According to the Bluetooth standard, Bluetooth devices can include low-power Bluetooth (BLE) devices and classic Bluetooth (Basic Rate / Enhanced Data Rate, BR / EDR) devices. Since low-power Bluetooth BLE supports audio and voice functions in newer versions, existing Bluetooth audio devices such as Bluetooth earphones, speakers, microphones, and the like still use classic Bluetooth (BR / EDR). Among them, the working frequency band of the classic Bluetooth device is 2.402 GHz-2.480 GHz, the frequency band interval is 1 MHz, and a total of 79 frequency channels are defined, i.e., 2402+k MHz (k=0, 1, …, 78).
[0095] With the development of communication technology, the number of Bluetooth devices has also rapidly increased. For example, with the popularization of Bluetooth devices such as True Wireless Stereo (TWS), the number of classic Bluetooth devices has also increased explosively.
[0096] In the process of the growth of the number of Bluetooth devices, there are often multiple Bluetooth devices in the same scene. For example, taking classic devices as an example, in some places with a large number of people, such as shopping malls, subways, offices, restaurants, etc., there are often a large number of classic Bluetooth devices. For example, Figure 1 A scenario information of a classic Bluetooth device is shown. As Figure 1 shown, there are multiple classic Bluetooth devices (indicated by Bluetooth symbols in the figure) 12 in the elevator 11, such as the mobile phone, Bluetooth earphone, smart watch, etc. of each user. For example, in a large shopping mall, there may be several hundred classic Bluetooth devices in the vicinity of the same location.
[0097] The coexistence of these Bluetooth devices can cause interference to the short-range communication of the Bluetooth devices. Exemplarily, Figure 2 A frequency diagram of Bluetooth communication is shown. As Figure 2As shown, the Bluetooth device will switch the channel once after each packet is sent or received, that is, according to the Bluetooth protocol, regularly frequency hopping in the frequency range of 2.402GHz-2.480GHz. Therefore, for each classic Bluetooth device, if it can obtain the time-frequency information of the frequency hopping of other classic Bluetooth devices around it, it can evade based on this and prevent other classic Bluetooth devices from interfering with the communication of the classic Bluetooth device.
[0098] Therefore, how to detect other Bluetooth devices around a Bluetooth device has become a technical problem to be solved.
[0099] In a related technology, the detection method (or scanning method or query method) of a classic Bluetooth device can include that the user device broadcasts and sends a query packet in a frequency hopping manner, wherein the query packet is a non-encrypted broadcast packet, which only has a query function, and any classic Bluetooth device can receive the query packet. When the classic Bluetooth device in the communication range receives the query packet, it can return its device information to the user device. In this way, the user device can query the device information of the classic Bluetooth device.
[0100] Specifically, Figures 3-5 A schematic diagram of frequency hopping sending of a query packet provided by an embodiment of the application is shown. Wherein the first part 30 in Figure 4 is enlarged along the horizontal direction, and the second part 40 in Figure 3 is enlarged along the vertical direction. As shown in Figure 3 , in a time period, the user device will frequency hop and send a query packet 31 (i.e. the dot pattern filling block in Figure 3 ) in 16 frequency bands. And in the next time period, as shown in Figure 4 , the user device will frequency hop and send a query packet 31 in another 16 frequency bands. And as shown in Figure 5 , after a period of time (such as 17200ms), the Bluetooth device around receives the query packet and returns its device information 41 (i.e. the black filling block and the diagonal pattern filling block in Figure 5 ) to the user device, at this time the user device has queried the information of this device.
[0101] However, the inventors have found through research that this method has many problems as follows:
[0102] Problem 1: Because other devices need to receive the query packet, the user device needs to send a large number of query packets with high power for device discovery, and in order to enable other devices to be discovered as much as possible, the transmission power generally needs to be set to the highest value, which has high power consumption.
[0103] Problem 2: In the case that the channel received by the queried device does not correspond to the frequency band sent by the user equipment (for example, the 16 frequencies sent by the query package do not correspond to the received frequency band of the queried device), the query delay is high and the query speed is slow.
[0104] Problem 3: When some devices are in a working state, the scanning of the query package may be affected, and the scanning may be missed, thereby affecting the query accuracy.
[0105] Problem 4: When some devices receive the query package but do not return the device information, the device cannot be queried, thereby affecting the query accuracy.
[0106] To solve at least one of the above problems, an embodiment of the present application provides a device detection method, which can detect Bluetooth devices within the communication range of the Bluetooth devices.
[0107] Before introducing the technical solutions of the embodiments of the present application, the technical terms involved in the embodiments of the present application are first described to facilitate understanding.
[0108] (1) Bluetooth address.
[0109] Figure 6 An exemplary schematic diagram of a Bluetooth device address provided by an embodiment of the present application is shown. The least significant bit (LSB) is used to identify the least significant bit in the binary string, and the most significant bit (MSB) is used to identify the most significant bit in the binary string.
[0110] Specifically, as shown in Figure 6 Each Bluetooth device has a 48-bit Bluetooth device address, which is used to uniquely identify the Bluetooth device. The Bluetooth device address includes three parts: a lower address part (LAP), an upper address part (UAP), and a no-significant address part (NAP). The LAP includes the lowest 24 bits, which uniquely identifies the Bluetooth device within a certain range. The UAP includes the middle 8 bits, and the NAP includes the highest 16 bits.
[0111] In the embodiments of the present application, the LAP address can be used as the first Bluetooth address.
[0112] (2) Physical layer frame format
[0113] Figure 7 An exemplary schematic diagram of the physical layer frame format of a BR data packet provided by an embodiment of the present application is shown. As Figure 7As shown, the BR data packet 71 can include three parts: an Access Code field, a Header field and a Payload field. The BR data packet 71 adopts a Gauss frequency Shift Keying (GFSK) modulation technique.
[0114] Figure 8 An exemplary physical layer frame format of an EDR data packet is shown in FIG. 8. As shown in FIG. 8, the EDR data packet 81 includes the following parts: an Access Code field, a Header field, a Guard field, a SYNC field, an Enhanced Data Rate Payload field and a Trailer field. The EDR data packet 81 adopts a GFSK modulation technique before the packet header and adopts a Differential Phase Shift Keying (DPSK) modulation technique after the packet header. Figure 8
[0115] It can be seen from FIGS. 7 and 8 that the BR data packet 71 and the EDR data packet 81 both include an Access Code field and a Header field. The Access Code field is a classical Bluetooth design preamble and is used for synchronization in classical Bluetooth communication. The Header field contains some information related to the data packet. The Payload field after the BR data packet 71 is used to carry data, and the Enhanced Data Rate Payload field after the EDR data packet 81 is also used to carry data. Figure 7 Figure 8 In addition, continuing to refer to FIGS. 7 and 8, the Access Code field can include 68 bits or 72 bits, each bit being 0 or 1. Specifically, the Access Code field can include a Preamble field, a Sync Word field and a Trailer field (the Access Code field of a partial data packet can not include the Trailer field, and the Access Code field of a partial data packet can include the Trailer field).
[0116] In addition, continuing to refer to FIGS. 7 and 8, the Access Code field can include 68 bits or 72 bits, each bit being 0 or 1. Specifically, the Access Code field can include a Preamble field, a Sync Word field and a Trailer field (the Access Code field of a partial data packet can not include the Trailer field, and the Access Code field of a partial data packet can include the Trailer field). Figure 7 Figure 8 In addition, continuing to refer to FIGS. 7 and 8, the Access Code field can include 68 bits or 72 bits, each bit being 0 or 1. Specifically, the Access Code field can include a Preamble field, a Sync Word field and a Trailer field (the Access Code field of a partial data packet can not include the Trailer field, and the Access Code field of a partial data packet can include the Trailer field).
[0117] In addition, continuing to refer to FIGS. 7 and 8, the Access Code field can include 68 bits or 72 bits, each bit being 0 or 1. Specifically, the Access Code field can include a Preamble field, a Sync Word field and a Trailer field (the Access Code field of a partial data packet can not include the Trailer field, and the Access Code field of a partial data packet can include the Trailer field). Figures 9A-9B An exemplary Preamble field is shown in FIG. 9. As shown in FIG. 9, the Preamble field can include 4 bits. Figure 9A Figure 9B As shown, the preamble field can be either "1010" or "0101". Specifically, when the least significant bit of the synchronization word field is 1, the preamble field can be "1010"; when the least significant bit of the synchronization word field is 0, the preamble field is "0101". Accordingly, when generating the access code field, the synchronization word field can be generated first, and then the preamble field can be generated based on whether the least significant bit of the synchronization word field is 0 or 1.
[0118] The Sync Word field may include 64 bits. In some embodiments of this application, after the master device establishes a Bluetooth connection with the slave device, the Sync Word field in the Bluetooth data packets of the master device and the data packets of the slave device may be generated based on the LAP address of the master device. In other embodiments of this application, during paging, the Sync Word field in the data packets of the master device and the data packets of the slave device may be generated based on the LAP address of the slave device. It should also be noted that, for ease of description, in the following sections of the embodiments of this application, BR data packets and EDR data packets conforming to the above frame format will be referred to as Bluetooth data packets.
[0119] For example, Figure 10 This diagram illustrates a process for generating a synchronization word field according to an embodiment of this application. Figure 10 As shown, the process of generating the synchronization word field may include the following steps one through five.
[0120] Step 1: The Bluetooth device obtains the 24-bit LAP address a1a2…a from the master device. 23 Then, a 6-bit string can be appended to the end of the LAP address to form a 30-bit first string. For example, if the highest bit 'a' of the LAP address... 23 If the value is 0, then the string "101a" can be concatenated, meaning "001101" is appended to the end of the LAP address. Also, if the highest bit of the LAP address is 'a'... 23 If the value is 1, then the string 101b can be concatenated, which means "110010" is appended to the end of the LAP address.
[0121] Step 2: For the first 30-bit string mentioned above, it can be compared with bits 34 to 63 of a pseudo-random noise (PN) sequence. 34 …p 63 Perform an XOR operation to obtain 30 bits of data to be encoded (Datato encode). The PN sequence is a sequence predefined in the protocol.
[0122] Step 3: Encode the 30-bit data. Encoding, a set of check sequences 102, i.e. 34-bit Wherein, it can be encoded by extending the BCH encoding. Wherein, the extended BCH encoding is based on a polynomial g' generated by a (63, 30) BCH encoding, multiplied by a factor (1 + D) to obtain the generating polynomial of the extended BCH encoding.
[0123] Step four, the 34-bit is spliced with the 30-bit to obtain a 64-bit codeword.
[0124] Step five, the codeword is XORed with the 0th to 63st bits p0...p 63 of the PN sequence to obtain the synchronization word.
[0125] After introducing the above technical terms, the Bluetooth communication system related to the embodiments of the present application will be described next.
[0126] In the Bluetooth communication system, there can be a master device and at least one slave device connected to the master device. Wherein, the master device and the slave device are the relationship between the two devices connected in the Bluetooth communication system.
[0127] For the master device, it can also be called a host or a Bluetooth host (Master / Center / Host), which is a device that initiates a connection request and controls the communication link, which is responsible for establishing a connection with the slave device, managing the communication process, and controlling data transmission, etc. For example, Figure 11 An exemplary schematic diagram of a Bluetooth communication system provided by the embodiments of the present application is shown. As Figure 11 shown, the master device 100 can include a mobile phone. It should be noted that the master device 100 can also be implemented as a desktop computer, a portable notebook computer, a tablet computer, a television, etc. with a Bluetooth connection function. For example, the master device 100 can be a device that complies with the classic Bluetooth protocol, i.e. a classic Bluetooth device.
[0128] For the slave device, also known as a slave, a Bluetooth slave or a peripheral device, it is a device that responds to the host connection request and accepts the connection. After establishing a connection with the master device, it will wait for incoming data and send a response to the master device. The slave device can be various types of devices. For example, continuing to refer to Figure 11 , the slave device can be a Bluetooth sound 201, a smart watch 202, an earbud wireless Bluetooth earphone 203, and a headset wireless Bluetooth earphone 204, etc. It should be noted that the slave device can be implemented as a Bluetooth keyboard, a Bluetooth mouse, a Bluetooth stylus, a smart home appliance, etc. without specific limitation. For example, the master device can also be a device that complies with the classic Bluetooth protocol, i.e. a classic Bluetooth device.
[0129] For a Bluetooth communication system, Figure 12 A schematic diagram of an exemplary Bluetooth communication system provided by an embodiment of the present application is shown. As shown in the diagram, Figure 12 In the Bluetooth communication, one master device can establish Bluetooth connection with one or more slave devices. For example, a first master device A1 can establish Bluetooth connection with a plurality of first slave devices B11 to B14. A second master device A2 can establish Bluetooth connection with a plurality of second slave devices B21 to B23. A third master device A3 can establish Bluetooth connection with one third slave device B31. In addition, in one Bluetooth communication, one master device can connect a plurality of slave devices, and one slave device can only connect one master device.
[0130] Exemplarily, Figure 13 A schematic diagram of another exemplary Bluetooth communication system provided by an embodiment of the present application is shown. As shown in the diagram, Figure 13 If a classic Bluetooth device C1 (master device) and a classic Bluetooth device D1 (slave device) establish Bluetooth connection, the communication data packets (such as packet 1 and packet 2 in Figure 13 ) transmitted between the classic Bluetooth device C1 and the classic Bluetooth device D1 will use a specific access code 1. The synchronization word of the access code 1 can be generated based on the LAP address LAP1 of the classic Bluetooth device C1. In the design and general use of classic Bluetooth, only the devices that establish connection can know the access code field, so that the receiving synchronization and channel estimation can be performed through the access code field when receiving the data packet at the physical layer. For a classic Bluetooth device, the access code field must be known before the data packet can be received.
[0131] In addition, if another Bluetooth connection is established between a classic Bluetooth device C2 (master device) and a classic Bluetooth device D2 (slave device), the communication data packets (such as packet 3 and packet 4 in Figure 13 ) transmitted between the classic Bluetooth device C2 and the classic Bluetooth device D2 will use another specific access code 2. The synchronization word of the access code 2 can be generated based on the LAP address LAP2 of the classic Bluetooth device C2.
[0132] If the classic Bluetooth device C1 accidentally receives the communication data packets between the classic Bluetooth device C2 and the classic Bluetooth device D2, but the classic Bluetooth device C1 does not know the access code 2 (i.e. the access code used by the classic Bluetooth device C2 and the classic Bluetooth device D2), even if the classic Bluetooth device C1 receives the communication data packets between the classic Bluetooth device C2 and the classic Bluetooth device D2, the signal of the communication data packets cannot be synchronized, so that the data packets cannot be demodulated and decoded. Therefore, the access code has a certain confidentiality.
[0133] After the Bluetooth communication system is introduced, in order to facilitate the description, the technical solutions of the embodiments of the present application are described in whole in combination with the Bluetooth communication system.
[0134] In the embodiments of the present application, continue to refer to Figure 12 Take the first master device A1 as an example, if there are multiple classic Bluetooth devices in its communication range 1200, such as the second master device A2, the third master device A3, multiple second slave devices B21 to B23, and the third slave device B31. If after the connection is established, the second master device A2 sends the first data packet to the multiple second slave devices B21 to B23, the multiple second slave devices B21 to B23 send the second data packet to the second master device A2, the third master device A3 sends the third data packet to the third slave device B31, and the third slave device B31 sends the fourth data packet to the third master device A3, the first master device A1 can obtain the first data packet to the fourth data packet (all the data packets conform to the frame format shown in Figure 7 Or Figure 8 the frame format shown).
[0135] In addition, based on the first data packet and the second data packet, the first master device A1 can obtain the first access code. The first master device A1 processes the synchronization word field of the first access code, and can obtain the LAP address of the second master device A2, so as to discover the second master device A2. In addition, based on the third data packet and the fourth data packet, the first master device A1 can obtain the second access code. The first master device A1 processes the synchronization word field of the second access code, and can obtain the LAP address of the third master device A3, so as to discover the third master device A3.
[0136] Exemplarily, in the embodiments of the present application, taking the slave device as an example, it can send the data packet of the frame structure when it works in broadcast or communication with the master device. For example, the slave device can send the data packet after it is powered on. It should be noted that the sending mode of the master device is similar, and details are not described herein.
[0137] After the technical solutions of the embodiments of the present application are introduced, the structure of the classic Bluetooth device in the embodiments of the present application is described in combination with the drawings.
[0138] Figure 14 The structure of the classic Bluetooth device 1400 is shown. It should be understood that Figure 14 The classic Bluetooth device 1400 shown is only an example of the classic Bluetooth device, and the classic Bluetooth device 1400 can have more or less components than those shown in the figure, can combine two or more components, or can have a different component configuration. Figure 14The various components shown in the middle can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0139] The classic Bluetooth device 1400 can include a processor 1410, an external memory interface 1420, an internal memory 1421, a universal serial bus (USB) interface 1430, a charge management module 1440, a power management module 1441, a battery 1442, an antenna 1, an antenna 2, a mobile communication module 1450, a wireless communication module 1460, an audio module 1470, a speaker 1470A, a receiver 1470B, a microphone 1470C, a headset interface 1470D, a sensor module 1480, a key 1490, a motor 1491, an indicator 1492, a camera 1493, a display screen 1494, and a subscriber identification module (SIM) card interface 1495, etc. Among them, the sensor module 1480 can include a pressure sensor 1480A, a gyroscope sensor 1480B, a barometric pressure sensor 1480C, a magnetic sensor 1480D, an acceleration sensor 1480E, a distance sensor 1480F, a proximity light sensor 1480G, a fingerprint sensor 1480H, a temperature sensor 1480J, a touch sensor 1480K, an ambient light sensor 1480L, a bone conduction sensor 1480M, etc.
[0140] The processor 1410 can include one or more processing units, for example: the processor 1410 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.
[0141] Among them, the controller can be the nerve center and command center of the classic Bluetooth device 1400. The controller can generate operation control signals according to instruction operation codes and timing signals to complete the control of fetching and executing instructions.
[0142] The processor 1410 can also include a memory for storing instructions and data. In some embodiments, the memory in the processor 1410 is a cache memory.
[0143] The USB interface 1430 is an interface conforming to the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 1430 can be used to connect a charger to charge the classic Bluetooth device 1400, and can also be used to transmit data between the classic Bluetooth device 1400 and a peripheral device. It can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other classic Bluetooth devices, such as AR devices, etc.
[0144] The charging management module 1440 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 1440 can receive charging input from a wired charger through the USB interface 1430. In some wireless charging embodiments, the charging management module 1440 can receive wireless charging input through the wireless charging coil of the classic Bluetooth device 1400. The charging management module 1440 charges the battery 1442 while also providing power to the classic Bluetooth device through the power management module 1441.
[0145] The power management module 1441 is used to connect the battery 1442, the charging management module 1440, and the processor 1410. The power management module 1441 receives input from the battery 1442 and / or the charging management module 1440 to power the processor 1410, the internal memory 1421, the external memory, the display 1494, the camera 1493, and the wireless communication module 1460, etc. The wireless communication function of the classic Bluetooth device 1400 can be realized through the antenna 1, the antenna 2, the mobile communication module 1450, the wireless communication module 1460, the modem processor, and the baseband processor, etc.
[0146] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the classic Bluetooth device 1400 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in combination with tuning switches.
[0147] The mobile communication module 1450 can provide a solution including 2G / 3G / 4G / 5G wireless communication applied to the classic Bluetooth device 1400. The mobile communication module 1450 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.
[0148] The wireless communication module 1460 can provide solutions for wireless communication including wireless local area networks (WLAN) (such as a wireless fidelity (WiFi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), and the like, which are applied to the classic Bluetooth device 1400. In embodiments of the present application, the wireless communication module 1460 can support WiFi technology and classic Bluetooth technology.
[0149] In some embodiments, the antenna 1 of the classic Bluetooth device 1400 is coupled with the mobile communication module 1450, and the antenna 2 is coupled with the wireless communication module 1460, so that the classic Bluetooth device 1400 can communicate with a network and other devices through wireless communication technology.
[0150] The classic Bluetooth device 1400 implements a display function through a GPU, a display screen 1494, and an application processor, and the like. The GPU is a microprocessor for image processing, which is connected to the display screen 1494 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 1410 can include one or more GPUs, which execute program instructions to generate or change display information.
[0151] The display screen 1494 is used to display images, videos, and the like. The display screen 1494 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), and the like. In some embodiments, the classic Bluetooth device 1400 can include 1 or M display screens 1494, M being a positive integer greater than 1.
[0152] The classic Bluetooth device 1400 can implement a shooting function through an ISP, a camera 1493, a video codec, a GPU, a display screen 1494, and an application processor, and the like.
[0153] The camera 1493 is configured to capture still images or videos. An object projects an optical image through a lens to a photosensitive element. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transmitted to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into an image signal in a standard format, such as RGB, YUV, or the like. In some embodiments, the classic Bluetooth device 1400 can include one or N cameras 1493, where N is a positive integer greater than 1.
[0154] The external memory interface 1420 can be configured to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the classic Bluetooth device 1400. The external memory card communicates with the processor 1410 through the external memory interface 1420 to implement a data storage function. For example, files such as music and videos can be saved in the external memory card.
[0155] The internal memory 1421 can be configured to store computer-executable program code including instructions. The processor 1410 executes various function applications and data processing of the classic Bluetooth device 1400 by running the instructions stored in the internal memory 1421. For example, the processor 1410 executes the instructions of the internal memory 1421 to enable the classic Bluetooth device to perform the device detection method provided in the embodiments of the present application.
[0156] The internal memory 1421 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, or the like), and the like. The data storage area can store data (such as audio data, a phonebook, or the like) created during use of the classic Bluetooth device 1400, and the like. In addition, the internal memory 1421 can include a high-speed random access memory, and can further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), or the like. In the embodiments of the present application, the internal memory 1421 or the external memory can be provided with a preset storage area for storing device information of other Bluetooth devices discovered by the classic Bluetooth device. For example, the LAP address of the other Bluetooth devices and one or more pieces of time-frequency information, or the like.
[0157] The classic Bluetooth device 1400 can realize audio functions through an audio module 1470, a speaker 1470A, a receiver 1470B, a microphone 1470C, a headset interface 1470D, and an application processor, etc. For example, music playing, recording, etc.
[0158] The audio module 1470 is used to convert digital audio information into an analog audio signal output, and is also used to convert an analog audio input into a digital audio signal. The audio module 1470 can also be used to encode and decode audio signals. In some embodiments, the audio module 1470 can be disposed in the processor 1410, or part of the functions of the audio module 1470 can be disposed in the processor 1410.
[0159] The keys 1490 include a power-on key, a volume key, etc. The keys 1490 can be mechanical keys. They can also be touch keys. The classic Bluetooth device 1400 can receive key inputs to generate key signal inputs related to user settings and function control of the classic Bluetooth device 1400.
[0160] The motor 1491 can generate a vibration prompt. The motor 1491 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations for different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. The indicator 1492 can be an indicator light, which can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, etc.
[0161] In one embodiment, Figure 15 A circuit schematic diagram of a wireless communication module provided by an embodiment of the present application is shown. As shown in the figure, the antenna 1 can include a first antenna 1511 and a second antenna 1512, and the wireless communication module 1460 can include a Bluetooth receiver 1461 and a WiFi receiver 1462. The Bluetooth receiver 1461 can receive signals through the first antenna 1511. The WiFi receiver 1462 can receive signals through the first antenna 1511 and the second antenna 1512. Figure 15
[0162] Among them, the Bluetooth receiver 1461 can generally be a narrowband receiver, such as a bandwidth of 8MHz. And since WiFi is a wideband communication technology, the WiFi receiver 1462 can be a wideband receiver, such as the bandwidth of the WiFi receiver 1462 can be 20MHz, 40MHz, 80MHz, 160MHz, etc.
[0163] In another embodiment, Figure 16 A circuit schematic diagram of another wireless communication module provided by an embodiment of the present application is shown. In the case that a classic Bluetooth device supports both WiFi technology and classic Bluetooth technology, the WiFi module and the classic Bluetooth module can be integrated on the same chip, so that the fusion of the WiFi function and the Bluetooth function can be realized.
[0164] Specifically, as shown in Figure 16 The wireless communication module 1460 can include a Bluetooth receiver 1461 (a part used by Bluetooth alone), a WiFi receiver 1462 (a part used by WiFi alone), and a common module 1463. The common module 1463 can be a common part of the Bluetooth receiver 1461 and the WiFi receiver 1462, such as a radio frequency front end, etc. For example, the common module 1463 can include a radio frequency part.
[0165] Through the common part 1463, the classic Bluetooth device can receive one wideband Bluetooth signal at a time through the WiFi receiver, such as can receive signals of 20, 40, 80 or more channels in parallel through the WiFi receiver, improving the signal receiving speed.
[0166] In yet another embodiment, Figure 17A A circuit schematic diagram of another wireless communication module provided by an embodiment of the present application is shown. In the embodiment of the present application, a wideband receiver can be additionally configured for Bluetooth alone to realize the wideband receiving capability of the Bluetooth device through the wideband receiver.
[0167] Specifically, as shown in Figure 17A The wireless communication module 1460 can include a Bluetooth receiver 1461 (a part used by Bluetooth alone), a wideband receiver 1464 (a part used by the wideband receiver alone), and a common module 1465. The common module 1465 can be a common part of the Bluetooth receiver 1461 and the wideband receiver 1464, such as a radio frequency front end, etc. For example, the common module 1465 can include a radio frequency part. For example, the bandwidth of the wideband receiver 1464 can be 8MHz, 16MH, 32MH, 40MHz, etc., and the bandwidth of the wideband receiver 1464 is greater than the bandwidth of the Bluetooth receiver 1461.
[0168] It should be noted that the embodiment of the present application can configure a wideband receiver for the Bluetooth receiver when the WiFi function and the Bluetooth function are fused (i.e., the Bluetooth receiver can use the WiFi receiver for parallel receiving of a wideband Bluetooth signal). Alternatively, the embodiment of the present application can configure a wideband receiver for the Bluetooth receiver when the wireless communication module 1460 does not have a WiFi receiver or the WiFi function and the Bluetooth function are not fused.
[0169] In one example, the wideband receiving capability of the wideband receiver 1464 is less than the wideband receiving capability of the WiFi receiver, i.e., the bandwidth of the wideband receiver 1464 is less than the bandwidth of the WiFi receiver. Alternatively, the WiFi receiver can be switched to receive signals when a large bandwidth scan is needed, and the wideband receiver can be switched to receive signals when a small bandwidth scan is needed.
[0170] In one specific example, the embodiments of the present application can configure the wideband receiver 1464 with a 16MHz wideband to receive 16 classic Bluetooth channels in parallel. In addition, the embodiments of the present application can configure the WiFi receiver with a 40MHz bandwidth to receive 40 classic Bluetooth channels in parallel.
[0171] In another embodiment, Figure 17B A circuit schematic diagram of another wireless communication module provided by the embodiments of the present application is shown. As Figure 17B shown, the narrow-bandwidth Bluetooth receiver in the wireless communication module 1460 can be replaced by the wideband receiver 1464 in the embodiments of the present application. The specific content of the wideband receiver 1464 can be referred to the related description in the above part of the embodiments of the present application, which will not be repeated here.
[0172] Correspondingly, in the present embodiment, the device detection method provided by the embodiments of the present application can be performed by the wideband receiver 1464. In addition, it should be noted that the embodiments of the present application can also be used in self-developed protocol stack, Bluetooth, short-range communication, Bluetooth WiFi fusion design, private Bluetooth, private short-range communication and other Bluetooth technology-based scenarios, which are not limited specifically.
[0173] It should be noted that since the device detection method of the embodiments of the present application can be performed by a classic Bluetooth device, the device detection scheme of the embodiments of the present application will be described below in combination with the circuit of the Bluetooth receiver and the device detection method. The device detection scheme of the embodiments of the present application can be performed by the Bluetooth receiver (such as the Bluetooth receiver 1461 in Figure 15 、 Figure 16 、 Figure 17A of the classic Bluetooth master device (i.e., the master device with classic Bluetooth function), or the wideband receiver (such as the wideband receiver 1464 in Figure 17B of the classic Bluetooth master device.
[0174] Figure 18 A structure schematic diagram of a device detection circuit provided by the embodiments of the present application is shown. As Figure 18As shown, the device detection circuit can include a receiving module 1801, an analog-to-digital conversion module 1802, a down-conversion module 1803, a signal superposition module 1804, a Bluetooth signal detection module 1805, a preamble detection module 1806, a synchronization word detection module 1807, a time-frequency signal detection module 1808, and a storage module 1809. In one embodiment, the device detection circuit can be disposed in a Bluetooth receiver (such as the Bluetooth receiver 1461 in Figure 15 , Figure 16 , Figure 17A In another embodiment, the device detection circuit can be disposed in a wideband receiver (such as the wideband receiver 1464 in Figure 17B .
[0175] Figure 19 A flowchart of a device detection method provided by an embodiment of the present application is shown, which can be applied to the device detection circuit shown. Figure 18 The device detection method provided by an embodiment of the present application is described below in combination with the device detection circuit shown. Figures 18-25
[0176] As shown, the device detection method can include the following steps S1901 to S1910. Figure 19
[0177] S1901, the receiving module 1801 receives signals of multiple frequency channels in parallel, wherein different frequency channels are used to transmit Bluetooth signals of different frequencies.
[0178] In some embodiments, the receiving module 1801 can perform wideband reception. The following will be described through multiple embodiments.
[0179] In one embodiment, the receiving module 1801 can perform wideband reception through a wideband receiver (such as the radio frequency part of the wideband receiver) configured by a Bluetooth receiver. For example, the wideband receiver can receive signals of J frequency channels in parallel, where J is a positive integer greater than 1. For example, continuing to refer to Figure 18 , the receiving module 1801 can receive signals of 16 frequency channels in parallel through the wideband receiver, i.e., signals of frequency channel 0 to frequency channel 15. It should be noted that the number of wideband receivers can be one or more, which is not specifically limited.
[0180] In another embodiment, the receiving module 1801 can perform wideband reception through a WiFi receiver (such as the radio frequency part of the WiFi receiver), such as receiving signals of K frequency channels in parallel, where K is a positive integer greater than 1. For example, continuing to refer to Figure 18 , the receiving module 1801 can receive signals of 40 frequency channels in parallel through the WiFi receiver, i.e., signals of frequency channel 0 to frequency channel 39.
[0181] In yet another embodiment, the receiving module 1801 can select the wideband receiver configured by the Bluetooth receiver to receive signals, or select the WiFi receiver to receive signals. For example, the receiving module 1801 can select the wideband receiver to receive signals of a small bandwidth when the classic Bluetooth device needs low power consumption (such as standby state or low power), and select the WiFi receiver to receive signals when the classic Bluetooth device does not need low power consumption. In another example, the receiving module 1801 can acquire the scene information of the classic Bluetooth device, and select the WiFi receiver to receive signals when it is determined based on the scene information that the classic Bluetooth device is in a crowded scene such as a train station, a company, or a subway. In addition, the WiFi receiver can be selected to receive signals of a large bandwidth when it is determined based on the scene information that the classic Bluetooth device is in a less crowded scene such as a home or a mountain. In yet another example, the receiving module 1801 can first select the WiFi receiver to receive signals of a large bandwidth, and select the wideband receiver to receive signals of a small bandwidth when the number of channels receiving Bluetooth signals is greater than or equal to 2. Further, the Bluetooth receiver (i.e., narrowband receiving capability) can be selected to receive signals when there are at least two channels receiving Bluetooth signals using the wideband receiver.
[0182] It should be noted that in the embodiments of the present application, the receiving module 1801 can also switch between the WiFi receiver, the wideband receiver, and the Bluetooth receiver according to actual application conditions and specific application requirements, or can also switch between the WiFi receiver and the Bluetooth receiver, or can also switch between the wideband receiver and the Bluetooth receiver, and no specific limitation is made.
[0183] In some other embodiments, the receiving module 1801 can also perform narrowband receiving through its own radio frequency part, and no further description is made.
[0184] In addition, in some embodiments, after the receiving module 1801 receives signals of K channels in parallel in the first time period, the receiving module 1801 can receive signals of another K channels in parallel in the second time period until the device search on all 79 channels is completed.
[0185] S1902, the analog-to-digital conversion module 1802 acquires signals of multiple channels collected by the receiving module 1801 (the signals can be referred to as first signals). In addition, the analog-to-digital conversion module 1802 converts the signals of the channels from an analog signal format to a digital signal format (for the sake of description, the signals in the digital signal format are referred to as digital signals). For example, the analog-to-digital conversion module 1802 can convert the signals of the channels from an analog signal format to a digital signal format through an analog-to-digital conversion process. Figure 18As shown in FIG. 18, the analog-to-digital conversion module 1802 (referred to as ADC for short) is connected with the receiving module 1801. Exemplarily, in the embodiment of the present application, the analog-to-digital conversion module 1803 can convert the digital signal in the format of the GFSK modulated signal.
[0186] S1903, the down-conversion module 1803 receives the digital signals of the channels, and down-converts the digital signals of the channels to the baseband to obtain the baseband signals of the channels. Wherein, as shown in FIG. 18, the down-conversion module 1803 is connected with the analog-to-digital conversion module 1802. Figure 18
[0187] S1904, the signal superposition module 1804 obtains the baseband signals of the multiple channels, and superposes the baseband signals of the channels to obtain the superposition signal. Wherein, as shown in FIG. 18, the signal superposition module 1804 is connected with the down-conversion module 1803. Figure 18
[0188] Exemplarily, the signal superposition module 1804 can superpose the baseband signals of part or all of the channels, and no specific limitation is made to this. Figure 20 FIG. 19 shows a schematic diagram of an exemplary signal superposition process provided by the embodiment of the present application. As shown in FIG. 19, if the data packet of the other classic Bluetooth device is received through the channel 0, and there is no data in the channel 1 to the channel 3, the channel 0 to the channel 3 are superposed to obtain the superposition signal. Wherein, as long as one of the channels has the data packet signal, the superposition signal has the data packet signal through the superposition mode. Optionally, in the embodiment of the present application, the signal superposition module 1804 can superpose the baseband signals of part or all of the channels, and no specific limitation is made to this. Figure 20
[0189] S1905, the Bluetooth signal detection module 1805 obtains the superposition signal, and detects whether the superposition signal includes the Bluetooth signal (i.e., whether the receiving module 1801 receives the Bluetooth signal sent by the external device) according to the signal strength of the superposition signal. Wherein, the Bluetooth signal detection module 1805 is connected with the signal superposition module 1804.
[0190] Exemplarily, S1905 can include the following steps C1 to C3.
[0191] Step C1, the Bluetooth signal detection module 1805 obtains the signal strength of the superposition signal. Exemplarily, the signal strength of the superposition signal can be the instantaneous strength of the superposition signal, such as to avoid false detection, the signal strength of the superposition signal can be the average signal strength in a short period of time. In one example, the signal strength can be the received signal strength indicator (RSSI). It should be noted that the signal strength can also be other physical quantities that can indicate the strength of the signal, and no specific limitation is made to this.
[0192] In step C2, the Bluetooth signal detection module 1805 determines whether the signal strength of the superimposed signal is greater than a first strength threshold. The first strength threshold is greater than the signal strength when there is no signal, and is less than the signal strength of a single data packet signal (the data packet signal after frequency down conversion). The first strength threshold can be set according to actual conditions and specific scenarios, and is not limited in this regard.
[0193] In step C3, the Bluetooth signal detection module 1805 determines that a Bluetooth signal has been received when the signal strength is greater than the first strength threshold (at this time, it cannot be determined whether the data packet signal is a Bluetooth data packet conforming to the data frame format described above, and the Bluetooth signal can be other data packet or other signal outside the Bluetooth data packet), and can continue to perform subsequent preamble detection. When the signal strength is less than the first strength threshold, it is determined that no data packet has been received, and the subsequent steps are stopped, such as returning to step S1901, and then obtaining signals of another plurality of frequency channels through the receiving module 1801 in the next time period, and then performing the device detection method of the embodiment of the present application on the obtained signals of the frequency channels. For example, if the superimposed signals of the frequency channels 0-15 do not include a Bluetooth signal, the signals of the frequency channels 16-31 can be obtained for device detection.
[0194] It should be noted that in the embodiment of the present application, the Bluetooth signal detection module 1805 can also use other methods to detect the Bluetooth signal. For example, the Bluetooth signal detection module 1805 can detect whether the superimposed signal has a signal feature of a Bluetooth signal, such as whether a preamble or a synchronization word exists, or is not limited in this regard.
[0195] In some embodiments, the plurality of frequency channels can be divided into a plurality of groups, each group can correspond to a signal superimposition module 1804 and a Bluetooth signal detection module 1805, and the baseband signals of each group of frequency channels can be superimposed by the signal superimposition module 1804 corresponding to the group, and then the superimposed signal can be detected by the Bluetooth signal detection module 1805 corresponding to the group. If one or more Bluetooth signals are detected, subsequent processing can be performed on them in sequence. Or each group corresponds to a subsequent processing module, and each data packet signal can be processed by the subsequent processing module.
[0196] In another embodiment, the Bluetooth signal detection module 1805 can superimpose all the received signals of the plurality of frequency channels together to obtain a superimposed signal. Through this embodiment, only one superimposed signal needs to be detected quickly to reduce the processing pressure of device detection, improve the processing efficiency, and reduce the processing complexity.
[0197] In some embodiments, in order to improve the detection accuracy, the Bluetooth signal detection module 1805 can determine whether the signal strength value is less than or equal to a second strength threshold. In the case where the signal strength value is less than or equal to the second strength threshold, S1906 is continued to be executed. In the case where the signal strength value is greater than the second strength threshold, the execution of the subsequent steps is stopped. The second strength threshold is greater than the first strength threshold, the second strength threshold can be greater than the signal strength of the digital signal of a single Bluetooth data packet, and the second strength threshold is less than the strength value after the superposition of the digital signals of two Bluetooth data packets (the data packet signal after frequency conversion). Since the superposition signal of the superposition of multiple data packet signals cannot be identified for the subsequent synchronization word, it can affect the subsequent device detection. Through this embodiment, the synchronization word detection and the subsequent device detection of the single Bluetooth data packet signal can be performed when it is ensured that the superposition signal contains the digital signal of a single Bluetooth data packet (without the influence of other data packet signals), thereby improving the detection accuracy.
[0198] S1906, the preamble detection module 1806 receives the superposition signal and detects whether the superposition signal contains a digital signal of a suspected preamble field (suspected Preamble, which can be referred to as a first field in the embodiments of the present application). The suspected preamble field is a field that has a certain possibility of being a preamble field. As shown in the following table, the suspected preamble field can be a field that has a certain possibility of being a preamble field. Figure 18 The preamble detection module 1806 is connected with the Bluetooth signal detection module 1805.
[0199] In some embodiments, the preamble detection module 1806 can detect the suspected preamble field in a cross-correlation manner. Exemplarily, S1906 can include the following steps C4 and C5.
[0200] Step C4, the preamble detection module 1806 can perform a correlation calculation on a signal segment in the superposition signal and a preset signal. The signal segment can include a continuous 4-bit data signal in the superposition signal.
[0201] Step C5, if the correlation (hereinafter referred to as the first correlation for the sake of distinction) is greater than or equal to a first correlation threshold, the preamble detection module 1806 determines that the digital signal of the suspected preamble field is detected. The preset signal can be generated locally by the preamble detection module 1806, and the preset signal can include a digital signal corresponding to the string 1010 and a digital signal corresponding to the string 0101. The first correlation threshold can be set according to specific scenes and actual needs, which can be a value greater than 0 and less than 1, and no specific limitation is made thereto.
[0202] Optionally, if the first correlation is less than the first correlation threshold, the preamble detection module 1806 can determine that the superposition signal does not contain a preamble, and can further determine that the superposition signal does not include the Bluetooth data packet.
[0203] In the embodiment, the suspected preamble fragment can be accurately detected by the preset signal generated in advance in a cross-correlation manner, and the detection accuracy of the suspected preamble fragment is improved.
[0204] In some other embodiments, the preamble detection module 1806 can detect the suspected preamble field in a self-correlation manner. For example, S1906 can include steps C6 to C8.
[0205] In step C6, the preamble detection module 1806 can divide the to-be-detected signal fragment in the superimposed signal into two parts, i.e., a first sub-part and a second sub-part, wherein each sub-part includes a digital signal of 2 consecutive bits.
[0206] In step C7, the preamble detection module 1806 calculates the correlation degree of the first sub-part and the second sub-part (for the sake of distinction, referred to as the second correlation degree below).
[0207] In step C8, if the second correlation degree is greater than or equal to a second correlation degree threshold, the preamble detection module 1806 determines that the digital signal of the suspected preamble field is detected. The second correlation degree threshold can be set according to specific scenarios and actual requirements, which can be a value greater than 0 and less than 1, and no specific limitation is made thereto.
[0208] Optionally, if the second correlation degree is less than the second correlation degree threshold, the preamble detection module 1806 can determine that the superimposed signal does not include the preamble, and can further determine that the superimposed signal does not include the Bluetooth data packet.
[0209] In addition, optionally, in order to further improve the calculation accuracy, before step C6, the preamble detection module 1806 can also calculate the correlation degree of the digital signal of the previous bit and the digital signal of the next bit in the first sub-part (for the sake of distinction, referred to as the third correlation degree below), and if the third correlation degree is less than a third correlation degree threshold, the preamble detection module 1806 performs step C6. Alternatively, in step C8, the preamble detection module 1806 can also calculate the third correlation degree, and if the second correlation degree is greater than or equal to the second correlation degree threshold and the third correlation degree is greater than or equal to the third correlation degree threshold, the preamble detection module 1806 determines that the digital signal of the suspected preamble field is detected. Through this embodiment, the influence of bit strings such as “0000” and “1111” on the detection result can be avoided.
[0210] Through the steps C6 to C8, since the preamble field is 0101 or 1010, the first two bits are repeated with the last two bits, and thus based on the repetition characteristic, whether the preamble field exists can be determined based on the similarity of the first subpart and the second subpart. Through this detection manner, the influence of frequency variation, phase offset, etc. in the actual signal on the detection result can be avoided, and the detection precision is improved.
[0211] In the embodiment of the present application, the preamble detection module 1806 can also detect the suspected preamble in other manners, such as detecting the bit string corresponding to the signal segment, and determining whether the bit string is 0101 or 1010.
[0212] Optionally, in the embodiment of the present application, the detection of the suspected preamble can also not be performed, and the detection of the synchronization word in the superimposed signal is directly performed, and no specific limitation is made to this.
[0213] S1907, the synchronization word detection module 1807 acquires the superimposed signal. The synchronization word detection module 1807 determines the starting sliding position of the sliding window in the superimposed signal. Wherein, the starting sliding position of the sliding window (which can be referred to as the first position in the embodiment of the present application) is determined according to the position of the suspected preamble field in the superimposed signal. Wherein, the length of the sliding window is equal to the length of the 64-bit digital signal.
[0214] In some embodiments, the synchronization word detection module 1807 can acquire the ending position of the suspected preamble. And the synchronization word detection module 1807 can move a preset distance (such as the length of a preset number of samples, wherein the preset number can be determined according to actual conditions or specific scenarios, and no limitation is made to this) to the left (or forward) from the ending position as the starting sliding position. Exemplarily, if the ending position is the signal position corresponding to the qth sample, the length of r samples can be moved to the left, that is, the synchronization word detection is started from the signal position corresponding to the (q-r)th sample (the starting sliding position). Wherein, q and r are any positive integers, and q-r is greater than or equal to 1.
[0215] S1908, the sliding window starts from the starting sliding position and slides in the superimposed signal multiple times to obtain multiple signal segments. Then, the synchronization word detection module 1807 can decode each signal segment to obtain multiple candidate synchronization word fields.
[0216] Exemplarily, the sliding window can slide L times from the starting sliding position, and each time the sliding window moves rightward (or backward) by a length of 1 sample (it is to be noted that the sliding distance can be selected as other values according to actual conditions and specific requirements, for example, a fixed value is selected each time). Wherein, in each sliding, the sliding window can select 64 consecutive bits as a candidate synchronization word field, wherein L is a positive integer greater than 1. Exemplarily, if the starting position of the first window is the signal position corresponding to the pth sampling in the process of receiving the first communication message, the starting position of the first sliding is the signal position corresponding to the (p+1)th sampling, and so on until the sliding is completed. Wherein, p can be any integer greater than or equal to 1. And the moving distance is set to other values according to actual conditions and specific requirements, which is not limited specifically.
[0217] Exemplarily, Figure 21 An exemplary schematic diagram of the sliding window detecting the synchronization word is shown. Wherein, x represents a bit, and x can be 0 or 1. And it is to be noted that, in order to intuitively show, Figure 21 The superimposed signal is shown in the form of a bit sequence, and it can be understood that in the actual implementation process, the above sliding window detection process can be performed on the modulated signal of the GFDK.
[0218] As Figure 21 shown, after determining the end position D0 of the suspected preamble 0101( Figure 21 in the superimposed signal 2201, the starting sliding position D1 is obtained by moving the end position D0 leftward by a distance of 2 bits of the digital signal (only exemplary, the specific number can be set according to actual conditions and specific requirements).
[0219] The sliding window 2202 starts from the starting sliding position D1, selects 64 bits of the digital signal, and obtains a signal segment. Then, the sliding window 2201 slides rightward by a distance of 1 bit of the digital signal, and selects 64 bits of the digital signal again to obtain another signal segment. Similarly, the sliding window 2201 can obtain multiple signal segments by multiple sliding.
[0220] Alternatively, in the embodiments of the present application, other ways other than the sliding window can also be used to determine the synchronization word or the suspected synchronization word, for example, the 64-bit field after the suspected preamble can be directly determined as the synchronization word, which is not limited specifically.
[0221] For demodulation, in the embodiments of the present application, the digital signal in the format of GFSK modulation signal is converted into a bit sequence (i.e. a string composed of 0 and 1) through demodulation.
[0222] Exemplarily, the demodulation process can include: the synchronization word detection module 1807 performs phase extraction on each signal segment to obtain a plurality of phase information. The synchronization word detection module 1807 calculates the phase difference between two adjacent phase information. The synchronization word detection module 1807 obtains the frequency offset information based on the calculated phase difference, and determines the subsequent synchronization word field corresponding to each signal segment based on the frequency offset information.
[0223] It should be noted that the synchronization word detection module 1807 can also obtain the bit sequence through other demodulation modes, and the specific limitation is not made.
[0224] In some other embodiments, the synchronization word detection module 1807 can also
[0225] Through this example, since the end position of the digital signal suspected of the preamble is not necessarily accurate, that is, the start position of the synchronization word cannot be accurately determined through the end position of the suspected preamble. Therefore, by determining the to-be-searched bit sequence in the manner of moving a certain distance to the left, the synchronization word can be sufficiently detected, and the detection accuracy is improved.
[0226] In addition, it should be noted that other ways can also be used to select the candidate synchronization word field in the embodiments of the present application, and the specific limitation is not made. For example, the synchronization word detection module 1807 can also directly take the 64-bit sequence after the suspected preamble as the candidate synchronization word field, and the specific limitation is not made.
[0227] S1909, the synchronization word detection module 1807 performs error correction on each candidate synchronization word field to determine Q error positions.
[0228] In some embodiments, the synchronization word detection module 1807 can perform error correction in the decoding process of the subsequent synchronization word field. For example, since the code word has the characteristics of the BCH code, the synchronization word detection module 1807 can calculate the suspected code word (codeword) of the candidate synchronization word field, and then perform extended BCH decoding on the suspected code word (codeword) to obtain the position of the error bit.
[0229] Exemplarily, Figure 22 A schematic diagram of error correction of a candidate synchronization word field provided by an embodiment of the present application is shown. As Figure 22 shown, S1909 can include the following steps S19091 to S19092.
[0230] S19091, the synchronization word detection module 1807 performs exclusive OR operation on the 0th to 63rd bits p0…p63 of the PN sequence and the candidate synchronization word field to obtain a 64-bit suspected code word (codeword). 63
[0231] S19092, the syndrome detection module 1807 calculates the suspected code word using a Horner algorithm to obtain a correction value (Syndrome). It should be noted that in the embodiments of the present application, the syndrome detection module 1807 can also use other algorithms to calculate the Syndrome, which is not limited here.
[0232] S19093, the syndrome detection module 1807 calculates the coefficients of the error location polynomial using the Berlekamp-Messay algorithm (abbreviated as BM algorithm).
[0233] Exemplarily, the syndrome detection module 1807 can also use improved iBM algorithm and RiBM algorithm and other ways to calculate the coefficients of the error location polynomial, which is not limited here.
[0234] S19094, in the case of known coefficients of the error location polynomial, the Chein search algorithm is used to calculate the roots of the error location polynomial to obtain the position of the error bits.
[0235] It should be noted that the syndrome detection module 1807 can also use other ways to calculate the roots of the error location polynomial, which is not limited here.
[0236] It should be noted that in the embodiments of the present application, the error location can also be determined by other ways, which is not limited here.
[0237] S1910, the syndrome detection module 1807 judges whether the number of error positions Q is less than or equal to a preset data threshold (such as 5, which can be set according to actual situation and specific needs, which is not limited here). If the result is yes, S1911 can be continued. Exemplarily, in order to improve the accuracy, the preset data threshold can also be set to a value smaller than 5.
[0238] Optionally, if the result is no, such as 6 or more error bits, it is determined that the candidate synchronization word field is not reliable (may not be a synchronization word field), and the subsequent method is stopped. And through this judgment, it can be determined that the subsequent synchronization word field is not a synchronization word, and the candidate synchronization word field can continue to find the synchronization word.
[0239] In S1910, if the number of error bits is large, such as more than 5, it can be considered that the error probability of the solved LAP address is high, and the result is unreliable, which can not be processed subsequently.
[0240] Correspondingly, if the number of error bits is less than or equal to 5, it can be considered that the decoded LAP address is reliable. Thus, the code word's BCH-like code property can be utilized to ensure the reliability of the acquired LAP address by the embodiment of the present application.
[0241] S1911, the synchronization word detection module 1807 calculates the candidate synchronization word field to obtain a LAP address (which can be referred to as a first Bluetooth address in the embodiment of the present application).
[0242] Exemplarily, if the 64-bit suspected code word has been determined in the above decoding process, continue to refer to Figure 22 , S1911 can include the following steps S19111 and S19112,
[0243] S19111, the synchronization word detection module 1807 performs bit correction on the Q error positions of the suspected code word to obtain a corrected suspected code word. Exemplarily, if the suspected code word to be corrected is 0 at the error position, the synchronization word detection module 1807 can correct it to 1. And if the suspected code word to be corrected is 1 at the error position, the synchronization word detection module 1807 can correct it to 0.
[0244] S19112, the synchronization word detection module 1807 can calculate the LAP according to the 64-bit suspected code word in the reverse process of the method for generating the LAP shown in Figure 10
[0245] In one example, continue to refer to Figure 10 , after acquiring the 64-bit suspected code word, the lowest 34 bits of the suspected code word can be removed, such as removing the 34-bit to obtain the data to be encoded Then, the data to be encoded is XORed with the 34th to 63rd bits p 34 …p 63 of the PN sequence, and the LAP address can be obtained.
[0246] S1912, the time-frequency information detection module 1808 acquires time-frequency information. The time-frequency information includes the arrival time and the transmission frequency of the Bluetooth data packet.
[0247] For the time of arrival, in an embodiment, the time-frequency information detection module 1808 can determine the time information of the position of the synchronization word in the superimposed signal as the time of arrival. It should be noted that the time of arrival can also be determined according to other manners in the embodiments of the present application, which are not limited specifically herein. For example, the time-frequency information detection module 1808 can also determine the time corresponding to the suspected preamble as the time of arrival when the suspected preamble is detected.
[0248] For the transmission frequency, in an embodiment, the time-frequency information detection module 1808 can recalculate the synchronization word based on the LAP calculated in S1911, and generate an access code based on the recalculated synchronization word. The time-frequency information detection module 1808 performs GFSK adjustment on the access code, and performs correlation calculation on the signals (signals after analog-to-digital conversion) of each frequency band to determine the frequency band with the maximum correlation. The frequency of the frequency band with the maximum correlation is determined as the transmission frequency of the Bluetooth data packet. In another embodiment, the time-frequency information detection module 1808 can calculate the correlation of the superimposed signal and the signals of each frequency band to determine the frequency band with the maximum correlation. The frequency of the frequency band with the maximum correlation is determined as the transmission frequency of the Bluetooth data packet. It should be noted that the time of arrival can also be determined according to other manners in the embodiments of the present application, which are not limited specifically herein.
[0249] In S1913, the LAP address calculated in S1911 is stored in the time-frequency information storage space, and the storage module 1809 stores the calculated LAP address and the time-frequency information.
[0250] Exemplarily, Figure 23 An exemplary schematic diagram of a time-frequency information storage space provided by an embodiment of the present application is shown. As shown in Figure 23 The time-frequency information storage space can store at least one LAP address and the time-frequency information of each LAP address. For example, the time-frequency information storage space stores 2 pieces of time-frequency information of the LAP1 address, i.e., time-frequency information 11 and time-frequency information 12. For another example, the time-frequency information storage space stores 2 pieces of time-frequency information of the LAP1 address, i.e., time-frequency information 21 and time-frequency information 22.
[0251] In some embodiments, if the LAP address calculated by the embodiments of the present application is not stored in the time-frequency information storage space, the storage module 1809 can add the calculated LAP address and the acquired time-frequency information as a piece of time-frequency information of the LAP address in the time-frequency information storage space. Exemplarily, Figure 24 An exemplary schematic diagram of a time-frequency information storage space provided by an embodiment of the present application is shown. As shown in Figure 24As shown, if LAP0 and time-frequency information 0 are calculated by the above method, since LAP0 is a new LAP address, the storage module 1809 can store LAP0 and time-frequency information 0 in the time-frequency information storage space.
[0252] In some embodiments, if the LAP address calculated by the embodiments of the present application has been stored in the time-frequency information storage space, the storage module 1809 can record the time-frequency information obtained by the embodiments of the present application as a new piece of time-frequency information of the LAP address. Exemplarily, Figure 25 An exemplary schematic diagram of another time-frequency information storage space provided by the embodiments of the present application is shown. As shown in Figure 25 As shown, if LAP1 and time-frequency information 0 are calculated by the above method, since LAP1 has been stored in the time-frequency information storage space, the storage module 1809 can add time-frequency information 0 as a new piece of time-frequency information of LAP1. In some embodiments, if a LAP address does not have new time-frequency information added within a preset time length, the storage module 1809 can delete the LAP address and the original time-frequency information of the LAP address from the time-frequency information storage space.
[0253] By the embodiments, the device information of the wrong LAP address can be deleted, and the accuracy of the recorded information is improved. Moreover, the device information of the classic Bluetooth device beyond the Bluetooth search range or offline can be deleted in time, and the storage pressure of the device information is reduced.
[0254] The device detection method provided by the embodiments of the present application can calculate the LAP address of the other classic Bluetooth device through the sync word in the Bluetooth data packet of the other classic Bluetooth device, since the sync word field of the Bluetooth data packet of the classic Bluetooth device is generated according to the LAP address of the device. Since each LAP address can mark a classic Bluetooth device, after the LAP address is obtained and the device information of the classic Bluetooth device corresponding to the LAP address is stored, the classic Bluetooth device can be accurately queried.
[0255] Moreover, the device detection method of the embodiments of the present application can have at least one of the following advantages:
[0256] (1) The technical solution of the embodiments of the present application can perform efficient parallel scanning through the receiver, and the scanning speed is fast, and there is no need to send the query packet in the frequency hopping transmission mode and wait for the reply, and the device detection efficiency is high.
[0257] (2) The technical solution of the embodiments of the present application does not need to send signals to the outside, and does not need to broadcast the query packet with high power, and the power consumption is saved.
[0258] (3) Since the related scheme may not send a query packet reply if the receiving device is in a working state, the receiving device cannot be queried. Compared with the related scheme, since the device sends a Bluetooth data packet in a frame format for Bluetooth device detection and discovery after the device is turned on and during the working of the device, and the response of the queried device is not required, the embodiments of the present application improve the discovery of more devices and improve the accuracy of device discovery.
[0259] (4) The technical scheme of the embodiments of the present application only needs to process the preamble part, and only the preamble part of the Bluetooth data packet can be saved during buffering, thereby reducing the buffer pressure and enabling the same buffer resource to scan more channels in parallel.
[0260] (5) The embodiments of the present application can determine the frame header through the BCH-like code, without the need for high-performance reception such as synchronization, thereby saving resources and power consumption. The embodiments of the present application can detect whether the LAP address is reliable through the BCH-like code, thereby improving the generation accuracy of the LAP address.
[0261] The embodiments of the present application also provide another device detection scheme. Different from the above device detection scheme, continuing to refer to Figure 22 After the LAP address is calculated, step S1914 can be further included.
[0262] In step S1914, the data packet detection module detects whether the Bluetooth data packet has been completely received. If the transmission is ended, the device detection method provided by the embodiments of the present application is continued to be performed on the remaining signal part of the superimposed signal, such as returning to step S1905. Alternatively, a new channel can be received in parallel to obtain a new superimposed signal, and then the device detection method of the embodiments of the present application is performed on the new superimposed signal, such as returning to step S1901.
[0263] In some embodiments, S1914 can include steps E1-E3.
[0264] In step E1, the data packet detection module calculates the average signal strength of the signal part corresponding to the access code in the superimposed signal, where the average signal strength can be RSSI.
[0265] In step E2, the data packet detection module calculates the signal strength (hereinafter referred to as the first signal strength) of the other signal part of the superimposed signal after the signal part.
[0266] In step E3, the data packet detection module calculates the difference between the average signal strength and the first signal strength. If the difference is greater than or equal to a preset difference (such as 3 dB), it is determined that the current Bluetooth data packet has ended transmission. If the difference is less than the preset difference, it can be determined that the current Bluetooth data packet has not ended transmission.
[0267] In some embodiments, the data packet detection module can calculate the difference between the preset signal strength and the first signal strength, and determine whether the transmission has ended according to the difference. The preset signal strength can be set according to experience or calculation.
[0268] In this embodiment, since the data (such as the payload part) after the LAP is not needed in the technical solution of the present application, the data after the LAP has a probability of triggering the detection of the suspected preamble. In this embodiment, since the signal strength of the Bluetooth data packet is high, the superimposed signal strength is high during the reception of the Bluetooth data packet, and the superimposed signal strength is low after the reception is completed. Therefore, the present application can continue to process after the transmission of the Bluetooth data packet is completed, thereby reducing the probability of misrecognition and reducing the calculation pressure.
[0269] The present application also provides another device detection scheme. The difference between this device detection scheme and the above-mentioned device detection scheme is that the Bluetooth signal detection module 1805 can use the WiFi receiver to receive the signals of the K frequency channels in parallel when the signal strength value is less than the second strength threshold. And when the signal strength value is greater than or equal to the second strength threshold, the wideband receiver is used to receive the signals of the K frequency channels in parallel.
[0270] In this embodiment, when more than two Bluetooth data packets are received at the same time, the bandwidth of the receiving channel is reduced to avoid the influence of the detection results of the Bluetooth data packets, so as to ensure that only one Bluetooth data packet is received at the same time, thereby ensuring the detection accuracy.
[0271] It should be noted that in the present application, when the signal strength value is greater than or equal to the second strength threshold, the WiFi receiver can be adjusted to a narrow-bandwidth Bluetooth receiver. Alternatively, the wideband receiver can be adjusted to a narrow-bandwidth Bluetooth receiver. Alternatively, the bandwidth of the receiver can be reduced, and the present application does not make specific limitations in this regard.
[0272] The present application also provides another device detection scheme. The difference between this device detection scheme and the above-mentioned device detection scheme is that when the LAP address cannot uniquely identify the classic Bluetooth device, the traditional device scanning method (such as the above-mentioned calculation scheme for sending the query packet) can be used to assist in identifying the Bluetooth device. For example, the device information returned by the scanned device can be used to assist in identifying the device.
[0273] The embodiment of the present application further provides another device detection scheme, which is different from the above device detection scheme in that the classic Bluetooth device can include a plurality of Bluetooth receivers, the plurality of Bluetooth receivers receive signals of different channels, and device detection is performed on the received signals respectively, wherein the device detection of each Bluetooth receiver can refer to the related description in the above part of the embodiment of the present application, and details are not described herein again.
[0274] After introducing the device detection method of the embodiment of the present application through the hardware structure of the classic Bluetooth device, the software structure of the classic Bluetooth device is described below by taking an electronic device as an example.
[0275] Before starting to introduce the software structure of the classic Bluetooth device, the Bluetooth protocol stack is described first. Figure 26 An architecture diagram of a Bluetooth protocol stack provided by the embodiment of the present application is shown.
[0276] As shown in Figure 26 , the Bluetooth protocol stack can include three parts: Bluetooth Profiles, Bluetooth Host and Bluetooth Controller.
[0277] Bluetooth Profiles belong to the application layer. The application layer of Bluetooth takes a service as a data structure, and one application corresponds to one or more services. Profiles include the standard services defined and provided by Bluetooth. Users can also customize services.
[0278] Bluetooth Host includes Generic Attribute Profile (GATT), Attribute Protocol (ATT), Logic Link Control and Adaptation Protocol (L2CAP), Secure Manager Protocol (SMP) and Generic Access Profile (GAP). Among them, GATT is used to standardize the data in the attribute of Bluetooth, so that Bluetooth devices can be compatible with each other. The attribute is a concept used by Bluetooth to describe each data unit. ATT defines user commands and command operation data. L2CAP distinguishes between encrypted and non-encrypted connections, manages connection intervals, etc. SMP manages the encryption and security of the connection. GAP is used to control the lower layer Controller before the Bluetooth device connection is established, and is responsible for broadcasting, scanning and establishing a connection.
[0279] Bluetooth Controller corresponds to the part of the Bluetooth chip, which includes hardware and firmware software.
[0280] After introducing the Bluetooth protocol stack, the software structure of the Bluetooth device is described next.
[0281] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. Embodiments of the present application take the Android system with a layered architecture as an example to exemplarily describe the software structure of the electronic device.
[0282] Figure 27 is a software structure block diagram of the electronic device of embodiments of the present application.
[0283] The layered architecture of the electronic device 100 divides the software into several layers, each of which has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the system layer, and the kernel layer.
[0284] The application layer can include a series of application packages, such as WLAN, Bluetooth, music, video, short message, etc.
[0285] The application framework layer provides the application programming interface (API) and programming framework for the applications of the application layer. The application framework layer includes some pre-defined functions and Bluetooth services. Among them, the Bluetooth service can provide a Bluetooth application programming interface (bluetooth API) to enable interaction between the Bluetooth application and the Bluetooth service, as well as between the Bluetooth application and the hardware driver (such as the sensor driver) through the invocation of the Bluetooth application programming interface.
[0286] As shown in Figure 27 , the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
[0287] The system library can include a plurality of functional modules. For example, the system library can include a plurality of functional modules. For example: device detection management library, device information management library, Bluetooth protocol stack, etc. Among them, the device detection management library is used to manage device detection. The device information management library is used to store a plurality of LAP addresses and corresponding time-frequency information.
[0288] The kernel layer is the layer between hardware and software. The kernel layer at least contains Bluetooth driver, device detection driver, display driver, camera driver, audio driver, sensor driver.
[0289] The hardware can include a Bluetooth chip. The Bluetooth chip can include a device detection circuit, a Bluetooth communication circuit, and firmware. The device detection circuit is configured to implement the device detection method provided in the embodiments of the present application, the Bluetooth communication circuit is configured to implement Bluetooth communication, and the firmware is configured to support hardware functions.
[0290] It should be noted that the application layer, the application framework layer, and the kernel layer can be implemented by a main chip (main soc), wherein the application framework layer and the application layer correspond to Bluetooth Profiles in the Bluetooth protocol stack. The system library and the kernel layer correspond to a Bluetooth Host, and the Bluetooth chip is responsible for a Bluetooth Controller.
[0291] In this implementation, the software functions of the Bluetooth protocol stack are all placed in the operating system of the mobile phone to run, and the Bluetooth chip (or referred to as a short-distance chip) is responsible for the Bluetooth Controller.
[0292] Figure 28 FIG. 6 is another software structure block diagram of the electronic device according to the embodiments of the present application. Figure 28 The software structure shown in FIG. 6 is different from that shown in FIG. 5 in that the Bluetooth Profiles are placed in the main chip, the Bluetooth Host and the Bluetooth Controller are responsible for the Bluetooth chip. Accordingly, the running burden of the Bluetooth protocol stack is given to the Bluetooth chip. Figure 27 The software structure shown in FIG. 6 is different from that shown in FIG. 5 in that the Bluetooth Profiles are placed in the main chip, the Bluetooth Host and the Bluetooth Controller are responsible for the Bluetooth chip. Accordingly, the running burden of the Bluetooth protocol stack is given to the Bluetooth chip.
[0293] It should be understood that the software structure shown in FIG. 6 is only an example, and the electronic device 100 can include more or less layers than those shown in the figure, and each layer can include more or less components, which are not limited in the present application. Figure 27 The software structure shown in FIG. 6 is different from that shown in FIG. 5 in that the Bluetooth Profiles are placed in the main chip, the Bluetooth Host and the Bluetooth Controller are responsible for the Bluetooth chip. Accordingly, the running burden of the Bluetooth protocol stack is given to the Bluetooth chip. Figure 28 The layers and the components included in each layer in the software structure shown in FIG. 6 do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or less layers than those shown in the figure, and each layer can include more or less components, which are not limited in the present application.
[0294] The hardware and / or software modules corresponding to the functions are included. The algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of the present application.
[0295] In one example, Figure 29A schematic block diagram of an apparatus 2900 according to an embodiment of the present application is shown. The apparatus 2900 can include a processor 2901 and a transceiver / transceiver pin 2902, and optionally further include a memory 2903.
[0296] The various components of the apparatus 2900 are coupled together by a bus 2904, which can include a data bus, a power bus, a control bus, and a state signal bus. For the sake of clarity, the various buses are illustrated in Figure as the bus 2904.
[0297] Optionally, the memory 2903 can be used for storing instructions in the foregoing method embodiments. The processor 2901 can be used for executing the instructions in the memory 2903, and controlling the receiving pin to receive signals and the sending pin to send signals.
[0298] The apparatus 2900 can be a classic Bluetooth device or a Bluetooth chip of a classic Bluetooth device in the foregoing method embodiments.
[0299] All relevant contents of the steps involved in the foregoing method embodiments can be cited from the function description of the corresponding function modules, and will not be repeated here.
[0300] The steps performed by the classic Bluetooth device in the device detection method provided by the foregoing embodiments of the present application can also be performed by a chip system included in the classic Bluetooth device, wherein the chip system can include a processor and a Bluetooth chip. The chip system can be coupled with a memory, so that the chip system invokes a computer program stored in the memory when running, to realize the steps performed by the terminal 100. The processor in the chip system can be an application processor or a non-application processor.
[0301] The above-described embodiments are merely used to illustrate the technical solutions of the present application, but not limit the present application; even though the present application has been described in detail with reference to the foregoing embodiments, those ordinarily skilled in the art should understand: the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced equivalently; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A device detection method, characterized by, The method is applied to a first Bluetooth device, and the method comprises: receiving a first communication message sent by a second Bluetooth device; detecting a synchronization word in the first communication message; in a case where the synchronization word is detected in the first communication message, determining a first Bluetooth address based on the synchronization word; storing device information of a third Bluetooth device in a preset storage area, the third Bluetooth device being a Bluetooth device corresponding to the first Bluetooth address, and the preset storage area being used to store device information of Bluetooth devices detected by the first Bluetooth device.
2. The method of claim 1, wherein the detecting the synchronization word in the first communication message comprises: determining a first field in the first communication message, the first field being a preamble with a probability value greater than zero; determining the synchronization word in the first communication message based on position information of the first field in the first communication message.
3. The method of claim 2, wherein the determining the synchronization word in the first communication message based on the position information of the first field in the first communication message comprises: determining a plurality of second fields based on the first communication message based on the position information of the first field in the first communication message, wherein each second field is the synchronization word with a probability greater than zero; determining the synchronization word in the plurality of second fields.
4. The method of claim 2, wherein, the determining the plurality of second fields based on the first communication message comprises: determining a first position based on the position information; sliding a first window in the first communication message starting from the first position to obtain a plurality of first signals; demodulating the plurality of first signals to obtain the plurality of second fields.
5. The method of claim 1, wherein, the determining the first Bluetooth address based on the synchronization word comprises: determining a code word based on the synchronization word; decoding the code word to obtain positions of first bits of the code word, the first bits being error bits; in a case where a number of the first bits is less than or equal to a preset number threshold, determining the first Bluetooth address based on the code word.
6. The method of claim 1, wherein, after the storing the device information of the third Bluetooth device in the preset storage area, the method further comprises: deleting the device information of the third Bluetooth device in a case where the device information of the third Bluetooth device in the preset storage area is unchanged within a preset time length.
7. The method of claim 1, wherein, after the determining the first Bluetooth address based on the synchronization word, the method further comprises: detecting whether the first communication message has been received completely; in a case where the first communication message has been received completely, receiving a second communication message sent by a fourth device; in a case where a synchronization word is detected in the second communication message, determining a second Bluetooth address based on the synchronization word in the second communication message; storing device information of a fifth Bluetooth device in the preset storage area, the fifth Bluetooth device being a Bluetooth device corresponding to the second Bluetooth address.
8. The method of claim 1, wherein, the first Bluetooth device comprises a first receiver configured to receive a Bluetooth signal, and a bandwidth of the first receiver is greater than a bandwidth of a Bluetooth receiver. The first communication message sent by the second Bluetooth device is received, including: The first signals of J frequency channels are received in parallel by the first receiver, J being an integer greater than 1; Wherein, in the case that the frequency corresponding to any one of the J frequency channels is consistent with the transmission frequency of the first communication message, the first signal of the any one channel comprises the first communication message.
9. The method of claim 8, wherein, After the first signals of J frequency channels are received in parallel by the first receiver, the first communication message sent by the second Bluetooth device is further received, including: The first communication message is detected from the first signals of the J frequency channels, and the first communication message is acquired.
10. The method of claim 9, wherein, The first communication message is detected from the first signals of the J frequency channels, and the first communication message is acquired, including: The first signals of each of the J frequency channels are down-converted to obtain second signals of the J frequency channels; The second signals of the J frequency channels are superimposed to obtain a third signal; The signal strength of the third signal is acquired; In the case that the signal strength is greater than or equal to a preset threshold, the third signal is determined as the first communication message.
11. The method of claim 1, wherein, The first Bluetooth device comprises a WiFi receiver, and the first communication message sent by the second Bluetooth device is received, including: The fourth signals of K frequency channels are received in parallel by the WiFi receiver, K being an integer greater than 1; Wherein, in the case that the frequency corresponding to any one of the K frequency channels is consistent with the transmission frequency of the first communication message, the signal of the any one channel comprises the first communication message.
12. The method of claim 11, wherein, After the fourth signals of K frequency channels are received in parallel by the WiFi receiver, the first communication message sent by the second Bluetooth device is further received, including: The first communication message is detected from the fourth signals of the K frequency channels, and the first communication message is acquired.
13. The method of claim 12, wherein, The first communication message is detected from the fourth signals of the K frequency channels, and the first communication message is acquired, including: The fourth signals of each of the K frequency channels are down-converted to obtain fifth signals of the K frequency channels; The fifth signals of the K frequency channels are superimposed to obtain a sixth signal; The signal strength of the sixth signal is acquired; In the case that the signal strength is greater than or equal to a preset threshold, the sixth signal is determined as the first communication message.
14. The method of claim 8 or 11, wherein, The first Bluetooth device comprises a WiFi receiver and a first receiver, The first communication message sent by the second Bluetooth device is received, including: Under a first condition, signals of K frequency channels are received in parallel by the WiFi receiver; Under a second condition, signals of J frequency channels are received in parallel by the first receiver; Wherein, K is greater than J.
15. An electronic device, comprising: Comprise: One or more processors; Memory; And one or more computer programs, wherein the one or more computer programs are stored on the memory, when the computer programs are executed by the one or more processors, the processors execute the following steps: The first communication message sent by the second Bluetooth device is received; The first communication message is subjected to synchronization word detection; In a case that the synchronization word is detected in the first communication message, a first Bluetooth address is determined based on the synchronization word; In a case that the synchronization word is detected in the first communication message, a first Bluetooth address is determined based on the synchronization word; 16. A computer readable storage medium characterized by: A computer program, characterized in that, when the computer program runs on an electronic device, the electronic device is caused to execute the device detection method as claimed in any one of claims 1 to 14.
17. A chip or chip system, characterized by An electronic device, characterized in that, the electronic device comprises a processing circuit and an interface circuit, the interface circuit is used to receive code instructions and transmit to the processing circuit, the processing circuit is used to run the code instructions to execute the device detection method as claimed in any one of claims 1 to 14.