Bluetooth connection method, device, vehicle and storage medium

By using a mapping-based pairing code matching method in Bluetooth connections, the problem of low Bluetooth connection accuracy is solved, and the accuracy of pairing and connection is improved, especially in Bluetooth connections between vehicles and user terminals.

CN118158682BActive Publication Date: 2025-10-28XIAOMI EV TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410256883.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-06
Publication Date
2025-10-28
Estimated Expiration
2044-03-06

AI Technical Summary

Technical Problem

Bluetooth connectivity suffers from low accuracy, especially in Bluetooth pairing between vehicles and user terminals, where errors are common.

Method used

By obtaining a first Bluetooth pairing code with a mapping relationship from the server and matching it with the Bluetooth pairing code of the second device, the system identifies whether the second device is the target device, including marking valid and invalid pairing codes, ensuring the flexibility and accuracy of the pairing code.

Benefits of technology

It improves the accuracy of Bluetooth pairing, thereby improving the accuracy of Bluetooth connection, and is suitable for Bluetooth connection scenarios between user terminals and vehicle terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118158682B_ABST
    Figure CN118158682B_ABST
Patent Text Reader

Abstract

This disclosure relates to a Bluetooth connection method, apparatus, vehicle, and storage medium, belonging to the fields of Bluetooth and vehicle technology. The method includes: obtaining a first Bluetooth pairing code from a server, wherein the first Bluetooth pairing code has a mapping relationship with a first device and a target device to which the first device is to connect via Bluetooth; receiving a second Bluetooth pairing code sent by a second device; matching the first Bluetooth pairing code and the second Bluetooth pairing code to obtain a matching result; and identifying whether the second device is the target device based on the matching result. Thus, the first Bluetooth pairing code has a mapping relationship with the first device and the target device. Matching the first Bluetooth pairing code with the second Bluetooth pairing code to identify whether the second device is the target device provides high flexibility in the pairing code, improving the accuracy of Bluetooth pairing and consequently improving the accuracy of Bluetooth connection. This method is suitable for Bluetooth connection scenarios between user terminals and vehicle terminals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of Bluetooth and vehicle technology, and more particularly to a Bluetooth connection method, device, vehicle, and storage medium. Background Technology

[0002] Bluetooth is a wireless technology that supports short-range communication between devices. It boasts advantages such as high transmission efficiency, convenience, and security, and has been widely used in vehicles, industrial production, and other fields. For example, vehicle-mounted terminals equipped with Bluetooth modules can create Bluetooth keys for vehicles based on this technology. However, Bluetooth pairing is prone to errors, leading to frequent connection failures and low accuracy. Summary of the Invention

[0003] This disclosure provides a Bluetooth connection method, apparatus, vehicle, server, and computer-readable storage medium to at least solve the problem of low accuracy in Bluetooth connections in related technologies. The technical solution of this disclosure is as follows:

[0004] According to a first aspect of the present disclosure, a Bluetooth connection method is provided, comprising: obtaining a first Bluetooth pairing code from a server, wherein the first Bluetooth pairing code has a mapping relationship with a first device and a target device to which the first device is to connect via Bluetooth; receiving a second Bluetooth pairing code sent by a second device; matching the first Bluetooth pairing code with the second Bluetooth pairing code to obtain a matching result; and identifying whether the second device is the target device based on the matching result.

[0005] In one embodiment of this disclosure, the method further includes: obtaining a first identifier of the target device; and using a candidate device identified by the first identifier as the second device.

[0006] In one embodiment of this disclosure, the method further includes: if the target Bluetooth pairing code has not been matched with any Bluetooth pairing code, marking the target Bluetooth pairing code as a valid pairing code, wherein the target Bluetooth pairing code is the first Bluetooth pairing code or the second Bluetooth pairing code; if the target Bluetooth pairing code has been matched with any Bluetooth pairing code, marking the target Bluetooth pairing code as an invalid pairing code.

[0007] In one embodiment of this disclosure, before matching the first Bluetooth pairing code and the second Bluetooth pairing code, the method further includes: identifying that both the first Bluetooth pairing code and the second Bluetooth pairing code are valid pairing codes.

[0008] In one embodiment of this disclosure, the method further includes: if the first Bluetooth pairing code is an invalid pairing code, returning to the step of obtaining the first Bluetooth pairing code from the server and subsequent steps until a set end condition is met; if the second Bluetooth pairing code is an invalid pairing code, returning to the step of receiving the second Bluetooth pairing code sent by the second device and subsequent steps until the set end condition is met.

[0009] In one embodiment of this disclosure, the method further includes: if the second Bluetooth pairing code is an invalid pairing code, sending indication information to the second device, wherein the indication information is used to indicate that the second Bluetooth pairing code is an invalid pairing code.

[0010] In one embodiment of this disclosure, obtaining the first Bluetooth pairing code from the server includes: sending the identifier of the first device and the second identifier of the target device to the server, wherein the identifier of the first device and the second identifier are used to obtain the first Bluetooth pairing code; and receiving the first Bluetooth pairing code sent by the server.

[0011] In one embodiment of this disclosure, receiving the second Bluetooth pairing code sent by the second device includes: receiving a data packet broadcast by the second device; and extracting the second Bluetooth pairing code from the data packet.

[0012] In one embodiment of this disclosure, the method further includes: establishing a Bluetooth connection between the first device and the target device.

[0013] In one embodiment of this disclosure, if the target device is an in-vehicle device of a target vehicle, the method further includes: sending a first Bluetooth signal to the in-vehicle device of the target vehicle, wherein the first Bluetooth signal is used to create a Bluetooth key for the target vehicle on the first device; and receiving a second Bluetooth signal sent by the in-vehicle device of the target vehicle, wherein the second Bluetooth signal carries the creation result of the Bluetooth key.

[0014] In one embodiment of this disclosure, the first device is an in-vehicle device and the second device is a user terminal, or the first device is a user terminal and the second device is an in-vehicle device.

[0015] According to a second aspect of the present disclosure, another Bluetooth connection method is provided, comprising: obtaining a second Bluetooth pairing code from a server; sending the second Bluetooth pairing code to a first device, wherein the second Bluetooth pairing code is used to match with a first Bluetooth pairing code to obtain a matching result, the matching result being used to identify whether the second device is a target device to be Bluetooth connected by the first device, and the first Bluetooth pairing code having a mapping relationship with the first device and the target device.

[0016] In one embodiment of this disclosure, sending the second Bluetooth pairing code to the first device includes: broadcasting a data packet to the first device, wherein the data packet carries the second Bluetooth pairing code.

[0017] In one embodiment of this disclosure, the method further includes: if the broadcast duration of the data packet reaches a set duration, stopping the broadcast of the data packet to the first device.

[0018] In one embodiment of this disclosure, the method further includes: receiving indication information sent by the first device, wherein the indication information is used to indicate that the second Bluetooth pairing code is an invalid pairing code; and stopping broadcasting the data packet to the first device.

[0019] According to a third aspect of the present disclosure, another Bluetooth connection method is provided, comprising: receiving an identifier of the first device and a second identifier of a target device sent by a first device, wherein the target device is a device to be Bluetooth connected by the first device; filtering candidate Bluetooth pairing codes that have a mapping relationship with the identifier of the first device and the second identifier from a Bluetooth pairing code library, and using them as first Bluetooth pairing codes; filtering candidate Bluetooth pairing codes that match the first Bluetooth pairing codes from the Bluetooth pairing code library, and using them as second Bluetooth pairing codes corresponding to the target device; sending the first Bluetooth pairing code to the first device, and sending the second Bluetooth pairing code corresponding to the target device to the target device.

[0020] In one embodiment of this disclosure, the second Bluetooth pairing code corresponding to the target device is the first Bluetooth pairing code.

[0021] According to a fourth aspect of the present disclosure, a Bluetooth connection device is provided, comprising: an acquisition module configured to acquire a first Bluetooth pairing code from a server, wherein the first Bluetooth pairing code has a mapping relationship with a first device and a target device to which the first device is to connect via Bluetooth; a receiving module configured to receive a second Bluetooth pairing code sent by a second device; a matching module configured to match the first Bluetooth pairing code with the second Bluetooth pairing code to obtain a matching result; and an identification module configured to identify whether the second device is the target device based on the matching result.

[0022] In one embodiment of this disclosure, the receiving module is further configured to perform: obtaining a first identifier of the target device; and using the candidate device identified by the first identifier as the second device.

