Bluetooth connection method and apparatus, electronic device, and computer-readable storage medium

CN117119417BActive Publication Date: 2026-09-11SHENZHEN TCL NEW-TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210825436.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-13
Publication Date
2026-09-11
Estimated Expiration
2042-07-13

AI Technical Summary

Technical Problem

[0004]本申请实施例提供一种蓝牙连接方法、装置、电子设备和计算机可读存储介质,可以解决无法与新的蓝牙设备建立蓝牙连接的技术问题

Benefits of technology

[0020] In this embodiment, during the process of establishing a Bluetooth connection with the device to be connected, connection failure information is first collected through the first embedded point corresponding to the Bluetooth connection. Then, the configuration file corresponding to the Bluetooth connection is obtained, which includes a connection repair strategy and test connection failure information. The connection repair strategy corresponding to the test connection failure information that matches the connection failure information is executed to repair the Bluetooth connection. Next, the repaired embedded point information of the Bluetooth connection is obtained through the second embedded point corresponding to the Bluetooth connection. If the repaired embedded point information is the same as the preset embedded point information, it is determined that the Bluetooth connection with the device to be connected is successful.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117119417B_ABST
    Figure CN117119417B_ABST
Patent Text Reader

Abstract

This application discloses a Bluetooth connection method, apparatus, electronic device, and computer-readable storage medium. In this embodiment, during the process of establishing a Bluetooth connection with a device to be connected, connection failure information is collected through a first embedded point corresponding to the Bluetooth connection; a configuration file corresponding to the Bluetooth connection is obtained, the configuration file including a connection repair strategy and test connection failure information; the connection repair strategy corresponding to the test connection failure information matching the connection failure information is executed to repair the Bluetooth connection; post-repair embedded point information of the Bluetooth connection is obtained through a second embedded point corresponding to the Bluetooth connection; if the post-repair embedded point information is the same as preset embedded point information, then the Bluetooth connection with the device to be connected is determined to be successful. This application embodiment can establish a Bluetooth connection with a new Bluetooth device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Bluetooth technology, and more specifically to a Bluetooth connection method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] With the development of science and technology, wireless network technology is being used more and more widely. For example, Bluetooth technology in wireless networks is being applied in various fields. However, Bluetooth devices may experience connection failures due to compatibility issues during the connection process.

[0003] The current solution involves embedding the information of known Bluetooth devices into the native Android code. When a connection to a known Bluetooth device fails, the problem can be resolved based on the information in the code. However, if a new Bluetooth device appears, since the information of the new Bluetooth device is not embedded in the code, the connection failure cannot be resolved, thus preventing the connection from reaching the new Bluetooth device. Summary of the Invention

[0004] This application provides a Bluetooth connection method, apparatus, electronic device, and computer-readable storage medium, which can solve the technical problem of being unable to establish a Bluetooth connection with a new Bluetooth device.

[0005] A Bluetooth connection method, comprising:

[0006] During the process of establishing a Bluetooth connection with the device to be connected, the connection failure information with the device to be connected is collected through the first embedded point corresponding to the Bluetooth connection.

[0007] Obtain the configuration file corresponding to the above Bluetooth connection. The configuration file includes the connection repair strategy and test connection failure information.

[0008] Execute the connection repair strategy corresponding to the test connection failure information that matches the above connection failure information to repair the above Bluetooth connection;

[0009] The repaired Bluetooth connection information is obtained by using the second tracking point corresponding to the above Bluetooth connection.

[0010] If the repaired embedding information is the same as the preset embedding information, then the Bluetooth connection with the device to be connected is successful.

[0011] Accordingly, embodiments of this application provide a Bluetooth connection device, including:

[0012] The information collection module is used to collect connection failure information with the device to be connected through the first embedded point corresponding to the Bluetooth connection during the process of establishing a Bluetooth connection with the device to be connected.

[0013] The first acquisition module is used to acquire the configuration file corresponding to the above Bluetooth connection. The configuration file includes the connection repair strategy and test connection failure information.

[0014] The strategy execution module is used to execute the connection repair strategy corresponding to the test connection failure information that matches the above connection failure information, and repair the above Bluetooth connection.

[0015] The second acquisition module is used to acquire the repaired embedding information of the Bluetooth connection through the second embedding point corresponding to the Bluetooth connection.

[0016] The connection determination module is used to determine that the Bluetooth connection with the device to be connected is successful if the repaired embedded information is the same as the preset embedded information.

[0017] Furthermore, this application also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to run the computer program in the memory to implement the Bluetooth connection method provided in this application.

[0018] Furthermore, embodiments of this application also provide a computer-readable storage medium storing a computer program adapted for loading by a processor to execute any of the Bluetooth connection methods provided in embodiments of this application.

[0019] Furthermore, this application also provides a computer program product, including a computer program that, when executed by a processor, implements any of the Bluetooth connection methods provided in this application.

[0020] In this embodiment, during the process of establishing a Bluetooth connection with the device to be connected, connection failure information is first collected through the first embedded point corresponding to the Bluetooth connection. Then, the configuration file corresponding to the Bluetooth connection is obtained, which includes a connection repair strategy and test connection failure information. The connection repair strategy corresponding to the test connection failure information that matches the connection failure information is executed to repair the Bluetooth connection. Next, the repaired embedded point information of the Bluetooth connection is obtained through the second embedded point corresponding to the Bluetooth connection. If the repaired embedded point information is the same as the preset embedded point information, it is determined that the Bluetooth connection with the device to be connected is successful.

