Wireless fidelity Wi-Fi connection method and electronic device
By using the Bluetooth communication module to perform an energy scan on multiple Wi-Fi channels, combining the frequency coincidence relationship between the Bluetooth channel and the Wi-Fi channel, the available Wi-Fi channels are determined, which solves the problems of high power consumption and large latency of Wi-Fi connections in the prior art, and achieves a more efficient Wi-Fi connection.
Patent Information
- Application Number
- CN202311540641.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-16
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2043-11-16
AI Technical Summary
In the prior art, the solution of RSSI scanning of available Wi-Fi channels through Wi-Fi communication modules has problems of high power consumption and large delay.
Using a Wi-Fi connection method, the Bluetooth communication module is used to select N target Bluetooth channels from multiple Bluetooth channels for time-sharing and energy scanning, and obtain the RSSI value of each target Bluetooth channel. At least one available Wi-Fi channel is determined based on these RSSI values and the frequency coincidence relationship between the Bluetooth channel and the Wi-Fi channel. After starting the Wi-Fi communication module, only scan the available Wi-Fi channels provided by the Bluetooth communication module.
Through this method, the number and time of scanning Wi-Fi channels by the Wi-Fi communication module, the power consumption is reduced, and the efficiency of Wi-Fi connection is improved.
Smart Images