[0023] In one embodiment of this disclosure, the matching module is further configured to: if the target Bluetooth pairing code has not been matched with any Bluetooth pairing code, mark the target Bluetooth pairing code as a valid pairing code, wherein the target Bluetooth pairing code is the first Bluetooth pairing code or the second Bluetooth pairing code; if the target Bluetooth pairing code has been matched with any Bluetooth pairing code, mark the target Bluetooth pairing code as an invalid pairing code.

[0024] In one embodiment of this disclosure, before matching the first Bluetooth pairing code and the second Bluetooth pairing code, the matching module is further configured to perform: identifying that both the first Bluetooth pairing code and the second Bluetooth pairing code are valid pairing codes.

[0025] In one embodiment of this disclosure, the matching module is further configured to: if the first Bluetooth pairing code is an invalid pairing code, return to the step of obtaining the first Bluetooth pairing code from the server and subsequent steps until the set end condition is met; if the second Bluetooth pairing code is an invalid pairing code, return to the step of receiving the second Bluetooth pairing code sent by the second device and subsequent steps until the set end condition is met.

[0026] In one embodiment of this disclosure, the matching module is further configured to: if the second Bluetooth pairing code is an invalid pairing code, send indication information to the second device, wherein the indication information is used to indicate that the second Bluetooth pairing code is an invalid pairing code.

[0027] In one embodiment of this disclosure, the acquisition module is further configured to perform: sending the identifier of the first device and the second identifier of the target device to the server, wherein the identifier of the first device and the second identifier are used to acquire the first Bluetooth pairing code; and receiving the first Bluetooth pairing code sent by the server.

[0028] In one embodiment of this disclosure, the receiving module is further configured to perform: receiving a data packet broadcast by the second device; and extracting the second Bluetooth pairing code from the data packet.

[0029] In one embodiment of this disclosure, the identification module is further configured to perform: establishing a Bluetooth connection between the first device and the target device.

[0030] In one embodiment of this disclosure, if the target device is an in-vehicle device of a target vehicle, the identification module is further configured to perform: sending a first Bluetooth signal to the in-vehicle device of the target vehicle, wherein the first Bluetooth signal is used to create a Bluetooth key for the target vehicle on the first device; and receiving a second Bluetooth signal sent by the in-vehicle device of the target vehicle, wherein the second Bluetooth signal carries the creation result of the Bluetooth key.

[0031] In one embodiment of this disclosure, the first device is an in-vehicle device and the second device is a user terminal, or the first device is a user terminal and the second device is an in-vehicle device.

[0032] According to a fifth aspect of the present disclosure, another Bluetooth connection device is provided, comprising: an acquisition module configured to acquire a second Bluetooth pairing code from a server; and a transmission module configured to transmit the second Bluetooth pairing code to a first device, wherein the second Bluetooth pairing code is used to match with a first Bluetooth pairing code to obtain a matching result, the matching result being used to identify whether the second device is a target device to be Bluetooth connected by the first device, and the first Bluetooth pairing code has a mapping relationship with the first device and the target device.

[0033] In one embodiment of this disclosure, the sending module is further configured to perform: broadcasting a data packet to the first device, wherein the data packet carries the second Bluetooth pairing code.

[0034] In one embodiment of this disclosure, the sending module is further configured to: if the broadcast duration of the data packet reaches a set duration, stop broadcasting the data packet to the first device.

[0035] In one embodiment of this disclosure, the sending module is further configured to: receive indication information sent by the first device, wherein the indication information is used to indicate that the second Bluetooth pairing code is an invalid pairing code; and stop broadcasting the data packet to the first device.

[0036] According to a sixth aspect of the present disclosure, another Bluetooth connection device is provided, comprising: a receiving module configured to receive an identifier of the first device and a second identifier of a target device sent by the first device, wherein the target device is a device to be Bluetooth connected by the first device; a first filtering module configured to filter candidate Bluetooth pairing codes from a Bluetooth pairing code library that have a mapping relationship with the identifier of the first device and the second identifier, as a first Bluetooth pairing code; a second filtering module configured to filter candidate Bluetooth pairing codes that match the first Bluetooth pairing code from the Bluetooth pairing code library, as a second Bluetooth pairing code corresponding to the target device; and a sending module configured to send the first Bluetooth pairing code to the first device and send the second Bluetooth pairing code corresponding to the target device to the target device.

[0037] In one embodiment of this disclosure, the second Bluetooth pairing code corresponding to the target device is the first Bluetooth pairing code.

[0038] According to a seventh aspect of the present disclosure, a vehicle is provided, including a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the steps of the methods described in the first and second aspects of the present disclosure.

[0039] According to an eighth aspect of the present disclosure, a server is provided, including a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the steps of the method described in the third aspect of the present disclosure.

[0040] According to a ninth aspect of the present disclosure, a computer-readable storage medium is provided that stores computer program instructions thereon, which, when executed by a processor, implement the steps of the methods described in the first to third aspects of the present disclosure.

[0041] The technical solution provided by the embodiments of this disclosure has at least the following beneficial effects: there is a mapping relationship between the first Bluetooth pairing code and the first device and the target device. The first Bluetooth pairing code and the second Bluetooth pairing code are matched to identify whether the second device is the target device. Compared with the related technologies, which mostly use a common pairing code for Bluetooth connection, resulting in Bluetooth pairing errors and thus Bluetooth connection errors, the pairing code in this solution is more flexible, which improves the accuracy of Bluetooth pairing and thus the accuracy of Bluetooth connection. It is suitable for Bluetooth connection scenarios between user terminals and vehicle terminals.

[0042] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Attached Figure Description

[0043] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0044] Figure 1 This is a flowchart illustrating a Bluetooth connection method according to an exemplary embodiment.

[0045] Figure 2 This is a flowchart illustrating a Bluetooth connection method according to another exemplary embodiment.

[0046] Figure 3 This is a flowchart illustrating a Bluetooth connection method according to another exemplary embodiment.

[0047] Figure 4 This is a flowchart illustrating a Bluetooth connection method according to another exemplary embodiment.

[0048] Figure 5 This is a flowchart illustrating a Bluetooth connection method according to another exemplary embodiment.

[0049] Figure 6 This is an interactive flowchart illustrating a Bluetooth connection method according to an exemplary embodiment.

[0050] Figure 7 This is a block diagram illustrating a Bluetooth connectivity device according to an exemplary embodiment.

[0051] Figure 8 This is a block diagram illustrating a Bluetooth connectivity device according to another exemplary embodiment.

[0052] Figure 9 This is a block diagram illustrating a Bluetooth connectivity device according to another exemplary embodiment.

[0053] Figure 10 This is a block diagram illustrating a vehicle according to an exemplary embodiment. Detailed Implementation

[0054] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0055] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0056] Figure 1 This is a flowchart illustrating a Bluetooth connection method according to an exemplary embodiment, such as... Figure 1 As shown, the Bluetooth connection method of this disclosure includes the following steps.

[0057] S101, Obtain the first Bluetooth pairing code from the server, wherein the first Bluetooth pairing code has a mapping relationship with the first device and the target device to be connected to via Bluetooth by the first device.

[0058] It should be noted that the Bluetooth connection method of this disclosure is executed by an electronic device, such as a mobile phone, laptop, desktop computer, in-vehicle device (e.g., in-vehicle Bluetooth device), smart home appliance, etc. The Bluetooth connection method of this disclosure can be executed by the Bluetooth connection device of this disclosure, which can be configured in any electronic device to execute the Bluetooth connection method of this disclosure.

[0059] In one implementation, the executing entity may include a first device. The first device and the second device are different Bluetooth devices, and both the first device and the second device may include any Bluetooth device in the related technology, such as a Bluetooth headset, a user terminal (e.g., a mobile phone), an in-vehicle device (e.g., an in-vehicle Bluetooth device), etc. The number of second devices is at least one.

[0060] In one embodiment, the first device is an in-vehicle device and the second device is a user terminal, or the first device is a user terminal and the second device is an in-vehicle device.

[0061] It should be noted that the server refers to the server used to provide Bluetooth services, which may include, for example, a cloud server. The target device refers to the device to which the first device is to be connected via Bluetooth. The target device can be some or all of the second devices, and there can be at least one target device. There is a mapping relationship between the first Bluetooth pairing code and the first device and the target device. It can be understood that different first devices and / or different target devices can be mapped to different first Bluetooth pairing codes.

