Bluetooth connection method, device, electronic device and storage medium

By determining the position of Bluetooth devices within a target area and pre-pairing with multiple devices, the method addresses inefficient Bluetooth connection switching by enabling direct connections without repeated pairing, thus improving efficiency.

CN115460717BActive Publication Date: 2025-07-15BEIJING CO WHEELS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111485078.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-07
Publication Date
2025-07-15
Estimated Expiration
2041-12-07

AI Technical Summary

Technical Problem

When a user replaces the electronic device connected to the Bluetooth device, the prior art requires repeating the connection process between the electronic device and the Bluetooth device, and the switching speed is slow.

Method used

By obtaining the initial location information of the Bluetooth device, determining the area corresponding to the electronic device in the target area, and pairing it with the device, sending a pairing completion message to other electronic devices to establish a Bluetooth connection, and monitoring position changes in real time to disconnect or establish a connection.

Benefits of technology

Improves the efficiency of Bluetooth connection, reduces the steps of repeated pairing, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115460717B_ABST
    Figure CN115460717B_ABST
Patent Text Reader

Abstract

The present application relates to a Bluetooth connection method, apparatus, electronic device, and storage medium, and is applied to the field of communication technologies. The method includes: obtaining initial position information of a Bluetooth device; when it is determined according to the initial position information that the Bluetooth device is within its corresponding area, pairing with the Bluetooth device, sending a first pairing completion message to other electronic devices in a target area, and establishing a Bluetooth connection with the Bluetooth device; wherein, the first pairing completion message is used to instruct other electronic devices to pair with the Bluetooth device. The present application can improve the efficiency of Bluetooth connection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and in particular, to a Bluetooth connection method, apparatus, electronic device, and storage medium. Background Art

[0002] Currently, Bluetooth devices are increasingly widely used and can provide convenience for people's work and life. After a Bluetooth device establishes a Bluetooth connection with an electronic device such as a smart phone or a tablet computer, a user can make a call or listen to music through the Bluetooth device.

[0003] In certain scenarios, multiple electronic devices can be provided for a user, and the user can select one of the electronic devices to connect to the Bluetooth device according to needs. In the case where the user needs to replace the electronic device to which the Bluetooth device is connected, the connection process between the electronic device and the Bluetooth device needs to be repeated, and the switching speed is slow. Summary of the Invention

[0004] To solve the above technical problems or at least partially solve the above technical problems, this application provides a Bluetooth connection method, apparatus, electronic device, and storage medium.

[0005] According to a first aspect of this application, a Bluetooth connection method is provided, which is applied to an electronic device in a target area. Two or more of the electronic devices are included in the target area, and the two or more electronic devices correspond to different areas in the target area. The method includes:

[0006] Obtain initial position information of the Bluetooth device;

[0007] When it is determined according to the initial position information that the Bluetooth device is in its corresponding area, pair with the Bluetooth device, send a first pairing completion message to other electronic devices in the target area, and establish a Bluetooth connection with the Bluetooth device;

[0008] Wherein, the first pairing completion message is used to instruct the other electronic devices to pair with the Bluetooth device.

[0009] Optionally, establishing a Bluetooth connection with the Bluetooth device includes:

[0010] After receiving a second pairing completion message returned by the other electronic devices after pairing is completed, establish a Bluetooth connection with the Bluetooth device.

[0011] Optionally, the method further includes:

[0012] Obtain changed position information of the Bluetooth device in the target area;

[0013] When it is determined according to the changed location information that the Bluetooth device is not within its corresponding area, disconnect the Bluetooth connection with the Bluetooth device.

[0014] Optionally, when it is determined according to the location information that the Bluetooth device is within its corresponding area, pairing with the Bluetooth device includes:

[0015] When it is determined according to the location information that the Bluetooth device is within its corresponding area, display a Bluetooth connection prompt message, where the Bluetooth connection prompt message is used to indicate whether the user performs a Bluetooth connection operation;

[0016] In response to the Bluetooth connection operation, pair with the Bluetooth device.

[0017] According to the second aspect of the present application, a Bluetooth connection method is provided, which is applied to a positioning device in a target area. The method includes:

[0018] After detecting that the Bluetooth device is powered on for the first time, obtain the initial location information of the Bluetooth device in the target area;

[0019] Send the initial location information to each electronic device in the target area;

[0020] Wherein, each of the electronic devices corresponds to a different area in the target area;

[0021] Wherein, the initial location information is used for the electronic device to determine that when the Bluetooth device is within its corresponding area, pair with the Bluetooth device, send a first pairing completion message to other electronic devices, and establish a Bluetooth connection with the Bluetooth device;

[0022] Wherein, the first pairing completion message is used to instruct the other electronic devices to pair with the Bluetooth device.