Figure CN118474712B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a wireless fidelity Wi-Fi connection method and electronic device. Background Art
[0002] For device discovery and connection of Wireless Fidelity (Wi-Fi), it is extremely important to effectively reduce the power consumption and latency of electronic devices connecting to Wi-Fi.
[0003] In the prior art, the solution of scanning available Wi-Fi channels through a received signal strength indicator (RSSI) of a Wi-Fi communication module has the problems of high power consumption and large delay. Summary of the invention
[0004] The embodiments of the present application provide a wireless fidelity Wi-Fi connection method and an electronic device, which are used to reduce the power consumption and delay of the electronic device connecting to Wi-Fi.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a Wi-Fi connection method is provided, which is applied to an electronic device, wherein the electronic device includes a Bluetooth communication module and a Wi-Fi communication module, and the method includes: the electronic device uses the Bluetooth communication module to select N target Bluetooth channels from multiple Bluetooth channels for time-sharing energy scanning, and obtains the RSSI value scanned by each target Bluetooth channel. The frequency ranges scanned by the N target Bluetooth channels overlap with the frequency ranges corresponding to the M Wi-Fi channels respectively; N and M are both positive integers, and N is greater than or equal to M. The electronic device can determine at least one target Wi-Fi channel among the M Wi-Fi channels based on the N RSSI values received by the N target Bluetooth channels and the frequency overlap relationship between the Bluetooth channel and the Wi-Fi channel. The frequency overlap relationship at least includes the overlap relationship between the frequency range of each Wi-Fi channel and the frequency range of each target Bluetooth channel. The electronic device controls the Wi-Fi communication module to dock with a target Wi-Fi channel to achieve Wi-Fi communication.
[0007] By adopting the above technical solution, the electronic device can scan multiple Wi-Fi channels once through the Bluetooth communication module to determine at least one available Wi-Fi channel. After starting the Wi-Fi communication module, the Wi-Fi communication module can only scan the available Wi-Fi channels provided by the Bluetooth communication module, and does not need to scan all Wi-Fi channels, thereby reducing the number of Wi-Fi channels scanned by the Wi-Fi communication module, thereby reducing the time for the Wi-Fi communication module to scan the Wi-Fi channels and the time for the Wi-Fi communication module to connect to the Wi-Fi channels, and reducing the power consumption of the Wi-Fi communication module scanning the Wi-Fi channels.
[0008] The electronic device may calculate the energy intensity of the Wi-Fi channel based on the overlapping pattern of the frequency range of the Bluetooth channel and the frequency range of the Wi-Fi channel, thereby determining at least one available Wi-Fi channel.
[0009] In a possible implementation manner of the first aspect, among the N target Bluetooth channels that perform energy scanning in time division, two target Bluetooth channels that are continuously scanned at one time include a first Bluetooth channel and a second Bluetooth channel, and a frequency range corresponding to the first Bluetooth channel is discontinuous with a frequency range corresponding to the second Bluetooth channel.
[0010] In a possible implementation of the first aspect, an absolute value of a frequency difference between a frequency range corresponding to the first Bluetooth channel and a frequency difference between the second Bluetooth channel is greater than or equal to 10 MHz. In some implementation methods, an absolute value of a frequency difference between a frequency range corresponding to the first Bluetooth channel and a frequency difference between the second Bluetooth channel is greater than or equal to 18 MHz. In other implementation methods, an absolute value of a frequency difference between a frequency range corresponding to the first Bluetooth channel and a frequency difference between the second Bluetooth channel is greater than or equal to 24 MHz.
[0011] Among them, the absolute value of the frequency difference between the frequency range corresponding to the above-mentioned first Bluetooth channel and the second Bluetooth channel is greater than or equal to 18 MHz, which means that, in the scanning method of the same Bluetooth channel, the absolute value of the frequency difference between the frequency range corresponding to a part of the first Bluetooth channel and the second Bluetooth channel is equal to 18 MHz, and the absolute value of the frequency difference between the frequency range corresponding to another part of the first Bluetooth channel and the second Bluetooth channel is greater than 18 MHz.
[0012] In a possible implementation of the first aspect, among the N target Bluetooth channels that perform energy scanning in time division, the first target Bluetooth channel that performs energy scanning is the Bluetooth channel corresponding to the minimum frequency range. For example, the first target Bluetooth channel that performs energy scanning is the Bluetooth channel numbered 1.
[0013] The first target Bluetooth channel for energy scanning may not only be the Bluetooth channel corresponding to the minimum frequency range, but may also be the target Bluetooth channel corresponding to other serial numbers, such as the Bluetooth channel with serial number 2. Alternatively, the Bluetooth channel corresponding to a larger frequency range may be the first target Bluetooth channel for energy scanning, such as the Bluetooth channel with serial number 12.
[0014] Through the above-mentioned scanning strategy for the Bluetooth channel, the absolute value of the frequency difference between the target Bluetooth channels scanned continuously is limited, or the sequence number of the first target Bluetooth channel for energy scanning is limited, so that the efficiency of Bluetooth channel scanning can be improved, and there is no scanning blind area. The entire Bluetooth channel can be traversed within the minimum detection time, so that beacon frames appearing at any position can be scanned.
[0015] In a possible implementation of the first aspect, based on N RSSI values received by N target Bluetooth channels and the frequency overlap relationship between the Bluetooth channel and the Wi-Fi channel, at least one target Wi-Fi channel among M Wi-Fi channels is determined, including: the electronic device may determine the energy strength of each Wi-Fi channel among the M Wi-Fi channels based on the N RSSI values received by the N target Bluetooth channels and the frequency overlap relationship between the Bluetooth channel and the Wi-Fi channel. Then, the electronic device determines at least one target Wi-Fi channel from the M Wi-Fi channels by screening the energy strength of each Wi-Fi channel. Among them, the electronic device may set an energy strength threshold, and the Wi-Fi channel corresponding to the energy strength exceeding the energy strength threshold is the target Wi-Fi channel.
[0016] In a possible implementation of the first aspect, based on N RSSI values received by N target Bluetooth channels and the frequency overlap relationship between the Bluetooth channel and the Wi-Fi channel, the energy strength of each Wi-Fi channel is determined, including: the electronic device forms a first vector based on the N RSSI values received by the N target Bluetooth channels; the first vector includes N first vector factors. Then, the electronic device can form an association matrix of the Wi-Fi channel and the Bluetooth channel based on the acquired frequency overlap relationship; the association matrix includes at least N×M matrix factors, each matrix factor corresponds to a Wi-Fi channel and a Bluetooth channel respectively, and the value of the matrix factor is used to indicate the frequency overlap relationship between the Wi-Fi channel and the Bluetooth channel corresponding to the matrix factor. Then, the electronic device can calculate a second vector based on the association matrix and the first vector; the second vector includes M second vector factors, each second vector factor corresponds to a Wi-Fi channel, and each second vector factor is used to indicate the energy strength of the corresponding Wi-Fi channel. Among them, since the first vector, the second vector and the association matrix can be associated through matrix multiplication, the first vector is known, and the association matrix is known, then the value of the second vector can be calculated, that is, the energy intensity of each Wi-Fi channel can be determined.
[0017] Therefore, the electronic device can use the matrix solution method, that is, use the correlation matrix formed by the frequency overlap relationship between the Bluetooth channel and the Wi-Fi channel, and use the Bluetooth communication module to perform energy scanning on N target Bluetooth channels in time to obtain the RSSI value of each target Bluetooth channel scanned, to efficiently infer the energy strength of the Wi-Fi channel.
[0018] In a possible implementation of the first aspect, the frequency overlap relationship includes at least an overlap relationship between the frequency range of each Wi-Fi channel and the frequency range of each Bluetooth channel. The above-mentioned forming an association matrix based on the frequency overlap relationship includes: the electronic device first forms an original matrix based on the frequency overlap relationship between the frequency range of each Wi-Fi channel and the frequency range of each Bluetooth channel; wherein the original matrix includes Y×M matrix factors. Then, the matrix factors corresponding to the target Bluetooth channel are extracted from the original matrix to form an association matrix; wherein the association matrix includes N×M matrix factors, and N is less than Y.
[0019] In a possible implementation of the first aspect, a difference in frequency ranges corresponding to adjacent target Bluetooth channels is greater than or equal to 4 MHz and less than or equal to 8 MHz. The difference in frequency ranges corresponding to adjacent target Bluetooth channels is fixed, which means that the extraction of the target Bluetooth channels is uniform, so it is convenient to uniformly set scanning points on the target Bluetooth channels later.
[0020] In a possible implementation of the first aspect, the value of each matrix factor includes a first value, a second value, or a third value; wherein the magnitudes of the first value, the second value, and the third value are positively correlated with the frequency overlap degree of the Bluetooth channel and the Wi-Fi channel. Wherein, there are three situations from high to low for the frequency overlap degree of the Wi-Fi channel, one is that the frequency range of a Bluetooth channel is within the frequency range of a Wi-Fi channel, one is that the frequency range of a Bluetooth channel partially overlaps with the frequency range of a Wi-Fi channel, and the other is that the frequency range of a Bluetooth channel is outside the frequency range of a Wi-Fi channel. Assuming that the first value is greater than the second value and greater than the third value, then, if the frequency range of a Bluetooth channel is within the frequency range of a Wi-Fi channel, the value of the matrix factor corresponding to the Bluetooth channel and the Wi-Fi channel is the first value, if the frequency range of a Bluetooth channel partially overlaps with the frequency range of a Wi-Fi channel, the value of the matrix factor corresponding to the Bluetooth channel and the Wi-Fi channel is the second value, and if the frequency range of a Bluetooth channel is outside the frequency range of a Wi-Fi channel, the value of the matrix factor corresponding to the Bluetooth channel and the Wi-Fi channel is the third value.
[0021] In a possible implementation of the first aspect, the calculation of the second vector based on the association matrix and the first vector includes: based on the vector value of the first vector b and the target association matrix A, the following formula may be used: w*=(A T A) -1 A*b, calculate the vector value of the second vector w. If N=M, then the following formula can also be used: w*=A -1 *b, calculates the vector value of the second vector w.
[0022] In a possible implementation manner of the first aspect, N target Bluetooth channels are selected from multiple Bluetooth channels for time-sharing energy scanning, and a received signal strength indication RSSI value scanned by each target Bluetooth channel is obtained, including: an electronic device uses a Bluetooth communication module to select N target Bluetooth channels from multiple Bluetooth channels, performs energy scanning on beacon frames of each Wi-Fi channel in time-sharing, and obtains an RSSI value scanned by each target Bluetooth channel.
[0023] In summary, by adopting the above technical solution, electronic devices can customize scanning strategies based on the overlapping rules of the frequency range of the Bluetooth channel and the frequency range of the Wi-Fi channel, and make full use of the association matrix formed by the two. The "one scan, one analysis" cooperation step can be performed to improve the efficiency and reliability of the Bluetooth communication module to assist in scanning the Wi-Fi channel. Among them, in the above Wi-Fi connection method, the matrix solution method is used to efficiently infer the energy intensity of the Wi-Fi channel. The "normalized scanning"-"normalized analysis" strategy adopted in this solution simplifies the scanning, reporting, and data processing processes, which can improve the efficiency of the Bluetooth communication module in scanning the Bluetooth channel, reduce the analysis time of the Bluetooth communication module by scanning the Bluetooth channel to determine the available Wi-Fi channel, and reduce the delay and power consumption of the Wi-Fi connection.
[0024] In a second aspect, an electronic device is provided, comprising: a Bluetooth communication module, a Wi-Fi communication module, a memory and one or more processors; the Bluetooth module, the Wi-Fi module, the memory and the processor are coupled; the memory is used to store computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the electronic device, the electronic device executes the above method.
[0025] In a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer can execute any one of the methods in the first aspect or the second aspect.
[0026] In a fourth aspect, a computer program product comprising instructions is provided, which, when executed on an electronic device, enables the electronic device to execute any one of the methods in the first aspect or the second aspect.
[0027] In a fifth aspect, a device (for example, the device may be a chip system) is provided, the device including a processor for supporting an electronic device to implement the functions involved in the first aspect above. In one possible design, the device also includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, it may be composed of a chip, or may include a chip and other discrete devices.
[0028] Among them, the technical effects brought about by any design method in the second to fifth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of a time-frequency diagram of a Wi-Fi channel provided in an embodiment of the present application;
[0030] Figure 2A schematic diagram of a Wi-Fi connection solution provided in an embodiment of the present application;
[0031] Figure 3 A schematic diagram of the frequency overlap relationship between a Bluetooth channel and a Wi-Fi channel provided in an embodiment of the present application;
[0032] Figure 4 A schematic diagram of a connection structure between a Wi-Fi communication module and a Bluetooth communication module provided in an embodiment of the present application;
[0033] Figure 5 A schematic diagram of a correlation matrix provided in an embodiment of the present application;
[0034] Figure 6 A schematic diagram of another correlation matrix provided in an embodiment of the present application;
[0035] Figure 7 A schematic diagram of a Wi-Fi connection method provided in an embodiment of the present application;
[0036] Fig. 8A A schematic diagram of a Bluetooth channel scan provided in an embodiment of the present application;
[0037] Figure 8B A schematic diagram of another Bluetooth channel scanning provided in an embodiment of the present application;
[0038] Figure 8C A schematic diagram of another Bluetooth channel scanning provided in an embodiment of the present application;
[0039] Fig. 9 A bar graph corresponding to the value of a second vector provided in an embodiment of the present application;
[0040] Fig.10 A schematic diagram of a Wi-Fi beacon frame provided in an embodiment of the present application;
[0041] Fig.11 A schematic diagram of an evaluation mark for a Bluetooth channel scanning strategy provided in an embodiment of the present application;
[0042] Fig.12 A schematic diagram of a backtracking mechanism provided in an embodiment of the present application;
[0043] Fig.13 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0044] Fig.14 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;
[0045] Fig.15A schematic diagram of a chip structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0047] The following terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "multiple" means two or more. In this application, the character " / " generally indicates that the objects associated with each other are in an "or" relationship. For example, A / B can be understood as A or B.
[0048] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not limited to the listed steps or modules, but may optionally include other steps or modules that are not listed, or may optionally include other steps or modules that are inherent to these processes, methods, products or devices.
[0049] In addition, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present concepts in a specific way.
[0050] For device discovery and Wi-Fi connection, it is extremely important to effectively reduce the power consumption and delay of electronic devices connecting to Wi-Fi. In the prior art, the solution of using the Wi-Fi communication module to perform RSSI scanning of available Wi-Fi channels has the problems of high power consumption and large delay.
[0051] Specifically, due to the high power consumption of the Wi-Fi communication module, when the Wi-Fi communication module does not communicate, in order to reduce the power consumption of the electronic device, the user will not keep the Wi-Fi communication module turned on, until the user needs to communicate with the Wi-Fi communication module at a certain time (for example, t0) to turn on the Wi-Fi communication module. After the Wi-Fi communication module in the electronic device is turned on, all Wi-Fi channels must be scanned first, and then connected after scanning the available Wi-Fi channels. For the Bluetooth communication module auxiliary scanning solution in this application, due to the low power consumption of the Bluetooth communication module, the user will keep the Bluetooth communication module turned on, that is, the Bluetooth communication module has been scanning the available channels, and may have found an available Wi-Fi channel at t0. The Wi-Fi communication module directly scans the available Wi-Fi channels determined by the Bluetooth communication module, and connects to one of the available Wi-Fi channels. Thus, the available Wi-Fi channels are determined by the Bluetooth communication module, which can reduce the time for the Wi-Fi communication module to scan the Wi-Fi channels compared to the Wi-Fi communication module scanning all Wi-Fi channels, and reduce the power consumption of the Wi-Fi communication module scanning the Wi-Fi channels.
[0052] In some embodiments, although the information of the currently available wireless access point (AP) can be stored after the electronic device arrives at a certain place, the channel where the AP is located may change when the electronic device arrives at the place next time. Therefore, even if the electronic device stores the information corresponding to the AP in advance, the Wi-Fi communication module still needs to scan the Wi-Fi channel to determine the channel to be connected. Therefore, for the solution of storing AP, after the Wi-Fi communication module is turned on, the Wi-Fi communication module still needs to scan the duration of all Wi-Fi channels. Therefore, scanning and determining the available Wi-Fi channels in advance through the Bluetooth communication module also has the effect of increasing the Wi-Fi connection speed compared to the solution of storing AP.
[0053] For electronic devices that include both a Bluetooth communication module and a Wi-Fi communication module, the available Wi-Fi channels can be determined in advance by using the Bluetooth communication module as a guide to scan channel information and then detecting the Wi-Fi AP through a specific algorithm. This can reduce the number of Wi-Fi channels scanned by the Wi-Fi communication module after the Wi-Fi communication module is subsequently started, thereby achieving the effect of reducing power consumption and latency.
[0054] It should be noted that although the Bluetooth communication module cannot synchronize and deframe Wi-Fi signals due to the independence of the MAC / PHY protocols of Bluetooth and Wi-Fi, the Bluetooth communication module can detect the status of each Wi-Fi channel through RSSI scanning to determine the available Wi-Fi channels.
[0055] See also Figure 1 , Figure 1 A schematic diagram of a time-frequency diagram of a Wi-Fi channel provided in an embodiment of the present application. Figure 1 As shown, Wi-Fi channel 1, Wi-Fi channel 3, Wi-Fi channel 6 and Wi-Fi channel 7 are exchanging data, and Wi-Fi channel 11 is periodically sending and receiving Wi-Fi beacon frames, waiting for access to a station (STA) to provide services, wherein the period is 102.4ms. The above-mentioned channel 11 is a serviced and idle channel, that is, an available channel that can be connected to the Wi-Fi communication module in the embodiment of the present application.
[0056] Among them, the Bluetooth communication module can scan which channels have beacon frames, but cannot detect whether there is data service on the channel. Among them, channels with beacon frames and data interaction will be crowded, that is, the channel is in a busy state. Channels with beacon frames but no data interaction are in an idle state. If the channel to which the Wi-Fi communication module of the electronic device is to be connected is in a busy state, the channel will not respond to the connection request of the Wi-Fi communication module, resulting in the Wi-Fi communication module being unable to connect to the channel. If the channel to which the Wi-Fi communication module of the electronic device is to be connected is in an idle state, the channel can respond to the connection request of the Wi-Fi communication module and complete the connection between the Wi-Fi communication module and the channel.
[0057] Therefore, after the Bluetooth communication module scans the channel with beacon frames, since the Bluetooth scan cannot detect whether there is data service on the channel, it is necessary to design a detection algorithm to detect the periodicity, intensity, and frequency distribution of the received energy, so as to further determine whether the Wi-Fi channel is busy or idle, whether there is an AP, etc. That is, the Bluetooth communication module can select channels with signal strength exceeding the preset threshold from these channels through the designed detection algorithm, and report these channels to the Wi-Fi communication module. The Wi-Fi communication module scans the reported channels and finally connects to one of the idle channels to interact with data services.
[0058] For some examples, see Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a Wi-Fi connection solution. Figure 2As shown, it includes five steps: coarse scanning-algorithm estimation-fine scanning-algorithm confirmation-Wi-Fi scanning. First, coarse scanning refers to scanning all Wi-Fi channels through the Bluetooth communication module, that is, scanning all Wi-Fi channels. Algorithm estimation refers to reporting the scanning results of the coarse scanning to the upper-layer processor for processing, and summarizing the coarse range (coarse range) of the available Wi-Fi channels through algorithms, threshold analysis and other means, which is set as a set {Wc}. Fine scanning refers to verifying (verify) scanning each Wi-Fi channel in the above set {Wc}. Algorithm confirmation refers to reporting the scanning results of the fine scanning to the upper-layer processor for processing, summarizing the good range (fine range) of the available Wi-Fi channels, and setting it as a set {Wf}. Wi-Fi scanning refers to scanning each Wi-Fi channel in the set {Wf} through the Wi-Fi communication module, and establishing a connection with the AP on an available channel.
[0059] The above coarse scan performs a large-scale scan of all Wi-Fi channels with low time resolution and low frequency resolution, which has many scanning blind spots. The above fine scan is a small-scale concentrated scan with high time resolution and high frequency resolution, and each Wi-Fi channel in the set {Wc} needs to be verified and scanned. The coarse scan and fine scan will repeatedly scan the same channel, resulting in low channel scanning efficiency.
[0060] In the above scanning scheme, the first round of rough scanning has a scanning blind spot, and the second round of fine scanning will repeatedly scan the same channel, resulting in inefficient scanning. Therefore, the above scanning scheme has a poor scanning effect due to the existence of a scanning blind spot, and requires two rounds of scanning, which results in high scanning power consumption and long scanning time, reducing the efficiency of electronic devices connecting to Wi-Fi.
[0061] Therefore, in a Wi-Fi connection method provided by an embodiment of the present application, an electronic device can scan multiple Wi-Fi channels once through a Bluetooth communication module to determine at least one available Wi-Fi channel. After starting the Wi-Fi communication module, the Wi-Fi communication module can only scan the available Wi-Fi channels provided by the Bluetooth communication module, reducing the number of Wi-Fi channels scanned by the Wi-Fi communication module, thereby reducing the time for the Wi-Fi communication module to scan the Wi-Fi channels and the time for the Wi-Fi communication module to connect to the Wi-Fi channels, and reducing the power consumption of the Wi-Fi communication module to scan the Wi-Fi channels.
[0062] The Bluetooth communication module uses the Bluetooth channel to scan the Wi-Fi channel. The Bluetooth channel here refers to the Bluetooth Low Energy (BLE) channel. The scheme of the Bluetooth communication module scanning the Wi-Fi channel has the following premise: among multiple Wi-Fi channels, the frequency range of each Wi-Fi channel overlaps with the frequency range of at least one BLE channel.
[0063] Taking the Wi-Fi channel in the 2.4G band as an example, the BLE channel operates in the 2.4 GHz band and is divided into 40 Bluetooth channels, each with a bandwidth of 2 MHz. The Wi-Fi channel is divided into 13 Wi-Fi channels in the 2.4GHz band.
[0064] See also Figure 3 , Figure 3 A schematic diagram of the frequency overlap between Bluetooth channels and Wi-Fi channels is provided. Figure 3 As shown, in the 2.4 GHz frequency band, 13 Wi-Fi channels overlap with 40 Bluetooth channels in frequency. Among them, the frequency range of Wi-Fi channel 1 overlaps with the frequency range of Bluetooth channel 37 and Bluetooth channel 0-Bluetooth channel 9. The frequency range of Wi-Fi channel 2 overlaps with the frequency range of Bluetooth channel 38 and Bluetooth channel 1-Bluetooth channel 11. The frequency range of Wi-Fi channel 3 overlaps with the frequency range of Bluetooth channel 38 and Bluetooth channel 4-Bluetooth channel 13. The frequency range of Wi-Fi channel 4 overlaps with the frequency range of Bluetooth channel 38 and Bluetooth channel 6-Bluetooth channel 16. The frequency range of Wi-Fi channel 5 overlaps with the frequency range of Bluetooth channel 38 and Bluetooth channel 9-Bluetooth channel 18. The frequency range of Wi-Fi channel 6 overlaps with the frequency range of Bluetooth channel 38 and Bluetooth channel 11-Bluetooth channel 21. The frequency range of Wi-Fi channel 7 overlaps with the frequency range of Bluetooth channel 13-Bluetooth channel 23. The frequency range of Wi-Fi channel 8 overlaps with the frequency range of Bluetooth channel 15-Bluetooth channel 26. The frequency range of Wi-Fi channel 9 overlaps with the frequency range of Bluetooth channel 18-Bluetooth channel 28. The frequency range of Wi-Fi channel 10 overlaps with the frequency range of Bluetooth channel 20-Bluetooth channel 31. The frequency range of Wi-Fi channel 11 overlaps with the frequency range of Bluetooth channel 23-Bluetooth channel 33. The frequency range of Wi-Fi channel 12 overlaps with the frequency range of Bluetooth channel 25-Bluetooth channel 36. The frequency range of Wi-Fi channel 13 overlaps with the frequency ranges of Bluetooth channel 39 and Bluetooth channel 28-Bluetooth channel 36.
[0065] The frequency range of the Wi-Fi channel overlaps with the frequency range of the Bluetooth channel, including that the frequency range of the Bluetooth channel is within the frequency range of the Wi-Fi channel, and that the frequency range of the Wi-Fi channel partially overlaps with the frequency range of the Bluetooth channel. For example, the frequency range of Wi-Fi channel 2 overlaps with the frequency ranges of Bluetooth channel 38 and Bluetooth channel 1 to Bluetooth channel 11, including that the frequency ranges of Bluetooth channel 38 and Bluetooth channel 2 to Bluetooth channel 10 are within the frequency range of Wi-Fi channel 2, and the frequency ranges of Bluetooth channel 1 and Bluetooth channel 11 partially overlap with the frequency range of Wi-Fi channel 2.
[0066] Depend on Figure 3 It can be seen that the overlap relationship between the frequency range of each Bluetooth channel and the frequency range of each Wi-Fi channel specifically includes: the frequency range of the Bluetooth channel is within the frequency range of the Wi-Fi channel, the frequency range of the Bluetooth channel partially overlaps with the frequency range of the Wi-Fi channel, and the frequency range of the Bluetooth channel does not overlap with the frequency range of the Wi-Fi channel at all.
[0067] For ease of understanding, various embodiments of the present application are described by taking the application of Wi-Fi channels and Bluetooth channels in the 2.4G frequency band as an example.
[0068] For electronic devices that have both a Bluetooth communication module and a Wi-Fi communication module, the Bluetooth communication module of the electronic device can detect the Wi-Fi signal energy sequence (RSSI value), and determine the available Wi-Fi channel and report it to the upper processor, which then sends the available Wi-Fi channel to the Wi-Fi communication module, and the Wi-Fi communication module can find an available AP connection for a Wi-Fi channel from at least one available Wi-Fi channel. Among them, the electronic device can integrate the Bluetooth communication module and the Wi-Fi communication module into one communication module (chip, also called combo chip or turbo chip).
[0069] See also Figure 4 , Figure 4 FIG. 1 is a schematic diagram showing a connection structure of a Wi-Fi communication module and a Bluetooth communication module provided in an embodiment of the present application. Figure 4 As shown, the Wi-Fi communication module 401 includes a first processing module 402 and a Wi-Fi RSSI module 403. The Bluetooth communication module 404 includes a second processing module 405 and a Bluetooth RSSI module 406. The Wi-Fi communication module 401 and the Bluetooth communication module 404 exchange data via an upper layer processor 407.
[0070] In some examples, the Bluetooth RSSI module 406 of the Bluetooth communication module 404 is used to detect the Wi-Fi signal energy sequence (RSSI value) to obtain the RSSI value corresponding to each Wi-Fi channel. Then, the second processing module 405 is used to determine whether the above-mentioned Wi-Fi channel is available through a certain algorithm (including periodicity and energy threshold detection), and then the Bluetooth communication module 404 reports the available Wi-Fi channel to the upper processor. The upper processor 407 can generate scanning information based on the received available Wi-Fi channel, and then pass the scanning information to the Wi-Fi communication module 401. Finally, the Wi-Fi communication module 401 scans the Wi-Fi channel corresponding to the scanning information, and finds an AP with an available Wi-Fi channel from at least one available Wi-Fi channel to connect.
[0071] Among them, for the Bluetooth communication module, the RSSI value corresponding to each Bluetooth channel frequency can be obtained by performing energy scanning on each Bluetooth channel. Since the frequency range scanned by each Bluetooth channel overlaps with the frequency range corresponding to one or more Wi-Fi channels, the energy intensity of each Wi-Fi channel can be calculated based on the frequency overlap relationship and the RSSI value scanned by each Bluetooth channel. Then, the Bluetooth communication module can report the Wi-Fi channels that exceed the preset energy intensity threshold to the upper-layer processor, and the upper-layer processor will send the Wi-Fi channels that exceed the preset energy intensity threshold to the Wi-Fi communication module. The Wi-Fi communication module scans the reported Wi-Fi channels, thereby connecting to the available Wi-Fi channels to achieve Wi-Fi communication.
[0072] In some examples, after the Bluetooth communication module determines the energy strength of multiple Wi-Fi channels based on the energy strength of multiple Bluetooth channels, the Bluetooth communication module may report the energy strength of each Wi-Fi channel to an upper-layer processor, which screens the energy strength of each Wi-Fi channel and determines the Wi-Fi channels that exceed a preset energy strength threshold. The Wi-Fi channels that exceed the preset energy strength threshold are then sent to the Wi-Fi communication module, which scans the reported Wi-Fi channels to connect to available Wi-Fi channels and achieve Wi-Fi communication.
[0073] Among them, electronic devices Figure 3 The frequency overlap relationship between the Wi-Fi channel and the Bluetooth channel shown in the figure can be summarized as follows: Figure 5 The matrix of Wi-Fi channels and Bluetooth channels shown in Figure 1. Figure 3 The channel number in the Bluetooth protocol is the number specified in the Bluetooth protocol. In the embodiment of the present application, the electronic device can reorder the Bluetooth channels from small to large in frequency to obtain the following: Figure 3The serial numbers (1-40) of the Bluetooth channels shown can be set as level 1 serial numbers.
[0074] like Figure 5 As shown in the figure, in the matrix A formed by 13 Wi-Fi channels and 40 Bluetooth channels, the horizontal numbers are the numbers of the Wi-Fi channels (1-13), and the vertical numbers are the serial numbers of the Bluetooth channels (1-40). The association matrix includes 40×13 matrix factors, each of which corresponds to a Wi-Fi channel and a Bluetooth channel. The value of the matrix factor here is used to indicate the frequency overlap relationship between the Wi-Fi channel and the Bluetooth channel corresponding to the matrix factor. The matrix factor refers to Figure 5 The square that corresponds to the number of a Wi-Fi channel and the sequence number of a Bluetooth channel, for example, Figure 5 The number 1 in the dotted frame 501 indicates the frequency overlap between Wi-Fi channel 1 and Bluetooth channel 1.
[0075] Among them, the value of each matrix factor includes a first value, a second value or a third value. The magnitude of the first value, the second value and the third value is positively correlated with the frequency overlap degree of the Bluetooth channel and the Wi-Fi channel. There are three cases from high to low for the frequency overlap degree of the Bluetooth channel and the Wi-Fi channel. One is that the frequency range of a Bluetooth channel is within the frequency range of a Wi-Fi channel, one is that the frequency range of a Bluetooth channel partially overlaps with the frequency range of a Wi-Fi channel, and the other is that the frequency range of a Bluetooth channel is outside the frequency range of a Wi-Fi channel. Assume that the first value is greater than the second value, and the second value is greater than the third value, for example, the first value is 1, the second value is 0.5, and the third value is 0. Then, if the frequency range of a Bluetooth channel is within the frequency range of a Wi-Fi channel, the value of the matrix factor corresponding to the Bluetooth channel and the Wi-Fi channel is a first value (1); if the frequency range of a Bluetooth channel partially overlaps with the frequency range of a Wi-Fi channel, the value of the matrix factor corresponding to the Bluetooth channel and the Wi-Fi channel is a second value (0.5); if the frequency range of a Bluetooth channel is outside the frequency range of a Wi-Fi channel, the value of the matrix factor corresponding to the Bluetooth channel and the Wi-Fi channel is a third value (0).
[0076] Taking the first value as 1, the second value as 0.5, and the third value as 0 as an example, by referring to Figure 3 The frequency overlap relationship between the Wi-Fi channel and the Bluetooth channel shown in FIG. 1 is obtained by obtaining the value of each matrix factor, and the following matrix can be formed: Figure 5For example, the number 1 in the dotted box 501 indicates that the frequency overlap relationship between Wi-Fi channel 1 and Bluetooth channel 1 is that the frequency range of Bluetooth channel 1 is within the frequency range of Wi-Fi channel 1. If the value of the matrix factor is 0, it may not be shown in the matrix, that is, the grid corresponding to the matrix factor is blank, refer to Figure 5 shown.
[0077] In some other examples, the value of the second value may be a ratio of the partial overlap between the frequency range of the Bluetooth channel and the frequency range of the Wi-Fi channel. For example, if the ratio of the frequency overlap range between Bluetooth channel A and Wi-Fi channel B to the frequency range of Bluetooth channel A is 0.3, the second value may also be 0.3.
[0078] In an embodiment of the present application, after obtaining the frequency overlap relationship between the Bluetooth channel and the Wi-Fi channel, the electronic device can calculate the energy intensity of the Wi-Fi channel based on the sorted matrix of the Bluetooth channel and the Wi-Fi channel and the RSSI value of the Bluetooth channel obtained by scanning the Bluetooth communication module.
[0079] Among them, the number of Bluetooth channels is 40. By scanning each Bluetooth channel through the Bluetooth communication module, a corresponding signal strength can be obtained, which can be arranged into a vector b of length 40. There are only 13 Wi-Fi channels, and the signal strength of each Wi-Fi channel is unknown, which can be recorded as an unknown vector w. Then, w, b and the above matrix A can be associated through matrix multiplication, that is, A×w=b.
[0080] Among them, in the above relationship, the number of equations is greater than the number of unknowns, which is an over-constrained fitting problem. The estimated value of the vector w to be calculated is, if its solution is required to satisfy the minimum difference between A and b, and the L-2 norm is used as the penalty function, it becomes a quadratic problem:
[0081]
[0082] Among them, if the number of Bluetooth RSSI sampling channels, that is, the number of Bluetooth channels, is greater than the number of Wi-Fi channels, this is a prerequisite for reducing the frequency sampling resolution. In the embodiment of the present application, it is not necessary to sample all Bluetooth channels, and it is only necessary to ensure that the columns of the matrix are full rank. Among them, ensuring that the columns of the matrix are full rank means that the number of rows of the matrix is greater than or equal to the number of columns.
[0083] In some embodiments, ensuring that the columns of the matrix are full rank also includes that multiple Bluetooth channels in the matrix can detect multiple Wi-Fi channels without missing energy detection of any Wi-Fi channel.
[0084] For example, Figure 6As shown in c, the serial numbers of the Bluetooth channels that can be selected from the 40 Bluetooth channels are 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34 and 37. The 13 Bluetooth channels corresponding to the above serial numbers can detect 13 Wi-Fi channels without missing the energy detection of any Wi-Fi channel.
[0085] Since the matrix A is full column rank, A T A is reversible, so the solution to the above quadratic problem is:
[0086] w*=(A T A) -1 A*b(Formula 1)
[0087] Wherein, while ensuring that the columns of the matrix are full rank, the electronic device can select the minimum number of Bluetooth channels for sampling. Since the number of Wi-Fi channels is 13, that is, the number of columns of the matrix is 13, then the number of Bluetooth channels selected by the electronic device, that is, the number of rows of the matrix, can also be 13. That is, in a 40*13 matrix (such as Figure 6 ), select the target Bluetooth channel corresponding to row 13 (as shown in a Figure 6 b), forming a 13*13 matrix (as shown in Figure 6 c). Among them, Figure 6 As shown in b, the row number where the black grid is located is the row number corresponding to the sequence number of the extracted target Bluetooth channel. It can be understood that Figure 6 a, Figure 6 b and Figure 6 In c, the numbers in the first column on the left are the serial numbers of the Bluetooth channels.
[0088] Among them, the Bluetooth channels corresponding to some serial numbers may be uniformly selected from the 40 Bluetooth channels. For example, starting from the Bluetooth channel corresponding to the first serial number, the corresponding Bluetooth channels are selected every 3 serial numbers until 13 Bluetooth channels are obtained. The serial numbers of the Bluetooth channels selected above are 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34 and 37 respectively.
[0089] Among them, by uniformly extracting some Bluetooth channels as described above, it is possible to make the subsequent allocation of scanning points to the Bluetooth channels for energy scanning more uniform.
[0090] Since the number of rows and columns of the above matrix A is the same, the matrix A is a square matrix, so the solution to the above quadratic problem is:
[0091] w*=A -1 *b(Formula 2)
[0092] If some of the 40 Bluetooth channels are not extracted, the above-mentioned scheme of scanning the signal strength of the 40 Bluetooth channels is redundant, and the process of solving w becomes a fitting problem. Therefore, solving the value of w will be more complicated.
[0093] That is to say, the embodiment of the present application can calculate the value of the vector w corresponding to the Wi-Fi channel through a 40*13 matrix and the value of the vector b with a length of 40 corresponding to the Bluetooth channel. Alternatively, the value of the vector w corresponding to the Wi-Fi channel can be calculated through a 13*13 matrix and the value of the vector b with a length of 13 corresponding to the Bluetooth channel. Compared with the former, the latter can reduce the amount of calculation in the process of calculating the vector w, increase the speed of calculating the vector w, and only need to perform energy scanning on fewer Bluetooth channels. Thus, scanning 13 Bluetooth channels to obtain the signal strength corresponding to each Bluetooth channel reduces the scanning time and reduces the scanning power consumption compared to scanning 40 Bluetooth channels to obtain the signal strength corresponding to each Bluetooth channel.
[0094] Therefore, after calculating the value of vector w, that is, the energy strength of the Wi-Fi channel, the Bluetooth communication module can report the Wi-Fi channels that exceed the preset energy strength threshold to the Wi-Fi communication module, and the Wi-Fi communication module scans the reported Wi-Fi channels, thereby connecting to one of the available Wi-Fi channels to achieve Wi-Fi communication.
[0095] The following is a detailed description of a Wi-Fi connection method provided in an embodiment of the present application, which can be applied to an electronic device, wherein the electronic device includes a Bluetooth communication module and a Wi-Fi communication module. Figure 7 As shown, the method may include the following steps S101 to S103:
[0096] Step S101: using the Bluetooth communication module, selecting N target Bluetooth channels from a plurality of Bluetooth channels to perform energy scanning in time division, and obtaining a received signal strength indication RSSI value scanned from each target Bluetooth channel.
[0097] In the embodiment of the present application, since there is only one energy detection unit in the Bluetooth communication module and only one Bluetooth channel can be selected for sampling detection at each time, the electronic device can use the Bluetooth communication module to perform energy scanning on the Bluetooth channel in time division to obtain the RSSI value scanned by the Bluetooth channel.
[0098] Therefore, in the embodiment of the present application, N target Bluetooth channels can be selected from 40 Bluetooth channels for time-sharing energy scanning. The frequency ranges of the N target Bluetooth channels overlap with the frequency ranges corresponding to the M Wi-Fi channels. Both N and M are positive integers. Since the Wi-Fi channel is divided into 13 channels in the 2.4 GHz frequency band, the above M can be 13.
[0099] From the matrix obtained by sorting out the frequency overlap relationship between the Wi-Fi channel and the Bluetooth channel, it can be known that in order to calculate the energy intensity of each Wi-Fi channel while further reducing the scanning time and the scanning power consumption, the above N can be 13. In other words, the electronic device can use the Bluetooth communication module to select 13 target Bluetooth channels from multiple Bluetooth channels for time-sharing energy scanning, thereby obtaining the RSSI values scanned by the 13 target Bluetooth channels.
[0100] The embodiment of the present application does not impose any specific restrictions on the value of N, but it can be seen from the above matrix that the column rank of the matrix must be full, that is, N must be greater than or equal to M, that is, N must be greater than or equal to 13, and, due to the limitation of the total number of Bluetooth channels, N must be less than or equal to 40. In other words, N can be as small as 13 and as large as 40.
[0101] In an embodiment of the present application, there may be multiple methods for performing energy scanning in time-sharing for the selected N target Bluetooth channels. Among the N target Bluetooth channels for performing energy scanning in time-sharing, two target Bluetooth channels scanned continuously at one time include a first Bluetooth channel and a second Bluetooth channel, and the frequency range corresponding to the first Bluetooth channel is not continuous with the frequency range corresponding to the second Bluetooth channel. The frequency difference between the frequency range corresponding to the first Bluetooth channel and the frequency range corresponding to the second Bluetooth channel may be greater than or equal to 10 megahertz (MHz).
[0102] It can be understood that if N = 40, all 40 Bluetooth channels are target Bluetooth channels. Figure 6 Taking c as an example, Bluetooth channel 1, Bluetooth channel 4, Bluetooth channel 7, Bluetooth channel 10, Bluetooth channel 13, Bluetooth channel 16, Bluetooth channel 19, Bluetooth channel 22, Bluetooth channel 25, Bluetooth channel 28, Bluetooth channel 31, Bluetooth channel 34, and Bluetooth channel 37 are target Bluetooth channels.
[0103] In the embodiment of the present application, when N=13, Figure 6 The matrix formed by the Wi-Fi channel and the Bluetooth channel shown in c is used as an example. Then, Figure 6From c, we can see that the serial numbers of the target Bluetooth channels corresponding to this matrix are 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34 and 37 respectively.
[0104] For example, N is 13, and the absolute value of the frequency difference between the frequency range corresponding to the first Bluetooth channel and the frequency range corresponding to the second Bluetooth channel is greater than or equal to 18 MHz. Fig. 8A In the schematic diagram of Bluetooth channel scanning shown in FIG. 1 , the horizontal numbers represent the amount of time (s lot), and the vertical numbers represent the sequence number of the Bluetooth channel. Among them, 1 s lot can represent the unit time for the Bluetooth communication module to use a Bluetooth channel for energy scanning. Fig. 8A As shown in FIG. 1 , after a target Bluetooth channel is scanned in one s lot cycle, the difference between the sequence number of the target Bluetooth channel used by the Bluetooth communication module for scanning in the next s lot cycle and the sequence number of the target Bluetooth channel used by the Bluetooth communication module for scanning in the previous s lot cycle is equal to 3. Fig. 8A The circle 801 shown indicates that the target Bluetooth channel 5 performs energy scanning in the 11th s lot cycle. The circle 801 may also be referred to as a scanning point.
[0105] It can be understood that the sequence numbers 1 to 13 of the Bluetooth channels here are obtained by reordering the extracted target Bluetooth channels, and can be set to level 2 sequence numbers. Fig. 8A As shown in the figure, the first column of numbers on the left represents the level 1 sequence number corresponding to the extracted target Bluetooth channel, and the second column of numbers on the left represents the level 2 sequence number corresponding to the extracted target Bluetooth channel. Then, the difference between the sequence numbers of the two target Bluetooth channels scanned continuously is 3, corresponding to Figure 6 The sequence number of the Bluetooth channel shown in a (1-40) is 9, and the difference between the sequence numbers of the two target Bluetooth channels scanned continuously is 9, that is, the frequency difference between the frequency ranges corresponding to the two target Bluetooth channels scanned continuously is 18 MHz.
[0106] like Fig. 8A As shown in the figure, the sequence numbers of the target Bluetooth channels are from 1 to 4 to 7 to 10 to 13, and the scanning point has reached the target Bluetooth channel corresponding to sequence number 13 in the 5th s lot. Since there are only 13 target Bluetooth channels, the position of the scanning point corresponding to the 6th s lot returns to the 3rd channel, and the sequence numbers are from 3 to 6 to 9 to 12. Then in the 10th s lot, the scanning point returns to the 2nd channel, and the sequence numbers are from 2 to 5 to 8 to 11. Thus, the scanning of all selected target Bluetooth channels is completed within 13 s lots. After that, multiple cycles of scanning are performed according to this rule.
[0107] It should be noted that after calculating that the sequence number of the next scanning point exceeds the maximum sequence number (13) of the target Bluetooth channel, the scanning point returns to the target Bluetooth channel corresponding to the sequence number corresponding to the difference between the sequence number and the maximum sequence number. Then, after the scanning of the target Bluetooth channel corresponding to the sequence number in the slot cycle corresponding to the scanning point is completed, the sequence number of the target Bluetooth channel used by the Bluetooth communication module for scanning in the next slot cycle is equal to the difference between the sequence number of the target Bluetooth channel used by the Bluetooth communication module for scanning in the previous slot cycle. For example, the sequence number of the target Bluetooth channel corresponding to the scanning point of the 6th slot should be 13+3=16, which exceeds the maximum sequence number 13, and then returns to the target Bluetooth channel corresponding to the sequence number 3 corresponding to the difference 16-13=3. Then, the sequence number of the target Bluetooth channel corresponding to the scanning point of the 7th slot is 6, and the sequence numbers of the target Bluetooth channels corresponding to the scanning points of the 7th slot to the 9th slot are from 6 to 9 to 12. The target Bluetooth channel number of the scan point corresponding to the 10th slot should be 12+3=15, which exceeds the maximum number 13, and returns to the target Bluetooth channel number 2 corresponding to the difference 15-13=2. Then, the target Bluetooth channel number of the scan point corresponding to the 11th slot is 5, and the target Bluetooth channels corresponding to the scan points from the 11th slot to the 13th slot are from 5 to 8 to 11.
[0108] Among them, among the 13 target Bluetooth channels for energy scanning in the above-mentioned time-sharing, the absolute value of the frequency difference between two target Bluetooth channels scanned continuously at one time: the target Bluetooth channel at the scanning point corresponding to the 5th slot and the target Bluetooth channel at the scanning point corresponding to the 6th slot, and the target Bluetooth channel at the scanning point corresponding to the 9th slot and the target Bluetooth channel at the scanning point corresponding to the 10th slot is greater than 18MHz.
[0109] Among the N target Bluetooth channels that perform energy scanning in time division, the first target Bluetooth channel that performs energy scanning is the Bluetooth channel corresponding to the minimum frequency range. Fig. 8A As shown, among the 13 target Bluetooth channels that perform energy scanning in time division, the first target Bluetooth channel that performs energy scanning is the Bluetooth channel corresponding to sequence number 1, that is, the Bluetooth channel corresponding to the minimum frequency range.
[0110] In some examples, it is also taken that N is 13, and the absolute value of the frequency difference between the frequency range corresponding to the first Bluetooth channel and the frequency range corresponding to the second Bluetooth channel is greater than or equal to 18 MHz. Figure 8BIn the schematic diagram of Bluetooth channel scanning shown in FIG. 1 , the horizontal numbers represent the number of slots, and the vertical numbers represent the sequence numbers of Bluetooth channels. Among them, after a target Bluetooth channel is scanned in a slot cycle, the sequence number of the target Bluetooth channel used by the Bluetooth communication module for scanning in the next slot cycle is equal to the difference between the sequence number of the target Bluetooth channel used by the Bluetooth communication module for scanning in the previous slot cycle. It can be understood that the sequence numbers 1 to 13 of the Bluetooth channels here are also obtained by re-sorting the extracted Bluetooth channels. Figure 8B As shown, the numbers in the first column on the left represent the level 1 serial numbers corresponding to the extracted target Bluetooth channels, and the numbers in the second column on the left represent the level 2 serial numbers corresponding to the extracted target Bluetooth channels.
[0111] like Figure 8B As shown in the figure, the sequence number of the target Bluetooth channel is from 12 to 9 to 6 to 3, and the scanning point has reached the third target Bluetooth channel in the fourth slot. Since the minimum sequence number of the target Bluetooth channel is 1, the scanning point returns to the 13th target Bluetooth channel in the fifth slot. At this time, the sequence number of the target Bluetooth channel is from 13 to 10 to 7 to 4 to 1. Then in the 10th slot, the scanning point returns to the 11th target Bluetooth channel, and the sequence number is from 11 to 8 to 5 to 2. Thus, the scanning of all selected target Bluetooth channels is completed within 13 slots. After that, multiple cycles of scanning are performed according to this rule.
[0112] It should be noted that after calculating that the sequence number of the next scanning point is less than the minimum sequence number (1) of the target Bluetooth channel, the absolute value of the difference between the sequence number and the minimum sequence number is obtained, and then starting from the maximum sequence number, in order from large to small, the target Bluetooth channel corresponding to the sequence number of the absolute value is determined as the Bluetooth channel of the scanning point. Then, after the scanning of the target Bluetooth channel corresponding to the sequence number in the slot cycle corresponding to the scanning point is completed, in the next slot cycle, the sequence number of the target Bluetooth channel used for scanning by the Bluetooth communication module is equal to 3. For example, the sequence number of the target Bluetooth channel corresponding to the scanning point of the fifth slot should be 3-3=0, which is less than the minimum sequence number 1. Then, based on the absolute value of the difference 1, starting from the maximum sequence number, in order from large to small, the first sequence number, that is, the maximum sequence number 13, is determined as the channel of the scanning point corresponding to the fifth slot. Then, the target Bluetooth channel number of the scanning point corresponding to the 6th slot is 10, and the target Bluetooth channels number of the scanning points corresponding to the 6th s lot to the 9th s lot are from 10 to 7 to 4 to 1. The target Bluetooth channel number of the scanning point corresponding to the 10th s lot should be 1-3=-2, which is less than the minimum number 1. Based on the absolute value of the difference 3, the third number, that is, number 11, is determined as the channel of the scanning point corresponding to the 10th s lot in descending order from the largest number. Then, the target Bluetooth channel number of the scanning point corresponding to the 11th s lot is 8, and the target Bluetooth channels number of the scanning points corresponding to the 11th s lot to the 13th s lot are from 8 to 5 to 2.
[0113] Among the 13 target Bluetooth channels that are energy scanned in the above-mentioned time-sharing manner, the absolute value of the frequency difference between two Bluetooth channels scanned continuously at one time: the target Bluetooth channel at the scanning point corresponding to the 4th s lot and the target Bluetooth channel at the scanning point corresponding to the 5th s lot, and the target Bluetooth channel at the scanning point corresponding to the 9th s lot and the target Bluetooth channel at the scanning point corresponding to the 10th s lot is greater than 18 MHz.
[0114] In such Fig. 8A and Figure 8BIn the schematic diagram of Bluetooth channel scanning shown, the absolute value of the frequency difference between the frequency range corresponding to the first Bluetooth channel and the frequency range corresponding to the second Bluetooth channel is greater than or equal to 18 MHz, but the sequence number of the first target Bluetooth channel for energy scanning is different. The embodiment of the present application does not limit the first target Bluetooth channel for energy scanning, which can be a target Bluetooth channel with a smaller frequency (such as a target Bluetooth channel with a sequence number of 1) or a target Bluetooth channel with a larger frequency (such as a target Bluetooth channel with a sequence number of 12).
[0115] In some other examples, N is 13, and the absolute value of the frequency difference between the frequency range corresponding to the first Bluetooth channel and the frequency range corresponding to the second Bluetooth channel is greater than or equal to 24 MHz. Figure 8C In the schematic diagram of the Bluetooth channel scanning method shown in FIG. 1 , the horizontal numbers represent the number of s lots, and the vertical numbers represent the sequence numbers of the Bluetooth channels. After a target Bluetooth channel is scanned in one s lot cycle, the sequence number of the target Bluetooth channel used by the Bluetooth communication module for scanning in the next s lot cycle is equal to the difference between the sequence number of the target Bluetooth channel used by the Bluetooth communication module for scanning in the previous s lot cycle and 4. It can be understood that the sequence numbers 1 to 13 of the Bluetooth channels here are also obtained by re-ordering the extracted Bluetooth channels. Figure 8C As shown, the numbers in the first column on the left represent the level 1 serial numbers corresponding to the extracted target Bluetooth channels, and the numbers in the second column on the left represent the level 2 serial numbers corresponding to the extracted target Bluetooth channels.
[0116] like Figure 8C As shown in the figure, the sequence numbers of the target Bluetooth channels are from 2 to 6 to 10. The sequence number of the target Bluetooth channel where the scanning point is located at the 4th s lot should be 14, which exceeds the maximum sequence number 13, so it returns to the 1st target Bluetooth channel. At this time, the sequence numbers of the target Bluetooth channels are from 1 to 5 to 9 to 13. Then at the 8th s lot, the scanning point returns to the 4th target Bluetooth channel, and the sequence numbers are from 4 to 8 to 12. Then at the 11th s lot, the scanning point returns to the 3rd target Bluetooth channel, and the sequence numbers are from 3 to 7 to 11. Thus, the scanning of all selected target Bluetooth channels is completed within 13 s lots. After that, multiple cycles of scanning are performed according to this rule.
[0117] It should be noted that after calculating that the sequence number of the next scanning point exceeds the maximum sequence number (13) of the target Bluetooth channel, the scanning point returns to the target Bluetooth channel corresponding to the sequence number corresponding to the difference between the sequence number and the maximum sequence number. Then, after the scanning of the target Bluetooth channel corresponding to the sequence number in the s lot cycle corresponding to the scanning point is completed, the sequence number of the target Bluetooth channel used by the Bluetooth communication module for scanning in the next slot cycle is equal to 4, which is the difference between the sequence number of the target Bluetooth channel used by the Bluetooth communication module for scanning in the previous s lot cycle. For example, the sequence number of the target Bluetooth channel corresponding to the scanning point of the 4th slot should be 10+4=14, which exceeds the maximum sequence number 13, and returns to the target Bluetooth channel corresponding to the sequence number 1 corresponding to the difference 14-13=1. Then, the sequence number of the target Bluetooth channel corresponding to the scanning point of the 5th s lot is 5, and the sequence numbers of the target Bluetooth channels corresponding to the scanning points of the 5th s lot to the 7th s lot are from 5 to 9 to 13. The target Bluetooth channel number of the scanning point corresponding to the 8th s lot should be 13+4=17. If it exceeds the maximum sequence number 13, it will return to the target Bluetooth channel number 4 corresponding to the difference 17-13=4. Then, the target Bluetooth channel number of the scanning point corresponding to the 9th s lot is 8, and the target Bluetooth channels corresponding to the scanning points from the 9th s lot to the 10th s lot are from 8 to 12. The target Bluetooth channel number of the scanning point corresponding to the 11th s lot should be 12+4=16. If it exceeds the maximum sequence number 13, it will return to the target Bluetooth channel number 3 corresponding to the difference 16-13=3. Then, the target Bluetooth channel number of the scanning point corresponding to the 12th s lot is 7, and the target Bluetooth channels corresponding to the scanning points from the 12th s lot to the 13th slot are from 7 to 11.
[0118] Among them, the first target Bluetooth channel for energy scanning can also be target Bluetooth channel 1 or other target Bluetooth channels, which is not limited in this application.
[0119] Among the 13 target Bluetooth channels for energy scanning in time division, the difference between the serial numbers of two Bluetooth channels scanned continuously is 4, corresponding to Figure 6The sequence number of the Bluetooth channel shown in a (1-40) is 12, and the difference between the sequence numbers of the two target Bluetooth channels scanned in one continuous scan is 24 MHz. Among them, the absolute value of the frequency difference between the target Bluetooth channel where the scanning point corresponding to the 3rd s lot is located and the target Bluetooth channel where the scanning point corresponding to the 4th s lot is located, the target Bluetooth channel where the scanning point corresponding to the 7th s lot is located and the target Bluetooth channel where the scanning point corresponding to the 8th slot is located, and the target Bluetooth channel where the scanning point corresponding to the 10th s lot is located and the target Bluetooth channel where the scanning point corresponding to the 11th s lot is located is greater than 24 MHz.
[0120] In some other examples, in the same Bluetooth channel scanning scheme, if the difference between the sequence numbers of two target Bluetooth channels scanned continuously is 3, there may also be a difference between the sequence numbers of two target Bluetooth channels scanned continuously is 4.
[0121] Understandably, Fig. 8A , Figure 8B and Figure 8C The Bluetooth channel scanning method shown is only an example. The number N can be selected between 13-40, and the absolute value of the frequency difference between the frequency range corresponding to the first Bluetooth channel and the frequency range corresponding to the second Bluetooth channel can also be selected between any values greater than 10 MHz.
[0122] Among them, N target Bluetooth channels are selected from multiple Bluetooth channels for time-sharing energy scanning, and the RSS I value scanned by each target Bluetooth channel can be obtained. After obtaining the RSS I value scanned by each target Bluetooth channel, the electronic device can obtain an available channel by comparing the energy intensity of each channel. Alternatively, the electronic device uses a channel with energy intensity lower than a certain threshold as an available channel, wherein low energy intensity can indicate that the corresponding channel is relatively idle. It can be understood that if the signal quality of the channel is too poor to be connected to the Wi-Fi communication module, there will be a minimum energy intensity threshold between the available channel and the Wi-Fi communication module, and only channels greater than the minimum energy intensity threshold can be connected to the Wi-Fi communication module.
[0123] In the embodiment of the present application, N target Bluetooth channels are selected from multiple Bluetooth channels for time-sharing energy scanning, which can be performed by energy scanning the beacon frames of each Wi-Fi channel to obtain the RSSI value scanned by each target Bluetooth channel. Among them, the electronic device can periodically detect the RSSI value scanned by each target Bluetooth channel, and if the detected period of the RSSI value is 102.4 milliseconds, it can be considered that the corresponding Wi-Fi channel has a beacon frame.
[0124] For ease of understanding, the following embodiments are described by taking scanning beacon frames as an example.
[0125] After obtaining the RSSI value scanned for each target Bluetooth channel, the electronic device can determine the energy strength of the Wi-Fi channel based on the frequency overlap relationship between the Bluetooth channel and the Wi-Fi channel.
[0126] Step S102: determining at least one target Wi-Fi channel among the M Wi-Fi channels based on the N RSSI values received by the N target Bluetooth channels and the frequency overlap relationship between the Bluetooth channels and the Wi-Fi channels.
[0127] In the embodiment of the present application, the electronic device can pre-acquire the frequency overlap relationship between the Bluetooth channel and the Wi-Fi channel, and the frequency overlap relationship at least includes the overlap relationship between the frequency range of each Wi-Fi channel and the frequency range of each target Bluetooth channel, such as Figure 3 shown.
[0128] The electronic device can determine the energy strength of each Wi-Fi channel based on the N RSSI values received by the N target Bluetooth channels and the frequency overlap relationship between the Bluetooth channel and the Wi-Fi channel. Then, the electronic device can screen the energy strength of each Wi-Fi channel and determine at least one target WI FI channel from the M Wi-Fi channels. For example, the electronic device can set an energy strength threshold to screen the energy strength of each Wi-Fi channel, that is, compare the energy strength of each Wi-Fi channel with the energy strength threshold, and determine at least one Wi-Fi channel that exceeds the energy strength threshold as the target Wi-Fi channel.
[0129] In an embodiment of the present application, a vector formed by RSS I values of multiple target Bluetooth channels, a vector formed by RSS I values of multiple Wi-Fi channels, and a matrix of target Bluetooth channels and Wi-Fi channels can be associated by matrix multiplication. Wherein, a vector formed by N RSS I values received based on N target Bluetooth channels is assumed to be a first vector, and the first vector includes N first vector factors. A vector formed by M RSS I values received by M Wi-Fi channels is assumed to be a second vector, and the second vector includes M second vector factors, each second vector factor corresponds to a Wi-Fi channel, and each second vector factor is used to indicate the energy intensity of the corresponding Wi-Fi channel.
[0130] Since the incidence matrix and the value of the first vector are known, the second vector can be calculated based on the incidence matrix and the value of the first vector.
[0131] Wherein, a matrix may be formed based on the frequency overlap relationship between the Wi-Fi channel and the Bluetooth channel. The matrix includes at least N×M matrix factors, each matrix factor corresponds to a Wi-Fi channel and a Bluetooth channel, and the value of the matrix factor is used to indicate the frequency overlap relationship between the Wi-Fi channel and the Bluetooth channel corresponding to the matrix factor.
[0132] Specifically, if the electronic device uses a Bluetooth communication module and selects 40 target Bluetooth channels for time-sharing energy scanning, then N=40, which can be formed as follows: Figure 5 The 40×13 matrix shown in FIG. 1 includes 40×13 matrix factors. At this time, the electronic device can form a first vector based on 40 RSSI values received from 40 target Bluetooth channels, and the first vector includes 40 first vector factors. Then, in the case of N=40, the following is formed: Figure 5 The 40×13 matrix shown is the association matrix between the Wi-Fi channel and the Bluetooth channel.
[0133] In some examples, if the electronic device uses a Bluetooth communication module and selects 13 target Bluetooth channels for time-sharing energy scanning, then N=13, and the electronic device can also directly form a 13×13 matrix based on the frequency overlap relationship between the selected 13 target Bluetooth channels and the Wi-Fi channels, and the matrix includes 13×13 matrix factors. At this time, the above 13×13 matrix is the association matrix between the Wi-Fi channel and the Bluetooth channel.
[0134] Among them, since the frequency overlap relationship includes the overlap relationship between the frequency range of each Wi-Fi channel and the frequency range of each Bluetooth channel. Then, if the number of extracted target Bluetooth channels N is less than 40, the electronic device can first form an original matrix according to the overlap relationship between the frequency range of each Wi-Fi channel and the frequency range of each Bluetooth channel. The original matrix includes Y×M matrix factors. Among them, Y here is 40, and M is 13. Then, N target Bluetooth channels can be extracted from the original matrix to form an association matrix, and the association matrix includes N×M matrix factors, N is less than 40, that is, N is less than Y.
[0135] For example, when N=13, the following can be formed based on the overlap relationship between the frequency range of each Wi-Fi channel and the frequency range of each Bluetooth channel: Figure 6 The original matrix of 40×13 shown in a is then extracted from the original matrix to form the matrix factor corresponding to the target Bluetooth channel. Figure 6 The 13×13 association matrix shown in c is shown in FIG. In the case of N=13, the electronic device may form a first vector based on 13 RSSI values received from 13 target Bluetooth channels, and the first vector includes 13 first vector factors.
[0136] It can be understood that when N=40, the 40×13 matrix is the correlation matrix. When N=13, the 40×13 matrix is the original matrix, and the 13×13 matrix formed by extracting 13 target Bluetooth channels is the correlation matrix.
[0137] In order to make the distribution of scanning points in the Bluetooth channels more uniform, the N target Bluetooth channels selected from the multiple Bluetooth channels are uniformly selected, that is, the difference in the frequency ranges corresponding to adjacent target Bluetooth channels is fixed. The difference can be greater than or equal to 4 MHz and less than or equal to 8 MHz. For example, Figure 6 As shown in b, starting with the Bluetooth channel with sequence number 1 as the first target Bluetooth channel, a target Bluetooth channel is selected every sequence number 3, and the difference in frequency ranges corresponding to adjacent target Bluetooth channels is 6 MHz.
[0138] In some examples, the above-mentioned selection of N target Bluetooth channels from multiple Bluetooth channels may also be non-uniform. For example, the difference in frequency ranges corresponding to adjacent target Bluetooth channels may be 4 MHz, and there may also be a difference in frequency ranges corresponding to adjacent target Bluetooth channels of 6 MHz. Among them, the above-mentioned extraction of the target Bluetooth channels must ensure that the frequency ranges corresponding to the extracted target Bluetooth channels can overlap with the frequency ranges of the 13 Wi-Fi channels respectively.
[0139] Among them, the specific steps of calculating the second vector w based on the association matrix A and the first vector b can refer to the above formula 1 or formula 2, and this application will not repeat them here.
[0140] Among them, since the above sampling strategy can be predetermined, for example, the electronic device determines to select N = 13 target Bluetooth channels for time-sharing energy scanning, then the inverse matrix of the association matrix A can also be stored in advance without real-time calculation. In other words, the frequency overlap relationship between the Bluetooth channel and the Wi-Fi channel can be obtained in advance, and the association matrix obtained from the frequency overlap relationship can also be obtained in advance, and how to evenly extract 13 target Bluetooth channels and form the association matrix A can also be extracted and obtained. Therefore, the inverse matrix of the above association matrix A can also be obtained and stored in advance, and the electronic device does not need to calculate in real time when in use, which improves the calculation efficiency of the energy intensity of the Wi-Fi channel.
[0141] Among them, after the electronic device calculates the value of the second vector w, that is, the energy intensity of the 13 Wi-Fi channels, it can set the energy intensity threshold. The electronic device determines the target Wi-Fi channel that exceeds the energy intensity threshold by comparing the energy intensity of each Wi-Fi channel with the energy intensity threshold. For example, assuming that the values of the second vector w are calculated as follows: w1 corresponding to Wi-Fi channel 1 is 0.2, w2 corresponding to Wi-Fi channel 2 is 1.5, w3 corresponding to Wi-Fi channel 3 is 0.3, w4 corresponding to Wi-Fi channel 4 is 0.2, w5 corresponding to Wi-Fi channel 5 is 0.1, w6 corresponding to Wi-Fi channel 6 is 1, w7 corresponding to Wi-Fi channel 7 is 0.08, w8 corresponding to Wi-Fi channel 8 is 0.09, w9 corresponding to Wi-Fi channel 9 is 0.07, w10 corresponding to Wi-Fi channel 10 is 0.03, w11 corresponding to Wi-Fi channel 11 is 0.18, w12 corresponding to Wi-Fi channel 1 is 1, and w13 corresponding to Wi-Fi channel 13 is 0.39. If the energy intensity threshold is set to 0.45, the electronic device may determine that the target Wi-Fi channels exceeding the energy intensity threshold are Wi-Fi channel 2, Wi-Fi channel 6, and Wi-Fi channel 12.
[0142] In some embodiments, the values of the 13 second vectors w may also be formed as follows: Fig. 9 The electronic device can set the energy intensity threshold as Fig. 9 As shown, the target Wi-Fi channels that exceed the energy intensity threshold can be obtained, namely Wi-Fi channel 2, Wi-Fi channel 6 and Wi-Fi channel 12. It can be understood that the above energy intensity threshold is only an example and can be customized according to actual needs, and the embodiments of the present application are not limited to this.
[0143] After calculating the energy strengths of the M Wi-Fi channels and determining at least one target Wi-Fi channel that exceeds the energy strength threshold from the M Wi-Fi channels, the electronic device can use the Wi-Fi communication module to scan the target Wi-Fi channels, thereby selecting the target Wi-Fi channel to be connected.
[0144] Step S103: Control the Wi-Fi communication module to connect to a target Wi-Fi channel to achieve Wi-Fi communication.
[0145] In the embodiment of the present application, after the electronic device selects a target Wi-Fi channel to be connected by scanning the Wi-Fi communication module, it controls the Wi-Fi communication module to connect to the target Wi-Fi channel to achieve Wi-Fi communication.
[0146] Based on this, a Wi-Fi connection method provided in an embodiment of the present application can customize the scanning strategy based on the overlapping rule of the frequency range of the Bluetooth channel and the frequency range of the Wi-Fi channel, and make full use of the association matrix formed by the two. It can perform the "one scan, one analysis" cooperation step to improve the efficiency and reliability of the Bluetooth communication module to assist in scanning the Wi-Fi channel. Among them, in the above-mentioned Wi-Fi connection method, the matrix solution method is used to efficiently infer the energy intensity of the Wi-Fi channel. Compared with the Bluetooth scanning strategy of "coarse scanning"-"judgment"-"fine scanning", the embodiment of the present application adopts the strategy of "normalized scanning"-"normalized analysis" to simplify the scanning, reporting, and data processing processes, which can improve the efficiency of the Bluetooth communication module in scanning the Bluetooth channel, reduce the analysis time of the Bluetooth communication module by scanning the Bluetooth channel to determine the available Wi-Fi channel, and reduce the delay and power consumption of the Wi-Fi connection.
[0147] In the Wi-Fi connection method provided by the embodiment of the present application, since the Bluetooth communication module is kept turned on, the electronic device can select N target Bluetooth channels through the Bluetooth communication module in advance for time-sharing energy scanning, and can determine at least one available Wi-Fi channel based on the RSSI value scanned by each target Bluetooth channel, and can determine the available Wi-Fi channels before the Wi-Fi communication module scans the Wi-Fi channels. After starting the Wi-Fi communication module, the Wi-Fi communication module can only scan the available Wi-Fi channels determined by the Bluetooth communication module, thereby assisting in determining the available Wi-Fi channels through the Bluetooth communication module, and reducing the number of Wi-Fi channels scanned by the Wi-Fi communication module compared to the Wi-Fi communication module scanning all Wi-Fi channels, thereby reducing the time for the Wi-Fi communication module to scan the Wi-Fi channels and the time for the Wi-Fi communication module to connect to the Wi-Fi channels, and reducing the power consumption of the Wi-Fi communication module to scan the Wi-Fi channels.
[0148] The embodiment of the present application also provides an evaluation method for a Bluetooth channel scanning strategy, which can evaluate different Bluetooth channel scanning strategies.
[0149] Among them, the shortest detection time of Bluetooth RSSI can be taken as a time (slot). Then, through investigation, it can be found that in outdoor places (such as subways, shopping malls) and other occasions, it can be found that the length of beacon frames appearing on 90% of Wi-Fi channels is roughly equal to 5 slots to 18 slots, among which the length of the beacon frame with the highest probability appearing on the Wi-Fi channel is equal to 12 to 13 slots. Among them, there are 640 slots in a beacon cycle. Among them, the bandwidth of the Wi-Fi beacon frame is 20MHz, covering at least 10 consecutive Bluetooth channels. Therefore, in the embodiment of the present application, the minimum length of the beacon frame appearing on the Wi-Fi channel (5 slots) can be used as the time characteristic length of the typical beacon frame, and the number of Bluetooth channels (10) continuously covered by the bandwidth of the beacon frame can be used as the frequency characteristic width of the typical beacon frame. Among them, a typical beacon frame is such as Fig.10 The time-frequency diagram shown can be abstracted into a rectangular window 901 (also called a beacon window). The typical beacon frame is the beacon frame that may exist on the 13 Wi-Fi channels in the embodiment of the present application.
[0150] In the embodiment of the present application, the rectangular window can be used to verify in the time-frequency diagram that there is at least one scanning point in each rectangular window, so that any beacon frame will be scanned by the scanning method of the Bluetooth channel provided in the embodiment of the present application, so that there will be no omission of scanning beacon frames, that is, there will be no blank areas (scanning blind areas) of typical size, and beacons appearing at any position have similar chances of being scanned. Therefore, the existence of scanning points in the rectangular window can verify that the scanning method of the Bluetooth channel provided in the embodiment of the application improves the effectiveness of scanning.
[0151] like Fig.10 In the Bluetooth channel scanning strategy shown in the figure, the first column of numbers on the left side of the Bluetooth channels are the level 1 serial numbers corresponding to the 13 target Bluetooth channels in the 40 Bluetooth channels after the 13 target Bluetooth channels are extracted from the 40 Bluetooth channels. The second column of numbers on the left side of the Bluetooth channels are the level 2 serial numbers after the 13 target Bluetooth channels are sorted again. The circles in the figure are Bluetooth scanning points. It should be pointed out that in Bluetooth scanning, the time resolution is one slot, and the frequency resolution satisfies that the beacon window can be scanned at any position. Fig.10 As shown, no matter where the matrix window 901 is moved to in the time-frequency diagram, at least one scanning point will appear in the matrix window 901 .
[0152] In the implementation of this application, if the position of the beacon window is marked with the upper left corner grid of the beacon window, and it is assumed that the beacon window can appear at any position on the time-frequency graph, then the number of scanning points that can be covered by the beacon window corresponding to each grid determines the quality of the scanning strategy. Among them, the more scanning points that can be covered by the beacon window corresponding to each grid, the higher the quality of the corresponding Bluetooth scanning strategy.
[0153] In the embodiment of the present application, each grid can mark the beacon window according to the number of scanning points in the beacon window at that position. If there is no scanning point in the beacon window, the grid is marked as black; if there is only one scanning point in the beacon window, the grid is marked as a diagonal line; if there are two scanning points in the beacon window, the grid is marked as white; if there are three scanning points in the beacon window, the grid is marked as a vertical line; if there are four scanning points in the beacon window, the grid is marked as a cross line.
[0154] Depend on Fig.11 As can be seen from a, the conventional Bluetooth channel scanning method diagram contains many black grids, that is, it contains many scanning dark areas. Fig.11It can be seen from b, c, and d that in the Bluetooth channel scanning strategy provided in the embodiment of the present application, there are no black grids, that is, no dark area is scanned.
[0155] Among them, the Bluetooth scanning strategy provided in the embodiment of the present application can be reflected by the average value of the number of scanning points in the beacon corresponding to all grids.
[0156] For example, Fig.11 The Bluetooth channel scanning strategy shown in b is scored as (57×1+(130-57)×2) / 130=1.56, that is, the beacon window appearing at any position can cover 1.56 scanning points on average.
[0157] like Fig.11 The Bluetooth channel scanning strategy shown in c is scored as (60×1+(130-60)×2) / 130=1.538, that is, the beacon window appearing at any position can cover 1.538 scanning points on average.
[0158] like Fig.11 The Bluetooth channel scanning strategy shown in d is scored as (60×1+(130-60)×2) / 130=1.538, that is, the beacon window appearing at any position can cover 1.538 scanning points on average.
[0159] Therefore, by calculating the number of scanning points that the beacon window can cover on average, different Bluetooth channel scanning strategies can be evaluated to determine a Bluetooth channel scanning strategy with better scanning effect.
[0160] In summary, through the above-mentioned evaluation method of the Bluetooth channel scanning strategy, it can be confirmed that the Bluetooth channel scanning strategy provided by the embodiment of the present application has no scanning blind area and has a better scanning effect.
[0161] The present application embodiment also provides a backtracking mechanism for the Wi-Fi connection method. Fig. 8A The Bluetooth channel scanning strategy is used as an example to illustrate.
[0162] After the electronic device calculates the value of the vector w corresponding to the energy intensity of each Wi-Fi channel through the association matrix, it can infer the target Wi-Fi channel where the AP may exist through the threshold. Fig.12 The bar graph of a shows the value of the vector factor corresponding to each Wi-Fi channel. Among them, the values of the vector factors corresponding to Wi-Fi channel 2, Wi-Fi channel 6, and Wi-Fi channel 12 exceed the preset threshold. That is, Wi-Fi channel 2, Wi-Fi channel 6, and Wi-Fi channel 12 are Wi-Fi channels that the AP may have.
[0163] Then, according to Fig.12 The frequency overlap relationship between the Wi-Fi channel and the Bluetooth channel shown in b can be used to query the Bluetooth channels corresponding to Wi-Fi channel 2, Wi-Fi channel 6, and Wi-Fi channel 12. Among them, the Bluetooth channels corresponding to Wi-Fi channel 2 are 4, 7, 10, and 13. The Bluetooth channels corresponding to Wi-Fi channel 6 are 13, 16, 19, and 22. The Bluetooth channels corresponding to Wi-Fi channel 12 are 28, 31, 34, and 37.
[0164] For example, the Bluetooth channels corresponding to Wi-Fi channel 2 are 4, 7, 10, and 13. Fig.12 c shows the detection sequence of Wi-Fi channel 2 (as Fig.12 The dashed box 1201 shown in c). The scanned s lot sequence can be divided into multiple sequences with the length of a beacon scheduled transmission time (TBTT) as the period. On the s lot sequence detected by Bluetooth RSSI, the signal can be converted into a sequence containing only [0,1], that is, a vector. A beacon cycle (102.4ms) can generate a vector with a length of 196. Continuously detecting N beacon cycles can obtain N vectors. Fig.12 It can be seen from c that in the above Bluetooth channel scanning strategy, the data extracted from any Bluetooth channel is basically uniform.
[0165] By calculating at least one of the similarity, duty cycle, and number of common areas of the N vectors, it is determined whether there is a beacon frame on Wi-Fi channel 2. For example, if the calculated similarity between the vectors is higher, the possibility that a beacon frame exists on Wi-Fi channel 2 is higher. For another example, if the calculated duty cycle of the vector is closer to a preset duty cycle, the possibility that a beacon frame exists on Wi-Fi channel 2 is higher.
[0166] That is to say, by comparing the similarity, duty cycle, number of public areas, etc. of the above N vectors, it is possible to determine whether the Bluetooth channel corresponding to Wi-Fi channel 2 is a channel where beacon frames exist.
[0167] Through the above-mentioned backtracking mechanism for the Wi-Fi connection method, it can be backtracked to determine whether the beacon frame exists accurately in the WI FI channel whose energy intensity exceeds the energy intensity threshold.
[0168] In some embodiments, after the electronic device determines at least one target Wi-Fi channel that exceeds the energy intensity threshold from M Wi-Fi channels through the Bluetooth communication module, it can also perform vector detection on the Bluetooth channels corresponding to each target Wi-Fi channel, that is, the signal on the slot sequence detected by Bluetooth RSSI in the above-mentioned backtracking mechanism generates N vectors, and by comparing the similarity, duty cycle, number of public areas, etc. of the above-mentioned N vectors, it is determined whether there is a beacon frame in the Bluetooth channel corresponding to each target Wi-Fi channel. Thus, the electronic device can further screen the target Wi-Fi channel, and report the target Wi-Fi channel corresponding to the Bluetooth channel determined to have a beacon frame after vector detection to the Wi-Fi communication module. Then, after the electronic device uses the Wi-Fi communication module to scan the above-screened target Wi-Fi channel, it determines the final target Wi-Fi channel from the above-screened target Wi-Fi channel, and controls the Wi-Fi communication module to dock with the target Wi-Fi channel to achieve Wi-Fi communication. Therefore, the backtracking mechanism can further reduce the number of Wi-Fi channels scanned by the Wi-Fi communication module, reduce the time for the Wi-Fi communication module to scan Wi-Fi channels and the time for the Wi-Fi communication module to connect to Wi-Fi channels, and reduce the power consumption of the Wi-Fi communication module to scan Wi-Fi channels.
[0169] The execution subject of the Wi-Fi connection method provided in the embodiment of the present application may be a device for Wi-Fi connection, and the execution device may be Fig.13 The electronic device shown. At the same time, the execution device can also be a central processing unit (CPU) of the electronic device, or a control module for Wi-Fi connection in the electronic device. In the embodiment of the present application, the Wi-Fi connection method provided in the embodiment of the present application is described by taking the electronic device executing the Wi-Fi connection method as an example.
[0170] The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings. Fig.13The structure diagram of an electronic device 100 is shown. The electronic device 100 may include at least one of a mobile phone, a foldable electronic device, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device, or a smart city device, etc., including a Bluetooth communication module and a Wi-Fi communication module. The specific type of the electronic device 100 is not particularly limited in the embodiment of the present application.
[0171] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) connector 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor 180J, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0172] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0173] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0174] The processor can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.
[0175] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 may be a cache memory. The memory may store instructions or data that have been used or are frequently used by the processor 110. If the processor 110 needs to use the instruction or data, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0176] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc. The processor 110 may be connected to a touch sensor, an audio module, a wireless communication module, a display, a camera, and other modules through at least one of the above interfaces.
[0177] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0178] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0179] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0180] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0181] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0182] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), bluetooth low energy (BLE), ultra wide band (UWB), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0183] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other electronic devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0184] The external memory interface 120 can be used to connect an external memory card, such as a MicroSD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external memory card. Or files such as music and videos are transferred from the electronic device to the external memory card.
[0185] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional methods or data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.
[0186] Some other embodiments of the present application provide an electronic device. The electronic device may include: a Bluetooth communication module, a Wi-Fi communication module, a memory, and one or more processors; the Bluetooth module, the Wi-Fi module, the memory, and the processor are coupled. The memory is also used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can perform the various functions or steps performed by the electronic device in the above method embodiment. The structure of the electronic device can refer to Fig.13 The structure of the electronic device 100 is shown.
[0187] like Fig.14 As shown, it is a diagram of the software architecture inside the electronic device. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the internal architecture of the electronic device can be divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (ART) and the native C / C++ library, the hardware abstract layer (HAL) and the kernel layer.
[0188] The application layer can include a series of application packages.
[0189] like Fig.14 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0190] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0191] like Fig.14 As shown, the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, an activity manager, an input manager, and the like.
[0192] The window manager provides window management services (WMS). WMS can be used for window management, window animation management, surface management, and as a transfer station for the input system.
[0193] Content providers are used to store and retrieve data and make it accessible to applications. This data can include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0194] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0195] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0196] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0197] The activity manager can provide activity management services (AMS), which can be used to start, switch, and schedule system components (such as activities, services, content providers, and broadcast receivers) as well as manage and schedule application processes.
[0198] The input manager can provide input management services (IMS), which can be used to manage system input, such as touch screen input, key input, sensor input, etc. IMS takes events from input device nodes and distributes them to appropriate windows through interaction with WMS.
[0199] The Android runtime includes the core library and the Android runtime. The Android runtime is responsible for converting source code into machine code. The Android runtime mainly uses the ahead of time (AOT) compilation technology and the just in time (JIT) compilation technology.
[0200] The core library is mainly used to provide basic Java class library functions, such as basic data structures, mathematics, IO, tools, databases, networks, etc. The core library provides an API for users to develop Android applications.
[0201] The native C / C++ library can include multiple functional modules, such as surface manager, media framework, libc, OpenGL ES, SQLite, Webkit, etc.
[0202] Among them, the surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media framework supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES provides drawing and operation of 2D graphics and 3D graphics in applications. SQLite provides a lightweight relational database for applications of electronic device 100.
[0203] The hardware abstraction layer runs in user space, encapsulates kernel layer drivers, and provides a calling interface to the upper layer.
[0204] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0205] The Wi-Fi connection methods in the aforementioned embodiments can all be implemented in the electronic device 100 having the aforementioned hardware structure and software structure.
[0206] The present application also provides a chip system, such as Fig.15As shown, the chip system 150 includes at least one processor 1501 and at least one interface circuit 1502. The processor 1501 and the interface circuit 1502 can be interconnected through lines. For example, the interface circuit 1502 can be used to receive signals from other devices (such as a computer memory). For another example, the interface circuit 1502 can be used to send signals to other devices (such as processor 1501). Exemplarily, the interface circuit 1502 can read instructions stored in the memory and send the instructions to the processor 1501. When the instruction is executed by the processor 1501, the computer can execute the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0207] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device (such as a mobile phone), the electronic device executes each function or step executed by the mobile phone in the above-mentioned method embodiment.
[0208] The present application also provides a computer program product, which, when executed on a computer, enables the computer to execute the functions or steps executed by the mobile phone in the above method embodiment. The computer may be an electronic device, such as a mobile phone.
[0209] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0210] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0211] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0212] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0213] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0214] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A wireless fidelity Wi-Fi connection method, characterized in that: Applied to an electronic device, the electronic device includes a Bluetooth communication module and a Wi-Fi communication module, and the method includes: Using the Bluetooth communication module, N target Bluetooth channels are selected from multiple Bluetooth channels for time-sharing energy scanning, and a received signal strength indicator RSSI value scanned by each of the target Bluetooth channels is obtained; the frequency ranges scanned by the N target Bluetooth channels overlap with the frequency ranges corresponding to the M Wi-Fi channels respectively; N and M are both positive integers, and N is greater than or equal to M; determining, based on the N RSSI values received by the N target Bluetooth channels and the frequency overlap relationship between the Bluetooth channel and the Wi-Fi channel, an energy strength of each Wi-Fi channel in the M Wi-Fi channels; screening the energy strength of each Wi-Fi channel to determine at least one target Wi-Fi channel in the M Wi-Fi channels; the frequency overlap relationship at least includes an overlap relationship between a frequency range of each Wi-Fi channel and a frequency range of each target Bluetooth channel; The Wi-Fi communication module is controlled to connect to one of the target Wi-Fi channels to achieve Wi-Fi communication.
2. The method according to claim 1, characterized in that Among the N target Bluetooth channels that perform energy scanning in time division, two target Bluetooth channels that are continuously scanned at one time include a first Bluetooth channel and a second Bluetooth channel, and a frequency range corresponding to the first Bluetooth channel is discontinuous with a frequency range corresponding to the second Bluetooth channel.
3. The method according to claim 2, characterized in that An absolute value of a frequency difference between a frequency range corresponding to the first Bluetooth channel and a frequency range corresponding to the second Bluetooth channel is greater than or equal to 10 MHz.
4. The method according to claim 2 or 3, characterized in that: Among the N target Bluetooth channels that perform energy scanning in time division, the first target Bluetooth channel that performs energy scanning is the Bluetooth channel corresponding to the minimum frequency range.
5. The method according to claim 1, characterized in that The determining, based on the N RSSI values received by the N target Bluetooth channels and the frequency overlap relationship between the Bluetooth channel and the Wi-Fi channel, the energy strength of each Wi-Fi channel in the M Wi-Fi channels includes: Based on the N RSSI values received from the N target Bluetooth channels, a first vector is formed; the first vector includes N first vector factors; Based on the frequency overlap relationship, an association matrix is formed; the association matrix includes at least N×M matrix factors, each of the matrix factors corresponds to a Wi-Fi channel and a Bluetooth channel respectively, and the value of the matrix factor is used to indicate the frequency overlap relationship between the Wi-Fi channel and the Bluetooth channel corresponding to the matrix factor; Based on the association matrix and the first vector, a second vector is calculated; the second vector includes M second vector factors, each second vector factor corresponds to a Wi-Fi channel, and each second vector factor is used to indicate the energy intensity of the corresponding Wi-Fi channel.
6. The method according to claim 5, characterized in that The frequency overlap relationship at least includes an overlap relationship between a frequency range of each Wi-Fi channel and a frequency range of each Bluetooth channel; Wherein, forming a correlation matrix based on the frequency overlap relationship includes: Based on the frequency overlap relationship, an original matrix is formed; wherein the original matrix includes Y×M matrix factors; The matrix factors corresponding to the target Bluetooth channel are extracted from the original matrix to form the association matrix; wherein the association matrix includes N×M matrix factors, and N is less than Y.
7. The method according to claim 6, characterized in that A difference between frequency ranges corresponding to adjacent target Bluetooth channels is greater than or equal to 4 MHz and less than or equal to 24 MHz.
8. The method according to any one of claims 5 to 7, characterized in that: The value of each matrix factor includes a first value, a second value or a third value; wherein the magnitudes of the first value, the second value and the third value are positively correlated with the degree of frequency overlap between the Bluetooth channel and the Wi-Fi channel.
9. The method according to any one of claims 5 to 7, characterized in that: The step of calculating the second vector based on the incidence matrix and the first vector comprises: Based on the vector value of the first vector b and the association matrix A, the following formula is used: w*=(A T A) -1 A*b Calculate the vector value of the second vector w.
10. The method according to any one of claims 1-3, 5-7, characterized in that: The step of selecting N target Bluetooth channels from a plurality of Bluetooth channels and performing energy scanning in a time-sharing manner, and obtaining a received signal strength indication RSSI value scanned by each of the target Bluetooth channels, comprises: Select N target Bluetooth channels from the multiple Bluetooth channels to perform energy scanning on beacon frames of each Wi-Fi channel in a time-sharing manner, and obtain RSSI values scanned by each of the target Bluetooth channels.
11. An electronic device, characterized in that: The electronic device comprises: a Bluetooth communication module, a Wi-Fi communication module, a memory and one or more processors; the Bluetooth communication module, the Wi-Fi communication module, the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code comprises computer instructions. When the computer instructions are executed by the electronic device, the electronic device executes the method as described in any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed in the mobile terminal, the mobile terminal executes the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
KR1018382220000B1