[0062] For example, taking a vehicle as an application scenario, the first device is mobile phone 1, and the target device is the in-vehicle equipment of vehicle 1. Mobile phone 1 can obtain Bluetooth pairing code A from the server. There is a mapping relationship between Bluetooth pairing code A and mobile phone 1 and the in-vehicle equipment of vehicle 1. It should be noted that in this embodiment, Bluetooth pairing code A is the first Bluetooth pairing code.

[0063] For example, taking a vehicle as an application scenario, the first device is mobile phone 2, and the target device is the in-vehicle equipment of vehicle 1. Mobile phone 2 can obtain Bluetooth pairing code B from the server. There is a mapping relationship between Bluetooth pairing code B and mobile phone 2 and the in-vehicle equipment of vehicle 1. It should be noted that in this embodiment, Bluetooth pairing code B is the first Bluetooth pairing code.

[0064] For example, taking a vehicle as an application scenario, the first device is the in-vehicle device of vehicle 2, and the target device is mobile phone 1. The in-vehicle device of vehicle 2 can obtain Bluetooth pairing code C from the server. There is a mapping relationship between Bluetooth pairing code C and mobile phone 1 and the in-vehicle device of vehicle 2. It should be noted that in this embodiment, Bluetooth pairing code C is the first Bluetooth pairing code.

[0065] For example, taking a vehicle as an application scenario, the first device is the in-vehicle device of vehicle 2, and the target device is mobile phone 3. The in-vehicle device of vehicle 2 can obtain the Bluetooth pairing code D from the server. There is a mapping relationship between the Bluetooth pairing code D and mobile phone 3 and the in-vehicle device of vehicle 2. It should be noted that in this embodiment, the Bluetooth pairing code D is the first Bluetooth pairing code.

[0066] It should be noted that there are no strict restrictions on the first Bluetooth pairing code; for example, it can include numbers, Chinese characters, English characters, etc. For example, the first Bluetooth pairing code can be 123456.

[0067] In one implementation, the first device has control over the server and can obtain the first Bluetooth pairing code from the server on its own.

[0068] In one implementation, obtaining a first Bluetooth pairing code from a server includes receiving a first Bluetooth pairing code sent by the server.

[0069] In one implementation, obtaining a first Bluetooth pairing code from a server includes sending an identifier of a first device and a second identifier of a target device to the server, wherein the identifier of the first device and the second identifier are used to obtain the first Bluetooth pairing code, and receiving the first Bluetooth pairing code sent by the server. It should be noted that the relevant information regarding the server obtaining the first Bluetooth pairing code can be found in the following embodiments, and will not be repeated here. Therefore, sending the identifier of the first device and the second identifier of the target device to the server can obtain the first Bluetooth pairing code.

[0070] It should be noted that the identifier of the first device corresponds one-to-one with the first device, and the identifier of the second device corresponds one-to-one with the target device. The identifier of the first device is the identifier of the device granularity of the first device, and the identifier of the second device is the identifier of the device granularity of the target device. There are no restrictions on the device identifier, such as including the device name, number, etc.

[0071] S102 receives the second Bluetooth pairing code sent by the second device.

[0072] It should be noted that the second Bluetooth pairing code refers to the Bluetooth pairing code sent by the second device. There is a corresponding relationship between the second Bluetooth pairing code and the second device. It can be understood that different second devices can correspond to different second Bluetooth pairing codes.

[0073] In one embodiment, the method further includes acquiring the signal strength of a third Bluetooth signal transmitted by a candidate device, and selecting a second device from a plurality of candidate devices based on the signal strength of the third Bluetooth signal. Thus, a second device can be selected from a plurality of candidate devices, taking into account the signal strength of the third Bluetooth signal transmitted by the candidate devices.

[0074] It should be noted that the second device may be some or all of the candidate devices.

[0075] In some cases, a second device is selected from multiple candidate devices based on the signal strength of the third Bluetooth signal, including selecting the candidate device corresponding to the third Bluetooth signal as the second device if the signal strength of the third Bluetooth signal is greater than a set threshold.

[0076] In some examples, a second device is selected from multiple candidate devices based on the signal strength of the third Bluetooth signal. This includes sorting the candidate devices from largest to smallest according to the signal strength of the third Bluetooth signal, and selecting the top N candidate devices as the second device, where N is a positive integer. It should be noted that there are no strict limitations on N; for example, it can be 1, 3, etc.

[0077] In one embodiment, the method further includes obtaining a first identifier of the target device and using the candidate devices identified by the first identifier as second devices. Thus, the second device can be determined by taking the first identifier of the target device into account.

[0078] It should be noted that the first identifier and the second identifier may be the same or different. For example, the first identifier and the second identifier may be identifiers of different granularities for the target device. For instance, the first identifier may be an identifier of the brand granularity for the target device, while the second identifier may be an identifier of the device granularity. The first identifier has a corresponding relationship with the target device. For example, the first identifier and the target device may correspond one-to-one, or different target devices may correspond to the same first identifier.

[0079] In some examples, the first identifier is an identifier at the brand level of the target device. The candidate device identified by the first identifier is used as the second device. This includes taking the candidate brand identified by the first identifier as the target brand and obtaining the candidate device corresponding to the target brand as the second device.

[0080] In one embodiment, receiving a second Bluetooth pairing code sent by a second device includes receiving a data packet broadcast by the second device and extracting the second Bluetooth pairing code from the data packet to obtain the second Bluetooth pairing code. It should be noted that the data packet carries the second Bluetooth pairing code, and the relevant content of the broadcast data packet can be found in the following embodiments, which will not be repeated here.

[0081] In some examples, the second Bluetooth pairing code is extracted from the data packet, including extracting the encrypted Bluetooth pairing code from the data packet and decrypting the encrypted Bluetooth pairing code to obtain the second Bluetooth pairing code. It should be noted that the encryption and decryption of the Bluetooth pairing code can be implemented using any encryption transmission method in related technologies, such as ASCII (American Standard Code for Information Interchange), without further limitation here.

[0082] In some cases, the data packet carries fields such as length, broadcast category, and first identifier of the second device.

[0083] In some cases, the data packet is in hexadecimal format and the data packet length is 17 bytes.

[0084] For example, the data packet is as follows: 10094D69436172202020202020202020. Here, 10 represents the field length (1 byte), 09 represents the broadcast category (1 byte), 4D69436172 represents "MICAR" encrypted using ASCII (5 bytes), and 2020202020202020202020 represents 10 spaces encrypted using ASCII (10 bytes). In this embodiment, the second Bluetooth pairing code is empty.

[0085] For example, the data packet is as follows: 10094D6943617231323334353620202020. Here, 10 represents the field length (1 byte), 09 represents the broadcast category (1 byte), 4D69436172 is the ASCII-encrypted result of "MICAR" (5 bytes), 313233343536 is the ASCII-encrypted result of the Bluetooth pairing code "123456" (6 bytes), and 20202020 is the ASCII-encrypted result of four spaces (4 bytes). In this embodiment, "123456" is the second Bluetooth pairing code.

[0086] S103, match the first Bluetooth pairing code with the second Bluetooth pairing code to obtain the matching result.

[0087] It should be noted that there are no strict limitations on the matching results; for example, they may include the degree of matching, successful matching, or failed matching.

[0088] In one implementation, matching a first Bluetooth pairing code with a second Bluetooth pairing code to obtain a matching result includes matching the first Bluetooth pairing code with the second Bluetooth pairing code according to a set matching rule to obtain a matching result. It should be noted that the set matching rule is not subject to excessive limitations.

[0089] In one implementation, a first Bluetooth pairing code and a second Bluetooth pairing code are matched to obtain a matching result, including obtaining the similarity between the first Bluetooth pairing code and the second Bluetooth pairing code as the matching degree.

[0090] In one implementation, a first Bluetooth pairing code and a second Bluetooth pairing code are matched to obtain a matching result. This includes inputting the first Bluetooth pairing code and the second Bluetooth pairing code into a target model, and having the target model output the matching result. It should be noted that the target model is not overly limited; for example, it may include a deep learning model (such as a large language model).

[0091] In one implementation, a first Bluetooth pairing code and a second Bluetooth pairing code are matched to obtain a matching result, including obtaining a matching result indicating successful matching if the first Bluetooth pairing code and the second Bluetooth pairing code are the same, and obtaining a matching result indicating failed matching if the first Bluetooth pairing code and the second Bluetooth pairing code are not the same.