[0023] Optionally, the method further includes:

[0024] Obtain the changed location information of the Bluetooth device in the target area, and send the changed location information to each of the electronic devices;

[0025] Wherein, the changed location information is used for the electronic device that has established a Bluetooth connection with the Bluetooth device to determine that when the Bluetooth device is not within its corresponding area, disconnect the Bluetooth connection with the Bluetooth device; and,

[0026] For the electronic device that has not established a Bluetooth connection with the Bluetooth device to determine that when the Bluetooth device is within its corresponding area, establish a Bluetooth connection with the Bluetooth device.

[0027] Optionally, obtaining the initial position information of the Bluetooth device in the target area includes:

[0028] Detecting the Bluetooth signal sent by the Bluetooth device to obtain signal strength information;

[0029] Determining the initial position information of the Bluetooth device in the target area according to the signal strength information.

[0030] According to the third aspect of the present application, a Bluetooth connection device is provided, which is applied to an electronic device in a target area. There are two or more of the electronic devices in the target area, and the two or more electronic devices correspond to different areas in the target area. The Bluetooth connection device includes:

[0031] A position information acquisition module, configured to acquire the initial position information of the Bluetooth device;

[0032] A Bluetooth connection establishment module, configured to pair with the Bluetooth device when it is determined according to the initial position information that the Bluetooth device is in its corresponding area, send a first pairing completion message to other electronic devices in the target area, and establish a Bluetooth connection with the Bluetooth device;

[0033] Wherein, the first pairing completion message is used to instruct the other electronic devices to pair with the Bluetooth device.

[0034] Optionally, the Bluetooth connection establishment module is specifically configured to pair with the Bluetooth device when it is determined according to the position information that the Bluetooth device is in its corresponding area, send a first pairing completion message to other electronic devices in the target area, and establish a Bluetooth connection with the Bluetooth device after receiving a second pairing completion message returned by the other electronic devices after pairing is completed.

[0035] Optionally, the position information acquisition module is further configured to acquire the changed position information of the Bluetooth device in the target area;

[0036] The Bluetooth connection establishment module is further configured to disconnect the Bluetooth connection with the Bluetooth device when it is determined according to the changed position information that the Bluetooth device is not in its corresponding area.

[0037] Optionally, the Bluetooth connection establishment module is specifically configured to implement pairing with the Bluetooth device when it is determined according to the position information that the Bluetooth device is in its corresponding area in the following manner:

[0038] When it is determined according to the position information that the Bluetooth device is in its corresponding area, display a Bluetooth connection prompt message, where the Bluetooth connection prompt message is used to instruct the user whether to perform a Bluetooth connection operation;

[0039] In response to a Bluetooth connection operation, pair with the Bluetooth device.

[0040] According to the fourth aspect of the present application, a Bluetooth connection device is provided, which is applied to a positioning device in a target area. The Bluetooth connection device includes:

[0041] A location information acquisition module, configured to acquire the initial location information of the Bluetooth device in the target area after detecting that the Bluetooth device is powered on for the first time;

[0042] A location information sending module, configured to send the initial location information to each electronic device in the target area;

[0043] Wherein, each of the electronic devices corresponds to a different area in the target area;

[0044] Wherein, when the electronic device determines that the Bluetooth device is within its corresponding area based on the initial location information, the electronic device pairs with the Bluetooth device, sends a first pairing completion message to other electronic devices, and establishes a Bluetooth connection with the Bluetooth device;

[0045] Wherein, the first pairing completion message is used to instruct the other electronic devices to pair with the Bluetooth device.

[0046] Optionally, the location information acquisition module is further configured to acquire the changed location information of the Bluetooth device in the target area;

[0047] The location information sending module is further configured to send the changed location information to each of the electronic devices;

[0048] Wherein, when the electronic device that has established a Bluetooth connection with the Bluetooth device determines that the Bluetooth device is not within its corresponding area based on the changed location information, the electronic device disconnects the Bluetooth connection with the Bluetooth device; and,

[0049] When the electronic device that has not established a Bluetooth connection with the Bluetooth device determines that the Bluetooth device is within its corresponding area based on the changed location information, the electronic device establishes a Bluetooth connection with the Bluetooth device.

[0050] Optionally, the positioning device further includes: at least two positioning modules;

[0051] The location information acquisition module is further configured to send a detection instruction to the at least two positioning modules, where the detection instruction is used to instruct the positioning modules to detect the Bluetooth signals sent by the Bluetooth device to obtain signal strength information; receive the signal strength information returned by the positioning modules, and determine the initial location information of the Bluetooth device in the target area according to the signal strength information.

[0052] According to a fifth aspect of the present application, there is provided an electronic device, including: a processor, where the processor is configured to execute a computer program stored in a memory, and when the computer program is executed by the processor, the method described in the first aspect or the second aspect is implemented.

