Low-power-consumption Bluetooth quick connection method and device, medium and equipment
By calculating the connection address of the main device in the low-power Bluetooth connection, and modifying the broadcast address, the problems of large power consumption and low connection efficiency in the existing technology are solved, and fast and accurate connection is achieved.
Patent Information
- Application Number
- CN202411821918.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-25
Smart Images

Figure CN119697618A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Bluetooth connection technology, and in particular to a low-power Bluetooth quick connection method, device, storage medium and electronic device. Background Art
[0002] like Figure 2 As shown, the current master-slave device connection strategy based on low-power Bluetooth is that the slave device turns on the broadcast function to broadcast the device, and the master device turns on the scanning function to search and scan. Then, after scanning a qualified device, the master device initiates a connection to the slave device.
[0003] In some specific scenarios and applications, such as electronic price tag functions, people hope that the power consumption during connection is as low as possible and the connection speed is faster. However, due to the existence of scanning actions in existing technical solutions, the time to scan a device that meets the requirements is uncertain, and when the master device scans a qualified slave device, it is necessary to turn off the scanning function before connecting to the scanned slave device, and the switching process between the scanning action and the connection action state also takes a certain amount of time to complete.
[0004] From the perspective of low power consumption strategy, the fewer actions the master device takes in the connection strategy, the less time it takes to execute the connection strategy. From the perspective of connection accuracy, the master and slave devices use the same algorithm strategy to calculate the slave device broadcast address and the master device connection address, which will make the random address information carried by the slave device broadcast consistent with the connection address specified by the master device, thereby achieving fast and accurate connection. However, in the prior art, because of the need to perform processing actions such as device scanning and post-scan connection, the above-mentioned technical problems of low power consumption, accurate connection and fast connection cannot be solved by the prior art. Summary of the invention
[0005] In view of the problems of high power consumption and low connection efficiency in the connection process in the prior art, there is a need for a low-power Bluetooth quick connection solution in which a master device can directly connect to a slave device of a specified address without scanning and the slave device broadcasts specific address information. Taking into account factors such as economy, i.e., hardware requirements and deployment quantity, as well as stability, this application mainly provides a low-power Bluetooth quick connection method, device, storage medium and electronic device.
[0006] In order to achieve the above-mentioned purpose, the first technical solution adopted in the present application is: a low-power Bluetooth quick connection method, which includes: calculating the connection address of the master device on the slave device side according to the MAC address of the master device; modifying the broadcast address of the slave device to the connection address and starting broadcasting broadcast information carrying the connection address to allow the master device to connect to the slave device; calculating the broadcast address of the slave device on the master device side according to the MAC address of the master device; the master device fixes the connection broadcast address, thereby completing the connection between the master device and the slave device.
[0007] Optionally, the connection address of the master device is calculated on the slave device side based on the MAC address of the master device, including: obtaining the MAC address of the master device on the slave device side through the binding relationship between the slave device and the master device; or, inputting the MAC address of the master device into the slave device through external input.
[0008] Optionally, the calculation process of the connection address and the broadcast address includes: obtaining the highest byte value of the MAC address in the master device or in the slave device according to the MAC address of the master device; shifting the highest byte value right by a predetermined number of bits to obtain a second MAC address, and obtaining the value of the upper four-bit address of the second MAC address; comparing the value of the upper four-bit address with a first predetermined threshold, and determining the connection address or the broadcast address in the master device or in the slave device according to the comparison result.
[0009] Optionally, the value of the upper four bits of the address is compared with a first predetermined threshold, and based on the comparison result, a connection address or a broadcast address is determined in the master device or in the slave device, including: when the value of the upper four bits of the address is not less than the first predetermined threshold, using the MAC address of the master device as the connection address or the broadcast address; when the value of the upper four bits of the address is less than the first predetermined threshold, determining the connection address or the broadcast address based on the relationship between the value of the upper four bits of the address and the second predetermined threshold, the third predetermined threshold and the fourth predetermined threshold.
[0010] Optionally, the connection address or broadcast address is determined based on the size relationship between the value of the upper four-bit address and the second predetermined threshold, the third predetermined threshold and the fourth predetermined threshold, including: when the upper four-bit address is less than the second predetermined threshold, inserting the first value into the predetermined position of the MAC address to obtain the connection address or broadcast address; when the upper four-bit address is not less than the second predetermined threshold and less than the third predetermined threshold, inserting the second value into the predetermined position of the MAC address to obtain the connection address or broadcast address; when the upper four-bit address is not less than the third predetermined threshold and less than the fourth predetermined threshold, inserting the third value into the predetermined position of the MAC address to obtain the connection address or broadcast address; and when the upper four-bit address is not less than the fourth predetermined threshold and less than the first predetermined threshold, inserting the fourth value into the predetermined position of the MAC address to obtain the connection address or broadcast address.
[0011] The second technical solution adopted in the present application is: a low-power Bluetooth quick connection device, which includes: a connection address calculation module, which is used to calculate the connection address of the master device on the slave device side according to the MAC address of the master device; an address broadcast module, which is used to modify the broadcast address of the slave device to the connection address and start broadcasting the broadcast information carrying the connection address to allow the master device to connect to the slave device; a broadcast address calculation module, which is used to calculate the broadcast address of the slave device on the master device side according to the MAC address of the master device; a connection module, which is used for the master device to fix the connection broadcast address, thereby completing the connection between the master device and the slave device.
[0012] Optionally, the connection address of the master device is calculated on the slave device side based on the MAC address of the master device, including: obtaining the MAC address of the master device on the slave device side through the binding relationship between the slave device and the master device; or, inputting the MAC address of the master device into the slave device through external input.
[0013] Optionally, the calculation process of the connection address and the broadcast address includes: obtaining the highest byte value of the MAC address in the master device or in the slave device according to the MAC address of the master device; shifting the highest byte value right by a predetermined number of bits to obtain a second MAC address, and obtaining the value of the upper four-bit address of the second MAC address; comparing the value of the upper four-bit address with a first predetermined threshold, and determining the connection address or the broadcast address in the master device or in the slave device according to the comparison result.
[0014] Optionally, the value of the upper four bits of the address is compared with a first predetermined threshold, and based on the comparison result, a connection address or a broadcast address is determined in the master device or in the slave device, including: when the value of the upper four bits of the address is not less than the first predetermined threshold, using the MAC address of the master device as the connection address or the broadcast address; when the value of the upper four bits of the address is less than the first predetermined threshold, determining the connection address or the broadcast address based on the relationship between the value of the upper four bits of the address and the second predetermined threshold, the third predetermined threshold and the fourth predetermined threshold.
[0015] Optionally, the connection address or broadcast address is determined based on the size relationship between the value of the upper four-bit address and the second predetermined threshold, the third predetermined threshold and the fourth predetermined threshold, including: when the upper four-bit address is less than the second predetermined threshold, inserting the first value into the predetermined position of the MAC address to obtain the connection address or broadcast address; when the upper four-bit address is not less than the second predetermined threshold and less than the third predetermined threshold, inserting the second value into the predetermined position of the MAC address to obtain the connection address or broadcast address; when the upper four-bit address is not less than the third predetermined threshold and less than the fourth predetermined threshold, inserting the third value into the predetermined position of the MAC address to obtain the connection address or broadcast address; and when the upper four-bit address is not less than the fourth predetermined threshold and less than the first predetermined threshold, inserting the fourth value into the predetermined position of the MAC address to obtain the connection address or broadcast address.
[0016] The third technical solution adopted in the present application is: a computer-readable storage medium storing a computer program / instruction, which is operated to execute the low-power Bluetooth quick connection method in solution one.
[0017] The fourth technical solution adopted in the present application is: a computer device, including a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to implement the low-power Bluetooth fast connection method in solution one.
[0018] The technical solution of the present application can achieve the following beneficial effects: no scanning is required when connecting a master device and a slave device, which effectively reduces power consumption and connection time during the connection process, achieves fast connection, and improves the accuracy of device connection. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0020] Figure 1 It is a schematic diagram of a specific implementation of a low-power Bluetooth quick connection method of the present application;
[0021] Figure 2 It is a flow chart of the master-slave device connection process in the prior art;
[0022] Figure 3 It is a schematic diagram of a connection process of a low-power Bluetooth quick connection method of the present application;
[0023] Figure 4It is a schematic diagram of an address calculation process of a low-power Bluetooth fast connection method of the present application;
[0024] Figure 5 It is a schematic diagram of a specific implementation of a low-power Bluetooth quick connection device of the present application.
[0025] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0026] The preferred embodiments of the present application are described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present application can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present application.
[0027] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0028] At present, the master-slave device connection strategy based on low-power Bluetooth is that the slave device turns on the broadcast function to broadcast, the master device turns on the scan function to scan, and initiates the connection after the master device monitors the slave device. In some specific scenarios and applications, such as the electronic price tag function, people hope that the power consumption during connection is as low as possible and the connection speed is faster.
[0029] However, in these application scenarios, the slave broadcast address of the master device connection is not fixed. Based on the characteristics of the above-mentioned fields, the master and slave devices are usually bound in advance before connection, so the MAC addresses of the master and slave devices are known in advance. Based on the above characteristics, this application proposes a specific connection method.
[0030] In this method, the broadcast address of the slave device adopts the RANDOM address, so that its address has a certain relationship with the master device. Based on this rule, the master device does not need to scan when connecting to the slave device, but can use a fixed algorithm to calculate the corresponding broadcast address of the slave device according to its own MAC address, and then fix the connection to this address. The address data of the broadcast address and connection address calculated by the master device and the slave device are the same, thereby ensuring that the master device and the slave device can quickly and accurately establish a connection.
[0031] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The specific embodiments described below can be combined with each other to form new embodiments. The same or similar ideas or processes described in one embodiment may not be repeated in other embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0032] Figure 1 An implementation of a low-power Bluetooth quick connection method of the present application is shown.
[0033] Figure 1 The low-power Bluetooth fast connection method shown includes: step S101, calculating the connection address of the master device at the slave device end according to the MAC address of the master device;
[0034] Step S102, modifying the broadcast address of the slave device to a connection address and starting broadcasting of the connection address to allow the master device to connect to the slave device;
[0035] Step S103, calculating the broadcast address of the slave device at the master device end according to the MAC address of the master device;
[0036] Step S104, the master device fixes the connection broadcast address, thereby completing the connection between the master device and the slave device.
[0037] In this specific implementation, the master device only sends a connection request information packet to the specified address without scanning processing, which effectively reduces the connection power consumption and connection time and realizes fast connection. In addition, both the master and slave devices use the same set of algorithms to calculate the broadcast address and the connection address, which improves the accuracy of the connection. At the same time, the slave device can realize the connection of nearly unlimited devices based on the random address carried by the broadcast.
[0038] Specifically, the device roles of the present application are divided into master devices and slave devices. When the slave device side learns the MAC address of the master device to be connected, it calculates the connection address based on the MAC address of the master device, and then turns on ADV (broadcast function) to enable the master device to connect to the slave device, so that its address has a certain regular connection with the master device side. In this way, the master device side does not need to scan, and can use a fixed algorithm to calculate the corresponding slave device side connection address based on its own MAC address, and then fix the connection to the broadcast address. Figure 3 Schematic diagram of the connection process of a low-power Bluetooth quick connection method of the present application. Figure 3 As shown, the slave device broadcasts the connection address of the master device based on the random address type calculated according to the predetermined algorithm. This broadcast carries the calculated address information. The master device also calculates the address information carried by the slave device broadcast according to its own MAC address, and then sends a packet requesting connection to the broadcast address. After receiving the packet, the slave device completes the connection with the master device. Among them, the address type of the broadcast address and the connection address calculated by this calculation method is a random address.
[0039] exist Figure 1 In the illustrated implementation, the low-power Bluetooth fast connection method includes step S101, calculating the connection address of the master device at the slave device end according to the MAC address of the master device.
[0040] In a specific embodiment of the present application, step S101 includes: obtaining the MAC address of the master device on the slave device side through the binding relationship between the slave device and the master device; or, inputting the MAC address of the master device into the slave device through external input.
[0041] Specifically, the master and slave devices are usually bound before connection, so the MAC address of the master device is known in advance, so it is easier for the slave device to obtain the MAC address information of the master device, or the MAC address of the master device can be input into the slave device through external input. After obtaining the MAC address of the master device, the slave device uses the MAC address of the master device according to a specific calculation algorithm to calculate the connection address of the master device.
[0042] exist Figure 1 In the illustrated embodiment, the low-power Bluetooth fast connection method includes step S102, modifying the broadcast address of the slave device to a connection address and starting to broadcast the connection address to allow the master device to connect to the slave device.
[0043] Specifically, the original broadcast address of the slave device is modified to the calculated connection address, and then the broadcast function of the slave device is turned on to send a broadcast with the connection address information so that the master device can connect to the slave device.
[0044] exist Figure 1 In the illustrated implementation, the low power Bluetooth fast connection method includes step S103, calculating the broadcast address of the slave device at the master device end according to the MAC address of the master device.
[0045] In a specific embodiment of the present application, according to the MAC address of the master device, the highest byte value of the MAC address is obtained in the master device or in the slave device; the highest byte value is shifted right by a predetermined position to obtain a second MAC address, and the value of the upper four-bit address of the second MAC address is obtained; the value of the upper four-bit address is compared with a first predetermined threshold, and according to the comparison result, the connection address or the broadcast address is determined in the master device or in the slave device.
[0046] Further, the value of the upper four-bit address is compared with a first predetermined threshold, and based on the comparison result, a connection address or a broadcast address is determined in the master device or in the slave device, including: when the value of the upper four-bit address is not less than the first predetermined threshold, the MAC address of the master device is used as the connection address or the broadcast address; when the value of the upper four-bit address is less than the first predetermined threshold, the connection address or the broadcast address is determined based on the relationship between the value of the upper four-bit address and the second predetermined threshold, the third predetermined threshold and the fourth predetermined threshold.
[0047] Furthermore, the connection address or broadcast address is determined based on the size relationship between the value of the upper four-bit address and the second predetermined threshold, the third predetermined threshold and the fourth predetermined threshold, including: when the upper four-bit address is less than the second predetermined threshold, inserting the first value into the predetermined position of the MAC address to obtain the connection address or broadcast address; when the upper four-bit address is not less than the second predetermined threshold and less than the third predetermined threshold, inserting the second value into the predetermined position of the MAC address to obtain the connection address or broadcast address; when the upper four-bit address is not less than the third predetermined threshold and less than the fourth predetermined threshold, inserting the third value into the predetermined position of the MAC address to obtain the connection address or broadcast address; and when the upper four-bit address is not less than the fourth predetermined threshold and less than the first predetermined threshold, inserting the fourth value into the predetermined position of the MAC address to obtain the connection address or broadcast address.
[0048] Specifically, Figure 4 This is a schematic diagram of the address calculation process of a low-power Bluetooth fast connection method of the present application, such as Figure 4As shown, the MAC address of the master device is obtained, and then the highest byte value of the MAC address is obtained and the highest byte value is shifted right by four bits to obtain a new value of the upper four-bit byte. The value of the upper four-bit byte is compared with a predetermined first threshold value. When the value of the upper four-bit address is not less than the first predetermined threshold value, the address value is not modified, that is, the MAC address of the master device is used as the connection address or broadcast address; when the value of the upper four-bit address is less than the first predetermined threshold value, the connection address or broadcast address is determined according to the size relationship between the value of the upper four-bit address and the second predetermined threshold value, the third predetermined threshold value and the fourth predetermined threshold value, that is, when the upper four-bit address is less than the second predetermined threshold value, the first value is inserted into the predetermined position of the MAC address to obtain the connection address or broadcast address; when the upper four-bit address is not less than the second predetermined threshold value and less than the third predetermined threshold value, the second value is inserted into the predetermined position of the MAC address to obtain the connection address or broadcast address; when the upper four-bit address is not less than the third predetermined threshold value and less than the fourth predetermined threshold value, the third value is inserted into the predetermined position of the MAC address to obtain the connection address or broadcast address; and When the address is not less than the fourth predetermined threshold value and less than the first predetermined threshold value, the fourth value is inserted into the predetermined position of the MAC address to obtain the connection address or the broadcast address, wherein the first threshold value may be 0XC, the second threshold value may be 0X3, the third threshold value may be 0X6, the fourth threshold value may be 0X9, the first value is obtained by calculating the "OR" logical relationship between the value after the "AND" logical relationship between the highest byte value and 0X0F and 0XC0, the second value is obtained by calculating the "OR" logical relationship between the value after the "AND" logical relationship between the highest byte value and 0X0F and 0XD0, the third value is obtained by calculating the "OR" logical relationship between the value after the "AND" logical relationship between the highest byte value and 0X0F and 0XE0, and the fourth value is obtained by calculating the "OR" logical relationship between the value after the "AND" logical relationship between the highest byte value and 0X0F and 0XF0, and the predetermined position is the highest byte of the address. The above values are only exemplary, and the present application is not limited to the value range.
[0049] exist Figure 1 In the illustrated embodiment, the low power Bluetooth fast connection method includes step S104, where the master device is fixedly connected to the broadcast address, thereby completing the connection between the master device and the slave device.
[0050] Specifically, the master device sends a connection request to the slave device. After receiving the request, the slave device completes the verification of relevant information, and then completes the connection between the master device and the slave device, that is, the master device is connected to the slave device carrying the designated address broadcast information.
[0051] The present application uses the MAC address of the master device at the master device end and the slave device end respectively, and uses the same algorithm to simultaneously calculate the connection address and the broadcast address, wherein the values of the connection address and the broadcast address are the same, and then the slave device broadcasts a broadcast message containing the connection address to allow the master device to connect, and the master device specifies the connection address according to the calculated broadcast address, thereby connecting to the corresponding slave device, and then completing the connection between the master device and the slave device. Therefore, the master device of the present application only sends a connection request information packet to connect to the specified address, and the master device does not need to perform scanning processing during the connection process, which effectively reduces the connection power consumption and connection time, and realizes fast connection. In addition, the master and slave devices use the same set of algorithms to calculate the broadcast address and the connection address, which can effectively improve the accuracy of the connection. At the same time, based on the random address carried by the broadcast in the slave device, the connection of nearly unlimited devices can be realized, which can be applied to more usage scenarios.
[0052] Figure 5 A specific implementation of a low-power Bluetooth quick connection device of the present application is shown.
[0053] exist Figure 5 In the specific implementation shown, the low-power Bluetooth quick connection device mainly includes: a connection address calculation module, which is used to calculate the connection address of the master device on the slave device side according to the MAC address of the master device; an address broadcast module, which is used to modify the broadcast address of the slave device to the connection address and start broadcasting the broadcast information carrying the connection address to allow the master device to connect to the slave device; a broadcast address calculation module, which is used to calculate the broadcast address of the slave device on the master device side according to the MAC address of the master device; a connection module, which is used for the master device to fix the connection broadcast address, thereby completing the connection between the master device and the slave device.
[0054] In a specific embodiment of the present application, the connection address of the master device is calculated on the slave device side based on the MAC address of the master device, including: obtaining the MAC address of the master device on the slave device side through the binding relationship between the slave device and the master device; or, inputting the MAC address of the master device into the slave device through external input.
[0055] In a specific embodiment of the present application, the calculation process of the connection address and the broadcast address includes: according to the MAC address of the master device, obtaining the highest byte value of the MAC address in the master device or in the slave device; shifting the highest byte value right by a predetermined position to obtain a second MAC address, and obtaining the value of the upper four-bit address of the second MAC address; comparing the value of the upper four-bit address with a first predetermined threshold, and determining the connection address or the broadcast address in the master device or in the slave device according to the comparison result.
[0056] In a specific embodiment of the present application, the value of the upper four-bit address is compared with a first predetermined threshold, and based on the comparison result, a connection address or a broadcast address is determined in a master device or in a slave device, including: when the value of the upper four-bit address is not less than the first predetermined threshold, the MAC address of the master device is used as the connection address or the broadcast address; when the value of the upper four-bit address is less than the first predetermined threshold, the connection address or the broadcast address is determined based on the relationship between the value of the upper four-bit address and the second predetermined threshold, the third predetermined threshold and the fourth predetermined threshold. In a specific embodiment of the present application, a connection address or a broadcast address is determined according to a size relationship between the value of the upper four-bit address and a second predetermined threshold, a third predetermined threshold, and a fourth predetermined threshold, including: when the upper four-bit address is less than the second predetermined threshold, inserting the first value into a predetermined position of the MAC address to obtain a connection address or a broadcast address; when the upper four-bit address is not less than the second predetermined threshold and less than the third predetermined threshold, inserting the second value into a predetermined position of the MAC address to obtain a connection address or a broadcast address; when the upper four-bit address is not less than the third predetermined threshold and less than the fourth predetermined threshold, inserting the third value into a predetermined position of the MAC address to obtain a connection address or a broadcast address; and when the upper four-bit address is not less than the fourth predetermined threshold and less than the first predetermined threshold, inserting the fourth value into a predetermined position of the MAC address to obtain a connection address or a broadcast address
[0057] The low-power Bluetooth quick connection device provided in the present application can be used to execute the low-power Bluetooth quick connection method described in any of the above embodiments. Its implementation principles and technical effects are similar and will not be repeated here.
[0058] In a specific embodiment of the present application, each functional module in a low-power Bluetooth quick connection device of the present application can be directly in hardware, in a software module executed by a processor, or in a combination of the two.
[0059] The software modules may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from and write information to the storage medium.
[0060] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, or any combination thereof. A general-purpose processor may be a microprocessor, but in an alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration. In an alternative, the storage medium may be integrated with the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and the storage medium may reside in a user terminal as discrete components.
[0061] In another specific embodiment of the present application, a computer-readable storage medium stores a computer program / instruction, and the computer program / instruction is operated to execute the low-power Bluetooth quick connection method described in the above embodiment.
[0062] In a specific embodiment of the present application, a computer device includes a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the low-power Bluetooth fast connection method described in the above embodiment.
[0063] In a specific embodiment of the present application, a computer program product includes a computer program / instruction, which, when executed by a processor, implements the low-power Bluetooth fast connection method described in the above embodiment.
[0064] 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 the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, 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.
[0065] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0066] The above description is only an embodiment of the present application and does not limit the patent scope of the present application. Any equivalent structural transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A low-power Bluetooth quick connection method, characterized in that: include: According to the MAC address of the master device, the connection address of the master device is calculated on the slave device side; Modify the broadcast address of the slave device to the connection address and start broadcasting broadcast information carrying the connection address to allow the master device to connect to the slave device; Calculate the broadcast address of the slave device at the master device end according to the MAC address of the master device; The master device is fixedly connected to the broadcast address, thereby completing the connection between the master device and the slave device.
2. The low-power Bluetooth quick connection method according to claim 1, characterized in that: Based on the MAC address of the master device, the connection address of the master device is calculated on the slave device, including: The MAC address of the master device is obtained at the slave device through the binding relationship between the slave device and the master device; or the MAC address of the master device is input into the slave device through external input.
3. The low-power Bluetooth quick connection method according to claim 1, characterized in that: The calculation process of the connection address and the broadcast address includes: According to the MAC address of the master device, obtaining, in the master device or in the slave device, a highest byte value of the MAC address; Shift the highest byte value right by a predetermined number of bits to obtain a second MAC address, and obtain the value of the upper four bits of the second MAC address; The value of the upper four bits of the address is compared with a first predetermined threshold, and according to the comparison result, the connection address or the broadcast address is determined in the master device or in the slave device.
4. The low-power Bluetooth quick connection method according to claim 3, characterized in that: The comparing the value of the upper four-bit address with a first predetermined threshold, and determining the connection address or the broadcast address in the master device or in the slave device according to the comparison result, comprises: When the value of the upper four bits of the address is not less than the first predetermined threshold, using the MAC address of the master device as the connection address or the broadcast address; When the value of the upper four-bit address is less than the first predetermined threshold, the connection address or the broadcast address is determined according to the magnitude relationship between the value of the upper four-bit address and the second predetermined threshold, the third predetermined threshold and the fourth predetermined threshold.
5. The low-power Bluetooth quick connection method according to claim 4, characterized in that: The determining the connection address or the broadcast address according to the magnitude relationship between the value of the upper four bits of the address and the second predetermined threshold, the third predetermined threshold, and the fourth predetermined threshold comprises: When the upper four bits of the address are less than the second predetermined threshold, inserting the first value into a predetermined position of the MAC address to obtain the connection address or the broadcast address; When the upper four bits of the address are not less than the second predetermined threshold and less than the third predetermined threshold, inserting the second value into a predetermined position of the MAC address to obtain the connection address or the broadcast address; When the upper four bits of the address are not less than the third predetermined threshold and less than the fourth predetermined threshold, inserting a third value into a predetermined position of the MAC address to obtain the connection address or the broadcast address; and When the upper four bits of the address are not less than the fourth predetermined threshold and less than the first predetermined threshold, a fourth value is inserted into a predetermined position of the MAC address to obtain the connection address or the broadcast address.
6. A low-power Bluetooth quick connection device, characterized in that: include: A connection address calculation module, which is used to calculate the connection address of the master device on the slave device side according to the MAC address of the master device; An address broadcast module, which is used to modify the broadcast address of the slave device to the connection address and start broadcasting broadcast information carrying the connection address to allow the master device to connect to the slave device; A broadcast address calculation module, which is used to calculate the broadcast address of the slave device at the master device end according to the MAC address of the master device; A connection module is used for the master device to be fixedly connected to the broadcast address, thereby completing the connection between the master device and the slave device.
7. The low-power Bluetooth quick connection device according to claim 6, characterized in that: The calculation process of the connection address and the broadcast address includes: obtaining the highest byte value of the MAC address in the master device or in the slave device according to the MAC address of the master device; Shift the highest byte value right by a predetermined number of bits to obtain a second MAC address, and obtain the value of the upper four bits of the second MAC address; The value of the upper four bits of the address is compared with a first predetermined threshold, and according to the comparison result, the connection address or the broadcast address is determined in the master device or in the slave device.
8. The low-power Bluetooth quick connection device according to claim 6, characterized in that: The comparing the value of the upper four-bit address with a first predetermined threshold, and determining the connection address or the broadcast address in the master device or in the slave device according to the comparison result, comprises: When the value of the upper four bits of the address is not less than the first predetermined threshold, using the MAC address of the master device as the connection address or the broadcast address; When the value of the upper four-bit address is less than the first predetermined threshold, the connection address or the broadcast address is determined according to the magnitude relationship between the value of the upper four-bit address and the second predetermined threshold, the third predetermined threshold and the fourth predetermined threshold.
9. A computer-readable storage medium storing a computer program / instruction, characterized in that: The computer program / instructions are operated to perform the low power Bluetooth quick connection method according to any one of claims 1-5.
10. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the low-power Bluetooth fast connection method according to any one of claims 1 to 5.