[0092] S104, Based on the matching results, identify whether the second device is the target device.

[0093] In one implementation, based on the matching result, identifying whether the second device is the target device includes identifying the second device as the target device if the matching degree is greater than a set threshold. It should be noted that the set threshold is not overly limited; for example, if the matching degree ranges from 0 to 1, the set threshold can be 0.8.

[0094] In one implementation, based on the matching result, identifying whether the second device is the target device includes obtaining the second device corresponding to the second Bluetooth pairing code with the highest matching degree, and using it as the target device.

[0095] In one implementation, identifying whether a second device is a target device based on the matching result includes identifying the second device as a target device if the matching result indicates a successful match, and identifying the second device as a non-target device if the matching result indicates a failed match.

[0096] In one implementation, the method further includes establishing a Bluetooth connection between the first device and the target device.

[0097] In one embodiment, if the target device is an in-vehicle device of a target vehicle, the method further includes sending a first Bluetooth signal to the in-vehicle device of the target vehicle, wherein the first Bluetooth signal is used to create a Bluetooth key for the target vehicle on the first device, and receiving a second Bluetooth signal sent by the in-vehicle device of the target vehicle, wherein the second Bluetooth signal includes the creation result of the Bluetooth key. Thus, after establishing a Bluetooth connection between the first device and the in-vehicle device of the target vehicle, the first device and the in-vehicle device of the target vehicle can transmit Bluetooth signals to create a Bluetooth key for the target vehicle on the first device.

[0098] It should be noted that the creation result of the Bluetooth key is not limited in many ways; for example, it may include whether the Bluetooth key was created successfully or failed.

[0099] For example, continuing with the Bluetooth pairing code A mentioned above, the second device includes the in-vehicle equipment of vehicles 1 and 2.

[0100] Mobile phone 1 can obtain Bluetooth pairing code A from the server. Bluetooth pairing code A has a mapping relationship with mobile phone 1 and the in-vehicle equipment of vehicle 1. Mobile phone 1 receives Bluetooth pairing code E sent by vehicle 1 and Bluetooth pairing code F sent by vehicle 2. Bluetooth pairing code E is identical to Bluetooth pairing code A, while Bluetooth pairing code F is different from Bluetooth pairing code A. It should be noted that in this embodiment, Bluetooth pairing codes E and F are both second Bluetooth pairing codes.

[0101] Bluetooth pairing code E matches Bluetooth pairing code A. Mobile phone 1 receives a matching result indicating that Bluetooth pairing code E and Bluetooth pairing code A have successfully matched, and identifies the vehicle's in-vehicle device as the target device. A Bluetooth connection is established between mobile phone 1 and the vehicle's in-vehicle device. Mobile phone 1 sends a first Bluetooth signal to the vehicle's in-vehicle device, wherein the first Bluetooth signal is used to create a Bluetooth key for vehicle 1 on mobile phone 1. Mobile phone 1 receives a second Bluetooth signal sent by the vehicle's in-vehicle device, wherein the second Bluetooth signal includes the creation result of the vehicle's Bluetooth key.

[0102] Bluetooth pairing code F is consistent with Bluetooth pairing code A. Mobile phone 1 receives a matching result indicating that Bluetooth pairing code F and Bluetooth pairing code A failed to match, and identifies the vehicle's on-board equipment as a non-target device.

[0103] The Bluetooth connection method provided in this disclosure obtains a first Bluetooth pairing code from a server. The first Bluetooth pairing code has a mapping relationship with a first device and a target device to which the first device is to connect via Bluetooth. A second Bluetooth pairing code sent by a second device is received. The first and second Bluetooth pairing codes are matched to obtain a matching result. Based on the matching result, it is determined whether the second device is the target device. Therefore, the mapping relationship between the first Bluetooth pairing code and the first and target devices, and the matching of the first and second Bluetooth pairing codes to identify whether the second device is the target device, is more flexible than related technologies that mostly use universal pairing codes for Bluetooth connection, leading to Bluetooth pairing errors and consequently Bluetooth connection errors. This method improves the accuracy of Bluetooth pairing and thus the accuracy of Bluetooth connection, making it suitable for Bluetooth connection scenarios between user terminals and vehicle terminals.

[0104] Based on any of the above embodiments, the method further includes marking the target Bluetooth pairing code as a valid pairing code if it has not been matched with any other Bluetooth pairing code, wherein the target Bluetooth pairing code is either a first Bluetooth pairing code or a second Bluetooth pairing code; and marking the target Bluetooth pairing code as an invalid pairing code if it has been matched with any other Bluetooth pairing code. Therefore, considering whether the Bluetooth pairing code has been matched with other Bluetooth pairing codes, marking the Bluetooth pairing code as a valid or invalid pairing code can achieve the determination of the validity or invalidity of the Bluetooth pairing code.

[0105] It should be noted that "any Bluetooth pairing code" refers to any Bluetooth pairing code other than the target Bluetooth pairing code. "The target Bluetooth pairing code has been matched with any Bluetooth pairing code" means that the target Bluetooth pairing code has been matched with any Bluetooth pairing code, without imposing any restrictions on the matching result between the target Bluetooth pairing code and any Bluetooth pairing code.

[0106] For example, continuing with the Bluetooth pairing codes A and E above, if Bluetooth pairing code A has not been matched with any other Bluetooth pairing code, Bluetooth pairing code A will be marked as a valid pairing code. If Bluetooth pairing code A has been matched with Bluetooth pairing code E, Bluetooth pairing code A will be marked as an invalid pairing code.

[0107] Figure 2 This is a flowchart illustrating a Bluetooth connection method according to another exemplary embodiment, such as... Figure 2 As shown, the Bluetooth connection method of this disclosure includes the following steps.

[0108] S201, Obtain the first Bluetooth pairing code from the server, wherein the first Bluetooth pairing code has a mapping relationship with the first device and the target device to be connected to via Bluetooth by the first device.

[0109] S202, Receive the second Bluetooth pairing code sent by the second device.

[0110] The details of steps S201-S202 can be found in the above embodiments and will not be repeated here.

[0111] S203 identifies that both the first Bluetooth pairing code and the second Bluetooth pairing code are valid pairing codes.

[0112] S204, Match the first Bluetooth pairing code with the second Bluetooth pairing code to obtain the matching result.

[0113] For example, continuing with the Bluetooth pairing codes A and E mentioned above, mobile phone 1 can recognize that both Bluetooth pairing codes A and E are valid pairing codes, and can match Bluetooth pairing codes A and E to obtain the matching result.

[0114] S205, based on the matching results, identify whether the second device is the target device.

[0115] The details of steps S204-S205 can be found in the above embodiments and will not be repeated here.

[0116] The Bluetooth connection method provided in the embodiments of this disclosure further includes identifying that both the first Bluetooth pairing code and the second Bluetooth pairing code are valid pairing codes before matching the first Bluetooth pairing code and the second Bluetooth pairing code. This avoids continuing to match the first Bluetooth pairing code and the second Bluetooth pairing code when the first Bluetooth pairing code and / or the second Bluetooth pairing code are invalid, improving the accuracy of Bluetooth pairing and thus improving the accuracy of Bluetooth connection.

[0117] Based on any of the above embodiments, the method further includes, if the first Bluetooth pairing code is an invalid pairing code, returning to the process of obtaining the first Bluetooth pairing code from the server and subsequent steps, until a set termination condition is met. Thus, even when the first Bluetooth pairing code is invalid, the method can continue to obtain the first Bluetooth pairing code from the server and perform subsequent steps to match based on a valid first Bluetooth pairing code, improving the accuracy of Bluetooth pairing and consequently improving the accuracy of Bluetooth connection.

[0118] Based on any of the above embodiments, the method further includes, if the second Bluetooth pairing code is an invalid pairing code, returning to the process of receiving the second Bluetooth pairing code sent by the second device and subsequent steps, until a set termination condition is met. Therefore, even when the second Bluetooth pairing code is invalid, the method can continue to receive the second Bluetooth pairing code sent by the second device and subsequent steps, enabling matching based on a valid second Bluetooth pairing code, thus improving the accuracy of Bluetooth pairing and consequently the accuracy of Bluetooth connection.

[0119] It should be noted that there are no strict restrictions on the set termination conditions. For example, identifying the second device as the target device and / or reaching a set number of matches can be used as the set termination conditions.