[0053] According to a sixth aspect of the present application, there is provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in the first aspect or the second aspect is implemented.

[0054] According to a seventh aspect of the present application, there is provided a computer program product, and when the computer program product runs on a computer, the computer is caused to execute the method described in the first aspect or the second aspect.

[0055] The technical solutions provided in the embodiments of the present application have the following advantages compared with the prior art:

[0056] In the case where there are two or more electronic devices in the target area, an electronic device can obtain the initial location information of a Bluetooth device, and determine whether the Bluetooth device is within its own area according to the initial location information. Since two or more electronic devices correspond to different areas in the target area, when the Bluetooth device is within the area corresponding to a certain electronic device (i.e., the target electronic device), the target electronic device can pair with the Bluetooth device, send a first pairing completion message to other electronic devices in the target area, and establish a Bluetooth connection with the Bluetooth device. It can be seen that the Bluetooth device can be pre-paired with two or more electronic devices, and only establish a Bluetooth connection with the target electronic device. In this way, when the Bluetooth device needs to connect to other electronic devices, there is no need for pairing, and a Bluetooth connection can be directly established. Therefore, the efficiency of Bluetooth connection can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0059] Figure 1 A schematic diagram of a system architecture showing an exemplary application environment to which the Bluetooth connection method according to an embodiment of the present application can be applied;

[0060] Figure 2 A flowchart of a Bluetooth connection method in an embodiment of the present application;

[0061] Figure 3 Another flowchart of a Bluetooth connection method in an embodiment of the present application;

[0062] Figure 4 An interaction flowchart of a Bluetooth connection method in an embodiment of the present application;

[0063] Figure 5 A schematic structural diagram of a Bluetooth connection device in an embodiment of the present application;

[0064] Figure 6 A schematic structural diagram of a Bluetooth connection device in an embodiment of the present application;

[0065] Figure 7 A schematic structural diagram of an electronic device in an embodiment of the present application. Detailed implementation manners

[0066] In order to be able to more clearly understand the above objects, features, and advantages of the present application, the solution of the present application will be further described below. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments may be combined with each other.

[0067] In the following description, many specific details are set forth in order to fully understand the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present application, rather than all of the embodiments.

[0068] Figure 1 A schematic diagram of a system architecture showing an exemplary application environment to which the Bluetooth connection method according to an embodiment of the present application can be applied.

[0069] As Figure 1 shown, the system architecture 100 may include a positioning device 101, electronic devices 102 and 103, a Bluetooth device 104, and a network. The network is used to provide a medium for communication links between the positioning device 101 and the electronic devices 102 and 103, and between the electronic devices 102 and 103 and the Bluetooth device 104. The electronic devices 102 and 103 include, but are not limited to, portable computers, smart phones, tablet computers, vehicle-mounted devices, etc., and the Bluetooth device 104 may include Bluetooth headsets, Bluetooth bracelets, Bluetooth cameras, etc. It should be understood,Figure 1 The number of electronic devices in [description] is merely illustrative. According to implementation requirements, any number of electronic devices may be provided.

[0070] The Bluetooth connection method provided by the embodiments of the present application is applicable to scenarios capable of providing two or more electronic devices, such as automotive scenarios. If a car contains two rows of seats, electronic devices with displays can be installed in front of the front row seats and the rear row seats. Users can listen to music or watch movies through the electronic devices.

[0071] As an alternative implementation, the above positioning device 101 in the vehicle cockpit can be implemented by a main positioning module and two or more slave positioning modules. The space inside the cockpit is the target area for Bluetooth device applications. The main positioning module is used to instruct the slave positioning modules to detect the positions of Bluetooth devices inside the cockpit and send the position information of the Bluetooth devices to different electronic devices inside the cockpit. After the Bluetooth device is powered on for the first time, the electronic devices in the front row and the rear row of the car are both paired with the Bluetooth device. The electronic device corresponding to the position where the Bluetooth device is located (such as the front row) can establish a Bluetooth connection with the Bluetooth device. After the user wearing the Bluetooth device switches to the rear row, the electronic device in the front row disconnects the Bluetooth connection with the Bluetooth device, and the electronic device in the rear row can directly establish a Bluetooth connection with the Bluetooth device without pairing, so the efficiency of Bluetooth connection can be improved.

[0072] First, the Bluetooth connection method of the embodiments of the present application will be introduced on the electronic device side below.

[0073] See Figure 2 , Figure 2 which is a flowchart of a Bluetooth connection method in the embodiments of the present application, applied to an electronic device in a target area, and may include the following steps:

[0074] Step S210, obtain the initial position information of the Bluetooth device.