[0021] In this embodiment, the configuration file includes a connection repair strategy and test connection failure information. Even if the connection repair strategy cannot be found based on the device identifier of the device to be connected, that is, even if the device to be connected is a new Bluetooth device, the connection repair strategy corresponding to the test connection failure information that matches the connection failure information in the configuration file can be executed to repair the Bluetooth connection. Then, the Bluetooth connection is confirmed to be successful through the repaired embedding information obtained by the second embedding point. This allows a Bluetooth connection to be established with a new Bluetooth device even if there is a problem with the Bluetooth connection with the new Bluetooth device. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating the Bluetooth processing method provided in an embodiment of this application;

[0024] Figure 2 This is a schematic diagram of the configuration file provided in an embodiment of this application;

[0025] Figure 3 This is a schematic diagram of the dynamic repair system provided in the embodiments of this application;

[0026] Figure 4 This is a flowchart illustrating another Bluetooth processing method provided in an embodiment of this application;

[0027] Figure 5 This is a flowchart illustrating another Bluetooth processing method provided in an embodiment of this application;

[0028] Figure 6 This is a schematic diagram of the Bluetooth processing device provided in the embodiments of this application;

[0029] Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0031] This application provides a Bluetooth connection method, apparatus, electronic device, and computer-readable storage medium. The Bluetooth connection apparatus can be integrated into an electronic device, which may be a server or a terminal, etc.

[0032] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.

[0033] The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and the server can be connected directly or indirectly through wired or wireless communication, which is not limited herein.

[0034] Furthermore, in the embodiments of this application, "multiple" refers to two or more. The terms "first" and "second," etc., in the embodiments of this application are used for distinguishing descriptions and should not be construed as implying relative importance.

[0035] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0036] In this embodiment, the description will be from the perspective of the Bluetooth connection device. In order to facilitate the explanation of the Bluetooth connection method of this application, the following will describe the Bluetooth connection device integrated into the terminal in detail, that is, the terminal will be used as the execution subject for detailed explanation.

[0037] Please see Figure 1 , Figure 1 This is a schematic flowchart of a Bluetooth connection method provided in an embodiment of this application. The Bluetooth connection method may include:

[0038] S101. During the process of establishing a Bluetooth connection with the device to be connected, the connection failure information with the device to be connected is collected through the first embedded point corresponding to the Bluetooth connection.

[0039] This can involve establishing a Bluetooth connection between the target device and the device to be connected. The target device can be a terminal or a server. In this embodiment, the target device will be described as a terminal.

[0040] The device to be connected can broadcast Bluetooth information, allowing the terminal to search for the Bluetooth information and then establish a Bluetooth connection with the device based on the Bluetooth information.

[0041] Bluetooth information can be the device identifier of the device to be connected. After the terminal obtains the device identifier of the device to be connected, it can display the device identifier. Then, in response to the confirmation operation of the device identifier of the device to be connected, the key input interface is displayed. The key input interface includes input controls. In response to the trigger operation of the input controls, the key of the device to be connected is obtained. The terminal then establishes a Bluetooth connection with the device to be connected based on the device identifier and the key.

[0042] Alternatively, after the terminal searches for various device identifiers, it can use the device identifier with the strongest Bluetooth signal as the device identifier of the device to be connected, then obtain the key of the device identifier of the device to be connected, and then establish a Bluetooth connection with the device to be connected based on the device identifier and the key.

[0043] The first tracking point is a collection of code snippets that collect Bluetooth connection failure information. In other words, a piece of code is embedded within the code corresponding to the Bluetooth connection to detect the connection failure. The connection failure information can contain details about the reasons why the Bluetooth connection failed.

[0044] S102. Obtain the configuration file corresponding to the Bluetooth connection. The configuration file includes the connection repair strategy and test connection failure information.

[0045] In this embodiment, the configuration file stores connection repair strategies for older Bluetooth devices and test connection failure information. Older Bluetooth devices can refer to devices that have successfully established a Bluetooth connection with the terminal.

[0046] In other words, in this embodiment, the test connection failure information of the Bluetooth device that has successfully established a Bluetooth connection with the terminal and the connection repair strategy corresponding to the test connection failure information are stored in the configuration file. This allows the terminal to repair the Bluetooth connection with the device to be connected by referring to the connection repair strategy of the Bluetooth device that has successfully established a Bluetooth connection with the terminal when it collects the connection failure information with the device to be connected, thereby establishing a Bluetooth connection with the device to be connected.

[0047] Optionally, when Bluetooth is started, the terminal can read the configuration file corresponding to the Bluetooth connection from the local storage space and store the configuration file in memory. Then, when connection failure information is collected, the configuration file can be retrieved from memory.

[0048] Alternatively, the terminal can read the Bluetooth connection configuration file from the server when Bluetooth is started, store the configuration file in memory, and then retrieve the configuration file from memory when connection failure information is collected.

[0049] In some embodiments, before obtaining the configuration file corresponding to the Bluetooth connection, the method further includes:

[0050] When a test connection failure message corresponding to the Bluetooth connection of the test device is collected, the initial connection repair strategy input by the user is obtained.

[0051] Implement the initial connection repair strategy to repair the test Bluetooth connection;

[0052] If the repair fails, return to the step of obtaining the initial connection repair strategy input by the user when the test connection failure information corresponding to the Bluetooth connection of the test device is collected;

[0053] If the repair is successful, the initial connection repair strategy will be used as the connection repair strategy, and the test connection failure information corresponding to the connection repair strategy and the initial connection repair strategy will be associated and stored in the configuration file.

[0054] In this embodiment, before the terminal leaves the factory, a Bluetooth connection can be established between the terminal and the test device. If the Bluetooth connection fails, that is, if the terminal collects test connection failure information, the terminal can perform a prompt operation so that the user is aware of the Bluetooth connection failure. Then the user can input an initial connection repair strategy for the Bluetooth connection, and the terminal can obtain the initial connection repair strategy and execute the initial connection repair strategy.

[0055] If the terminal successfully establishes a Bluetooth connection with the test device after executing the initial connection repair strategy, the initial connection repair strategy will be used as the connection repair strategy, and the connection repair strategy and the corresponding test connection failure information will be associated and stored to obtain the configuration file. If the terminal fails to establish a Bluetooth connection with the test device after executing the initial connection repair strategy, it means that the initial connection repair strategy cannot repair the Bluetooth connection, and the terminal will prompt the user to continue entering a new initial connection repair strategy.

[0056] It should be understood that users can enter the initial connection repair policy on the terminal, or they can enter the initial connection repair policy on other terminals or servers. The other terminals or servers will then send the initial connection repair policy to the terminal, and the terminal will then obtain the initial connection repair policy.

[0057] The testing equipment can be a Bluetooth device that already exists in the terminal before it leaves the factory.

[0058] It should be noted that the configuration file can also include the device identifier. When storing the connection repair strategy and the test connection failure information corresponding to the initial connection repair strategy, the connection repair strategy, the device identifier of the test device, and the test connection failure information corresponding to the initial connection repair strategy can be stored together to obtain the configuration file.

[0059] When the configuration file includes a device identifier, after the terminal obtains the configuration file, it can statistically analyze various test connection failure information to obtain the frequency of each test connection failure information. Then, the test connection failure information with high frequency and its corresponding connection repair strategy are stored at the beginning of the configuration file, so that test connection failure information matching the connection failure information can be obtained more quickly in the future.

[0060] It should be understood that when a device identifier corresponds to a list that includes test connection failure information and connection repair strategies corresponding to that device identifier, the frequency of test connection failure information can be obtained by counting the identical test connection failure information in each list.

[0061] Alternatively, when there is a list of associated test connection failure information and connection repair policies, and the list includes the device identifiers corresponding to the associated test connection failure information and connection repair policies, the number of device identifiers in the list can be used as the frequency of test connection failure information.

[0062] In other embodiments, obtaining the configuration file corresponding to the Bluetooth connection includes:

[0063] Determine the device type of the device to be connected;

[0064] Obtain the corresponding Bluetooth connection configuration file based on the device type of the device to be connected.

[0065] Since the reasons for Bluetooth connection failure may be the same when a terminal connects to a Bluetooth device of the same device type, one configuration file can be assigned to each device type. When connection failure information of the device to be connected is collected, the configuration file corresponding to the device type of the device to be connected can be obtained. This allows the system to first search for test connection failure information that matches the connection failure information in the configuration file corresponding to the device type of the device to be connected, so as to find the test connection failure information that matches the connection failure information more quickly and thus speed up the process of successfully establishing a Bluetooth connection.

[0066] The device type can be input device type, audio device type, etc.

[0067] S103. Execute the connection repair strategy corresponding to the test connection failure information that matches the connection failure information, and repair the Bluetooth connection.

[0068] In this embodiment, even if the device to be connected is a new Bluetooth device, that is, even if the device to be connected is a Bluetooth device that has not successfully established a Bluetooth connection with the terminal before, that is, even if the device to be connected is a Bluetooth device that has established a Bluetooth connection with the terminal for the first time, that is, even if the device to be connected is a device that appeared after the terminal was manufactured, the configuration file also includes test connection failure information corresponding to Bluetooth devices that have successfully established a Bluetooth connection with the terminal and connection repair strategies corresponding to the test connection failure information.

[0069] Therefore, when there is test connection failure information in the configuration file that matches the connection failure information, it indicates that the reason for the Bluetooth connection failure between the terminal and the device to be connected is the same as or similar to the reason for the Bluetooth connection failure between the terminal and the old Bluetooth device. Then, based on the connection failure information with the device to be connected, a connection repair strategy that can repair the Bluetooth connection with the device to be connected can be found from the connection repair strategy of the old Bluetooth device, thereby establishing a Bluetooth connection with the device to be connected.

[0070] In other words, in this embodiment, when a problem similar to that of an older Bluetooth device occurs during the Bluetooth connection process with the device to be connected, a connection repair strategy can be found from the test connection failure information and the connection repair strategy based on the connection failure information, thereby achieving automatic repair of the Bluetooth connection.