[0120] Based on any of the above embodiments, the method further includes sending indication information to the second device if the second Bluetooth pairing code is an invalid pairing code, wherein the indication information is used to indicate that the second Bluetooth pairing code is an invalid pairing code. Thus, when the second Bluetooth pairing code becomes invalid, the second device can be promptly notified that its corresponding second Bluetooth pairing code has become invalid.

[0121] Figure 3 This is a flowchart illustrating a Bluetooth connection method according to another exemplary embodiment, such as... Figure 3 As shown, the Bluetooth connection method of this disclosure includes the following steps.

[0122] S301, Obtain the first Bluetooth pairing code from the server, wherein the first Bluetooth pairing code has a mapping relationship with the first device and the target device to be connected to via Bluetooth by the first device.

[0123] S302 receives the second Bluetooth pairing code sent by the second device.

[0124] S303 identifies whether the target Bluetooth pairing code has been matched with any other Bluetooth pairing code.

[0125] The target Bluetooth pairing code is either the first Bluetooth pairing code or the second Bluetooth pairing code.

[0126] If yes, proceed to step S304; otherwise, proceed to step S305.

[0127] S304 marks the target Bluetooth pairing code as an invalid pairing code.

[0128] S305 marks the target Bluetooth pairing code as a valid pairing code.

[0129] S306 identifies whether the first Bluetooth pairing code is a valid pairing code.

[0130] If yes, proceed to step S307; otherwise, return to step S301 and its subsequent steps.

[0131] S307 identifies whether the second Bluetooth pairing code is a valid pairing code.

[0132] If yes, proceed to step S308; otherwise, proceed to step S310.

[0133] S308 matches the first Bluetooth pairing code with the second Bluetooth pairing code to obtain the matching result.

[0134] S309, based on the matching results, identify whether the second device is the target device.

[0135] S310, send indication information to the second device, wherein the indication information is used to indicate that the second Bluetooth pairing code is an invalid pairing code.

[0136] It should be noted that after step S310, you can return to execute step S302 and subsequent steps.

[0137] The relevant content of steps S301-S310 can be found in the above embodiments, and will not be repeated here.

[0138] Figure 4 This is a flowchart illustrating a Bluetooth connection method according to another exemplary embodiment, such as... Figure 4 As shown, the Bluetooth connection method of this disclosure includes the following steps.

[0139] S401 retrieves the second Bluetooth pairing code from the server.

[0140] It should be noted that the Bluetooth connection method of this disclosure is executed by an electronic device, such as a mobile phone, laptop, desktop computer, in-vehicle device (e.g., in-vehicle Bluetooth device), smart home appliance, etc. The Bluetooth connection method of this disclosure can be executed by the Bluetooth connection device of this disclosure, which can be configured in any electronic device to execute the Bluetooth connection method of this disclosure.

[0141] In one implementation, the executing entity may include a second device.

[0142] In one implementation, the second device has control over the server and can obtain the second Bluetooth pairing code from the server on its own.

[0143] In one implementation, obtaining a second Bluetooth pairing code from a server includes receiving a second Bluetooth pairing code sent by the server.

[0144] S402, a second Bluetooth pairing code is sent to the first device, wherein the second Bluetooth pairing code is used to match with the first Bluetooth pairing code to obtain a matching result, and the matching result is used to identify whether the second device is the target device to be connected to by the first device via Bluetooth, and there is a mapping relationship between the first Bluetooth pairing code, the first device, and the target device.

[0145] In one implementation, sending a second Bluetooth pairing code to a first device includes broadcasting a data packet to the first device, wherein the data packet carries the second Bluetooth pairing code. Thus, broadcasting the data packet to the first device enables the sending of the second Bluetooth pairing code to the first device.

[0146] It should be noted that broadcasting data packets to the first device can be achieved using any broadcasting method in the relevant technologies, such as broadcasting data packets via Bluetooth. No further restrictions are imposed here.

[0147] In some examples, the method also includes stopping the broadcast of data packets to the first device if the broadcast duration of the data packets reaches a set duration. It should be noted that the set duration is not overly limited; for example, it could include 30 seconds. Therefore, by stopping the broadcast of data packets to the first device when the broadcast duration is long, time-limited broadcasting of the second Bluetooth pairing code can be achieved, improving the real-time performance of the second Bluetooth pairing code.

[0148] In some examples, the method further includes receiving indication information sent by the first device, wherein the indication information is used to indicate that the second Bluetooth pairing code is an invalid pairing code and to stop broadcasting data packets to the first device. Thus, when the second Bluetooth pairing code becomes invalid, broadcasting data packets to the first device can be stopped, avoiding the continued broadcasting of the second Bluetooth pairing code when it has expired.

[0149] The Bluetooth connection method provided in this disclosure obtains a second Bluetooth pairing code from a server and sends the second Bluetooth pairing code to a first device. The second Bluetooth pairing code is used to match with a first Bluetooth pairing code to obtain a matching result. The matching result is used to identify whether the second device is the target device for Bluetooth connection by the first device. A mapping relationship exists between the first Bluetooth pairing code, the first device, and the target device. Therefore, the second Bluetooth pairing code can be obtained from the server and sent to the first device to match the first and second Bluetooth pairing codes, thereby identifying whether the second device is the target device. Compared to related technologies that mostly use universal pairing codes for Bluetooth connection, leading to Bluetooth pairing errors and consequently Bluetooth connection errors, this solution offers higher flexibility in pairing codes, improving the accuracy of Bluetooth pairing and thus the accuracy of Bluetooth connection. It is suitable for Bluetooth connection scenarios between user terminals and vehicle terminals.

[0150] Figure 5 This is a flowchart illustrating a Bluetooth connection method according to another exemplary embodiment, such as... Figure 5 As shown, the Bluetooth connection method of this disclosure includes the following steps.

[0151] S501, receive the identifier of the first device and the second identifier of the target device sent by the first device, wherein the target device is the device to be connected to by the first device via Bluetooth.

[0152] It should be noted that the Bluetooth connection method of this disclosure is executed by an electronic device, such as a mobile phone, laptop, desktop computer, in-vehicle device (e.g., in-vehicle Bluetooth device), smart home appliance, etc. The Bluetooth connection method of this disclosure can be executed by the Bluetooth connection device of this disclosure, which can be configured in any electronic device to execute the Bluetooth connection method of this disclosure.

[0153] In one implementation, the executing entity may include a server.

[0154] S502, select candidate Bluetooth pairing codes from the Bluetooth pairing code library that have a mapping relationship with the identifier and the second identifier of the first device, and use them as the first Bluetooth pairing code.

[0155] It should be noted that the Bluetooth pairing code library includes multiple candidate Bluetooth pairing codes, and the first Bluetooth pairing code is some or all of the candidate Bluetooth pairing codes.

[0156] For example, the Bluetooth pairing code library includes Bluetooth pairing codes A, B, C, and D. Bluetooth pairing code A has a mapping relationship with the identifier of mobile phone 1 and the second identifier of the vehicle's in-vehicle device; Bluetooth pairing code B has a mapping relationship with the identifier of mobile phone 2 and the second identifier of the vehicle's in-vehicle device; Bluetooth pairing code C has a mapping relationship with the second identifier of mobile phone 1 and the identifier of the vehicle's in-vehicle device; and Bluetooth pairing code D has a mapping relationship with the second identifier of mobile phone 3 and the identifier of the vehicle's in-vehicle device. It should be noted that in this embodiment, the mobile phone's identifier and the mobile phone's second identifier are the same, both being device-level identifiers; similarly, the in-vehicle device's second identifier and the in-vehicle device's identifier are the same, both being device-level identifiers.

[0157] If the first device is mobile phone 1 and the target device is the vehicle-mounted device of vehicle 1, the server can select Bluetooth pairing code A from the Bluetooth pairing code library as the first Bluetooth pairing code.

[0158] If the first device is mobile phone 2 and the target device is the vehicle-mounted device of vehicle 1, the server can select Bluetooth pairing code B from the Bluetooth pairing code library as the first Bluetooth pairing code.

[0159] If the first device is the vehicle-mounted device of vehicle 2 and the target device is mobile phone 1, the server can select Bluetooth pairing code C from the Bluetooth pairing code library as the first Bluetooth pairing code.