[0075] In the embodiments of the present application, the target area refers to an area capable of providing two or more electronic devices. Two or more electronic devices are distributed at different positions in the target area, and two or more electronic devices correspond to different areas in the target area. For example, the target area may be the aforementioned interior area of the car, and two or more electronic devices may include: an electronic device installed in front of the front row seats and an electronic device installed in front of the rear row seats. Or, the target area is a certain conference room, and two or more electronic devices are installed in the conference room. Users can establish a Bluetooth connection with the electronic devices through the Bluetooth device to conduct video conferences, etc.

[0076] When the user uses a Bluetooth device in the target area, if the Bluetooth device is powered on for the first time, it can be paired with the electronic device first and then a Bluetooth connection can be established. The electronic device can obtain the initial position information of the Bluetooth device in the target area and perform different pairing and Bluetooth connection processes according to the position of the Bluetooth device in the target area.

[0077] Step S220: When it is determined according to the initial position information that the Bluetooth device is within its corresponding area, pair with the Bluetooth device, send a first pairing completion message to other electronic devices in the target area, and establish a Bluetooth connection with the Bluetooth device. The first pairing completion message is used to instruct other electronic devices to pair with the Bluetooth device.

[0078] Each electronic device can determine whether the Bluetooth device is within the area corresponding to the electronic device according to the initial position information. For example, the area corresponding to the electronic device in the front row of the car is the area where the front row seats are located, and the area corresponding to the electronic device in the back row is the area where the back row seats are located. If the Bluetooth device is located in the front row seat of the car, then the Bluetooth device is within the area corresponding to the electronic device in the front row.

[0079] When it is determined according to the initial position information that the Bluetooth device is within its corresponding area, the Bluetooth device can be paired. By sending a first pairing completion message to other electronic devices, other electronic devices can be paired with the Bluetooth device. In the embodiments of the present application, each electronic device in the target area can be paired with the Bluetooth device, and only the target electronic device (i.e., the electronic device within the corresponding area of the Bluetooth device) establishes a Bluetooth connection with the Bluetooth device.

[0080] In the Bluetooth connection method of the embodiments of the present application, when there are two or more electronic devices in the target area, the electronic device can obtain the position information of the Bluetooth device and determine whether the Bluetooth device is within its area according to the position information. Since two or more electronic devices correspond to different areas in the target area, when the Bluetooth device is within the area corresponding to a certain electronic device (i.e., the target electronic device), the target electronic device can pair with the Bluetooth device and send a first pairing completion message to other electronic devices in the target area so that other electronic devices can also pair with the Bluetooth device. Moreover, the target electronic device establishes a Bluetooth connection with the Bluetooth device. It can be seen that the Bluetooth device can be pre-paired with two or more electronic devices and only establish a Bluetooth connection with the target electronic device. In this way, when the Bluetooth device needs to connect to other electronic devices, there is no need for pairing and a Bluetooth connection can be directly established. Therefore, the efficiency of Bluetooth connection can be improved.

[0081] See Figure 3 , Figure 3Another flowchart of the Bluetooth connection method in the embodiments of the present application, which is applied to a positioning device in a target area, may include the following steps:

[0082] Step S310: After detecting that the Bluetooth device is powered on for the first time, obtain the initial position information of the Bluetooth device in the target area.

[0083] As described above, the positioning device is a device for obtaining the position information of the Bluetooth device. The initial position information of the Bluetooth device can be obtained in the following manner: Detect the Bluetooth signal sent by the Bluetooth device to obtain signal strength information, receive the signal strength information, and determine the initial position information of the Bluetooth device in the target area according to the signal strength information.

[0084] As described above, the positioning device may include a main positioning module and more than two slave positioning modules. The specific implementation process may be: The main positioning module sends a detection instruction to more than two slave positioning modules. The detection instruction is used to instruct the slave positioning module to detect the Bluetooth signal sent by the Bluetooth device to obtain signal strength information. Receive the signal strength information returned by the slave positioning module, and determine the initial position information of the Bluetooth device in the target area according to the signal strength information.

[0085] Among them, the detection instruction may carry the ID information of the Bluetooth device, and the slave positioning module can detect the Bluetooth signal sent by the Bluetooth device according to the ID information. The number of slave positioning modules may be two or more. The main positioning module and more than two slave positioning modules may be distributed at different positions in the target area. For example, when the target area is the interior area of a vehicle, the main positioning module and more than two slave positioning modules may be distributed on the top of the vehicle. Since the main positioning module and more than two slave positioning modules all have corresponding position coordinate information, the initial position information of the Bluetooth device in the target area can be calculated according to the signal strength information.