[0071] For example, if the Bluetooth connection between the terminal and the device to be connected fails due to a Bluetooth pairing timeout, both the connection failure message and the test connection failure message can be "Page Timeout". The connection repair strategy associated with "Page Timeout" can be to pair twice.

[0072] In some embodiments, when the configuration file includes a device identifier, a connection repair strategy corresponding to the test connection failure information that matches the connection failure information is executed to repair the Bluetooth connection, including:

[0073] If the configuration file does not include the device identifier of the device to be connected, execute the connection repair strategy corresponding to the test connection failure information that matches the connection failure information to repair the Bluetooth connection.

[0074] In this embodiment, if the configuration file does not include the device identifier of the device to be connected, it indicates that the device to be connected is a new Bluetooth device. In this case, the connection repair strategy corresponding to the test connection failure information that matches the connection failure information is executed to repair the Bluetooth connection.

[0075] After the terminal successfully establishes a Bluetooth connection with the device to be connected, the device identifier of the device to be connected, the test connection failure information matching the connection failure information, and the connection repair strategy corresponding to the test connection failure information matching the connection failure information can be associated and stored in the configuration file. This enables dynamic updates to the configuration file, so that the next time the terminal establishes a Bluetooth connection with the device to be connected, the connection repair strategy for repairing the Bluetooth connection with the device to be connected can be found based on the device identifier of the device to be connected.

[0076] Optionally, the configuration file can store a list corresponding to each device identifier, which includes test connection failure information and connection repair strategies for that device identifier. Alternatively, it can contain a list of associated test connection failure information and connection repair strategies, including the device identifiers corresponding to the associated test connection failure information and connection repair strategies.

[0077] For example, when a list of associated test connection failure information and connection repair policies exists, and the list includes the device identifiers corresponding to the associated test connection failure information and connection repair policies, the configuration file can be configured as follows: Figure 2 As shown in Figure 201, the device identifier of the device to be connected is b. When the connection failure information is 0, the connection repair strategy corresponding to the test connection failure information that matches the connection failure information is connection repair strategy A. Then, connection repair strategy A is executed to repair the Bluetooth connection with the device to be connected. When the repair is successful, the device identifier b of the device to be connected is added to the list of device identifiers corresponding to the test connection failure information that matches the connection failure information. At this time, the configuration file can be configured as follows: Figure 2 As shown in 202, the device identifier of the device to be connected, the test connection failure information matching the connection failure information, and the connection repair strategy corresponding to the test connection failure information matching the connection failure information are associated and stored in the configuration file.

[0078] If the configuration file includes the device identifier of the device to be connected, it indicates that the device to be connected is a Bluetooth device that has successfully established a Bluetooth connection with the terminal. Therefore, the connection repair strategy for the device to be connected can be found directly based on the device identifier. Thus, in some embodiments, after obtaining the configuration file corresponding to the Bluetooth connection, the following is also included:

[0079] If the configuration file includes the device identifier of the device to be connected, the connection repair policy corresponding to the device identifier in the configuration file will be executed to repair the Bluetooth connection so that the Bluetooth connection with the device to be connected can be successful.

[0080] It should be noted that when the device identifier of the device to be connected has multiple connection repair policies in the configuration file, i.e., when there are multiple test connection failure messages, the terminal can directly execute multiple connection repair policies to repair the Bluetooth connection with the device to be connected. Alternatively, the terminal can further filter out the test connection failure messages that match the device identifier of the device to be connected from the multiple test connection failure messages in the configuration file, and then execute the connection repair policy corresponding to the test connection failure message that matches the connection failure message to repair the Bluetooth connection with the device to be connected.

[0081] Optionally, the Bluetooth connection method in this application embodiment can be implemented using a dynamic repair system. The dynamic repair system can be as follows: Figure 3 As shown. The dynamic repair system includes a dynamic repair module, a configuration module, and multiple Bluetooth modules. Different Bluetooth modules are used to connect to different types of Bluetooth devices. For example, the A2dpService Bluetooth module is used to establish Bluetooth connections with audio devices and to receive music. The HidService Bluetooth module is used to establish connections with input devices, such as mice, keyboards, and remote controls. The terminal can use Binder to call the Bluetooth module's interface across processes to establish Bluetooth connections with other Bluetooth devices, and the Bluetooth module's interface can be implemented according to the Bluedroid Bluetooth protocol stack.

[0082] Different Bluetooth modules may have different repair interfaces within the dynamic repair module. Each Bluetooth module can store a configuration file, meaning the connection repair strategy can be stored within the Bluetooth module. When a terminal establishes a Bluetooth connection with a device to be connected via the Bluetooth module, the terminal can upload the device identifier of the device to be connected to the dynamic repair module for storage via the Bluetooth module.

[0083] When the terminal collects connection failure information through the first embedded point in the Bluetooth module, it uploads the connection failure information to the dynamic repair module. The terminal then uses the dynamic repair module to call the corresponding dynamic repair interface of the Bluetooth module, so as to call the configuration file in the Bluetooth module to repair the Bluetooth connection with the Bluetooth device to be connected.

[0084] In this configuration module, the terminal can distribute the configuration file to each Bluetooth module when it starts establishing a Bluetooth connection with the device to be connected.

[0085] After the repair is complete, the terminal uploads the repair result to the dynamic repair module via Bluetooth. If the repair result is successful, the terminal then uploads the device identifier of the device to be connected to the configuration module for storage via the dynamic repair module.