[0160] If the first device is the vehicle-mounted device of vehicle 2 and the target device is mobile phone 3, the server can select Bluetooth pairing code D from the Bluetooth pairing code library as the first Bluetooth pairing code.

[0161] S503 selects a candidate Bluetooth pairing code from the Bluetooth pairing code library that matches the first Bluetooth pairing code, and uses it as the second Bluetooth pairing code for the target device.

[0162] S504, send a first Bluetooth pairing code to the first device, and send a second Bluetooth pairing code corresponding to the target device to the target device.

[0163] It should be noted that a matching relationship can be established in advance between any two candidate Bluetooth pairing codes in the Bluetooth pairing code library. Different first Bluetooth pairing codes may match the same or different candidate Bluetooth pairing codes, and no further restrictions are imposed here.

[0164] In one implementation, the second Bluetooth pairing code corresponding to the target device is the first Bluetooth pairing code, that is, the candidate Bluetooth pairing code that matches the first Bluetooth pairing code is the first Bluetooth pairing code.

[0165] For example, continuing with the Bluetooth pairing code A mentioned above, the server can select Bluetooth pairing code A from the Bluetooth pairing code library as the second Bluetooth pairing code corresponding to the in-vehicle device of vehicle 1, and send Bluetooth pairing code A to both mobile phone 1 and the in-vehicle device of vehicle 1. Correspondingly, mobile phone 1 can receive Bluetooth pairing code A sent by the server, and the in-vehicle device of vehicle 1 can receive Bluetooth pairing code A sent by the server. It should be noted that in this embodiment, Bluetooth pairing code A is the first Bluetooth pairing code and the second Bluetooth pairing code corresponding to the in-vehicle device of vehicle 1.

[0166] For example, continuing with the Bluetooth pairing code B mentioned above, the server can select Bluetooth pairing code B from the Bluetooth pairing code library as the second Bluetooth pairing code corresponding to the in-vehicle device of vehicle 1, and send Bluetooth pairing code B to both mobile phone 2 and the in-vehicle device of vehicle 1. Correspondingly, mobile phone 2 can receive Bluetooth pairing code B sent by the server, and the in-vehicle device of vehicle 1 can receive Bluetooth pairing code B sent by the server. It should be noted that in this embodiment, Bluetooth pairing code B is the first Bluetooth pairing code and the second Bluetooth pairing code corresponding to the in-vehicle device of vehicle 1.

[0167] For example, continuing with the Bluetooth pairing code C mentioned above, the server can select Bluetooth pairing code C from the Bluetooth pairing code library as the second Bluetooth pairing code corresponding to mobile phone 1, and send Bluetooth pairing code C to both mobile phone 1 and the in-vehicle equipment of vehicle 2. Accordingly, mobile phone 1 can receive Bluetooth pairing code C sent by the server, and the in-vehicle equipment of vehicle 2 can receive Bluetooth pairing code C sent by the server. It should be noted that in this embodiment, Bluetooth pairing code C is the first Bluetooth pairing code and the second Bluetooth pairing code corresponding to mobile phone 1.

[0168] For example, continuing with the Bluetooth pairing code D mentioned above, the server can select Bluetooth pairing code D from the Bluetooth pairing code library as the second Bluetooth pairing code corresponding to mobile phone 3, and send Bluetooth pairing code D to both mobile phone 3 and the in-vehicle device of vehicle 2. Correspondingly, mobile phone 3 can receive Bluetooth pairing code D sent by the server, and the in-vehicle device of vehicle 2 can receive Bluetooth pairing code D sent by the server. It should be noted that in this embodiment, Bluetooth pairing code D is the first Bluetooth pairing code and the second Bluetooth pairing code corresponding to mobile phone 3.

[0169] The Bluetooth connection method provided in the embodiments of this disclosure receives an identifier of a first device and a second identifier of a target device sent by a first device, wherein the target device is the device to be connected to by the first device via Bluetooth. The method selects candidate Bluetooth pairing codes from a Bluetooth pairing code library that have a mapping relationship with the identifier and second identifier of the first device, and uses them as the first Bluetooth pairing code. It then selects candidate Bluetooth pairing codes from the Bluetooth pairing code library that match the first Bluetooth pairing code, and uses them as the second Bluetooth pairing code corresponding to the target device. The method then sends the first Bluetooth pairing code to the first device and sends the second Bluetooth pairing code corresponding to the target device to the target device. Therefore, there is a mapping relationship between the first Bluetooth pairing code and the identifier of the first device and the second identifier of the target device. The second Bluetooth pairing code corresponding to the target device matches the first Bluetooth pairing code, and the first Bluetooth pairing code is sent to the first device, while the second Bluetooth pairing code corresponding to the target device is sent to the target device. This is to match the first Bluetooth pairing code and the second Bluetooth pairing code to identify whether the second device is the target device. Compared with related technologies that mostly use universal pairing codes for Bluetooth connection, which leads to Bluetooth pairing errors and thus Bluetooth connection errors, the pairing code in this solution is more flexible, improving the accuracy of Bluetooth pairing and thus improving the accuracy of Bluetooth connection. It is suitable for Bluetooth connection scenarios between user terminals and vehicle terminals.

[0170] Figure 6 This is an interactive flowchart illustrating a Bluetooth connection method according to an exemplary embodiment, such as... Figure 6 As shown, the Bluetooth connection method of this disclosure includes the following steps.

[0171] S601, the first device sends the identifier of the first device and the second identifier of the target device to the server.

[0172] S602, the server selects candidate Bluetooth pairing codes from the Bluetooth pairing code library that have a mapping relationship with the identifier and the second identifier of the first device, uses them as the first Bluetooth pairing code, and uses the first Bluetooth pairing code as the second Bluetooth pairing code corresponding to the target device.

[0173] S603, the server sends the first Bluetooth pairing code to the first device.

[0174] S604, the server sends the first Bluetooth pairing code to the target device.

[0175] S605, the target device sends the second Bluetooth pairing code corresponding to the target device to the first device.

[0176] S606, the first device identifies that the first Bluetooth pairing code matches the second Bluetooth pairing code corresponding to the target device, and generates a matching result to indicate that the matching is successful.

[0177] S607, The first device establishes a Bluetooth connection between the first device and the target device.

[0178] The details of steps S601-S607 can be found in the above embodiments and will not be repeated here.

[0179] Figure 7 This is a block diagram illustrating a Bluetooth connectivity device according to an exemplary embodiment. (Refer to...) Figure 7 The Bluetooth connection device 100 of this disclosure includes: an acquisition module 110, a receiving module 120, a pairing module 130, and an identification module 140.

[0180] The acquisition module 110 is configured to acquire a first Bluetooth pairing code from the server, wherein the first Bluetooth pairing code has a mapping relationship with the first device and the target device to be connected to via Bluetooth by the first device;

[0181] The receiving module 120 is configured to receive a second Bluetooth pairing code sent by the second device;

[0182] The matching module 130 is configured to perform a matching operation between the first Bluetooth pairing code and the second Bluetooth pairing code to obtain a matching result;

[0183] The identification module 140 is configured to perform an identification based on the matching result to determine whether the second device is the target device.

[0184] In one embodiment of this disclosure, the receiving module 120 is further configured to perform: acquiring a first identifier of the target device; and using the candidate device identified by the first identifier as the second device.

[0185] In one embodiment of this disclosure, the matching module 130 is further configured to: mark the target Bluetooth pairing code as a valid pairing code if the target Bluetooth pairing code has not been matched with any Bluetooth pairing code, wherein the target Bluetooth pairing code is the first Bluetooth pairing code or the second Bluetooth pairing code; and mark the target Bluetooth pairing code as an invalid pairing code if the target Bluetooth pairing code has been matched with any Bluetooth pairing code.

[0186] In one embodiment of this disclosure, before matching the first Bluetooth pairing code and the second Bluetooth pairing code, the matching module 130 is further configured to perform: identifying that both the first Bluetooth pairing code and the second Bluetooth pairing code are valid pairing codes.

[0187] In one embodiment of this disclosure, the matching module 130 is further configured to: if the first Bluetooth pairing code is an invalid pairing code, return to the execution of obtaining the first Bluetooth pairing code from the server and subsequent steps until the set end condition is met; if the second Bluetooth pairing code is an invalid pairing code, return to the execution of receiving the second Bluetooth pairing code sent by the second device and subsequent steps until the set end condition is met.