[0086] Step S320: Send the initial position information to each electronic device in the target area. Each electronic device corresponds to a different area in the target area; among them, the initial position information is used for the electronic device to determine that when the Bluetooth device is in its corresponding area, pair with the Bluetooth device, send a first pairing completion message to other electronic devices, and establish a Bluetooth connection with the Bluetooth device; where the first pairing completion message is used to instruct other electronic devices to pair with the Bluetooth device.

[0087] The above steps correspond to Figure 2 Step S220 of the embodiment. For details, please refer to Figure 2 the description of the embodiment, which will not be elaborated here.

[0088] Refer to Figure 4 , Figure 4It is an interaction flowchart of the Bluetooth connection method in the embodiments of the present application, which may include the following steps:

[0089] Step S402, after the positioning device detects that the Bluetooth device is powered on for the first time, it authenticates the Bluetooth device.

[0090] In the embodiments of the present application, after detecting that the Bluetooth device is powered on for the first time, the Bluetooth device can be authenticated first, that is, it is determined whether the Bluetooth device is an authenticated Bluetooth device. Optionally, the Bluetooth signal sent by the Bluetooth device can be received, and the header information in the Bluetooth signal can be extracted; if the extracted header information is the same as the preset header information, it is determined that the authentication is passed; if the extracted header information is different from the preset header information, it is determined that the authentication fails.

[0091] For example, assuming that the preset header information is "I am the headset authenticated by ** Automobile", if the header of the Bluetooth signal sent by the Bluetooth device also contains "I am the headset authenticated by ** Automobile", the authentication is passed; otherwise, the authentication fails. For the Bluetooth device with failed authentication, no processing may be performed, and the user can use the existing Bluetooth connection method to perform Bluetooth connection. For the Bluetooth device with passed authentication, step S404 can be continued.

[0092] Step S404, after the positioning device authenticates the Bluetooth device, it obtains the initial position information of the Bluetooth device in the target area.

[0093] After that, the initial position information can be sent to two or more electronic devices in the target area. Assuming that there are two electronic devices in the target area, it may include step S4060 and step S4062.

[0094] Step S408, when the electronic device determines that the Bluetooth device is within its corresponding area according to the initial position information, it pairs with the Bluetooth device.

[0095] When the target electronic device determines that the Bluetooth device is within its corresponding area according to the initial position information, it can directly pair with the Bluetooth device, or after prompting the user, pair according to the user's Bluetooth connection operation. For example, a Bluetooth connection prompt message can be displayed, where the Bluetooth connection prompt message is used to indicate whether the user performs a Bluetooth connection operation; in response to the Bluetooth connection operation, pair with the Bluetooth device.

[0096] Step S410, the electronic device sends a first pairing completion message to other electronic devices in the target area.

[0097] Step S412, other electronic devices pair with the Bluetooth device and return a second pairing completion message after the pairing is completed.

[0098] It should be noted that after each electronic device completes pairing with a Bluetooth device, the pairing information between the electronic device and the Bluetooth device can be stored, and the Bluetooth device can also store the pairing information between the Bluetooth device and each electronic device. In this way, before establishing a Bluetooth connection with the Bluetooth device, the electronic device can directly establish a Bluetooth connection without the need to pair again.

[0099] Step S414: After the electronic device receives the second pairing completion message, it establishes a Bluetooth connection with the Bluetooth device.

[0100] After other electronic devices in the target area complete pairing with the Bluetooth device, they can return a second pairing completion message to the target electronic device. In this way, the target electronic device can know that other electronic devices have completed pairing with the Bluetooth device, that is, all electronic devices in the target area have completed pairing with the Bluetooth device, and then establish a Bluetooth connection with the Bluetooth device.

[0101] Step S416: The positioning device continuously detects the position information of the Bluetooth device in the target area.

[0102] By continuously detecting the position information of the Bluetooth device in the target area, the positioning device can determine whether the position of the Bluetooth device in the target area has changed. It should be noted that if the Bluetooth device changes from the area corresponding to one electronic device to the area corresponding to another electronic device, it can be considered that the position of the Bluetooth device has changed; if the position of the Bluetooth device changes within the area corresponding to one electronic device, it is considered that the position of the Bluetooth device has not changed. For example, if the Bluetooth device is located on the left seat in the back row of a car and after the position change, the Bluetooth device is located on the right seat in the back row. Since the Bluetooth device is in the area corresponding to the back row electronic device before and after the position change, it is considered that the position of the Bluetooth device in the target area has not changed. If the Bluetooth device is located in the front row of the car after the position change, it is considered that the position of the Bluetooth device in the target area has changed.

[0103] If the position of the Bluetooth device in the target area has not changed, no action needs to be taken. If the position of the Bluetooth device in the target area changes, the changed position information can be sent to more than two electronic devices, and steps S4180 and S4182 can be executed.