[0086] At this time, the Bluetooth connection method in the embodiments of this application can be as follows: Figure 4 As shown.

[0087] In other embodiments, before resolving the Bluetooth connection by executing a connection repair strategy corresponding to the test connection failure information that matches the connection failure information, the method further includes:

[0088] Based on the device type of the device to be connected, the test connection failure information and connection repair strategies in the configuration file are arranged to obtain the arranged configuration file;

[0089] From the sorted configuration files, filter out the test connection failure messages that match the connection failure messages.

[0090] In this embodiment, since the reasons for Bluetooth connection failure may be the same when the terminal connects to a Bluetooth device of the same device type, the test connection failure information and connection repair strategy corresponding to the device type to be connected can be arranged at the beginning of the configuration file. This allows the test connection failure information that matches the connection failure information to be filtered out from the arranged configuration file more quickly, thereby enabling a faster and more successful Bluetooth connection to be established with the device to be connected.

[0091] S104. Connect to the corresponding second embedding point via Bluetooth and obtain the embedding point information after the Bluetooth connection is repaired.

[0092] After the terminal executes the connection repair strategy corresponding to the test connection failure information that matches the connection failure information, it can determine whether the Bluetooth connection with the device to be connected is successful through the repaired embedded point information collected by the second embedded point.

[0093] The second tracking point is a collection of codes that collect information about successful Bluetooth connection.

[0094] S105. If the repaired embedding information is the same as the preset embedding information, then the Bluetooth connection with the device to be connected is successful.

[0095] In this embodiment, connection failure information is collected through the first tracking point. Then, the connection repair strategy corresponding to the connection failure information is selected from the configuration file according to the connection failure information. Next, the repair tracking point information is collected through the second tracking point. If the repair tracking point information is the same as the preset tracking point information, the Bluetooth connection is determined to be successful.

[0096] Although the configuration file contains test connection failure information that matches the connection failure information, when there are multiple connection failure information, after executing the connection repair strategy corresponding to the test connection failure information that matches one of the multiple connection failure information, the Bluetooth connection with the device to be connected may still fail. That is, the repaired tracking information is different from the preset tracking information.

[0097] Therefore, in some other embodiments, there are multiple first tracking points, and a connection failure message is collected through each first tracking point;

[0098] Execute the connection repair strategy corresponding to the test connection failure information that matches the connection failure information to repair the Bluetooth connection, including:

[0099] The connection repair strategy corresponding to the test connection failure information that matches the first connection failure information is executed to repair the Bluetooth connection. The first connection failure information is the connection failure information collected by the first first tracking point among multiple first tracking points.

[0100] After obtaining the repaired Bluetooth connection tracking information through the second tracking point corresponding to the Bluetooth connection, the following is also included:

[0101] If the repaired embedding information is different from the preset embedding information, the second connection failure information will be used as the first connection failure information. The second connection failure information is the connection failure information collected by the second first embedding point among multiple first embedding points.

[0102] Return to the steps of executing the connection repair strategy corresponding to the test connection failure information that matches the first connection failure information to repair the Bluetooth connection.

[0103] When there are multiple connection failure messages, the later connection failure messages may be caused by the earlier connection failure messages. Therefore, in this embodiment, the repair is performed first based on the earlier connection failure messages. That is, the repair is performed first based on the first connection failure message. If the later connection failure messages are caused by the earlier connection failure messages, then even though there are multiple connection failure messages, the Bluetooth connection can be repaired when the connection repair strategy determined based on the earlier connection failure messages is executed, thereby speeding up the repair process.

[0104] At this time, the Bluetooth connection method of this application embodiment can be as follows: Figure 5 As shown.

[0105] However, when subsequent connection failure information is not caused by previous connection failure information, after repairing based on the previous connection failure information, it is still necessary to repair based on subsequent connection failure information. That is, the second connection failure information needs to be treated as the first connection failure information, and then the connection repair strategy corresponding to the test connection failure information that matches the first connection failure information needs to be executed to repair the Bluetooth connection. This process is relatively slow.

[0106] Therefore, in other embodiments, the configuration file includes a configuration subfile, which includes at least two associated connection repair strategies;

[0107] Execute the connection repair strategy corresponding to the test connection failure information that matches the connection failure information to repair the Bluetooth connection, including:

[0108] Execute the connection repair strategy in the configuration subfile that matches the connection failure information to repair the Bluetooth connection;

[0109] After obtaining the repaired Bluetooth connection tracking information through the second tracking point corresponding to the Bluetooth connection, the following is also included:

[0110] If the repaired tracking information is different from the preset tracking information, then return to the connection repair strategy in the configuration subfile that matches the connection failure information to perform the steps to repair the Bluetooth connection.

[0111] In this embodiment, during the testing process, connection repair strategies corresponding to potentially simultaneous test connection failure information can be associated and stored in a configuration sub-file. Then, when the terminal obtains multiple connection failure messages, it can directly execute the connection repair strategy in the configuration sub-file corresponding to the multiple connection failure messages, allowing multiple connection failure messages to be repaired simultaneously, thereby speeding up the successful establishment of a Bluetooth connection.