[0188] In one embodiment of this disclosure, the matching module 130 is further configured to perform: if the second Bluetooth pairing code is an invalid pairing code, send indication information to the second device, wherein the indication information is used to indicate that the second Bluetooth pairing code is an invalid pairing code.

[0189] In one embodiment of this disclosure, the acquisition module 110 is further configured to perform: sending the identifier of the first device and the second identifier of the target device to the server, wherein the identifier of the first device and the second identifier are used to acquire the first Bluetooth pairing code; and receiving the first Bluetooth pairing code sent by the server.

[0190] In one embodiment of this disclosure, the receiving module 120 is further configured to perform: receiving a data packet broadcast by the second device; and extracting the second Bluetooth pairing code from the data packet.

[0191] In one embodiment of this disclosure, the identification module 140 is further configured to perform: establishing a Bluetooth connection between the first device and the target device.

[0192] In one embodiment of this disclosure, if the target device is an in-vehicle device of a target vehicle, the identification module 140 is further configured to perform: sending a first Bluetooth signal to the in-vehicle device of the target vehicle, wherein the first Bluetooth signal is used to create a Bluetooth key for the target vehicle on the first device; and receiving a second Bluetooth signal sent by the in-vehicle device of the target vehicle, wherein the second Bluetooth signal carries the creation result of the Bluetooth key.

[0193] In one embodiment of this disclosure, the first device is an in-vehicle device and the second device is a user terminal, or the first device is a user terminal and the second device is an in-vehicle device.

[0194] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0195] The Bluetooth connection device provided in the embodiments of this disclosure obtains a first Bluetooth pairing code from a server. The first Bluetooth pairing code has a mapping relationship with a first device and a target device to which the first device is to connect via Bluetooth. It receives a second Bluetooth pairing code sent by a second device, matches the first Bluetooth pairing code with the second Bluetooth pairing code to obtain a matching result, and identifies whether the second device is the target device based on the matching result. Therefore, the mapping relationship between the first Bluetooth pairing code and the first device and the target device, and the matching of the first and second Bluetooth pairing codes to identify whether the second device is the target device, is more flexible than related technologies that mostly use universal pairing codes for Bluetooth connection, leading to Bluetooth pairing errors and consequently Bluetooth connection errors. This solution improves the accuracy of Bluetooth pairing and thus the accuracy of Bluetooth connection, making it suitable for Bluetooth connection scenarios between user terminals and vehicle terminals.

[0196] Figure 8 This is a block diagram illustrating a Bluetooth connectivity device according to another exemplary embodiment. (Refer to...) Figure 8 The Bluetooth connection device 200 of this disclosure includes: an acquisition module 210 and a transmission module 220.

[0197] The acquisition module 210 is configured to retrieve a second Bluetooth pairing code from the server;

[0198] The sending module 220 is configured to send the second Bluetooth pairing code to the first device, wherein the second Bluetooth pairing code is used to match with the first Bluetooth pairing code to obtain a matching result, and the matching result is used to identify whether the second device is the target device to be connected to by the first device via Bluetooth, and there is a mapping relationship between the first Bluetooth pairing code, the first device, and the target device.

[0199] In one embodiment of this disclosure, the sending module 220 is further configured to perform: broadcasting a data packet to the first device, wherein the data packet carries the second Bluetooth pairing code.

[0200] In one embodiment of this disclosure, the sending module 220 is further configured to: if the broadcast duration of the data packet reaches a set duration, stop broadcasting the data packet to the first device.

[0201] In one embodiment of this disclosure, the sending module 220 is further configured to: receive indication information sent by the first device, wherein the indication information is used to indicate that the second Bluetooth pairing code is an invalid pairing code; and stop broadcasting the data packet to the first device.

[0202] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0203] The Bluetooth connection device provided in the embodiments of this disclosure obtains a second Bluetooth pairing code from a server and sends the second Bluetooth pairing code to a first device. The second Bluetooth pairing code is used to match with a first Bluetooth pairing code to obtain a matching result. The matching result is used to identify whether the second device is the target device for Bluetooth connection by the first device. There is a mapping relationship between the first Bluetooth pairing code, the first device, and the target device. Therefore, the second Bluetooth pairing code can be obtained from the server and sent to the first device to match the first and second Bluetooth pairing codes, thereby identifying whether the second device is the target device. Compared to related technologies that mostly use universal pairing codes for Bluetooth connection, leading to Bluetooth pairing errors and consequently Bluetooth connection errors, this solution offers higher flexibility in pairing codes, improving the accuracy of Bluetooth pairing and thus the accuracy of Bluetooth connection. It is suitable for Bluetooth connection scenarios between user terminals and vehicle terminals.

[0204] Figure 9 This is a block diagram illustrating a Bluetooth connectivity device according to another exemplary embodiment. (Refer to...) Figure 9 The Bluetooth connection device 300 of this embodiment includes: a receiving module 310, a first filtering module 320, a second filtering module 330, and a sending module 340.

[0205] The receiving module 310 is configured to receive the identifier of the first device and the second identifier of the target device sent by the first device, wherein the target device is the device to be connected to by the first device via Bluetooth;

[0206] The first filtering module 320 is configured to filter out candidate Bluetooth pairing codes from the Bluetooth pairing code library that have a mapping relationship with the identifier of the first device and the second identifier, and use them as the first Bluetooth pairing code;

[0207] The second filtering module 330 is configured to filter out candidate Bluetooth pairing codes that match the first Bluetooth pairing code from the Bluetooth pairing code library, and use them as the second Bluetooth pairing code corresponding to the target device.

[0208] The sending module 340 is configured to send the first Bluetooth pairing code to the first device and send the second Bluetooth pairing code corresponding to the target device to the target device.

[0209] In one embodiment of this disclosure, the second Bluetooth pairing code corresponding to the target device is the first Bluetooth pairing code.

[0210] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0211] The Bluetooth connection device provided in the embodiments of this disclosure receives an identifier of a first device and a second identifier of a target device sent by a first device, wherein the target device is the device to be Bluetooth connected by the first device. The device filters out candidate Bluetooth pairing codes that have a mapping relationship with the identifier and the second identifier of the first device from the Bluetooth pairing code library and uses them as the first Bluetooth pairing code. The device also filters out candidate Bluetooth pairing codes that match the first Bluetooth pairing code from the Bluetooth pairing code library and uses them as the second Bluetooth pairing code corresponding to the target device. The device sends the first Bluetooth pairing code to the first device and sends the second Bluetooth pairing code corresponding to the target device to the target device. Therefore, there is a mapping relationship between the first Bluetooth pairing code and the identifier of the first device and the second identifier of the target device. The second Bluetooth pairing code corresponding to the target device matches the first Bluetooth pairing code, and the first Bluetooth pairing code is sent to the first device, while the second Bluetooth pairing code corresponding to the target device is sent to the target device. This is to match the first Bluetooth pairing code and the second Bluetooth pairing code to identify whether the second device is the target device. Compared with related technologies that mostly use universal pairing codes for Bluetooth connection, which leads to Bluetooth pairing errors and thus Bluetooth connection errors, the pairing code in this solution is more flexible, improving the accuracy of Bluetooth pairing and thus improving the accuracy of Bluetooth connection. It is suitable for Bluetooth connection scenarios between user terminals and vehicle terminals.

[0212] Figure 10 This is a block diagram illustrating a vehicle according to an exemplary embodiment. For example, vehicle 400 may be a hybrid vehicle, a non-hybrid vehicle, an electric vehicle, a fuel cell vehicle, or other type of vehicle. Vehicle 400 may be an autonomous vehicle, a semi-autonomous vehicle, or a non-autonomous vehicle.

[0213] Reference Figure 10 The vehicle 400 may include various subsystems, such as an infotainment system 410, a perception system 420, a decision control system 430, a drive system 440, and a computing platform 450. The vehicle 400 may also include more or fewer subsystems, and each subsystem may include multiple components. Furthermore, each subsystem and component of the vehicle 400 can be interconnected via wired or wireless means.

[0214] In some embodiments, the infotainment system 410 may include a communication system, an entertainment system, and a navigation system, etc.

[0215] The perception system 420 may include several sensors for sensing information about the environment surrounding the vehicle 400. For example, the perception system 420 may include a global positioning system (which may be GPS, BeiDou, or other positioning systems), an inertial measurement unit (IMU), lidar, millimeter-wave radar, ultrasonic radar, and a camera device.