[0104] Step S420: If the electronic device has established a Bluetooth connection with the Bluetooth device and determines that the Bluetooth device is not in its corresponding area based on the changed position information, the electronic device disconnects the Bluetooth connection with the Bluetooth device.

[0105] Step S422: If the electronic device has not established a Bluetooth connection with the Bluetooth device and determines that the Bluetooth device is in its corresponding area based on the changed position information, the electronic device establishes a Bluetooth connection with the Bluetooth device.

[0106] Similar to the first power-on of the Bluetooth device in step S406, the positioning device can send the changed location information to each electronic device. Different from the first power-on of the Bluetooth device, since each electronic device and the Bluetooth device have completed pairing, the electronic device can directly confirm to disconnect the Bluetooth connection with the Bluetooth device or establish a Bluetooth connection with the Bluetooth device according to the changed location information. In addition, if the electronic device has not established a Bluetooth connection with the Bluetooth device and determines that the Bluetooth device is not within its corresponding area according to the changed location information, no action may be taken.

[0107] It should be noted that even if the electronic device disconnects the Bluetooth connection with the Bluetooth device, the pairing relationship with the Bluetooth device can still be maintained. In this way, when re-establishing the Bluetooth connection next time, a direct connection can be made without the need for re-pairing, thereby improving the efficiency of Bluetooth connection.

[0108] For example, if the Bluetooth device has established a Bluetooth connection with the electronic device in the back row of the car and the user wearing the Bluetooth device moves from the back row seat to the front row seat. Then, the electronic device in the back row can actively disconnect the Bluetooth connection with the Bluetooth device, and the electronic device in the front row actively establishes a Bluetooth connection with the Bluetooth device. If the user then moves from the front row seat to the back row seat, the electronic device in the front row can actively disconnect the Bluetooth connection with the Bluetooth device, and the electronic device in the back row actively establishes a Bluetooth connection with the Bluetooth device.

[0109] In the Bluetooth connection method of the embodiment of the present application, after the positioning device searches for the Bluetooth device, if the Bluetooth device is powered on for the first time, the Bluetooth device can be authenticated first. After confirming that the Bluetooth device is an authenticated device, the initial location information of the Bluetooth device is obtained and sent to each electronic device in the target area. Each electronic device can judge whether the Bluetooth device is within the area corresponding to the electronic device according to the initial location information. If so, pair with the Bluetooth device; if not, no action may be taken. The electronic device that has completed pairing (i.e., the target electronic device) sends a first pairing completion message to other electronic devices, so that other electronic devices can also pair with the Bluetooth device. After the pairing is completed, a second pairing completion message is returned. Furthermore, the target electronic device establishes a Bluetooth connection with the Bluetooth device. The positioning device can detect the position coordinates of the Bluetooth device in real time. If the position of the Bluetooth device changes, the electronic device that has established a Bluetooth connection actively disconnects the Bluetooth connection with the Bluetooth device; the electronic device that has not established a Bluetooth connection with the Bluetooth device and the Bluetooth device has changed to the corresponding area actively establishes a Bluetooth connection with the Bluetooth device. It can be seen that when re-establishing the Bluetooth connection each time, there is no need for re-pairing, so the efficiency of Bluetooth connection can be improved and the user experience can be enhanced.

[0110] Corresponding to the above method embodiments, an embodiment of the present application further provides a Bluetooth connection device, which is applied to an electronic device in a target area. The target area includes two or more electronic devices, and the two or more electronic devices correspond to different areas in the target area. The Bluetooth connection device 500 includes:

[0111] A location information acquisition module 510, configured to acquire the initial location information of a Bluetooth device;

[0112] A Bluetooth connection establishment module 520, configured to, when it is determined according to the initial location information that the Bluetooth device is within its corresponding area, pair with the Bluetooth device, send a first pairing completion message to other electronic devices in the target area, and establish a Bluetooth connection with the Bluetooth device;

[0113] Wherein, the first pairing completion message is used to instruct other electronic devices to pair with the Bluetooth device.

[0114] Optionally, the Bluetooth connection establishment module 520 is specifically configured to, when it is determined according to the location information that the Bluetooth device is within its corresponding area, pair with the Bluetooth device, send a first pairing completion message to other electronic devices in the target area, and establish a Bluetooth connection with the Bluetooth device after receiving a second pairing completion message returned by other electronic devices after pairing is completed.

[0115] Optionally, the location information acquisition module 510 is further configured to: acquire the changed location information of the Bluetooth device in the target area.

[0116] Optionally, the Bluetooth connection establishment module 520 is further configured to disconnect the Bluetooth connection with the Bluetooth device when it is determined according to the changed location information that the Bluetooth device is not within its corresponding area.

[0117] Optionally, the Bluetooth connection establishment module 520 is specifically configured to pair with the Bluetooth device when it is determined according to the following manner that the Bluetooth device is within its corresponding area:

[0118] When it is determined according to the location information that the Bluetooth device is within its corresponding area, display a Bluetooth connection prompt message, where the Bluetooth connection prompt message is used to indicate whether the user performs a Bluetooth connection operation;

[0119] In response to the Bluetooth connection operation, pair with the Bluetooth device.

[0120] See Figure 6 , Figure 6 which is a schematic structural diagram of the Bluetooth connection device in an embodiment of the present application, applied to a positioning device in a target area. The Bluetooth connection device 600 includes:

[0121] A location information acquisition module 610, configured to obtain initial location information of a Bluetooth device in a target area after detecting that the Bluetooth device is powered on for the first time;

[0122] A location information sending module 620, configured to send the initial location information to each electronic device in the target area;

[0123] Wherein, each electronic device corresponds to a different area in the target area;

[0124] Wherein, the initial location information is used for the electronic device to determine that when the Bluetooth device is within its corresponding area, pair with the Bluetooth device, send a first pairing completion message to other electronic devices, and establish a Bluetooth connection with the Bluetooth device;

[0125] Wherein, the first pairing completion message is used to instruct other electronic devices to pair with the Bluetooth device.

[0126] As described above, the positioning device may include a main positioning module and more than two slave positioning modules, Figure 6 The shown Bluetooth connection device 600 is equivalent to the main positioning module.

[0127] Optionally, the location information acquisition module 610 is further configured to: obtain the changed location information of the Bluetooth device in the target area.

[0128] Optionally, the location information sending module 620 is further configured to send the changed location information to each electronic device.

[0129] Wherein, the changed location information is used for the electronic device that has established a Bluetooth connection with the Bluetooth device to disconnect the Bluetooth connection with the Bluetooth device when determining that the Bluetooth device is not within its corresponding area; and,

[0130] For an electronic device that has not established a Bluetooth connection with the Bluetooth device to establish a Bluetooth connection with the Bluetooth device when determining that the Bluetooth device is within its corresponding area according to the changed location information.

[0131] Optionally, the positioning device further includes: at least two positioning modules. As described above, the positioning device may include a main positioning module and more than two slave positioning modules. Here, the at least two positioning modules are equivalent to at least two slave positioning modules.

[0132] The location information acquisition module 610 is further configured to send a detection instruction to at least two positioning modules. The detection instruction is used to instruct the positioning module to detect the Bluetooth signal sent by the Bluetooth device to obtain signal strength information; receive the signal strength information returned by the positioning module, and determine the initial location information of the Bluetooth device in the target area according to the signal strength information.

[0133] The specific details of each module or unit in the above device have been described in detail in the corresponding method, so they will not be elaborated here.

[0134] It should be noted that although several modules or units of a device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of the two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0135] In an exemplary embodiment of the present application, an electronic device is further provided, including: a processor; a memory for storing processor-executable instructions; wherein, the processor is configured to execute the above Bluetooth connection method in this exemplary embodiment.

[0136] Figure 7 It is a schematic structural diagram of the electronic device in the embodiment of the present application. It should be noted that Figure 7 The illustrated electronic device 700 is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present application.

[0137] As Figure 7 shown, the electronic device 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage section 708 into the random access memory (RAM) 703. In the RAM 703, various programs and data required for system operation are also stored. The central processing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. The input / output (I / O) interface 705 is also connected to the bus 704.

[0138] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a local area network (LAN) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as required. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as required so that a computer program read from it can be installed into the storage section 708 as required.

[0139] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes program code for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 709, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit 701, various functions defined in the device of the present application are performed.

[0140] In an embodiment of the present application, there is also provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Bluetooth connection method is implemented.

[0141] It should be noted that the computer-readable storage medium shown in the present application may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical cable, radio frequency, etc., or any suitable combination of the above.

[0142] In an embodiment of the present application, there is also provided a computer program product, and when the computer program product runs on a computer, the computer is caused to execute the above-mentioned Bluetooth connection method.

[0143] It should be noted that in this text, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the said element.

[0144] The above are only specific embodiments of the present application, enabling those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments described herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.

Claims

1. A Bluetooth connection method, characterized in that, An electronic device applied to a target area, where there are two or more such electronic devices in the target area, and the two or more electronic devices correspond to different areas in the target area. The method includes: Obtain the initial position information of the Bluetooth device; When it is determined according to the initial position information that the Bluetooth device is within its corresponding area, pair with the Bluetooth device, send a first pairing completion message to other electronic devices in the target area, and establish a Bluetooth connection with the Bluetooth device; Wherein, the first pairing completion message is used to instruct the other electronic devices to pair with the Bluetooth device.