[0112] It should be understood that the configuration subfile corresponding to the test connection failure information that matches multiple connection failure information can refer to the configuration subfile that includes the test connection failure information that matches at least one of the multiple connection failure information.

[0113] For example, given configuration subfiles 1, 2, and 3, and connection failure information including connection failure message a, b, and c, where configuration subfile 1 includes test connection failure messages a and b, configuration subfile 2 includes test connection failure messages a, b, and c, and configuration subfile 3 includes test connection failure message d, then the configuration subfiles corresponding to the test connection failure messages matching multiple connection failure messages can be configuration subfile 1 and configuration subfile 2.

[0114] Optionally, the number of test connection failure messages that match the connection failure messages in multiple connection failure messages in each configuration subfile can be determined first, and then the connection repair strategy in the configuration subfile with the higher number of failure messages can be executed first, thereby further speeding up the establishment of a successful Bluetooth connection.

[0115] For example, consider configuration subfiles 1, 2, and 3. Connection failure information includes connection failure messages a, b, and c. Configuration subfile 1 includes test connection failure messages a and b. Configuration subfile 2 includes test connection failure messages a, b, and c. Configuration subfile 3 includes test connection failure message d. Therefore, configuration subfile 1 has 2 subfiles, and configuration subfile 2 has 3 subfiles. The connection repair strategy in configuration subfile 2 is executed first, followed by the connection repair strategy in configuration subfile 1.

[0116] As described above, in this embodiment, during the process of establishing a Bluetooth connection with the device to be connected, connection failure information is first collected through the first embedded point corresponding to the Bluetooth connection. Then, the configuration file corresponding to the Bluetooth connection is obtained, which includes a connection repair strategy and test connection failure information. The connection repair strategy corresponding to the test connection failure information that matches the connection failure information is executed to repair the Bluetooth connection. Next, the repaired embedded point information of the Bluetooth connection is obtained through the second embedded point corresponding to the Bluetooth connection. If the repaired embedded point information is the same as the preset embedded point information, it is determined that the Bluetooth connection with the device to be connected is successful.

[0117] In this embodiment, the configuration file includes a connection repair strategy and test connection failure information. Even if the connection repair strategy cannot be found based on the device identifier of the device to be connected, that is, even if the device to be connected is a new Bluetooth device, the connection repair strategy corresponding to the test connection failure information that matches the connection failure information in the configuration file can be executed to repair the Bluetooth connection. Then, the Bluetooth connection is confirmed to be successful through the repaired embedding information obtained by the second embedding point. This allows a Bluetooth connection to be established with a new Bluetooth device even if there is a problem with the Bluetooth connection with the new Bluetooth device.

[0118] To facilitate better implementation of the Bluetooth connection method provided in this application, this application also provides an apparatus based on the above-described Bluetooth connection method. The meanings of the terms used are the same as in the Bluetooth connection method described above, and specific implementation details can be found in the descriptions within the method embodiments.

[0119] For example, such as Figure 6 As shown, the Bluetooth connectivity device may include:

[0120] The information acquisition module 601 is used to collect connection failure information with the device to be connected through the first embedded point corresponding to the Bluetooth connection during the process of establishing a Bluetooth connection with the device to be connected.

[0121] The first acquisition module 602 is used to acquire the configuration file corresponding to the Bluetooth connection. The configuration file includes the connection repair strategy and test connection failure information.

[0122] The strategy execution module 603 is used to execute the connection repair strategy corresponding to the test connection failure information that matches the connection failure information, and to repair the Bluetooth connection.

[0123] The second acquisition module 604 is used to connect to the corresponding second embedding point via Bluetooth and acquire the repaired embedding point information of the Bluetooth connection.

[0124] The connection confirmation module 605 is used to determine that the Bluetooth connection with the device to be connected is successful if the repaired embedded point information is the same as the preset embedded point information.

[0125] Optionally, the policy execution module 603 is specifically used to execute:

[0126] If the configuration file does not include the device identifier of the device to be connected, execute the connection repair strategy corresponding to the test connection failure information that matches the connection failure information to repair the Bluetooth connection.

[0127] Optionally, the policy execution module 603 is also used to execute:

[0128] If the configuration file includes the device identifier of the device to be connected, the connection repair policy corresponding to the device identifier in the configuration file will be executed to repair the Bluetooth connection so that the Bluetooth connection with the device to be connected can be successful.

[0129] Optionally, there may be multiple first tracking points, and a connection failure message may be collected through each first tracking point.

[0130] Accordingly, the policy execution module 603 is specifically used to execute:

[0131] The connection repair strategy corresponding to the test connection failure information that matches the first connection failure information is executed to repair the Bluetooth connection. The first connection failure information is the connection failure information collected by the first of the multiple first tracking points.

[0132] The Bluetooth connectivity device also includes:

[0133] Return to the execution module, used for:

[0134] If the repaired embedding information is different from the preset embedding information, the second connection failure information will be used as the first connection failure information. The second connection failure information is the connection failure information collected by the second first embedding point among multiple first embedding points.

[0135] Return to the steps of executing the connection repair strategy corresponding to the test connection failure information that matches the first connection failure information to repair the Bluetooth connection.

[0136] Optionally, the configuration file includes a configuration subfile, which includes at least two associated connection repair strategies.

[0137] Accordingly, the policy execution module 603 is specifically used to execute:

[0138] The connection repair strategy in the configuration subfile that matches the connection failure information is executed to repair the Bluetooth connection.

[0139] The return execution module is also used to execute:

[0140] If the repaired tracking information is different from the preset tracking information, then return to the connection repair strategy in the configuration subfile that matches the connection failure information to perform the steps to repair the Bluetooth connection.

[0141] Optionally, the Bluetooth connectivity device also includes:

[0142] The sorting module is used to perform:

[0143] Based on the device type of the device to be connected, the test connection failure information and connection repair strategies in the configuration file are arranged to obtain the arranged configuration file;

[0144] From the sorted configuration files, filter out the test connection failure messages that match the connection failure messages.

[0145] Optionally, the Bluetooth connectivity device also includes:

[0146] The test module is used to execute:

[0147] When a test connection failure message corresponding to the Bluetooth connection of the test device is collected, the initial connection repair strategy input by the user is obtained.

[0148] Implement the initial connection repair strategy to repair the test Bluetooth connection;

[0149] If the repair fails, return to the step of obtaining the initial connection repair strategy input by the user when the test connection failure information corresponding to the Bluetooth connection of the test device is collected;

[0150] If the repair is successful, the initial connection repair strategy will be used as the connection repair strategy, and the test connection failure information corresponding to the connection repair strategy and the initial connection repair strategy will be associated and stored in the configuration file.

[0151] In practice, the above modules can be implemented as independent entities or combined arbitrarily as the same or several entities. For the specific implementation methods and corresponding beneficial effects of the above modules, please refer to the previous method embodiments, which will not be repeated here.

[0152] This application also provides an electronic device, which may be a server or a terminal, etc. Figure 7 As shown, it illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application, specifically:

[0153] The electronic device may include components such as a processor 701 with one or more processing cores, a memory 702 with one or more computer-readable storage media, a power supply 703, and an input unit 704. Those skilled in the art will understand that... Figure 7 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0154] The processor 701 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes computer programs and / or modules stored in the memory 702, and calls data stored in the memory 702 to perform various functions and process data. Optionally, the processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 701.

[0155] The memory 702 can be used to store computer programs and modules. The processor 701 executes various functional applications and data processing by running the computer programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, computer programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.

[0156] The electronic device also includes a power supply 703 that supplies power to the various components. Preferably, the power supply 703 can be logically connected to the processor 701 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 703 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0157] The electronic device may also include an input unit 704, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0158] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 701 in the electronic device loads the executable files corresponding to the processes of one or more computer programs into the memory 702 according to the following instructions, and the processor 701 runs the computer programs stored in the memory 702 to realize various functions, such as:

[0159] During the process of establishing a Bluetooth connection with the device to be connected, connection failure information with the device to be connected is collected through the first embedded point corresponding to the Bluetooth connection.

[0160] Obtain the configuration file corresponding to the Bluetooth connection. The configuration file includes the connection repair strategy and test connection failure information.

[0161] Execute the connection repair strategy corresponding to the test connection failure information that matches the connection failure information to repair the Bluetooth connection;

[0162] By connecting to the corresponding second tracking point via Bluetooth, the tracking point information after the Bluetooth connection is repaired can be obtained.

[0163] If the repaired embedding information is the same as the preset embedding information, then the Bluetooth connection with the device to be connected is successful.

[0164] For details on the specific implementation methods and corresponding beneficial effects of each of the above operations, please refer to the detailed description of the Bluetooth connection method above, which will not be repeated here.

[0165] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0166] Therefore, embodiments of this application provide a computer-readable storage medium storing a computer program that can be loaded by a processor to execute the steps in any of the Bluetooth connection methods provided in embodiments of this application. For example, the computer program can execute the following steps:

[0167] During the process of establishing a Bluetooth connection with the device to be connected, connection failure information with the device to be connected is collected through the first embedded point corresponding to the Bluetooth connection.

[0168] Obtain the configuration file corresponding to the Bluetooth connection. The configuration file includes the connection repair strategy and test connection failure information.

[0169] Execute the connection repair strategy corresponding to the test connection failure information that matches the connection failure information to repair the Bluetooth connection;

[0170] By connecting to the corresponding second tracking point via Bluetooth, the tracking point information after the Bluetooth connection is repaired can be obtained.

[0171] If the repaired embedding information is the same as the preset embedding information, then the Bluetooth connection with the device to be connected is successful.

[0172] For details on the specific implementation methods and corresponding beneficial effects of the above operations, please refer to the previous embodiments, which will not be repeated here.

[0173] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0174] Since the computer program stored in the computer-readable storage medium can execute the steps in any of the Bluetooth connection methods provided in the embodiments of this application, the beneficial effects that any of the Bluetooth connection methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0175] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the Bluetooth connection method described above.

