Method, apparatus, device, and storage medium for establishing a Bluetooth link
The primary Bluetooth device uses the secondary Bluetooth device as a proxy to realize parallel paging of multiple target devices, solving the problem of low serial connection efficiency of Bluetooth devices and improving the efficiency and user experience of Bluetooth link establishment.
Patent Information
- Application Number
- CN202110565801.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-24
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-05-24
AI Technical Summary
When existing Bluetooth devices establish links with multiple target devices, the serial connection method leads to problems of long time and low efficiency.
The primary Bluetooth device uses the secondary Bluetooth device as a proxy to initiate paging to the target device, realizes parallel paging of multiple target devices, and shortens the time for establishing a Bluetooth link.
Through parallel paging, the efficiency of Bluetooth link establishment is improved, the time required to establish multiple Bluetooth links is shortened, and the user experience is improved.
Smart Images

Figure CN115396856B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of wireless communication technologies, and in particular, to a method, apparatus, device, and storage medium for establishing a Bluetooth link. Background Art
[0002] Wireless communication can be carried out between two Bluetooth-enabled devices by establishing a Bluetooth link.
[0003] In some scenarios, it is necessary to establish Bluetooth links between a Bluetooth device and multiple target devices. For example, a Bluetooth headset establishes Bluetooth links with two mobile phones, or a Bluetooth headset establishes Bluetooth links with a mobile phone and a laptop computer. Related technologies support a Bluetooth device to serially establish Bluetooth links with multiple target devices. That is, after a Bluetooth device successfully establishes a Bluetooth link with a target device or fails due to timeout, it then establishes a Bluetooth link with another target device.
[0004] Obviously, this serial connection method takes a relatively long time and has low efficiency. Summary of the Invention
[0005] Embodiments of the present application provide a method, apparatus, device, and storage medium for establishing a Bluetooth link. The technical solution is as follows:
[0006] According to one aspect of the embodiments of the present application, a method for establishing a Bluetooth link in a master Bluetooth device is provided. The method includes:
[0007] Sending a connection notification to a slave Bluetooth device, where the connection notification is used to instruct the slave Bluetooth device to act as an agent of the master Bluetooth device and initiate a page to a second target device;
[0008] Receiving connection information from the slave Bluetooth device, where the connection information is used for the master Bluetooth device to communicate continuously with the second target device;
[0009] Establishing a second Bluetooth link with the second target device based on the connection information.
[0010] According to one aspect of the embodiments of the present application, a method for establishing a Bluetooth link in a slave Bluetooth device is provided. The method includes:
[0011] Receiving a connection notification from a master Bluetooth device, where the connection notification is used to instruct the slave Bluetooth device to act as an agent of the master Bluetooth device and initiate a page to a second target device;
[0012] Initiating a page to the second target device;
[0013] If the paging of the second target device is successful, connection information is sent to the master Bluetooth device, and the connection information is used for the master Bluetooth device to communicate continuously with the second target device to establish a second Bluetooth link between the master Bluetooth device and the second target device.
[0014] According to one aspect of the embodiments of the present application, a device for establishing a Bluetooth link in a master Bluetooth device is provided. The device includes:
[0015] A connection notification sending module, configured to send a connection notification to a slave Bluetooth device, where the connection notification is used to instruct the slave Bluetooth device to act as an agent of the master Bluetooth device to initiate paging for a second target device;
[0016] A connection information receiving module, configured to receive connection information from the slave Bluetooth device, where the connection information is used for the master Bluetooth device to communicate continuously with the second target device;
[0017] A Bluetooth link establishing module, configured to establish a second Bluetooth link with the second target device based on the connection information.
[0018] According to one aspect of the embodiments of the present application, a device for establishing a Bluetooth link in a slave Bluetooth device is provided. The device includes:
[0019] A connection notification receiving module, configured to receive a connection notification from a master Bluetooth device, where the connection notification is used to instruct the slave Bluetooth device to act as an agent of the master Bluetooth device to initiate paging for a second target device;
[0020] A paging initiating module, configured to initiate paging for the second target device;
[0021] A connection information sending module, configured to, if the paging of the second target device is successful, send connection information to the master Bluetooth device, where the connection information is used for the master Bluetooth device to communicate continuously with the second target device to establish a second Bluetooth link between the master Bluetooth device and the second target device.
[0022] According to one aspect of the embodiments of the present application, a Bluetooth device is provided. The Bluetooth device includes a processor and a memory. A computer program is stored in the memory and is executed by the processor to implement the method on the master Bluetooth device side or the method on the slave Bluetooth device side as described above.
[0023] According to one aspect of the embodiments of the present application, a computer-readable storage medium is provided. A computer program is stored in the storage medium and is executed by a processor to implement the method on the master Bluetooth device side or the method on the slave Bluetooth device side as described above.
[0024] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a Bluetooth device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the Bluetooth device executes the method on the main Bluetooth device side or the method on the auxiliary Bluetooth device side as described above.
[0025] The technical solution provided by the embodiments of the present application may include the following beneficial effects:
[0026] The main Bluetooth device uses the secondary Bluetooth device as its proxy to initiate a paging to a target device, thereby effectively overcoming the limitation that a single Bluetooth device cannot initiate paging to multiple target devices simultaneously. The main Bluetooth device initiates a paging to one target device, and in parallel, the secondary Bluetooth device, as the proxy of the main Bluetooth device, initiates a paging to another target device, thereby realizing parallel paging to two target devices, shortening the time required to establish multiple Bluetooth links, and improving efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] To more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0028] Figure 1 Exemplarily shows a state diagram of a Bluetooth device;
[0029] Figure 2 Exemplarily shows a flowchart of a Bluetooth link establishment process;
[0030] Figure 3 Is a schematic diagram of the solution implementation environment provided by an embodiment of the present application;
[0031] Figure 4 Is a schematic diagram of the solution implementation environment provided by another embodiment of the present application;
[0032] Figure 5 Is a flowchart of a method for establishing a Bluetooth link provided by an embodiment of the present application;
[0033] Figure 6 Is a flowchart of a method for establishing a Bluetooth link provided by another embodiment of the present application;
[0034] Figure 7 Is a block diagram of a device for establishing a Bluetooth link provided by an embodiment of the present application;
[0035] Figure 8 It is a block diagram of a device for establishing a Bluetooth link provided by another embodiment of the present application;
[0036] Figure 9 It is a structural block diagram of a Bluetooth device provided by an embodiment of the present application. Detailed implementation manners
[0037] To make the objectives, technical solutions and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0038] Before introducing and explaining the technical solutions of the present application, some background knowledge of Bluetooth technology will be introduced and explained first.
[0039] Figure 1 An exemplary state diagram of a Bluetooth device is shown.
[0040] Inquiry state. Once a device wants to discover new devices, it will enter the inquiry state. At this time, the device broadcasts its inquiry packet (ID packet) to all devices within a specified range. The packet contains the IAC (Inquiry Access Code). The packet is sent out by using an inquiry hopping sequence. A device in the inquiry state can also receive inquiry replies (FHS packets), but the device does not confirm these packets.
[0041] Inquiry scan state. When a device wants to receive inquiry packets, it will enter the inquiry scan state. The scan is carried out according to the inquiry hopping sequence.
[0042] Page state. The state entered when a device searches for other devices. The device uses a page hopping sequence to send a page packet (ID packet) to notify other devices that it intends to learn about other devices and their services.
[0043] Page scan state. In the page scan state, the device listens for a page sequence containing its own DAC (Device Access Code). Once the device hopes to receive a page data packet, it enters the page scan state. The scan will be carried out according to the page hopping sequence. If the device receives a page packet, it will enter the slave response state.
[0044] The synchronization train state and the synchronization scan state are not highly relevant to the technical solution of this application, so they will not be elaborated here.
[0045] When two devices need to establish a Bluetooth link, one device enters the paging state and the other device enters the paging scan state. The two devices use the same paging hopping sequence. When they jump to the same frequency point, a Bluetooth link is established between the two devices. The device that initiates the paging is called the master device, and the device that performs the paging scan is called the slave device.
[0046] As Figure 2 shown, it exemplarily shows a flowchart of the Bluetooth link establishment process. This process may include 6 steps (S1 to S6) as shown in Table 1 below:
[0047] Table 1
[0048]
[0049] Multiple different packet types are defined in the baseband layer of the Bluetooth system. Higher layers use these packets to form higher-layer PDUs (Protocol Data Units). The above-mentioned packet types include: ID, NULL, POLL, FHS, DM1; These packets are defined in both the Synchronous Connection Oriented link (abbreviated as SCO) and the Asynchronous Connectionless Link (abbreviated as ACL). DH1, AUX1, DM3, DH3, DM5, DH5 are only defined in the asynchronous link (ACL). HV1, HV2, HV3, DV are only defined in the synchronous link (SCO).
[0050] During the Bluetooth link establishment process, mainly 3 packet types, namely ID, FHS, and POLL, are involved.
[0051] The ID packet is a 68-bit data packet used for paging, inquiry, and response processes, mainly composed of a Device Access Code (DAC) or an Inquiry Access Code (IAC).
[0052] The FHS (Frequency Hop Synchronization) packet is a special control packet that contains the Bluetooth device address of the device and the clock information of the source device. It contains 144 information bits and a 16-bit CRC (Cyclic Redundancy Check) code. The Payload uses 2 / 3 forward error correction (FEC) coding, which can make the total length of the payload reach 240 bits. The FHS packet covers a single time slot.
[0053] The POLL packet is similar to the NULL packet (i.e., an empty packet). The NULL packet is a packet with a length of 126 bits, consisting only of a Channel Access Code (CAC) and a packet header, and is used to return connection information to the source device. The NULL packet does not need to be acknowledged. The difference between the POLL packet and the NULL packet is that the POLL packet requires an acknowledgment from the destination device. Once the master device sends a POLL packet, the slave device must send back a packet in response.
[0054] In the above step S1, the master device sends high-frequency ID packets, which have the highest priority from a software perspective and occupy a high bandwidth from an air interface perspective. Generally, they do not support concurrent paging processes. Therefore, the current related technologies only support serial connections of Bluetooth. When a Bluetooth device needs to connect to multiple target devices, it must first connect to one target device and then connect to another target device. If the first target device does not turn on Bluetooth or is out of the connectable range, it is necessary to wait until the connection times out before starting to connect to another Bluetooth device, which takes a relatively long time, has low efficiency, and affects the user experience.
[0055] This application provides a method for establishing a Bluetooth link. The main Bluetooth device uses the secondary Bluetooth device as its proxy to initiate a page to the target device, thereby effectively overcoming the limitation that a single Bluetooth device cannot initiate a page to multiple target devices simultaneously. The main Bluetooth device initiates a page to one target device, and in parallel, the secondary Bluetooth device, as the proxy of the main Bluetooth device, initiates a page to another target device, thus realizing parallel paging of two target devices, shortening the time required to establish multiple Bluetooth links, and improving efficiency.
[0056] Figure 3 The figure shows a schematic diagram of the implementation environment of the solution provided by an embodiment of this application. The implementation environment of the solution may include: a main Bluetooth device 31, a secondary Bluetooth device 32, a first target device 33, and a second target device 34.
[0057] The master Bluetooth device 31 is the device that initiates a Bluetooth connection. The master Bluetooth device 31 needs to establish Bluetooth connections with the first target device 33 and the second target device 34 respectively.
[0058] In the embodiment of the present application, the process of establishing connections between the master Bluetooth device 31 and the first target device 33 and the second target device 34 can be executed in parallel. On the one hand, the master Bluetooth device 31 itself initiates a paging to the first target device 33 to establish a first Bluetooth link with the first target device 33. On the other hand, the master Bluetooth device 31 uses the slave Bluetooth device 32 as its proxy device. The slave Bluetooth device 32 initiates a paging to the second target device 34, and then after the paging is successful, the master Bluetooth device 31 establishes a second Bluetooth link with the second target device 34. In this way, the limitation that a single device does not support a concurrent paging process is overcome, and efficient parallel connection is achieved.
[0059] The above-mentioned master Bluetooth device 31, slave Bluetooth device 32, first target device 33, and second target device 34 can be any electronic devices that support Bluetooth functions (such as having a Bluetooth chip), including but not limited to headphones, mobile phones, tablet computers, wearable devices, laptop computers, vehicle terminal devices, etc.
[0060] In an exemplary application scenario, as Figure 4 shown, the master Bluetooth device 31 and the slave Bluetooth device 32 can be the left and right earphones of a pair of earphones. The master Bluetooth device is the master earphone, and the slave Bluetooth device is the slave earphone. For example, the master Bluetooth device 31 (or the master earphone) is the left earphone, and the slave Bluetooth device 32 (or the slave earphone) is the right earphone; or, the master Bluetooth device 31 (or the master earphone) is the right earphone, and the slave Bluetooth device 32 (or the slave earphone) is the left earphone. Optionally, which of the left and right earphones serves as the master Bluetooth device 31 and which serves as the slave Bluetooth device 32 can be determined by negotiation between the two earphones or set by default configuration. The present application does not limit this.
[0061] Exemplarily, a user has a pair of TWS (True Wireless Stereo) Bluetooth headsets and two mobile phones (denoted as mobile phone #A and mobile phone #B). In the initial state, the left and right headsets are in the headset case and there is no Bluetooth connection with mobile phone #A and mobile phone #B. When the user opens the headset case, the two headsets can adopt the technical solution provided by this application. On the one hand, the master headset (such as the left headset) itself initiates a paging to mobile phone #A and establishes a Bluetooth link with mobile phone #A. On the other hand, the master headset (such as the left headset) uses the slave headset (such as the right headset) as its proxy device, and the slave headset (such as the right headset) initiates a paging to mobile phone #B. Then, after the paging is successful, the master headset (such as the left headset) establishes a Bluetooth link with mobile phone #B. Through this parallel connection method, it is possible to efficiently and quickly reconnect to two target devices after the headset case is opened.
[0062] Of course, in some other application scenarios, the above-mentioned master Bluetooth device 31 and slave Bluetooth device 32 can also be a set of speakers or other Bluetooth devices, and this application does not make any limitations in this regard.
[0063] Figure 5 The flowchart of the method for establishing a Bluetooth link provided by an embodiment of this application is shown. This method can be applied to Figure 3 the solution implementation environment shown, and this method may include the following steps (510-540):
[0064] Step 510, the master Bluetooth device sends a connection notification to the slave Bluetooth device, and this connection notification is used to instruct the slave Bluetooth device to act as a proxy of the master Bluetooth device and initiate a paging to the second target device.
[0065] To realize the communication between the master Bluetooth device and the slave Bluetooth device, a Bluetooth connection can be established between the master Bluetooth device and the slave Bluetooth device. Optionally, in the embodiments of this application, the Bluetooth connection between the master Bluetooth device and the slave Bluetooth device is called an inter-device Bluetooth link, and the master Bluetooth device sends a connection notification to the slave Bluetooth device through this inter-device Bluetooth link.
[0066] Since a single device does not support concurrent paging processes, during the process that the master Bluetooth device is paging the first target device, the slave Bluetooth device can be used as its proxy device to initiate a paging to the second target device. In this way, the master Bluetooth device can, on the one hand, initiate a paging to the first target device by itself and initiate a paging to the second target device with the help of the slave Bluetooth device, so as to realize parallel paging of two target devices.
[0067] Optionally, the connection notification includes the DAC of the second target device, so that the slave Bluetooth device can know which device the master Bluetooth device expects to establish a Bluetooth link with.
[0068] Step 520, the secondary Bluetooth device initiates a paging to the second target device.
[0069] After the secondary Bluetooth device receives the connection notification from the primary Bluetooth device, it initiates a paging to the second target device.
[0070] In an exemplary embodiment, the secondary Bluetooth device sends a paging message to the second target device; if the secondary Bluetooth device receives a slave first paging response from the second target device, the secondary Bluetooth device sends a master paging response to the second target device; thereafter, if the secondary Bluetooth device receives a slave second paging response from the second target device, the secondary Bluetooth device determines that the paging of the second target device is successful. That is, the secondary Bluetooth device executes the above Figure 2 and the processes of steps S1 to S4 shown in Table 1. Subsequently, the primary Bluetooth device executes the above Figure 2 and steps S5 to S6 shown in Table 1, so as to establish a second Bluetooth link between the primary Bluetooth device and the second target device.
[0071] For this method, if the secondary Bluetooth device does not receive a slave first paging response from the second target device, or the secondary Bluetooth device does not receive a slave second paging response from the second target device, the secondary Bluetooth device determines that the paging of the second target device fails. In the case of a failure to page the second target device, the secondary Bluetooth device may send a paging failure notification to the primary Bluetooth device, and the paging failure notification is used to indicate that the secondary Bluetooth device fails to page the second target device. After receiving the paging failure notification from the secondary Bluetooth device, the primary Bluetooth device can learn that the secondary Bluetooth device fails to page the second target device. Subsequently, if the primary Bluetooth device still wants to establish a Bluetooth link with the second target device, it can initiate a paging to the second target device by itself.
[0072] In addition, if the secondary Bluetooth device performs the above step S3 to send a master device paging response to the second target device, since the master device paging response needs to carry information about the device (i.e., the master Bluetooth device) that actually establishes a connection with the second target device, the secondary Bluetooth device needs to obtain the relevant information of the master Bluetooth device before sending the master device paging response to the second target device. For example, the relevant information of the master Bluetooth device can be carried in the connection notification sent by the master Bluetooth device to the secondary Bluetooth device. Alternatively, after the secondary Bluetooth device receives the slave device's first paging response from the second target device, the secondary Bluetooth device sends an information acquisition request to the master Bluetooth device, and this information acquisition request is used to request to obtain the relevant information of the master Bluetooth device; correspondingly, after receiving this information acquisition request, the master Bluetooth device sends the relevant information of the master Bluetooth device to the secondary Bluetooth device. Of course, in some other embodiments, the secondary Bluetooth device can also obtain the relevant information of the master Bluetooth device at other appropriate times, and this application does not make any limitations in this regard. In addition, the relevant information of the master Bluetooth device refers to the information that needs to be carried in the master device paging response, including but not limited to at least one of the following: LAP (LAN Access Point), UAP (Upper Address Portion), NAP (Non-significant Address Portion), device type, device address (LT_ADDR (Logical Transport Access Request Address)), clock information, paging scan mode.
[0073] In another exemplary embodiment, the secondary Bluetooth device sends a paging message to the second target device; if the secondary Bluetooth device receives the slave device's first paging response from the second target device, the secondary Bluetooth device determines that the paging of the second target device is successful. That is, the secondary Bluetooth device performs the above Figure 2 and the processes of steps S1 to S2 shown in Table 1. Subsequently, the master Bluetooth device performs the above Figure 2 and the processes of steps S3 to S6 shown in Table 1, so as to establish a second Bluetooth link between the master Bluetooth device and the second target device.
[0074] For this method, if the secondary Bluetooth device does not receive the slave device's first paging response from the second target device, the secondary Bluetooth device determines that the paging of the second target device fails. In the case of a failed paging of the second target device, the secondary Bluetooth device may send a paging failure notification to the primary Bluetooth device, and the paging failure notification is used to indicate that the secondary Bluetooth device fails to page the second target device. After receiving the paging failure notification from the secondary Bluetooth device, the primary Bluetooth device can learn that the secondary Bluetooth device fails to page the second target device. Subsequently, if the primary Bluetooth device still wants to establish a Bluetooth link with the second target device, it can initiate a page to the second target device by itself.
[0075] In addition, for this method, the secondary Bluetooth device does not need to perform the above step S3 to send the master device paging response to the second target device. Instead, the primary Bluetooth device performs the above step S3 to send the master device paging response to the second target device. Therefore, the relevant information of the primary Bluetooth device introduced above does not need to be provided to the secondary Bluetooth device.
[0076] Step 530, if the paging of the second target device is successful, the secondary Bluetooth device sends connection information to the primary Bluetooth device, and the connection information is used for the primary Bluetooth device to communicate continuously with the second target device.
[0077] Optionally, the secondary Bluetooth device sends the connection information to the primary Bluetooth device through the above Bluetooth link between devices.
[0078] The so-called continuous communication means that the primary Bluetooth device does not need to initiate a page to the second target device again and can directly use the connection information to communicate with the second target device, such as exchanging the necessary information required to establish a Bluetooth link, so as to establish a Bluetooth link between the primary Bluetooth device and the second target device.
[0079] Optionally, the connection information includes clock synchronization information, and the clock synchronization information is used to enable the primary Bluetooth device and the second target device to communicate on the same frequency point. For example, the clock synchronization information may be clock offset information, and the primary Bluetooth device can adjust its own clock according to the clock offset information so that the primary Bluetooth device and the second target device can communicate on the same frequency point.
[0080] Step 540, the primary Bluetooth device establishes a second Bluetooth link with the second target device based on the connection information.
[0081] After receiving the connection information from the secondary Bluetooth device, the primary Bluetooth device establishes a second Bluetooth link with the second target device based on the connection information. In the embodiments of the present application, the Bluetooth link between the primary Bluetooth device and the second target device is referred to as the second Bluetooth link.
[0082] In an exemplary embodiment, if the above-mentioned step S3 is executed by the secondary Bluetooth device to send a master device paging response to the second target device, then the master Bluetooth device determines a target frequency point based on the connection information, and sends an LMP (Link Manager Protocol) feature exchange request to the second target device at the target frequency point. The LMP feature exchange request includes the feature information of the master Bluetooth device, receives an LMP feature exchange response from the second target device, the LMP feature exchange response includes the feature information of the second target device, saves the feature information of the second target device, and sends an LMP establishment completion message to the second target device. The LMP establishment completion message is used to indicate that the Bluetooth link is established. That is, after the master Bluetooth device determines the target frequency point based on the connection information, it executes the above-mentioned Figure 2 and the processes of steps S5 to S6 shown in Table 1 to complete the process of establishing the Bluetooth link.
[0083] In another exemplary embodiment, if the above-mentioned step S3 is executed by the master Bluetooth device to send a master device paging response to the second target device, then the master Bluetooth device determines a target frequency point based on the connection information, and sends a master device paging response to the second target device at the target frequency point. If a slave second paging response from the second target device is received, then an LMP feature exchange request is sent to the second target device. The LMP feature exchange request includes the feature information of the master Bluetooth device, receives an LMP feature exchange response from the second target device, the LMP feature exchange response includes the feature information of the second target device, saves the feature information of the second target device, and sends an LMP establishment completion message to the second target device. The LMP establishment completion message is used to indicate that the Bluetooth link is established. That is, after the master Bluetooth device determines the target frequency point based on the connection information, it executes the above-mentioned Figure 2 and the processes of steps S3 to S6 shown in Table 1 to complete the process of establishing the Bluetooth link.
[0084] Optionally, the master Bluetooth device initiates a page to the first target device. If the page to the first target device is successful, the master Bluetooth device establishes a first Bluetooth link with the first target device; wherein, the process of establishing the second Bluetooth link is executed in parallel with the process of establishing the first Bluetooth link. In the embodiments of the present application, the Bluetooth link between the master Bluetooth device and the first target device is referred to as the first Bluetooth link, and the process of establishing the first Bluetooth link can refer to Figure 2 and the processes of steps S1 to S6 shown in Table 1.
[0085] In summary, for the technical solution provided in the embodiments of the present application, the master Bluetooth device uses the slave Bluetooth device as its proxy to initiate a paging to the target device, thereby effectively overcoming the limitation that a single Bluetooth device cannot initiate paging to multiple target devices simultaneously, enabling the master Bluetooth device to initiate a paging to one target device. In parallel, the slave Bluetooth device, as the proxy of the master Bluetooth device, initiates a paging to another target device, thus realizing parallel paging to two target devices, shortening the time-consuming required to establish multiple Bluetooth links, and improving efficiency.
[0086] In addition, for the two methods introduced above, if the slave Bluetooth device executes the above-mentioned step S3 to send a master device paging response to the second target device, then the steps executed by the master Bluetooth device are relatively fewer, and the slave Bluetooth device shares as many steps as possible, so as to make full use of the processing resources of the slave Bluetooth device and minimize the processing volume of the master Bluetooth device; if the master Bluetooth device executes the above-mentioned step S3 to send a master device paging response to the second target device, then the relevant information of the master Bluetooth device introduced above does not need to be provided to the slave Bluetooth device, which helps to reduce the signaling overhead between the master and slave Bluetooth devices.
[0087] Figure 6 The flowchart of a method for establishing a Bluetooth link provided by another embodiment of the present application is shown.
[0088] In this embodiment, the master Bluetooth device is the master Bluetooth headset, and the slave Bluetooth device is the slave Bluetooth headset. Taking the method applied to Figure 4 the solution implementation environment shown as an example. Among them, the preset conditions include: mobile phone #A and the headset have been paired, and the Bluetooth of mobile phone #A is turned on or off; mobile phone #B and the headset have been paired, and the Bluetooth of mobile phone #B is turned on or off; both the left headset and the right headset are in the headset case; the headset case is closed; there is no Bluetooth connection between the left headset and the right headset; there is no Bluetooth connection between the left headset / right headset and the mobile phone (including mobile phone #A and mobile phone #B). The user usage scenario is: when the headset case is opened, the headset automatically reconnects to mobile phone #A and mobile phone #B.
[0089] For the convenience of process analysis, each headset is divided into two parts: the host and the controller; among them, the host is the upper-layer software, and the controller is the lower-layer hardware module responsible for processing the transmission and reception of Bluetooth technology wireless signals.
[0090] As Figure 6 shown, the method may include the following steps (601-614):
[0091] Step 601, the user opens the headset case, and the headset case sends an open-case event to the left headset and the right headset respectively.
[0092] Optionally, the earphone case sends an open - case event to the main programs of the left earphone and the right earphone respectively.
[0093] Step 602: Establish a connection between the left earphone and the right earphone, and perform role arbitration and merge the PDL (Paired Device List).
[0094] The purpose of role arbitration is to determine the roles between the two earphones. Optionally, the result of role arbitration is assumed that the left earphone assumes the primary role (i.e., the left earphone is the main Bluetooth device), and the right earphone assumes the secondary role (i.e., the right earphone is the secondary Bluetooth device).
[0095] Taking TWS earphones as an example, the process of role arbitration can be as follows: The left earphone sends its own status information to the right earphone. The status information includes: (a) whether it is in the earphone charging case, (b) whether it is connected to the mobile phone, (c) whether it is in a call service, (d) whether it is in a music service, etc. The right earphone will determine its own role by combining its own status information and the status information of the left earphone. The right earphone will reply its role information to the left earphone. It should be noted that for different Bluetooth devices, the process of role arbitration may be different, and this application does not limit this.
[0096] The purpose of merging the PDL is to merge the PDLs of the two earphones. Since the two earphones can be used separately, it is possible that the two earphones are paired with different devices. For example, the left earphone is paired with mobile phone #A and saves the address and key of mobile phone #A, and the right earphone is paired with mobile phone #B and saves the address and key of mobile phone #B. After this process is completed, both the left earphone and the right earphone will save the address and key of mobile phone #A and the address and key of mobile phone #B.
[0097] Taking TWS earphones as an example, the process of merging the PDL can be as follows: The left earphone sends its pairing record to the right earphone. The right earphone merges the PDL and saves the merged PDL. The right earphone sends the merged PDL to the left earphone, and the left earphone saves the merged PDL. It should be noted that for different Bluetooth devices, the process of merging the PDL may be different, and this application does not limit this.
[0098] If the number of paired devices included in the merged PDL is less than 2 (denoted as PDL < 2), then the main earphone (such as the left earphone) only needs to connect to at most one target device; if the number of paired devices included in the merged PDL is greater than or equal to 2 (denoted as PDL ≥ 2), then the main earphone (such as the left earphone) needs to connect to at least two target devices.
[0099] Figure 6Shown is the process with PDL≥2, where mobile phone #A manages the connection status of the main earphone (such as the left earphone), and the main earphone initiates a paging to mobile phone #A. Mobile phone #B manages the connection status of the main earphone (such as the left earphone), but initiates a paging to mobile phone #B through the proxy of the secondary earphone (such as the right earphone).
[0100] The Bluetooth link establishment process of mobile phone #A includes steps 603 to 605.
[0101] In step 603, the main program of the left earphone sends a connection creation command to the controller of the left earphone.
[0102] For example, the connection creation command can be a standard HCI_Create_Connection command.
[0103] In step 604, the process of the above steps S1 to S6 is executed between the controller of the left earphone and mobile phone #A to establish a Bluetooth link between the left earphone and mobile phone #A.
[0104] In step 605, after the Bluetooth link is established, the controller of the left earphone sends a connection completion event to the main program of the left earphone.
[0105] For example, the connection completion event can be a standard HCI_Connection_Complete event.
[0106] The Bluetooth link establishment process of mobile phone #B includes steps 606 to 614.
[0107] In step 606, the main program of the left earphone sends a connection notification to the main program of the right earphone, and this connection notification is used to indicate that the right earphone acts as the proxy of the left earphone to initiate a paging to mobile phone #B.
[0108] In step 607, the main program of the right earphone sends a connection creation command to the controller of the right earphone.
[0109] Optionally, the connection creation command can be a standard HCI_Create_Connection command or a private Create_Connection command.
[0110] In step 608, the controller of the right earphone initiates a paging to mobile phone #B.
[0111] In step 609, if the paging to mobile phone #B is successful, the controller of the right earphone sends a paging success event to the main program of the right earphone.
[0112] Optionally, the paging success event can be Page_Complete Event-Success or Vendor_Connection_Complete Event–Page Success.
[0113] Step 610, if paging mobile phone #B fails, the controller of the right earphone sends a paging failure event to the main program of the right earphone.
[0114] Optionally, the paging failure event can be Page_Complete Event-Timeout or Vendor_Connection_Complete Event–Page Timeout.
[0115] Step 611, the main program of the right earphone sends a connection result to the main program of the left earphone.
[0116] Optionally, when the main program of the right earphone receives a paging success event, the main program of the right earphone sends a connection success result (which can also be called a paging success notification) to the main program of the left earphone, and carries connection information, where the connection information includes clock synchronization information, and the clock synchronization information is used to enable the left earphone and mobile phone #B to communicate on the same frequency point; when the main program of the right earphone receives a paging failure event, the main program of the right earphone sends a connection failure result (which can also be called a paging failure notification) to the main program of the left earphone. Optionally, the connection information can also include information such as address information and device type, and the embodiments of the present application do not limit this.
[0117] Step 612, the controller of the right earphone sends a paging completion indication to the controller of the left earphone.
[0118] Optionally, the paging completion indication can be Page_Complete indication.
[0119] Step 613, the controller of the left earphone and mobile phone #B execute the process of the above steps 5-6 to establish a Bluetooth link between the left earphone and mobile phone #B.
[0120] For example, the left earphone and the right earphone exchange characteristic information, and then send an LMP establishment completion message.
[0121] Step 614, after the Bluetooth link is established, the controller of the left earphone sends a connection completion event to the main program of the left earphone.
[0122] For example, the connection completion event can be Connection_Complete event.
[0123] It should be noted that the names of some messages or events involved in this embodiment are only exemplary and explanatory. The names can be set according to certain specifications or requirements, and this application does not make any limitations in this regard.
[0124] In addition, in this embodiment, only the slave earphone (i.e., the right earphone) is taken as an example to execute the above step S3 to send a master device paging response to mobile phone #B, that is, the slave earphone (i.e., the right earphone) executes steps S1 to S4 and the master earphone (i.e., the left earphone) then executes steps S5 to S6, and finally a Bluetooth link is established between the master earphone (i.e., the left earphone) and mobile phone #B. In some other embodiments, it is also possible for the master earphone (i.e., the left earphone) to execute the above step S3 to send a master device paging response to mobile phone #B, that is, the slave earphone (i.e., the right earphone) executes steps S1 to S2 and the master earphone (i.e., the left earphone) then executes steps S3 to S6, and finally a Bluetooth link is established between the master earphone (i.e., the left earphone) and mobile phone #B. For the specific introduction of these two methods, reference can be made to the above embodiments, and details will not be elaborated here.
[0125] By adopting the technical solution provided by this application, the connection requirement is sent to the slave earphone through a custom private instruction (the connection notification sent by the master earphone to the slave earphone), so as to realize the parallel connection of two target devices (such as two mobile phones). Compared with the serial connection scheme of related technologies, a positive benefit of 5s to 10s can be obtained, improving the user experience.
[0126] It should be noted that in the above method embodiment, the technical solution of this application is introduced only from the perspective of the interaction between the master Bluetooth device and the slave Bluetooth device. The steps performed by the above master Bluetooth device can be separately implemented as a Bluetooth link establishment method on the master Bluetooth device side, and the steps performed by the above slave Bluetooth device can be separately implemented as a Bluetooth link establishment method on the slave Bluetooth device side.
[0127] The following is an embodiment of the device of this application, which can be used to execute the method embodiment of this application. For the details not disclosed in the device embodiment of this application, please refer to the method embodiment of this application.
[0128] Figure 7 The block diagram of the device for establishing a Bluetooth link in the master Bluetooth device provided by an embodiment of this application is shown. This device has the function of implementing the above method example on the master Bluetooth device side, and this function can be implemented by hardware or by hardware executing corresponding software. This device can be the above-mentioned master Bluetooth device or can be set in the master Bluetooth device. The device 700 may include: a connection notification sending module 710, a connection information receiving module 720, and a Bluetooth link establishment module 730.
[0129] A connection notification sending module 710, configured to send a connection notification to a secondary Bluetooth device, where the connection notification is used to instruct the secondary Bluetooth device to act as an agent of the primary Bluetooth device and initiate a paging to a second target device.
[0130] A connection information receiving module 720, configured to receive connection information from the secondary Bluetooth device, where the connection information is used for the primary Bluetooth device to perform subsequent communication with the second target device.
[0131] A Bluetooth link establishing module 730, configured to establish a second Bluetooth link with the second target device based on the connection information.
[0132] In an exemplary embodiment, the Bluetooth link establishing module 730 is configured to:
[0133] Determine a target frequency point based on the connection information;
[0134] Send a Link Management Protocol (LMP) feature exchange request including the feature information of the primary Bluetooth device to the second target device at the target frequency point;
[0135] Receive an LMP feature exchange response from the second target device, where the LMP feature exchange response includes the feature information of the second target device;
[0136] Save the feature information of the second target device, and send an LMP establishment completion message to the second target device, where the LMP establishment completion message is used to indicate that the second Bluetooth link is established.
[0137] In an exemplary embodiment, the Bluetooth link establishing module 730 is configured to:
[0138] Determine a target frequency point based on the connection information;
[0139] Send a master device paging response to the second target device at the target frequency point;
[0140] If a slave second paging response from the second target device is received, send an LMP feature exchange request including the feature information of the primary Bluetooth device to the second target device;
[0141] Receive an LMP feature exchange response from the second target device, where the LMP feature exchange response includes the feature information of the second target device;
[0142] Save the feature information of the second target device, and send an LMP establishment completion message to the second target device, where the LMP establishment completion message is used to indicate that the second Bluetooth link is established.
[0143] In an exemplary embodiment, the connection information includes clock synchronization information, and the clock synchronization information is used to enable the master Bluetooth device and the second target device to communicate on the same frequency point.
[0144] In an exemplary embodiment, the apparatus 700 further includes: a paging failure notification receiving module, configured to receive a paging failure notification from the slave Bluetooth device, where the paging failure notification is used to indicate that the slave Bluetooth device fails to page the second target device.
[0145] In an exemplary embodiment, the apparatus 700 further includes a paging initiation module, configured to initiate a page to a first target device.
[0146] The Bluetooth link establishment module 730 is further configured to, if the paging of the first target device is successful, establish a first Bluetooth link with the first target device.
[0147] Wherein, the establishment process of the second Bluetooth link is executed in parallel with the establishment process of the first Bluetooth link.
[0148] In an exemplary embodiment, the master Bluetooth device is a master Bluetooth headset, and the slave Bluetooth device is a slave Bluetooth headset.
[0149] Figure 8 The block diagram of the apparatus for establishing a Bluetooth link in a slave Bluetooth device provided in another embodiment of the present application is shown. This apparatus has the functions of implementing the method example on the slave Bluetooth device side, and the functions can be implemented by hardware or by hardware executing corresponding software. This apparatus can be the slave Bluetooth device introduced above, or can be disposed in the slave Bluetooth device. The apparatus 800 may include: a connection notification receiving module 810, a paging initiation module 820, and a connection information sending module 830.
[0150] The connection notification receiving module 810 is configured to receive a connection notification from the master Bluetooth device, where the connection notification is used to indicate that the slave Bluetooth device acts as an agent of the master Bluetooth device to initiate a page to a second target device.
[0151] The paging initiation module 820 is configured to initiate a page to the second target device.
[0152] The connection information sending module 830 is configured to, if the paging of the second target device is successful, send connection information to the master Bluetooth device, where the connection information is used for the master Bluetooth device to communicate with the second target device continuously to establish a second Bluetooth link between the master Bluetooth device and the second target device.
[0153] In an exemplary embodiment, the paging initiation module 820 is configured to:
[0154] Send a paging message to the second target device;
[0155] If a slave first paging response from the second target device is received, send a master paging response to the second target device;
[0156] If a slave second paging response from the second target device is received, determine that paging the second target device is successful.
[0157] In an exemplary embodiment, the paging initiation module 820 is configured to:
[0158] Send a paging message to the second target device;
[0159] If a slave first paging response from the second target device is received, determine that paging the second target device is successful.
[0160] In an exemplary embodiment, the connection information includes clock synchronization information, and the clock synchronization information is used to enable the master Bluetooth device and the second target device to communicate on the same frequency point.
[0161] In an exemplary embodiment, the device 800 further includes: a failure notification sending module, configured to send a paging failure notification to the master Bluetooth device if paging the second target device fails, and the paging failure notification is used to indicate that the slave Bluetooth device fails to page the second target device.
[0162] In an exemplary embodiment, the establishment process of the second Bluetooth link is executed in parallel with the establishment process of the first Bluetooth link, and the first Bluetooth link is a Bluetooth link between the master Bluetooth device and the first target device.
[0163] In an exemplary embodiment, the master Bluetooth device is a master Bluetooth headset, and the slave Bluetooth device is a slave Bluetooth headset.
[0164] It should be noted that for the device provided in the above embodiment, when implementing its functions, only the above-mentioned division of each functional module is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device provided in the above embodiment and the method embodiment belong to the same concept, and the specific implementation process can be seen in the method embodiment, which will not be elaborated here.
[0165] Figure 9 The block diagram of the structure of a Bluetooth device provided by an embodiment of the present application is shown. This Bluetooth device can be used to implement the functions of the above Bluetooth link establishment method. The Bluetooth device 90 may include: a processor 91, a receiver 92, a transmitter 93, a memory 94, and a bus 95.
[0166] The processor 91 includes one or more processing cores. The processor 91 executes various functional applications and information processing by running software programs and modules.
[0167] The receiver 92 and the transmitter 93 can be implemented as a communication component, and the communication component can be a communication chip.
[0168] The memory 94 is connected to the processor 91 through the bus 95.
[0169] The memory 94 can be used to store a computer program, and the processor 91 is used to execute the computer program to implement each step in the above method embodiments.
[0170] In addition, the memory 94 can be implemented by any type of volatile or non-volatile storage device or a combination thereof. The volatile or non-volatile storage devices include, but are not limited to: RAM (Random-Access Memory), ROM (Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technologies, CD-ROM (Compact Disc Read-Only Memory), DVD (Digital Video Disc) or other optical storage, cassette tapes, magnetic tapes, disk storage or other magnetic storage devices.
[0171] In an exemplary embodiment, a computer-readable storage medium is further provided. A computer program is stored in the storage medium, and when the computer program is executed by the processor of the Bluetooth device, the method for establishing a Bluetooth link is implemented. Optionally, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random-Access Memory), SSD (Solid State Drives) or optical discs, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0172] In an exemplary embodiment, a computer program product or a computer program is further provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a Bluetooth device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to enable the Bluetooth device to perform the method for establishing a Bluetooth link described above.
[0173] It should be understood that the "plurality" mentioned herein refers to two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. In addition, the step numbers described herein only exemplarily show a possible execution sequence between steps. In some other embodiments, the above steps may not be executed in the order of the numbers. For example, two steps with different numbers may be executed simultaneously, or two steps with different numbers may be executed in an order opposite to the illustration. The embodiments of the present application do not limit this.
[0174] The above are only exemplary embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for establishing a Bluetooth link in a master Bluetooth device, characterized in that, The method includes: Sending a connection notification to a secondary Bluetooth device, where the connection notification is used to instruct the secondary Bluetooth device to act as an agent of the primary Bluetooth device and initiate a paging to a second target device; Receiving connection information from the secondary Bluetooth device, where the connection information is used for the primary Bluetooth device to communicate continuously with the second target device; Establishing a second Bluetooth link with the second target device based on the connection information; The establishing a second Bluetooth link with the second target device based on the connection information includes: Determining a target frequency point based on the connection information; Sending a Link Management Protocol (LMP) feature exchange request to the second target device at the target frequency point, where the LMP feature exchange request includes the feature information of the primary Bluetooth device; Or, Sending a master device paging response to the second target device at the target frequency point; if a slave second paging response from the second target device is received, then sending the LMP feature exchange request to the second target device; Receiving an LMP feature exchange response from the second target device, where the LMP feature exchange response includes the feature information of the second target device; Saving the feature information of the second target device and sending an LMP establishment completion message to the second target device, where the LMP establishment completion message is used to indicate that the second Bluetooth link is established.
2. The method according to claim 1, characterized in that, The connection information includes clock synchronization information, where the clock synchronization information is used to enable the primary Bluetooth device and the second target device to communicate at the same frequency point.
3. The method according to claim 1, characterized in that, The method further includes: Receiving a paging failure notification from the secondary Bluetooth device, where the paging failure notification is used to indicate that the secondary Bluetooth device fails to page the second target device.
4. The method according to claim 1, characterized in that The method further includes: Initiating a paging to a first target device; If the paging to the first target device is successful, establishing a first Bluetooth link with the first target device; Wherein, the establishment process of the second Bluetooth link is executed in parallel with the establishment process of the first Bluetooth link.
5. The method according to any one of claims 1 to 4, characterized in that, The primary Bluetooth device is a primary Bluetooth headset, and the secondary Bluetooth device is a secondary Bluetooth headset.
6. A method for establishing a Bluetooth link in a secondary Bluetooth device, characterized in that, The method includes: Receiving a connection notification from a primary Bluetooth device, where the connection notification is used to instruct the secondary Bluetooth device to act as an agent of the primary Bluetooth device and initiate a paging to a second target device; Sending a paging message to the second target device; If a slave first paging response from the second target device is received, then sending a master device paging response to the second target device; if a slave second paging response from the second target device is received, then determining that the paging to the second target device is successful; Or, If a slave first paging response from the second target device is received, then determining that the paging to the second target device is successful; If the paging to the second target device is successful, sending connection information to the primary Bluetooth device, where the connection information is used for the primary Bluetooth device to communicate continuously with the second target device to establish a second Bluetooth link between the primary Bluetooth device and the second target device.
7. The method according to claim 6, characterized in that, The connection information includes clock synchronization information, and the clock synchronization information is used to enable the master Bluetooth device and the second target device to communicate on the same frequency point.
8. The method according to claim 6, wherein The method further includes: If paging the second target device fails, a paging failure notification is sent to the master Bluetooth device, and the paging failure notification is used to indicate that the slave Bluetooth device fails to page the second target device.
9. The method according to claim 6, wherein The establishment process of the second Bluetooth link is executed in parallel with the establishment process of the first Bluetooth link, and the first Bluetooth link is the Bluetooth link between the master Bluetooth device and the first target device.
10. The method according to any one of claims 6 to 9, characterized in that The master Bluetooth device is a master Bluetooth headset, and the slave Bluetooth device is a slave Bluetooth headset.
11. A device for establishing a Bluetooth link in a master Bluetooth device, characterized in that, The device includes: A connection notification sending module, configured to send a connection notification to a slave Bluetooth device, where the connection notification is used to instruct the slave Bluetooth device to act as an agent of the master Bluetooth device and initiate paging to a second target device; A connection information receiving module, configured to receive connection information from the slave Bluetooth device, where the connection information is used for the master Bluetooth device to communicate continuously with the second target device; A Bluetooth link establishment module, configured to establish a second Bluetooth link with the second target device based on the connection information; The Bluetooth link establishment module is specifically configured to determine a target frequency point based on the connection information; send a Link Management Protocol (LMP) feature exchange request including the feature information of the master Bluetooth device to the second target device at the target frequency point; or send a master device paging response to the second target device at the target frequency point; if a slave second paging response from the second target device is received, send the LMP feature exchange request to the second target device; receive an LMP feature exchange response from the second target device, where the LMP feature exchange response includes the feature information of the second target device; save the feature information of the second target device, and send an LMP establishment completion message to the second target device, where the LMP establishment completion message is used to indicate that the second Bluetooth link is established.
12. An apparatus for establishing a Bluetooth link in a secondary Bluetooth device, characterized in that, The device includes: A connection notification receiving module, configured to receive a connection notification from a master Bluetooth device, where the connection notification is used to instruct the slave Bluetooth device to act as an agent of the master Bluetooth device and initiate paging to a second target device; A paging initiation module, configured to send a paging message to the second target device; if a slave first paging response from the second target device is received, send a master device paging response to the second target device; if a slave second paging response from the second target device is received, determine that paging the second target device is successful; or if a slave first paging response from the second target device is received, determine that paging the second target device is successful; A connection information sending module, configured to, if the paging of the second target device is successful, send connection information to the master Bluetooth device, where the connection information is used for the master Bluetooth device to perform subsequent communication with the second target device, so as to establish a second Bluetooth link between the master Bluetooth device and the second target device.
13. A Bluetooth device, characterized in that, The Bluetooth device includes a processor and a memory, and a computer program is stored in the memory, and the computer program is executed by the processor to implement the method according to any one of claims 1 to 5, or the method according to any one of claims 6 to 10.
14. A computer-readable storage medium, characterized in that, A computer program is stored in the storage medium, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 5, or the method according to any one of claims 6 to 10.
15. A computer program product, characterized in that, The computer program product includes computer instructions, the computer instructions are stored in a computer-readable storage medium, and the computer instructions are executed by a processor to implement the method according to any one of claims 1 to 5, or the method according to any one of claims 6 to 10.
Citation Information
Patent Citations
Extended connection method and extended connection system for Bluetooth device
CN111050306A