2. The method according to claim 1, wherein The establishing a Bluetooth connection with the Bluetooth device includes: After receiving the second pairing completion message returned by the other electronic device after pairing is completed, establish a Bluetooth connection with the Bluetooth device.

3. The method according to claim 1, wherein The method further includes: Obtain the changed position information of the Bluetooth device in the target area; When it is determined according to the changed position information that the Bluetooth device is not within its corresponding area, disconnect the Bluetooth connection with the Bluetooth device.

4. The method according to claim 1, characterized in that The pairing with the Bluetooth device when it is determined according to the position information that the Bluetooth device is within its corresponding area includes: When it is determined according to the position information that the Bluetooth device is within its corresponding area, display a Bluetooth connection prompt message, where the Bluetooth connection prompt message is used to instruct the user whether to perform a Bluetooth connection operation; In response to the Bluetooth connection operation, pair with the Bluetooth device.

5. A Bluetooth connection method, characterized in that, An positioning device applied to a target area. The method includes: After detecting that the Bluetooth device is powered on for the first time, obtain the initial position information of the Bluetooth device in the target area; Send the initial position information to each electronic device in the target area; Wherein, each of the electronic devices corresponds to a different area in the target area; Wherein, the initial position information is used by the electronic device to pair with the Bluetooth device, send a first pairing completion message to other electronic devices, and establish a Bluetooth connection with the Bluetooth device when it is determined that the Bluetooth device is within its corresponding area; Wherein, the first pairing completion message is used to instruct the other electronic devices to pair with the Bluetooth device.

6. The method according to claim 5, wherein The method further includes: Obtain the changed position information of the Bluetooth device in the target area, and send the changed position information to each of the electronic devices; Wherein, the changed position information is used by the electronic device that has established a Bluetooth connection with the Bluetooth device to disconnect the Bluetooth connection with the Bluetooth device when it is determined that the Bluetooth device is not within its corresponding area; and, The changed position information is used by the electronic device that has not established a Bluetooth connection with the Bluetooth device to establish a Bluetooth connection with the Bluetooth device when it is determined that the Bluetooth device is within its corresponding area.

7. The method according to claim 5, characterized in that, Obtaining the initial position information of the Bluetooth device in the target area includes: Detect the Bluetooth signal sent by the Bluetooth device to obtain signal strength information; According to the signal strength information, determine the initial position information of the Bluetooth device in the target area.

8. A Bluetooth connection device, characterized in that, An electronic device applied to a target area, where there are two or more of the electronic devices in the target area, and the two or more electronic devices correspond to different areas in the target area. The Bluetooth connection device includes: A location information acquisition module, configured to acquire the initial location information of the Bluetooth device; A Bluetooth connection establishment module, configured to, when determining that the Bluetooth device is within its corresponding area according to the initial location information, pair with the Bluetooth device, send a first pairing completion message to other electronic devices in the target area, and establish a Bluetooth connection with the Bluetooth device; Wherein, the first pairing completion message is used to instruct the other electronic devices to pair with the Bluetooth device.

9. A Bluetooth connection device, characterized in that, A positioning device applied to a target area, the Bluetooth connection device includes: A location information acquisition module, configured to acquire the initial location information of the Bluetooth device in the target area after detecting that the Bluetooth device is powered on for the first time; A location information sending module, configured to send the initial location information to each electronic device in the target area; Wherein, each of the electronic devices corresponds to a different area in the target area; Wherein, the initial location information is used for the electronic device to pair with the Bluetooth device, send a first pairing completion message to other electronic devices, and establish a Bluetooth connection with the Bluetooth device when determining that the Bluetooth device is within its corresponding area; Wherein, the first pairing completion message is used to instruct the other electronic devices to pair with the Bluetooth device.

10. The Bluetooth connection device according to claim 9, wherein The positioning device further includes: at least two positioning modules; The location information acquisition module is further configured to send a detection instruction to the at least two positioning modules, where the detection instruction is used to instruct the positioning modules to detect the Bluetooth signal sent by the Bluetooth device to obtain signal strength information; receive the signal strength information returned by the positioning modules, and determine the initial location information of the Bluetooth device in the target area according to the signal strength information.

11. An electronic device, characterized in that, Including: A processor, where the processor is configured to execute a computer program stored in a memory, and when the computer program is executed by the processor, the steps of the Bluetooth connection method according to any one of claims 1 to 4 are implemented, or the steps of the Bluetooth connection method according to any one of claims 5 to 7 are implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the Bluetooth connection method according to any one of claims 1 to 4 are implemented, or the steps of the Bluetooth connection method according to any one of claims 5 to 7 are implemented.

Citation Information

Patent Citations

  • Bluetooth and infrared-based indoor telephone portable answering system and working method

    CN103701986A

  • Bluetooth connection method, device, terminal and computer readable storage medium

    CN108632796A