[0216] The decision control system 430 may include a computing system, a vehicle controller, a steering system, a throttle, and a braking system.

[0217] The drive system 440 may include components that provide powered motion to the vehicle 400. In one embodiment, the drive system 440 may include an engine, an energy source, a transmission system, and wheels. The engine may be one or a combination of internal combustion engines, electric motors, and compressed air engines. The engine is capable of converting energy provided by the energy source into mechanical energy.

[0218] Some or all of the functions of the vehicle 400 are controlled by a computing platform 450. The computing platform 450 may include at least one processor 451 and a memory 452, the processor 451 being able to execute instructions 453 stored in the memory 452.

[0219] Processor 451 can be any conventional processor, such as a commercially available CPU. The processor may also include, for example, a Graphics Processing Unit (GPU), a Field Programmable Gate Array (FPGA), a System on Chip (SOC), an Application Specific Integrated Circuit (ASIC), or a combination thereof.

[0220] The memory 452 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0221] In addition to instruction 453, memory 452 can also store data, such as road maps, route information, vehicle position, direction, speed, and other data. The data stored in memory 452 can be used by computing platform 450.

[0222] In this embodiment of the disclosure, processor 451 may execute instruction 453 to implement all or part of the steps of the Bluetooth connection method provided in this disclosure.

[0223] In this embodiment of the vehicle, a first Bluetooth pairing code is obtained from a server. This first Bluetooth pairing code has a mapping relationship with a first device and a target device to which the first device is to connect via Bluetooth. A second Bluetooth pairing code sent by a second device is received, and the first and second Bluetooth pairing codes are matched to obtain a matching result. Based on the matching result, it is determined whether the second device is the target device. Therefore, the mapping relationship between the first Bluetooth pairing code and the first and target devices, and the matching of the first and second Bluetooth pairing codes to identify whether the second device is the target device, is a significant improvement over related technologies that often use universal pairing codes for Bluetooth connection, leading to pairing errors and subsequent connection failures. This solution offers greater flexibility in pairing codes, improving the accuracy of Bluetooth pairing and thus the accuracy of Bluetooth connection. It is suitable for Bluetooth connection scenarios between user terminals and vehicle terminals.

[0224] To implement the above embodiments, this disclosure also proposes a server, including a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the steps of the Bluetooth connection method provided in this disclosure.

[0225] To implement the above embodiments, this disclosure also proposes a computer-readable storage medium storing computer program instructions thereon, which, when executed by a processor, implement the steps of the Bluetooth connection method provided in this disclosure.

[0226] Alternatively, the computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0227] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0228] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A Bluetooth connection method, characterized in that, include: Send the identifier of the first device and the second identifier of the target device to the server, and receive the first Bluetooth pairing code determined by the server based on the identifier of the first device and the second identifier of the target device, wherein the first Bluetooth pairing code has a mapping relationship with the first device and the target device to be Bluetooth connected by the first device; Receive the data packet broadcast by the second device, extract the encrypted Bluetooth pairing code from the data packet, and decrypt the encrypted Bluetooth pairing code to obtain the second Bluetooth pairing code; The first Bluetooth pairing code and the second Bluetooth pairing code are matched to obtain the matching result; Based on the matching result, it is determined whether the second device is the target device. The target device is some or all of the second devices. The number of target devices is at least one. Different first devices and / or different target devices can be mapped to different first Bluetooth pairing codes.

2. The method according to claim 1, characterized in that, The method further includes: Obtain the first identifier of the target device; The candidate device identified by the first identifier is designated as the second device.

3. The method according to claim 1, characterized in that, The method further includes: If the target Bluetooth pairing code has not been matched with any Bluetooth pairing code, the target Bluetooth pairing code is marked as a valid pairing code, wherein the target Bluetooth pairing code is either the first Bluetooth pairing code or the second Bluetooth pairing code; If the target Bluetooth pairing code has been matched with any other Bluetooth pairing code, the target Bluetooth pairing code is marked as an invalid pairing code.

4. The method according to claim 3, characterized in that, Before matching the first Bluetooth pairing code with the second Bluetooth pairing code, the method further includes: Both the first Bluetooth pairing code and the second Bluetooth pairing code are confirmed to be valid pairing codes.

5. The method according to claim 4, characterized in that, The method further includes: If the first Bluetooth pairing code is an invalid pairing code, return to the steps of obtaining the first Bluetooth pairing code from the server and subsequent steps until the set termination condition is met; If the second Bluetooth pairing code is an invalid pairing code, return to the execution of receiving the second Bluetooth pairing code sent by the second device and subsequent steps until the set termination condition is met.

6. The method according to claim 3, characterized in that, The method further includes: If the second Bluetooth pairing code is an invalid pairing code, an indication message is sent to the second device, wherein the indication message is used to indicate that the second Bluetooth pairing code is an invalid pairing code.

7. The method according to any one of claims 1-6, characterized in that, The method further includes: Establish a Bluetooth connection between the first device and the target device.

8. The method according to claim 7, characterized in that, If the target device is an in-vehicle device of the target vehicle, the method further includes: Send a first Bluetooth signal to the in-vehicle equipment of the target vehicle, wherein the first Bluetooth signal is used to create a Bluetooth key for the target vehicle on the first device; The system receives a second Bluetooth signal sent by the vehicle's onboard equipment, wherein the second Bluetooth signal carries the creation result of the Bluetooth key.

9. The method according to any one of claims 1-6, characterized in that, The first device is an in-vehicle device and the second device is a user terminal, or the first device is a user terminal and the second device is an in-vehicle device.

10. A Bluetooth connection method corresponding to any one of the methods described in claims 1-9, characterized in that, include: Obtain the second Bluetooth pairing code from the server; A data packet carrying the second Bluetooth pairing code is broadcast to the first device, wherein the second Bluetooth pairing code is used to match with the first Bluetooth pairing code to obtain a matching result, and the matching result is used to identify whether the second device is the target device to be connected to by the first device via Bluetooth.

11. The method according to claim 10, characterized in that, The method further includes: If the broadcast duration of the data packet reaches the set duration, the broadcast of the data packet to the first device is stopped.

12. The method according to claim 10, characterized in that, The method further includes: Receive indication information sent by the first device, wherein the indication information is used to indicate that the second Bluetooth pairing code is an invalid pairing code; Stop broadcasting the data packet to the first device.

13. A Bluetooth connection method for performing the method corresponding to any one of claims 1-12, characterized in that, include: The device receives the identifier of the first device and the second identifier of the target device sent by the first device, wherein the target device is the device to be connected to by the first device via Bluetooth. Candidate Bluetooth pairing codes that have a mapping relationship with the identifier of the first device and the second identifier are selected from the Bluetooth pairing code library and used as the first Bluetooth pairing code; Candidate Bluetooth pairing codes that match the first Bluetooth pairing code are selected from the Bluetooth pairing code library and used as the second Bluetooth pairing code corresponding to the target device. Send the first Bluetooth pairing code to the first device, and send the second Bluetooth pairing code corresponding to the target device to the target device.

14. The method according to claim 13, characterized in that, The second Bluetooth pairing code corresponding to the target device is the first Bluetooth pairing code.

15. A Bluetooth connection device, characterized in that, include: The acquisition module is configured to send the identifier of the first device and the second identifier of the target device to the server, and receive a first Bluetooth pairing code determined by the server based on the identifier of the first device and the second identifier of the target device, wherein the first Bluetooth pairing code has a mapping relationship with the first device and the target device to which the first device is to be Bluetooth connected; The receiving module is configured to receive data packets broadcast by the second device, extract an encrypted Bluetooth pairing code from the data packets, and decrypt the encrypted Bluetooth pairing code to obtain a second Bluetooth pairing code. The matching module is configured to perform a match between the first Bluetooth pairing code and the second Bluetooth pairing code to obtain a matching result; The identification module is configured to perform an action based on the matching result to identify whether the second device is the target device, wherein the target device is some or all of the second devices, the number of target devices is at least one, and different first devices and / or different target devices can be mapped to different first Bluetooth pairing codes.

16. A vehicle, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured as follows: The steps for implementing the method according to any one of claims 1-12.

17. A server, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured as follows: The steps of implementing the method according to any one of claims 13-14.

18. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When executed by a processor, the program instructions implement the steps of the method described in any one of claims 1-14.

Citation Information

Patent Citations

  • Pairing method and system of Bluetooth device

    CN104378145A