[0176] The foregoing has provided a detailed description of a Bluetooth connection method, apparatus, electronic device, and computer-readable storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A Bluetooth connection method, characterized in that, include: During the process of establishing a Bluetooth connection with the device to be connected, connection failure information with the device to be connected is collected through the first embedded point corresponding to the Bluetooth connection. Obtain the configuration file corresponding to the Bluetooth connection, which includes a connection repair strategy and test connection failure information; The connection repair strategy corresponding to the test connection failure information that matches the connection failure information is executed to repair the Bluetooth connection; The repaired embedding information of the Bluetooth connection is obtained through the second embedding point corresponding to the Bluetooth connection; If the repaired embedding information is the same as the preset embedding information, then the Bluetooth connection with the device to be connected is confirmed to be successful. There are multiple first tracking points, and one connection failure message is collected through each first tracking point; The connection repair strategy corresponding to the test connection failure information that matches the connection failure information is executed to repair the Bluetooth connection, including: The Bluetooth connection is repaired by executing the connection repair strategy corresponding to the test connection failure information that matches the first connection failure information. The first connection failure information is the connection failure information collected by the first first tracking point among multiple first tracking points. After obtaining the repaired Bluetooth connection tracking information through the second tracking point corresponding to the Bluetooth connection, the method further includes: If the repaired embedding information is different from the preset embedding information, then the second connection failure information is used as the first connection failure information, and the second connection failure information is the connection failure information collected by the second first embedding point among multiple first embedding points; The steps involve returning to the connection repair strategy corresponding to the test connection failure information that matches the first connection failure information, and repairing the Bluetooth connection.

2. The Bluetooth connection method according to claim 1, characterized in that, Execute the connection repair strategy corresponding to the test connection failure information that matches the connection failure information to repair the Bluetooth connection, including: If the configuration file does not include the device identifier of the device to be connected, the connection repair strategy corresponding to the test connection failure information that matches the connection failure information is executed to repair the Bluetooth connection.

3. The Bluetooth connection method according to claim 2, characterized in that, After obtaining the configuration file corresponding to the Bluetooth connection, the method further includes: If the configuration file includes the device identifier of the device to be connected, then the connection repair strategy corresponding to the device identifier of the device to be connected in the configuration file is executed to repair the Bluetooth connection so that the Bluetooth connection with the device to be connected can be successful.

4. The Bluetooth connection method according to claim 1, characterized in that, The configuration file includes a configuration sub-file, which includes at least two associated connection repair strategies; The execution of the connection repair strategy corresponding to the test connection failure information that matches the connection failure information to repair the Bluetooth connection includes: The connection repair strategy in the configuration subfile that matches the connection failure information is executed to repair the Bluetooth connection; After obtaining the repaired Bluetooth connection tracking information through the second tracking point corresponding to the Bluetooth connection, the method further includes: If the repaired embedding information is different from the preset embedding information, then return to the step of executing the connection repair strategy in the configuration subfile that matches the connection failure information to repair the Bluetooth connection.

5. The Bluetooth connection method according to claim 1, characterized in that, Before executing the connection repair strategy corresponding to the test connection failure information that matches the connection failure information to repair the Bluetooth connection, the method further includes: Based on the device type of the device to be connected, the test connection failure information and the connection repair strategy in the configuration file are arranged to obtain the arranged configuration file; From the sorted configuration file, test connection failure information that matches the connection failure information is selected.

6. The Bluetooth connection method according to any one of claims 1-5, characterized in that, Before obtaining the configuration file corresponding to the Bluetooth connection, the following is also included: When a test connection failure message corresponding to the Bluetooth connection of the test device is collected, the initial connection repair strategy input by the user is obtained. The initial connection repair strategy is executed to repair the test Bluetooth connection; If the repair fails, return to the step of obtaining the initial connection repair strategy input by the user when the test connection failure information corresponding to the Bluetooth connection of the test device is collected; If the repair is successful, the initial connection repair strategy will be used as the connection repair strategy, and the test connection failure information corresponding to the connection repair strategy and the initial connection repair strategy will be associated and stored in the configuration file.

7. A Bluetooth connection device, characterized in that, include: The information collection module is used to collect connection failure information with the device to be connected through the first embedded point corresponding to the Bluetooth connection during the process of establishing a Bluetooth connection with the device to be connected. The first acquisition module is used to acquire the configuration file corresponding to the Bluetooth connection, the configuration file including connection repair strategy and test connection failure information; The strategy execution module is used to execute the connection repair strategy corresponding to the test connection failure information that matches the connection failure information, and repair the Bluetooth connection. The second acquisition module is used to acquire the repaired embedding information of the Bluetooth connection through the second embedding point corresponding to the Bluetooth connection; The connection determination module is used to determine that the Bluetooth connection with the device to be connected is successful if the repaired embedded information is the same as the preset embedded information. There are multiple first tracking points. One connection failure message is collected through each first tracking point. The strategy execution module is specifically used for: The Bluetooth connection is repaired by executing the connection repair strategy corresponding to the test connection failure information that matches the first connection failure information. The first connection failure information is the connection failure information collected by the first first tracking point among multiple first tracking points. The Bluetooth connectivity device also includes: Return to the execution module, used for: If the repaired embedding information is different from the preset embedding information, then the second connection failure information is used as the first connection failure information, and the second connection failure information is the connection failure information collected by the second first embedding point among multiple first embedding points; The steps involve returning to the connection repair strategy corresponding to the test connection failure information that matches the first connection failure information, and repairing the Bluetooth connection.

8. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a computer program, and the processor running the computer program in the memory to perform the Bluetooth connection method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the Bluetooth connection method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for enhancing Bluetooth connection stability

    CN111542040A

  • Wireless communication device and wireless connection method

    JP2013055514A