WO2019114303A1 - 蓝牙连接方法及装置 - Google Patents
蓝牙连接方法及装置 Download PDFInfo
- Publication number
- WO2019114303A1 WO2019114303A1 PCT/CN2018/100625 CN2018100625W WO2019114303A1 WO 2019114303 A1 WO2019114303 A1 WO 2019114303A1 CN 2018100625 W CN2018100625 W CN 2018100625W WO 2019114303 A1 WO2019114303 A1 WO 2019114303A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- version
- mobile terminal
- bluetooth
- feature information
- nth
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W80/00—Wireless network protocols or protocol adaptations to wireless operation
- H04W80/04—Network layer protocols, e.g. mobile IP [Internet Protocol]
- H04W80/045—Network layer protocols, e.g. mobile IP [Internet Protocol] involving different protocol versions, e.g. MIPv4 and MIPv6
Definitions
- the present disclosure relates to the field of communications, and in particular to a Bluetooth connection method and apparatus.
- the Bluetooth protocol stack can be generally divided into a core protocol and an upper application layer protocol (for example, an Object Push Profile (OPP) for transferring files, (Phonebook Access Profile) , referred to as PBAP for connecting to the phone book, the Bluetooth Audio Transmission Profile (A2DP) for multimedia audio transmission, hands-free profile (HFP for call, etc.),
- OPP Object Push Profile
- PBAP Packet Access Profile
- A2DP Bluetooth Audio Transmission Profile
- HFP hands-free profile
- the core protocol and the upper application layer protocol are logically independent, and there are interactive interfaces between the upper and lower layers.
- There are dozens of application protocols on the upper layer (more BLE-low-power Bluetooth).
- Each application layer protocol is independently updated.
- the AVRCP protocol is used for multimedia audio control.
- Bluetooth compatibility The most common and most troublesome problem with Bluetooth technology is Bluetooth compatibility, and a large part of the compatibility problem is due to
- AVRCP protocol Take the AVRCP protocol as an example.
- the audio/video remote control profile (AVRCP) protocol on the smartphone side is followed.
- the evolution of the Android version is updated, so the new Android phone this protocol is relatively new, and the Bluetooth devices (such as: car, earphone) existing on the market are often old, because the AVRCP version gap between the two is caused by a large gap.
- a series of problems, such as music can not be automatically played, high probability of failure in succession, can not synchronize music information, etc., seriously affecting the user experience.
- the platform for researching such problems in the research platform is to test as many devices as possible during the development and debugging period, and add devices with such problems to the blacklist for special processing. That is to say, the chip manufacturer's solution is to first know the device with the problem, and then change the code. Equipment manufacturers' products often face consumers. If such problems occur, users cannot wait until the equipment manufacturers analyze the problem and then change the code to solve the problem.
- the embodiment of the present disclosure provides a Bluetooth connection method and apparatus, so as to at least solve the problem that the Bluetooth connection process between devices caused by the Bluetooth version is large and the update is performed separately.
- a Bluetooth connection method including: acquiring, by a mobile terminal, feature information of a version of a Bluetooth protocol of a device to be connected; determining, according to the feature information, a connection version that the mobile terminal needs to use; The mobile terminal connects to the device to be connected using the connection version.
- the mobile terminal obtains the feature information of the version of the Bluetooth protocol of the device to be connected, and the mobile terminal determines, by the mobile terminal, the first version that is pre-reported by the device to be connected as the version of the device to be connected; The terminal acquires the first feature information of the device to be connected according to the preset to-be-requested parameter of the first version.
- determining, according to the feature information, the connection version that the mobile terminal needs to use including: generating a first feature mask corresponding to the standard version of the first version; acquiring the first feature mask and the Determining a first similarity between the first feature information; determining that the first version meets the preset condition, determining that the standard version of the first version is the connected version.
- the mobile terminal sequentially selects a Bluetooth version that is not the first version of the Bluetooth protocol as the Nth version according to the preset rule, and performs the following each time. Determining: obtaining, according to the Nth version of the preset to-be-requested parameter, the Nth feature information of the device to be connected; and acquiring between the Nth feature mask and the Nth feature information of the Nth version of the standard version a Nth degree of similarity; determining that the Nth version meets the preset condition, determining that the standard version of the Nth version is the connected version; and determining that the Nth similarity does not meet the preset condition, The mobile terminal selects the (N+1)th version as the Nth version according to the preset rule, and repeatedly performs the foregoing determining step; wherein the (N+1)th version and the Nth version are used for Represents two different Bluetooth versions, N being an integer greater than two.
- the mobile terminal determines the Nth version by determining, in a case where the number of valid bits of the first feature mask is less than the number of valid bits of the feature information, determining that the version level is higher than The version of the first version is the Nth version, wherein each valid bit is used to indicate that the device supports or the protocol requires the device to support the corresponding feature.
- the difference between the number of versions of the Bluetooth protocol and the number of repetitions of the step of performing the determining step by the mobile terminal selecting the Nth version is less than or equal to 1.
- the mobile terminal stores the number of repetitions, wherein the greater the number of repetitions, the lower the success rate of the device to be connected connected to the mobile terminal; when the number of repetitions is greater than a threshold, the method The method further includes: receiving input selection information, wherein the selection information is used to determine the connection version in a plurality of versions having a similarity greater than a preset value; the mobile terminal is connected to the to-be-connected using the connection version device.
- the mobile terminal determines the similarity between the feature mask and the feature information by performing bitwise AND operation on the feature mask and the feature information to obtain a result of bitwise and operation.
- the number of significant digits; the similarity is obtained by dividing the number of significant digits in the result by the number of significant digits of the feature mask.
- a Bluetooth connection apparatus including: an obtaining module, configured to acquire feature information of a version of a Bluetooth protocol of a device to be connected; and a determining module configured to determine a need according to the feature information A connection version used; a connection module configured to connect to the device to be connected using the connection version.
- the obtaining module is further configured to determine a first version that is to be reported in advance by the device to be connected as a version of the device to be connected; and obtain the to-be-acquired according to the preset to-be-requested parameter of the first version.
- the feature information of the connected device is further configured to determine a first version that is to be reported in advance by the device to be connected as a version of the device to be connected.
- the obtaining module is further configured to acquire feature information of a version of an application layer protocol profile profile of the device to be connected.
- a storage medium comprising a stored program, wherein the program is executed while performing the method described in any of the above alternative embodiments.
- a processor for running a program wherein the program is executed to perform the method described in any of the above alternative embodiments.
- the mobile terminal acquires the feature information of the version of the Bluetooth protocol of the device to be connected; determines the Bluetooth version of the use of the device to be connected according to the feature information, and then the mobile terminal connects to the device to be connected using the Bluetooth version corresponding thereto.
- the above solution solves the problem that the Bluetooth connection process between the devices is complicated due to the large number of Bluetooth versions and the update is performed in the related art.
- the mobile terminal uses the corresponding version to connect. To ensure the stability of the Bluetooth connection.
- FIG. 1 is a block diagram showing the hardware structure of a mobile terminal of a Bluetooth connection method according to an embodiment of the present disclosure
- FIG. 2 is a flowchart of a Bluetooth connection method in accordance with an embodiment of the present disclosure
- FIG. 4 is a schematic diagram of a feature information table according to the present embodiment.
- FIG. 5 is an interaction flowchart provided according to this embodiment.
- FIG. 6 is a schematic diagram of a rule similarity table according to an embodiment
- FIG. 7 is a schematic diagram of an interface presented to a user, in accordance with an embodiment
- FIG. 9 is a flow diagram of manual matching in accordance with an embodiment.
- FIG. 1 is a hardware structural block diagram of a mobile terminal of a Bluetooth connection method according to an embodiment of the present disclosure.
- the mobile terminal 10 may include one or more (only one shown) processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA).
- FIG. 1 is merely illustrative and does not limit the structure of the above electronic device.
- the mobile terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration than that shown in FIG.
- the memory 104 can be used to store software programs and modules of application software, such as program instructions/modules corresponding to the Bluetooth connection method in the embodiment of the present disclosure, and the processor 102 executes various programs by running software programs and modules stored in the memory 104. Functional application and data processing, that is, the above method is implemented.
- Memory 104 may include high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
- memory 104 may further include memory remotely located relative to processor 102, which may be connected to mobile terminal 10 over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
- Transmission device 106 is for receiving or transmitting data via a network.
- the above-described network specific example may include a wireless network provided by a communication provider of the mobile terminal 10.
- the transmission device 106 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
- the transmission device 106 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
- NIC Network Interface Controller
- RF Radio Frequency
- FIG. 2 is a flowchart of a Bluetooth connection method according to an embodiment of the present disclosure. As shown in FIG. 2, the process includes the following steps:
- Step S202 The mobile terminal acquires feature information of a version of the Bluetooth protocol of the device to be connected.
- the Bluetooth protocol here may be a different version of the application protocol of the Bluetooth protocol, and is of course not limited to the application layer protocol.
- Step S204 determining, according to the feature information, a connection version that the mobile terminal needs to use
- Step S206 the mobile terminal connects to the device to be connected by using the connection version.
- the mobile terminal acquires the feature information of the version of the Bluetooth protocol of the device to be connected; determines the Bluetooth version of the device to be connected according to the feature information, and then the mobile terminal connects to the device to be connected using the Bluetooth version corresponding thereto.
- the above solution solves the problem that the Bluetooth connection process between the devices is complicated due to the large number of Bluetooth versions and the update is performed in the related art.
- the mobile terminal uses the corresponding version to connect. To ensure the stability of the Bluetooth connection.
- the mobile terminal obtains the feature information of the version of the Bluetooth protocol of the device to be connected, and the method includes: determining, by the mobile terminal, the first version that is to be reported in advance by the mobile terminal as the version of the device to be connected; A version of the preset to-be-requested parameter acquires first feature information of the device to be connected.
- the device to be connected is notified of the version of the Bluetooth protocol of the mobile terminal before the connection, and the mobile terminal obtains the Bluetooth of the device to be connected according to the reported version template (including the preset to-be-requested parameter corresponding to the version). If the feature information of the protocol does not match the standard version of the previously reported version, the information reported by the device to be connected is incorrect (that is, the Bluetooth protocol of the manufacturer has not passed the national standard authentication, and the version number is falsely reported). At this moment, the mobile terminal needs to increase or decrease the Bluetooth protocol template, obtain the feature information of the device to be connected according to the new template, and then use the feature information of the new version of the standard version to match, and if it can match, determine the device to be connected. If the Bluetooth protocol version cannot be matched, continue to increase or lower the Bluetooth protocol version and re-execute the above steps.
- the increase or decrease is determined by the comparison of the feature information of the two. If the feature information of the device to be connected is more than the valid bit of the standard version, then There are many features supported by the connection, which may be the latest Bluetooth protocol version. The next time you increase or decrease the version to get the feature information, you can gradually increase the version, or you can greatly increase the version. This is a process of gradually narrowing down the Bluetooth version of the device to be connected.
- determining, according to the feature information, the connection version that the mobile terminal needs to use including: generating a first feature mask corresponding to the standard version of the first version; acquiring the first feature mask and the first feature information The first similarity between the two is determined; when it is determined that the first similarity meets the preset condition, determining that the standard version of the first version is the connected version.
- the standard version of the first version is the version described in the Bluetooth International Standard. For example, if the first version reported by the device to be connected is Bluetooth 2.0, the corresponding version of the Bluetooth 2.0 national standard is the standard version, and a feature mask is generated.
- the mobile terminal sequentially selects a Bluetooth version that is not the first version of the Bluetooth protocol according to the preset rule.
- the following determining step is performed each time: obtaining the Nth feature information of the device to be connected according to the preset request parameter of the Nth version; acquiring the Nth feature mask of the Nth version of the standard version and the The Nth similarity between the Nth feature information; determining that the Nth version meets the preset condition, determining that the standard version of the Nth version is the connected version; determining that the Nth similarity does not meet the preset situation
- the mobile terminal repeatedly selects the (N+1)th version as the Nth version according to the preset rule, and repeatedly performs the foregoing determining step; wherein the (N+1)th version and the Nth version are used to represent two For different Bluetooth versions, N is an integer greater than 2.
- the Nth version here is only for explaining the version different from the first version, that is, a version other than the first version.
- the first version of the above, the N version does not have the meaning of the order, but only indicates that this is a different version.
- the mobile terminal determines the Nth version by determining that the version level is higher than the first version if the number of valid bits of the first feature mask is less than the number of valid bits of the feature information.
- the version is the Nth version, where each valid bit is used to indicate that the device supports or the protocol requires the device to support the corresponding feature.
- the number of versions of the Bluetooth protocol is less than or equal to 1 when the mobile terminal selects the Nth version to perform the determining step. That is, the number of repetitions is the maximum number of times the above detection is allowed to be sequentially performed using different standard versions in the case where the similarity does not match.
- the mobile terminal stores the number of repetitions, wherein the greater the number of repetitions, the lower the success rate of the device to be connected connected to the mobile terminal; when the number of repetitions is greater than the threshold, the method further includes: receiving the input Selecting information, wherein the selection information is used to determine the connection version in a plurality of versions whose similarity is greater than a preset value; the mobile terminal uses the connection version to connect to the device to be connected.
- the mobile terminal determines the similarity between the feature mask and the feature information by performing bitwise AND operation on the feature mask and the feature information, and obtaining the number of valid bits of the result after the bitwise operation and the operation.
- the similarity is obtained by dividing the number of significant digits in the result by the number of significant digits of the feature mask.
- the acquiring, by the mobile terminal, the feature information of the version of the Bluetooth protocol of the device to be connected includes: acquiring, by the mobile terminal, feature information of a version of the application layer protocol profile profile of the device to be connected.
- the device shown in this embodiment includes a smart phone, and a remote Bluetooth device (such as a smart phone, a Bluetooth headset, a car, etc.).
- a remote Bluetooth device such as a smart phone, a Bluetooth headset, a car, etc.
- FIG. 3 is a matching flowchart according to an embodiment of the present disclosure.
- the present embodiment includes an adaptive matching unit S01, an adaptive determining unit S02, a manual matching prompting unit S03, and a manual matching unit S04.
- the application layer protocol of the smart phone and the remote bluetooth device is automatically matched through the S01 unit background. If the matching of S01 is successful, the process proceeds to the next normal process. If the matching of S01 fails, the process proceeds to S03.
- S03 first automatically selects an application protocol version according to the similarity information obtained by the adaptive matching, prompting the user to perform manual matching. A menu that jumps to the manual matching interface is provided. When the user enters the corresponding UI interface and enters the S04 manual matching, the normal flow is entered.
- FIG. 5 is a flow chart of interaction according to the embodiment, specifically taking AVRCP protocol matching as an example to briefly explain the whole process:
- Step S501 Start an interaction process according to an application scenario of an application layer protocol.
- Step S502 In this step, the smart phone acquires the AVRCP version information of the remote device. Specifically, the smart phone initiates a request to the remote Bluetooth device to obtain an AVRCP version of the remote machine, including but not limited to the version number of the AVRCP.
- Step S503 the smartphone acquires the feature Feature corresponding to the protocol and generates feature information. Specifically, the smart phone initiates the acquisition of the Feature information supported by the AVRCP on the machine to the remote machine, and generates the Feature flag information, where the flag information is composed of four bytes, and each bit represents a Feature, if the remote end If the machine supports this feature, the corresponding bit position is 1, and if it is not supported, it is set to 0.
- the four bytes can represent a total of 32 items. This is sufficient for each protocol of the Bluetooth application layer, and the feature information is stored for use.
- FIG. 4 is a schematic diagram of the feature information table according to the embodiment.
- Step S504 This step generates a Feature Mask of a standard version of the AVRCP. Specifically, the AVRCP version number obtained in step S402 selects a part of the representative features that the standard version must support, and generates a corresponding Feature Mask. The code is also composed of four bytes and the feature represented by each bit is the same as that in S503. If a feature is selected, the bit position of the corresponding Feature mask is 1 or 0.
- Step S505 The adaptive matching process is completed in this step. Specifically, the feature mask and the generated feature identifier information of the remote device are used for bitwise operation, and the obtained result is converted into hexadecimal.
- the hexadecimal number is equal to the hexadecimal number represented by the Feature mask, which means that the Feature item required to be supported in the Feature Mask is supported by the remote machine.
- Step S506 This step is used to judge whether the adaptation ends. Specifically, because the number of versions of each application layer protocol is different, and the number of commonly used versions is different, a threshold is preset according to each specific application layer protocol, and it is determined whether the round of the adaptive matching exceeds a predetermined threshold. For example, if there are four versions of the AVRCP protocol, the threshold of the AVRCP protocol is four. If it is exceeded, the normal flow is entered, and if it is not exceeded, the process proceeds to the next step S507.
- Step S507 This step is used to calculate the device "blackness” and "similarity".
- Blackness is a characterization of the extent to which a device has problems. Similarity is a characterization of how well a protocol in a device matches a corresponding standard protocol. Specifically, the degree of "black” of the device by the number of rounds performed by the adaptive matching is blackness, and the larger the value, the greater the degree of "black", which indicates that the problem with the device is greater.
- blackness the degree of "black” of the device by the number of rounds performed by the adaptive matching is blackness, and the larger the value, the greater the degree of "black”, which indicates that the problem with the device is greater.
- the number of significant digits in the result after the operation and the result is divided by the number of significant digits in the Feature Mask as the similarity value, and for each
- the similarity values obtained in one round are sorted, and the top three similarity values and the corresponding AVRCP version numbers are recorded, and are stored as the last similarity table to be used.
- Step S508 This step corresponds to step S505. Specifically, according to the calculation result of step S505, the AVRCP version acquired by the next round to the remote machine and the corresponding feature feature are adjusted, and the next round of matching is started, and step S503 is performed.
- Bluetooth is a kind of wireless communication, and there may be a case of packet distortion, resulting in an adaptive matching error.
- the actual work experience tells the technician that there are many profiles (ie: application layer protocol) information provided by the Bluetooth device and the supported feature information is not true, which also leads to adaptive matching error.
- This embodiment describes that when the blackness of the remote device exceeds the threshold, that is, the adaptive matching fails, we first automatically select a version according to the similarity information obtained in the adaptive matching process, and then enter the normal process and prompt the user.
- the semi-automatic matching embodiment is a technical solution in the application file, in which the mobile terminal determines the feature information of the terminal device to be connected, and matches one or more Bluetooth versions, but with which Bluetooth version If the similarity does not meet the preset conditions, you can list several Bluetooth versions with higher similarity, and sort them appropriately. You can guide the user to choose which Bluetooth version to use for connection, or not connect.
- FIG. 8 is a schematic flow chart of semi-automatic matching according to an embodiment, specifically:
- Step S801 When the black level of the remote device exceeds a threshold, that is, the adaptive matching fails.
- Blackness is a characterization of the extent to which a device has problems. Similarity is a characterization of how well a protocol in a device matches a corresponding standard protocol. Specifically, the degree of "black" of the device by the number of rounds performed by the adaptive matching is blackness, and the larger the value, the greater the degree of "black", which indicates that the problem with the device is greater.
- step S801 the mobile terminal has determined a plurality of similarities between the plurality of Bluetooth versions and the device to be connected, and records in the similarity table.
- the specific scheme for determining the similarity using a plurality of Bluetooth versions respectively is the same as the scheme for determining the similarity described in the previous alternative embodiment.
- Step S802 In this step, it is determined whether the similarity table generated in the adaptive matching is a rule. Specifically, it is prescribed that the similarity value of the first row must be larger than the second and third similarity values, otherwise it is irregular.
- FIG. 6 is a schematic diagram of a rule similarity table according to an embodiment, as shown in FIG. 6.
- Step S803 When it is determined in S802 that the rule similarity table is obtained by the similarity information calculated in the adaptive matching, the user automatically selects the AVRCP protocol version ranked first. As shown in the figure below, take the AVRCP protocol as an example.
- the adaptive matching step S807 will result in the following, in which the first AVRCP version 1.3 is selected for the user.
- Step S804 Prompting the user to communicate with the device may have a problem and provide a menu for transferring to the manual matching interface.
- Step S805 If the user clicks the jump menu, the user enters the manual matching menu interface, and the manual matching interface will prepare two optional protocol versions for the user, specifically the second and third versions in the similarity table. For the user to select, and the similarity is ranked first, the similarity is low, and if the user does not click, the normal process is entered.
- FIG. 7 is a schematic diagram of an interface presented to a user, in accordance with an embodiment.
- Step S806 Entering a manual matching interface, the interface presents all AVRCP version buttons supported by the smart terminal to the user. Each time the user clicks a button, the intelligent terminal sets the AVRCP to the corresponding version.
- the step 804 to the step S806 may be equivalent to the selection information of the input input in the foregoing optional embodiment, wherein the selection information is used to determine the connection version in multiple versions with similarities greater than a preset value;
- the mobile terminal connects to the device to be connected using the connection version.
- Manual matching as a supplement to semi-automatic matching is mainly based on two considerations. 1. According to work experience, there will actually be such a situation. Because the Bluetooth standard is open and the threshold is low, some manufacturers will select several versions of several features. For example, a device selects four features of AVRCP1.3, four features of AVRCP1.4, and four features of AVRCP1.5, thus forming a mixed version. 2. As a mature control process, various possible situations must be considered. In the semi-automatic matching, the first in the similarity table is larger than the second and third, but theoretically there are various For all kinds of possibilities, all other irregular situations are handled in manual matching.
- This embodiment describes that when the blackness of the remote device exceeds the threshold, that is, the adaptive matching fails, it first determines whether the similarity table is a rule. If it is irregular, it enters a manual matching process, and the process directly presents the similarity table to the user. Each version in the user is manually selected by the user. If there is a problem in the communication, the user can enter the manual interface again to select other items.
- the mobile terminal may be connected to the to-be-connected device by using a connection version selected by the user.
- the manual matching embodiment is a technical solution in the application file, in which the mobile terminal determines the feature information of the terminal device to be connected, and matches one or more Bluetooth versions, but the similarity with which Bluetooth version is When the preset condition is not met, the user can select which Bluetooth version to use for connection or not, as shown in FIG. 9.
- FIG. 9 is a flow diagram of manual matching according to an embodiment, specifically:
- Step S901 When the black level of the remote device exceeds a threshold, that is, the adaptive matching fails.
- Blackness is a characterization of the extent to which a device has problems. Similarity is a characterization of how well a protocol in a device matches a corresponding standard protocol. Specifically, the degree of "black" of the device by the number of rounds performed by the adaptive matching is blackness, and the larger the value, the greater the degree of "black", which indicates that the problem with the device is greater.
- the specific scheme for determining the similarity between a certain Bluetooth version and the remote device may be the same as the solution described in the foregoing alternative embodiment.
- Step S902 In this step, we will judge whether the similarity table generated in the adaptive matching is a rule. If it is irregular, the process proceeds to step S903.
- Step S903 First, the user is prompted to communicate that the abnormal adaptive matching fails, and manual matching is required.
- Step S904 Jump directly to the manual matching interface, and the interface presents the user with three protocol versions in the similarity table for the user to select, and the order is consistent with the similarity table.
- step 903 to step S904 may be equivalent to the selection information of the input received in the foregoing alternative embodiment, wherein the selection information is used to determine the connection version in multiple versions with similarity greater than a preset value;
- the mobile terminal connects to the device to be connected using the connection version.
- the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
- the technical solution of the present disclosure which is essential or contributes to the related art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, CD-ROM).
- the instructions include a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present disclosure.
- a Bluetooth connection device is also provided, which is used to implement the foregoing embodiments and implementation manners, and has not been described again.
- the term “module” may implement a combination of software and/or hardware of a predetermined function.
- the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
- a Bluetooth connection apparatus including:
- An obtaining module configured to acquire feature information of a version of a Bluetooth protocol of the device to be connected
- a determining module configured to determine, according to the feature information, a connection version that the mobile terminal needs to use
- connection module for connecting to the device to be connected using the connection version.
- the obtaining module is further configured to determine a first version that is to be reported in advance by the device to be connected as a version of the device to be connected, and obtain the to-be-connected according to the preset to-be-requested parameter of the first version. Characteristic information of the device.
- the determining module is further configured to generate a first feature mask corresponding to the standard version of the first version; acquire the first feature mask and the first similarity of the feature information; When the first similarity meets the preset situation, determining that the standard version of the first version is the connected version.
- the determining module is further configured to: after determining that the first similarity does not meet the preset condition, acquire the Nth of the to-be-connected device according to the preset to-be-requested parameter of the Nth version of the Bluetooth protocol.
- Feature information acquiring an Nth feature mask of the Nth version and an Nth similarity of the Nth feature information; determining the standard of the Nth version when determining that the Nth similarity meets a preset condition
- the version is the connected version; where N is a positive integer not equal to one.
- the determining module is further configured to determine the Nth version by determining the version if the number of valid bits of the first feature mask is less than the number of valid bits of the feature information.
- a version higher than the first version is the Nth version, wherein each valid bit is used to indicate that the device supports or the protocol requires the device to support the corresponding feature.
- the number of repetitions is less than or equal to the number of versions of the Bluetooth protocol, where the number of repetitions is obtained according to a feature mask of a different standard version and feature information uploaded by the device to be connected, and then determined according to the similarity. The number of times the version of the connection was made.
- the determining module is further configured to store the number of repetitions, wherein the greater the number of repetitions, the lower the success rate of the device to be connected connected to the mobile terminal; the number of repetitions is greater than a threshold
- the method further includes: receiving input selection information, wherein the selection information is used to determine the connection version in a plurality of versions having a similarity greater than a preset value; the mobile terminal is connected using the connection version To the device to be connected.
- the determining module is further configured to determine a similarity between the feature mask and the feature information by performing bitwise AND operation on the feature mask and the feature information, and obtaining bitwise and operation The number of significant digits of the result; dividing the number of significant digits in the result by the number of significant digits of the feature mask to obtain the similarity.
- the obtaining module is further configured to acquire feature information of a version of an application layer protocol profile profile of the device to be connected.
- each of the above modules may be implemented by software or hardware.
- the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the above modules are in any combination.
- the forms are located in different processors.
- a processor for running a program wherein the program is executed to perform the method described in any of the above alternative embodiments.
- a storage medium comprising a stored program, wherein the program is executed while performing the method described in any of the above alternative embodiments.
- modules or steps of the present disclosure described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
- the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. As such, the disclosure is not limited to any specific combination of hardware and software.
- the present disclosure is applicable to the field of communications, and solves the problem that the Bluetooth connection process between devices is complicated due to the large number of Bluetooth versions and the update of the related technologies in the related art.
- the mobile terminal After determining the Bluetooth version of the device to be connected, the mobile terminal uses the corresponding The version is connected to ensure the stability of the Bluetooth connection.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本公开提供了一种蓝牙连接方法及装置,其中该方法包括:移动终端获取待连接设备的蓝牙协议的版本的特征信息;依据该特征信息确定待连接设备的使用的蓝牙版本,然后移动终端使用与之对应的蓝牙版本连接至待连接设备。采用上述方案,解决了相关技术中由于蓝牙版本较多,且分别进行更新导致的设备之间的蓝牙连接流程复杂的问题,在确定待连接设备的蓝牙版本之后,移动终端使用对应的版本进行连接,保证了蓝牙连接的稳定性。
Description
本公开涉及通信领域,具体而言,涉及一种蓝牙连接方法及装置。
在相关技术中,蓝牙协议栈总体上可分为核心协议和上层的应用层协议(如:对象存储规范(Object Push Profile,简称为OPP)用于传文件,(电话号码簿访问协议Phonebook Access Profile,简称为PBAP)用于连接电话本,蓝牙音频传输模型协定(Advanced Audio Distribution Profile,简称为A2DP)用于多媒体音频传输,免提概要(Hands-Free Profile,简称为HFP用于通话等),核心协议和上层的应用层协议之间逻辑上相对独立,上下层之间存在交互的接口。上层的应用协议多达几十种(算上BLE-低功耗蓝牙-的话就更多了),一般智能手机支持的应用层协议也有十种左右。每一种应用层协议都独立进行版本的更迭(如:AVRCP协议用于多媒体音频控制,目前接触到的就有1.3、1.4、1.5、1.6等数个版本)。蓝牙技术最为常见也是最为头疼的问题是蓝牙的兼容性问题,而兼容性问题中很大一部分都是因为上述应用层协议种类较多且每种协议都独立进行版本更迭。就拿AVRCP协议来举个例子,智能手机侧的音视频远程控制规范(Audio/Video Remote Control Profile,简称为AVRCP)协议是随着Android版本的演进而更新的,所以新出的Android手机此协议都较新,而市场上存在的蓝牙设备(如:车载、耳机)往往都较为陈旧,因为两者间AVRCP版本差距较大引起的一系列问题,如音乐不能自动播放,高概率接连失败,不能同步音乐信息等,严重影响用户体验。
针对上述问题,相关技术中都是依托芯片商提供的方案。具体来说,在研平台针对此类问题的方案都是在开发、调试期测试尽可能多的设备,将存在此类问题的设备加入到黑名单当中,进行特殊的处理。也就是说芯片厂商的方案是首先知道存在问题的设备,然后才能改代码修复。而设备厂商的产品往往直面消费者如果此类问题发生,用户不可能等到设备厂商分析清楚问题再改代码出版本来解决。
其实在两个蓝牙设备通信的过程中是会相互之间获取对方的应用层协议的版本号的,那么为什么还会存在上述问题呢,是因为正规的蓝牙产品都是要经过蓝牙官方组织的认证的,比方说产品B宣称支持OPP协议1.3版本,正规的流程是向蓝牙官方组织提交认证申请,在官方组织授权的实验室通过一系列的测试pass后才会发放认证证书,经过测试后说明产品是符合官方协议规范的,而实际上很多厂商因为成本方面的问题都不会做此认证,而只经过内部测试便称自己的产品支持某一应用协议的某一版本,而实际上却不完全符合官方的协议规范,所以相关技术中还要解决的一个问题是如何知道对端蓝牙设备真正的协议版本。
针对相关技术中由于蓝牙版本较多,且分别进行更新导致的设备之间的蓝牙连接流程复杂的问题,目前还没有有效的解决方案。
发明内容
本公开实施例提供了一种蓝牙连接方法及装置,以至少解决相关技术中由于蓝牙版本较多,且分别进行更新导致的设备之间的蓝牙连接流程复杂的问题。
根据本公开的一个实施例,提供了一种蓝牙连接方法,包括:移动终端获取待连接设备的蓝牙协议的版本的特征信息;依据所述特征信息确定所述移动终端需要使用的连接版本;所述移动终端使用所述连接版本连接至所述待连接设备。
可选地,移动终端获取待连接设备的蓝牙协议的版本的特征信息,包括:所述移动终端将所述待连接设备预先上报的第一版本确定为所述待连接设备的版本;所述移动终端按照所述第一版本的预设待请求参数获取所述待连接设备的第一特征信息。
可选地,依据所述特征信息确定所述移动终端需要使用的连接版本,包括:生成与所述第一版本的标准版本对应的第一特征掩码;获取所述第一特征掩码和所述第一特征信息之间的第一相似度;在确定所述第一相似度符合预设情况时,确定所述第一版本的标准版本为所述连接版本。
可选地,在确定所述第一相似度不符合预设情况之后,移动终端依据预设规则,依次选取蓝牙协议中非所述第一版本的蓝牙版本为第N版本,每次均执行以下确定步骤:依据所述第N版本的预设待请求参数获取所述待连接设备的第N特征信息;获取所述第N版本标准版本的第N特征掩码和所述第N特征信息之间的第N相似度;在确定所述第N相似度符合预设情况时,确定所述第N版本的标准版本为所述连接版本;在确定所述第N相似度不符合预设情况时,所述移动终端依据所述预设规则选取第(N+1)版本为所述第N版本,重复执行上述确定步骤;其中,所述第(N+1)版本和所述第N版本用于表示两个不同的蓝牙版本,N为大于2的整数。
可选地,所述移动终端通过以下方式确定所述第N版本:在所述第一特征掩码的有效位个数小于所述特征信息的有效位个数的情况下,确定版本级别高于所述第一版本的版本为所述第N版本,其中,每个有效位用于表示设备支持或者协议要求设备支持对应的特征。
可选地,所述蓝牙协议的版本数,与所述移动终端选取第N版本执行所述确定步骤的重复次数的差值小于等于1。
可选地,移动终端存储所述重复次数,其中,所述重复次数越大,所述待连接设备连接至所述移动终端的成功率越低;在所述重复次数大于阈值时,所述方法还包括:接收输入的选择信息,其中,所述选择信息用于在相似度大于预设值的多个版本中确定所述连接版本;所述移动终端使用所述连接版本连接至所述待连接设备。
可选地,所述移动终端通过以下方式确定所述特征掩码和特征信息的相似度:将所述特征掩码和所述特征信息进行按位与操作,获取按位与操作后的结果的有效位个数;将所述结果中的有效位个数除以所述特征掩码的有效位个数得到所述相似度。
根据本公开的另一个实施例,还提供了一种蓝牙连接装置,包括:获取模块,设置为获取待连接设备的蓝牙协议的版本的特征信息;确定模块,设置为依据所述特征信息确定需要 使用的连接版本;连接模块,设置为使用所述连接版本连接至所述待连接设备。
可选地,所述获取模块还设置为将所述待连接设备预先上报的第一版本确定为所述待连接设备的版本;以及按照所述第一版本的预设待请求参数获取所述待连接设备的特征信息。
可选地,所述获取模块还设置为获取待连接设备的应用层协议剖面profile的版本的特征信息。
根据本公开的另一个实施例,还提供了一种存储介质,所述存储介质包括存储的程序,其中,所述程序运行时执行上述可选实施例任一项中所述的方法。
根据本公开的另一个实施例,还提供了一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行上述可选实施例任一项中所述的方法。
通过本公开,移动终端获取待连接设备的蓝牙协议的版本的特征信息;依据该特征信息确定待连接设备的使用的蓝牙版本,然后移动终端使用与之对应的蓝牙版本连接至待连接设备。采用上述方案,解决了相关技术中由于蓝牙版本较多,且分别进行更新导致的设备之间的蓝牙连接流程复杂的问题,在确定待连接设备的蓝牙版本之后,移动终端使用对应的版本进行连接,保证了蓝牙连接的稳定性。
此处所说明的附图用来提供对本公开的进一步理解,构成本申请的一部分,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。在附图中:
图1是本公开实施例的一种蓝牙连接方法的移动终端的硬件结构框图;
图2是根据本公开实施例的蓝牙连接方法的流程图;
图3是根据本公开实施例的匹配流程图;
图4是根据本实施例的特征信息表的示意图;
图5是根据本实施例提供的交互流程图;
图6是根据实施例的规则相似度表格示意图;
图7是根据实施例的呈现至用户的界面示意图;
图8是根据实施例的半自动匹配的流程示意图;
图9是根据实施例的手动匹配的流程示意图。
实施例一
本申请实施例一所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图1是本公开实施例的一种蓝牙连接方法的移动终端的硬件结构框图。如图1所示,移动终端10可以包括一个或多个(图中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输装置106。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,移动终端 10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可用于存储应用软件的软件程序以及模块,如本公开实施例中的蓝牙连接方法对应的程序指令/模块,处理器102通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
在本实施例中提供了一种运行于上述移动终端的蓝牙连接方法,图2是根据本公开实施例的蓝牙连接方法的流程图,如图2所示,该流程包括如下步骤:
步骤S202,移动终端获取待连接设备的蓝牙协议的版本的特征信息。需要补充的是,此处的蓝牙协议可以为蓝牙协议的应用层协议的不同版本,当然不局限于应用层协议。
步骤S204,依据该特征信息确定该移动终端需要使用的连接版本;
步骤S206,该移动终端使用该连接版本连接至该待连接设备。
通过上述步骤,移动终端获取待连接设备的蓝牙协议的版本的特征信息;依据该特征信息确定待连接设备的使用的蓝牙版本,然后移动终端使用与之对应的蓝牙版本连接至待连接设备。采用上述方案,解决了相关技术中由于蓝牙版本较多,且分别进行更新导致的设备之间的蓝牙连接流程复杂的问题,在确定待连接设备的蓝牙版本之后,移动终端使用对应的版本进行连接,保证了蓝牙连接的稳定性。
可选地,移动终端获取待连接设备的蓝牙协议的版本的特征信息,包括:该移动终端将该待连接设备预先上报的第一版本确定为该待连接设备的版本;该移动终端按照该第一版本的预设待请求参数获取该待连接设备的第一特征信息。
需要说明的是,即待连接设备在连接之前,会通知移动终端自身蓝牙协议的版本,移动终端依据上报的版本模板(内含该版本对应的预设待请求参数)去获取待连接设备的蓝牙协议的特征信息,在获取之后如果与之前上报版本的标准版本不能匹配,则说明该待连接设备上报信息有误(即厂家的蓝牙协议并没有经过国家标准认证,误报了自身版本号)。此刻则需要移动终端调高或者调低蓝牙协议的模板,依据新模板去获取待连接设备的特征信息,然后使用新版本的标准版本的特征信息进行匹配,如果可以匹配,则确定了待连接设备的蓝牙协议版本,如不能匹配,继续调高或者调低蓝牙协议版本重新执行上述步骤。
需要补充的是,在每次匹配相似度较低之后,调高或者调低是由二者的特征信息对比决定的,如果待连接设备的特征信息有效位多于标准版本的有效位,则说明待连接设支持的功 能多,可能是最新的蓝牙协议版本。在下次调高或调低版本去获取特征信息时,可以逐渐升高版本,也可以大幅度升高版本,这是一个逐渐缩小范围确定待连接设备的蓝牙版本的过程。
可选地,依据该特征信息确定该移动终端需要使用的连接版本,包括:生成与该第一版本的标准版本对应的第一特征掩码;获取该第一特征掩码和该第一特征信息之间的第一相似度;在确定该第一相似度符合预设情况时,确定该第一版本的标准版本为该连接版本。需要补充的是,第一版本的标准版本即蓝牙国际标准中记载的版本。例如待连接设备上报的第一版本是蓝牙2.0,则对应的是蓝牙2.0国家标准的版本为标准版本,生成特征掩码。
可选地,在确定该相似度不符合预设情况之后,在确定该第一相似度不符合预设情况之后,移动终端依据预设规则,依次选取蓝牙协议中非该第一版本的蓝牙版本为第N版本,每次均执行以下确定步骤:依据该第N版本的预设待请求参数获取该待连接设备的第N特征信息;获取该第N版本标准版本的第N特征掩码和该第N特征信息之间的第N相似度;在确定该第N相似度符合预设情况时,确定该第N版本的标准版本为该连接版本;在确定该第N相似度不符合预设情况时,该移动终端依据该预设规则选取第(N+1)版本为该第N版本,重复执行上述确定步骤;其中,该第(N+1)版本和该第N版本用于表示两个不同的蓝牙版本,N为大于2的整数。
需要补充的是,此处的第N版本只是为了说明与第一版本不一样的版本,即除了第一版本之外的一个版本。上述第一版本,第N版本并没有先后顺序的意思,只是表明这是不同的版本。
可选地,该移动终端通过以下方式确定该第N版本:在该第一特征掩码的有效位个数小于该特征信息的有效位个数的情况下,确定版本级别高于该第一版本的版本为该第N版本,其中,每个有效位用于表示设备支持或者协议要求设备支持对应的特征。
可选地,该蓝牙协议的版本数,与该移动终端选取第N版本执行该确定步骤的重复次数的差值小于等于1。即重复次数是在相似度不匹配的情况下,允许依次使用不同标准版本进行上述检测的最多次数。
可选地,移动终端存储该重复次数,其中,该重复次数越大,该待连接设备连接至该移动终端的成功率越低;在该重复次数大于阈值时,该方法还包括:接收输入的选择信息,其中,该选择信息用于在相似度大于预设值的多个版本中确定该连接版本;该移动终端使用该连接版本连接至该待连接设备。
可选地,该移动终端通过以下方式确定该特征掩码和特征信息的相似度:将该特征掩码和该特征信息进行按位与操作,获取按位与操作后的结果的有效位个数;将该结果中的有效位个数除以该特征掩码的有效位个数得到该相似度。
可选地,移动终端获取待连接设备的蓝牙协议的版本的特征信息,包括:该移动终端获取待连接设备的应用层协议剖面profile的版本的特征信息。
以下结合本公开一实施例进行详细说明。
本实施例所示的装置包括智能手机,及远端蓝牙设备(如:智能手机、蓝牙耳机、车载等)。
图3是根据本公开实施例的匹配流程图,如图3所示,本实施例包括自适应匹配单元S01,自适应判断单元S02,手动匹配提示单元S03和手动匹配单元S04。当智能手机同远端蓝牙设备通信时,首先通过S01单元后台自动匹配智能手机与远端蓝牙设备的应用层协议。进入S02,若S01匹配成功则进入接下来的正常流程,若S01匹配失败则进入S03,S03首先根据自适应匹配得到的相似度信息自动为用户选择一个应用协议版本,提示用户可以执行手动匹配并提供相应跳转到手动匹配界面的菜单,当用户进入对应UI接口即进入S04手动匹配后,进入正常流程。
下面是本实施例的具体实施例
自适应匹配实施例
本实施例描述了当用户通过智能手机同远端蓝牙设备进行应用协议匹配的交互过程。交互可以由智能手机端或者远端蓝牙设备发起。下文中称应用层协议为profile。图5是根据本实施例提供的交互流程图,具体地以AVRCP协议匹配为例简要说明下全过程:
步骤S501:根据应用层协议的应用场景开启交互流程。
步骤S502:该步骤中智能手机会获取远端设备的AVRCP版本信息。具体地,智能手机向远端蓝牙设备发起请求获取远端机器的AVRCP版本,包括但不限于AVRCP的版本号。
步骤S503:此步骤智能手机将获取协议对应的特征Feature并生成特征信息。具体地,智能手机向远端机器发起获取此机器上AVRCP所支持的Feature信息,并生成Feature标志信息,标志信息由四个字节组成,并规定每一个bit位代表某一Feature,若远端机器支持该Feature则对应bit位置为1,若不支持则置为0。四字节共可代表32项Feature这对于蓝牙应用层各协议已经足够,存储该Feature标志信息待用,图4是根据本实施例的特征信息表的示意图。
步骤S504:此步骤生成AVRCP某一标准版本的Feature掩码,具体地,由步骤S402得到的AVRCP版本号,选取此标准版本所必须支持的部分代表性Feature,生成对应的Feature掩码,Feature掩码也由四个字节组成并且每一位所代表的Feature与S503中的一致,如某一个Feature被选中则对应Feature掩码的bit位置为1否则置为0。
步骤S505:此步骤中完成自适应匹配过程,具体地,用Feature掩码和生成的远端设备的Feature标志信息进行按位与操作,所得到的结果转成十六进制,如果此十六进制数与Feature掩码所代表的十六进制数相等,即代表Feature掩码中要求支持的Feature项远端机器均支持,此时判定为自适应匹配成功,否则为不成功。并且若Feature掩码有效位(即所有置1的bit位)的总数小于Feature标志信息的有效位则在S508中提升协议版本,反之则降低。
步骤S506:此步骤用于判断自适应是否结束。具体地,因为每个应用层协议的版本数不同,且常用的版本数也不同,这里根据具体的每一个应用层协议预先设置好阈值,判断自适应匹配的轮次是否超过了规定的阈值,比如AVRCP协议常用的版本有四个,则AVRCP协议的阈值即为四。若超出则进入正常流程,若未超出则进入下一个步骤S507。
步骤S507:该步骤用于计算设备“黑度”和“相似度”。黑度是设备存在问题程度的刻画,相似度是对设备中的某一协议与对应的标准协议匹配程度的刻画。具体地,由自适应匹配执行的轮次数来标记此设备“黑色”的程度即为黑度,数值越大则“黑色”程度越大,越说明此设备存在的问题越大。在此基础上我们记录每一轮次Feature掩码和Feature标志信息按位与操作后的到结果中有效位的个数除以Feature掩码中的有效位个数作为相似度值,并对每一轮得到的相似度值进行排序,记录排列前三的相似度值和与之对应的AVRCP版本号,作为最后的相似度表格存储待用。
步骤S508:此步骤与步骤S505对应,具体地,根据步骤S505的计算结果调整下一轮次要向远端机器获取的AVRCP版本及相应的特征Feature,开始下一轮匹配,并进行步骤S503。
半自动匹配实施例
半自动匹配作为自适应匹配的补充主要基于两点考虑,1.是蓝牙是无线通信的一种,就可能存在数据包失真的情况,导致自适应匹配出错。2.实际的工作经验告诉技术人员有很多蓝牙设备提供的profile(即:应用层协议)信息及所支持的Feature信息不真实,这也会导致自适应匹配出错。本实施例描述了当远端设备的黑度超过了阈值也即自适应匹配失败,我们首先会根据自适应匹配过程中得到的相似度信息为用户自动选择一个版本然后进入正常流程并同时提示用户与此设备通信可能存在问题,如果用户在应用中发现确实存在问题,则引导用户到相应的UI接口中手动匹配。需要补充的是,半自动匹配实施例本申请文件中的一种技术方案,在移动终端确定了待连接终设备的特征信息,匹配出一个或多个蓝牙版本的情况下,但是与哪个蓝牙版本的相似度都不满足预设情况时,可以罗列出相似度较高的几个蓝牙版本,进行适当排序,可以引导用户选择二者使用哪个蓝牙版本进行连接,或者不连接,具体的如图8所示。
图8是根据一实施例的半自动匹配的流程示意图,具体地:
步骤S801:当远端设备的黑色程度超过阈值,也即自适应匹配失败。黑度是设备存在问题程度的刻画,相似度是对设备中的某一协议与对应的标准协议匹配程度的刻画。具体地,由自适应匹配执行的轮次数来标记此设备“黑色”的程度即为黑度,数值越大则“黑色”程度越大,越说明此设备存在的问题越大。
需要补充的是,在步骤S801之前,移动终端已经确定了多个蓝牙版本与待连接设备的多个相似度,记录在相似度表格中。具体的分别使用多个蓝牙版本确定相似度的方案,与之前可选实施例记载的确定相似度的方案是相同的。
步骤S802:此步骤中会判断自适应匹配中生成的相似度表格是否规则。具体地,预先规定排第一的相似度值必须比排第二、第三的相似度值都大则为规则,否则为不规则。图6是根据实施例的规则相似度表格示意图,如图6所示。
步骤S803:当S802中判断为规则相似度表格,由自适应匹配中计算得到的相似度信息,为用户自动选择排在第一的AVRCP协议版本。如下图所示,以AVRCP协议为例。自适应匹配步骤S807会得到以下结果,其中为用户选择排第一的AVRCP1.3版本。
步骤S804:提示用户与此设备通信可能会存在问题,并提供调转到手动匹配界面的菜单。
步骤S805:若用户点击了跳转菜单,则进入到手动匹配菜单界面,手动匹配界面中将为用户准备两项可选的协议版本,具体的为相似度表中排第二和第三的版本供用户选择,且相似度大的排在前,相似度低的排在后,若用户未点击则进入正常流程。接上一个步骤中的例子,图7是根据一实施例的呈现至用户的界面示意图。
步骤S806:进入手动匹配界面,该界面向用户呈现智能终端测所支持的所有AVRCP版本按钮,用户每点击一个按钮,智能终端则将AVRCP设置成对应的版本。
上述步骤804至步骤S806的步骤可以相当于上述可选实施例中接收输入的选择信息,其中,所述选择信息用于在相似度大于预设值的多个版本中确定所述连接版本;所述移动终端使用所述连接版本连接至所述待连接设备。
手动匹配实施例
手动匹配作为半自动匹配的补充主要基于两点考虑,1.根据工作经验,实际上会存在这样的情况,由于蓝牙标准公开,门槛较低,一些厂商会选择性挑选好几个版本的某几个Feature,比如说某设备选取AVRCP1.3四个Feature,AVRCP1.4四个Feature,AVRCP1.5四个Feature,从而形成一个杂糅的版本。2.作为一个成熟的控制流程必须考虑到各种可能的情况,半自动匹配中规定相似度表格中排第一的要比第二、第三都大才是规则的,而理论上则存在各种各样的可能,将其他各种非规则的情况都在手动匹配中处理。本实施例描述了当远端设备的黑度超过了阈值也即自适应匹配失败,首先会判断相似度表格是否规则,如果不规则,则进入手动匹配流程,该流程直接向用户呈现相似度表格中的各个版本,由用户手动选择其中的一个。如通信中存在问题,用户可以再次进入手动界面选择其他项。
上述描述可以对应于实施例一中的步骤S206,所述移动终端可以是使用用户选择的连接版本连接至所述待连接设备。需要补充的是,手动匹配实施例本申请文件中的一种技术方案,在移动终端确定了待连接终设备的特征信息,匹配出一个或多个蓝牙版本,但是与哪个蓝牙版本的相似度都不满足预设情况时,可以由用户选择二者使用哪个蓝牙版本进行连接,或者不连接,具体的如图9所示。
图9是根据一实施例的手动匹配的流程示意图,具体地:
步骤S901:当远端设备的黑色程度超过阈值,也即自适应匹配失败。黑度是设备存在问题程度的刻画,相似度是对设备中的某一协议与对应的标准协议匹配程度的刻画。具体地,由自适应匹配执行的轮次数来标记此设备“黑色”的程度即为黑度,数值越大则“黑色”程度越大,越说明此设备存在的问题越大。具体的确定某个蓝牙版本与远端设备的相似度的方案与之前可选实施例记载的方案可以是相同的,
步骤S902:此步骤中我们会判断自适应匹配中生成的相似度表格是否规则。如不规则进入步骤S903。
步骤S903:首先提示用户通信异常自适应匹配失败,需要手动匹配。
步骤S904:直接跳转到手动匹配界面,该界面向用户呈现相似度表格中的三个协议版本供用户选择,顺序与相似度表格一致。
上述步骤903至步骤S904的步骤可以相当于上述可选实施例中接收输入的选择信息,其中,所述选择信息用于在相似度大于预设值的多个版本中确定所述连接版本;所述移动终端使用所述连接版本连接至所述待连接设备。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。
实施例二
在本实施例中还提供了一种蓝牙连接装置,该装置用于实现上述实施例及实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
根据本公开的另一个实施例,还提供了一种蓝牙连接装置,包括:
获取模块,用于获取待连接设备的蓝牙协议的版本的特征信息;
确定模块,用于依据所述特征信息确定所述移动终端需要使用的连接版本;
连接模块,用于使用所述连接版本连接至所述待连接设备。
需要补充的是,实施例一中可以由移动终端执行的方法步骤,均可以由蓝牙连接装置执行。
可选地,所述获取模块还用于将所述待连接设备预先上报的第一版本确定为所述待连接设备的版本;按照所述第一版本的预设待请求参数获取所述待连接设备的特征信息。
可选地,所述确定模块还用于生成与所述第一版本的标准版本对应的第一特征掩码;获取所述第一特征掩码和所述特征信息的第一相似度;在确定所述第一相似度符合预设情况时,确定所述第一版本的标准版本为所述连接版本。
可选地,所述确定模块还用于在确定所述第一相似度不符合预设情况之后,按照所述蓝牙协议的第N版本的预设待请求参数获取所述待连接设备的第N特征信息;获取所述第N版本的第N特征掩码和所述第N特征信息的第N相似度;在确定所述第N相似度符合预设情况时,确定所述第N版本的标准版本为所述连接版本;其中,N为不等于1的正整数。
可选地,所述确定模块还用于通过以下方式确定所述第N版本:在所述第一特征掩码的有效位个数小于所述特征信息的有效位个数的情况下,确定版本级别高于所述第一版本的版本为所述第N版本,其中,每个有效位用于表示设备支持或者协议要求设备支持对应的特征。
可选地,重复次数小于等于所述蓝牙协议的版本数,其中,所述重复次数是依据不同标准版本的特征掩码和待连接设备上传的特征信息获取相似度,然后依据所述相似度确定连接版本的过程的次数。
可选地,所述确定模块还用于存储所述重复次数,其中,所述重复次数越大,所述待连接设备连接至所述移动终端的成功率越低;在所述重复次数大于阈值时,所述方法还包括:接收输入的选择信息,其中,所述选择信息用于在相似度大于预设值的多个版本中确定所述连接版本;所述移动终端使用所述连接版本连接至所述待连接设备。
可选地,所述确定模块还用于通过以下方式确定所述特征掩码和特征信息的相似度:将所述特征掩码和所述特征信息进行按位与操作,获取按位与操作后的结果的有效位个数;将所述结果中的有效位个数除以所述特征掩码的有效位个数得到所述相似度。
可选地,所述获取模块还用于获取待连接设备的应用层协议剖面profile的版本的特征信息。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
实施例三
根据本公开的另一个实施例,还提供了一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行上述可选实施例任一项中所述的方法。
实施例四
根据本公开的另一个实施例,还提供了一种存储介质,所述存储介质包括存储的程序,其中,所述程序运行时执行上述可选实施例任一项中所述的方法。
显然,本领域的技术人员应该明白,上述的本公开的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本公开不限制于任何特定的硬件和软件结合。
以上所述仅为本公开的实施例而已,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。
本公开适用于通信领域,用以解决相关技术中由于蓝牙版本较多,且分别进行更新导致的设备之间的蓝牙连接流程复杂的问题,在确定待连接设备的蓝牙版本之后,移动终端使用对应的版本进行连接,保证了蓝牙连接的稳定性。
Claims (14)
- 一种蓝牙连接方法,包括:移动终端获取待连接设备的蓝牙协议的版本的特征信息;依据所述特征信息确定所述移动终端需要使用的连接版本;所述移动终端使用所述连接版本连接至所述待连接设备。
- 根据权利要求1所述的方法,其中,移动终端获取待连接设备的蓝牙协议的版本的特征信息,包括:所述移动终端将所述待连接设备预先上报的第一版本确定为所述待连接设备的版本;所述移动终端按照所述第一版本的预设待请求参数获取所述待连接设备的第一特征信息。
- 根据权利要求2所述的方法,其中,依据所述特征信息确定所述移动终端需要使用的连接版本,包括:生成与所述第一版本的标准版本对应的第一特征掩码;获取所述第一特征掩码和所述第一特征信息之间的第一相似度;在确定所述第一相似度符合预设情况时,确定所述第一版本的标准版本为所述连接版本。
- 根据权利要求3所述的方法,其中,在确定所述第一相似度不符合预设情况之后,移动终端依据预设规则,依次选取蓝牙协议中非所述第一版本的蓝牙版本为第N版本,每次均执行以下确定步骤:依据所述第N版本的预设待请求参数获取所述待连接设备的第N特征信息;获取所述第N版本标准版本的第N特征掩码和所述第N特征信息之间的第N相似度;在确定所述第N相似度符合预设情况时,确定所述第N版本的标准版本为所述连接版本;在确定所述第N相似度不符合预设情况时,所述移动终端依据所述预设规则选取第(N+1)版本为所述第N版本,重复执行上述确定步骤;其中,所述第(N+1)版本和所述第N版本用于表示两个不同的蓝牙版本,N为大于2的整数。
- 根据权利要求4所述的方法,其中,所述移动终端通过以下方式确定所述第N版本:在所述第一特征掩码的有效位个数小于所述特征信息的有效位个数的情况下,确定版本级别高于所述第一版本的版本为所述第N版本,其中,每个有效位用于表示设备支持或者协议要求设备支持对应的特征。
- 根据权利要求4所述的方法,其中,所述蓝牙协议的版本数,与所述移动终端选取第N版本执行所述确定步骤的重复次数的差值小于等于1。
- 根据权利要求6所述的方法,其中,移动终端存储所述重复次数,其中,所述重复次数越大,所述待连接设备连接至所述移动终端的成功率越低;在所述重复次数大于阈值时,所述方法还包括:接收输入的选择信息,其中,所述选择信息用于在相似度大于预设值的多个版本中确定所述连接版本;所述移动终端使用所述连接版本连接至所述待连接设备。
- 根据权利要求3至7任一项所述的方法,其中,所述移动终端通过以下方式确定所述特征掩码和特征信息的相似度:将所述特征掩码和所述特征信息进行按位与操作,获取按位与操作后的结果的有效位个数;将所述结果中的有效位个数除以所述特征掩码的有效位个数得到所述相似度。
- 根据权利要求1所述的方法,其中,移动终端获取待连接设备的蓝牙协议的版本的特征信息,包括:所述移动终端获取待连接设备的应用层协议剖面profile的版本的特征信息。
- 一种蓝牙连接装置,包括:获取模块,设置为获取待连接设备的蓝牙协议的版本的特征信息;确定模块,设置为依据所述特征信息确定需要使用的连接版本;连接模块,设置为使用所述连接版本连接至所述待连接设备。
- 根据权利要求10所述的装置,其中,所述获取模块还设置为将所述待连接设备预先上报的第一版本确定为所述待连接设备的版本;以及按照所述第一版本的预设待请求参数获取所述待连接设备的特征信息。
- 根据权利要求10所述的装置,其中,所述获取模块还设置为获取待连接设备的应用层协议剖面profile的版本的特征信息。
- 一种存储介质,其中,所述存储介质包括存储的程序,其中,所述程序运行时执行上述权利要求1至9任一项中所述的方法。
- 一种处理器,其中,所述处理器用于运行程序,其中,所述程序运行时执行上述权利要求1至9任一项中所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711351390.7A CN108206997B (zh) | 2017-12-15 | 2017-12-15 | 蓝牙连接方法及装置 |
| CN201711351390.7 | 2017-12-15 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019114303A1 true WO2019114303A1 (zh) | 2019-06-20 |
Family
ID=62603877
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/100625 Ceased WO2019114303A1 (zh) | 2017-12-15 | 2018-08-15 | 蓝牙连接方法及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN108206997B (zh) |
| WO (1) | WO2019114303A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110730439A (zh) * | 2019-09-02 | 2020-01-24 | 苏宁智能终端有限公司 | 一种动态连接蓝牙设备的方法及装置 |
| CN119277354A (zh) * | 2024-03-13 | 2025-01-07 | 荣耀终端有限公司 | 一种蓝牙连接方法、电子设备及计算机可读存储介质 |
Families Citing this family (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108206997B (zh) * | 2017-12-15 | 2022-03-01 | 中兴通讯股份有限公司 | 蓝牙连接方法及装置 |
| CN109495871B (zh) * | 2018-12-20 | 2022-02-18 | Oppo广东移动通信有限公司 | 蓝牙连接控制方法、电子装置及计算机可读存储介质 |
| CN109842873A (zh) * | 2019-01-29 | 2019-06-04 | 深圳市海派通讯科技有限公司 | 基于移动设备间蓝牙连接的立体声播放方法 |
| JP7140719B2 (ja) * | 2019-07-04 | 2022-09-21 | アンリツ株式会社 | 測定装置及び測定方法 |
| CN110460984B (zh) * | 2019-08-16 | 2022-07-01 | 中科微电技术(深圳)有限公司 | 基于分布式存储的多蓝牙控制方法、系统、终端及存储 |
| CN111954039B (zh) * | 2020-07-02 | 2022-07-01 | 深圳市华曦达科技股份有限公司 | 机顶盒蓝牙配置方法、装置、电子设备及存储介质 |
| CN111741457B (zh) * | 2020-07-16 | 2023-06-09 | Oppo广东移动通信有限公司 | 一种蓝牙通讯方法、装置及计算机可读存储介质 |
| CN114339696A (zh) * | 2020-09-30 | 2022-04-12 | 华为技术有限公司 | 蓝牙通信系统、蓝牙连接方法、电子设备及存储介质 |
| CN112929862B (zh) * | 2021-02-04 | 2023-04-25 | 青岛海信传媒网络技术有限公司 | 基于蓝牙Beacon协议的设备连接方法 |
| CN113301113B (zh) * | 2021-04-12 | 2022-06-10 | 荣耀终端有限公司 | 一种profile版本确定方法、系统、电子设备及计算机存储介质 |
| CN116489629B (zh) * | 2023-03-31 | 2024-01-12 | 珠海市蓝辰科技有限公司 | 蓝牙音频数据的传输方法、装置、设备及介质 |
| CN117793684B (zh) * | 2024-02-28 | 2024-05-14 | 深圳市星迈科技有限公司 | 一种蓝牙智能设备接入app的处理方法、系统及介质 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101668315A (zh) * | 2009-10-12 | 2010-03-10 | 上海华为技术有限公司 | 对不同协议版本的网元进行操作的方法及装置 |
| US20130029596A1 (en) * | 2011-07-29 | 2013-01-31 | Motorola Solutions, Inc. | Pairing devices using data exchanged in an out-of-band channel |
| CN106211361A (zh) * | 2016-08-01 | 2016-12-07 | 惠州Tcl移动通信有限公司 | 一种移动终端蓝牙兼容处理方法及系统 |
| CN106612130A (zh) * | 2015-10-26 | 2017-05-03 | 现代自动车株式会社 | 解决蓝牙兼容性问题的方法和装置 |
| CN106878917A (zh) * | 2015-12-11 | 2017-06-20 | 比亚迪股份有限公司 | 信息的传输控制方法、系统、终端和数据采集器 |
| CN108206997A (zh) * | 2017-12-15 | 2018-06-26 | 中兴通讯股份有限公司 | 蓝牙连接方法及装置 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20090098113A (ko) * | 2008-03-13 | 2009-09-17 | 삼성전자주식회사 | 블루투스 통신의 에러 방지 방법 및 장치 |
| CN105159284B (zh) * | 2015-09-10 | 2018-02-02 | 上海工程技术大学 | 一种汽车发动机故障诊断与标定设备 |
| CN105978606B (zh) * | 2016-07-22 | 2018-11-16 | 青岛海信电器股份有限公司 | 蓝牙设备远程通信方法、蓝牙设备及客户端 |
-
2017
- 2017-12-15 CN CN201711351390.7A patent/CN108206997B/zh active Active
-
2018
- 2018-08-15 WO PCT/CN2018/100625 patent/WO2019114303A1/zh not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101668315A (zh) * | 2009-10-12 | 2010-03-10 | 上海华为技术有限公司 | 对不同协议版本的网元进行操作的方法及装置 |
| US20130029596A1 (en) * | 2011-07-29 | 2013-01-31 | Motorola Solutions, Inc. | Pairing devices using data exchanged in an out-of-band channel |
| CN106612130A (zh) * | 2015-10-26 | 2017-05-03 | 现代自动车株式会社 | 解决蓝牙兼容性问题的方法和装置 |
| CN106878917A (zh) * | 2015-12-11 | 2017-06-20 | 比亚迪股份有限公司 | 信息的传输控制方法、系统、终端和数据采集器 |
| CN106211361A (zh) * | 2016-08-01 | 2016-12-07 | 惠州Tcl移动通信有限公司 | 一种移动终端蓝牙兼容处理方法及系统 |
| CN108206997A (zh) * | 2017-12-15 | 2018-06-26 | 中兴通讯股份有限公司 | 蓝牙连接方法及装置 |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110730439A (zh) * | 2019-09-02 | 2020-01-24 | 苏宁智能终端有限公司 | 一种动态连接蓝牙设备的方法及装置 |
| CN110730439B (zh) * | 2019-09-02 | 2022-09-20 | 苏宁智能终端有限公司 | 一种动态连接蓝牙设备的方法及装置 |
| CN119277354A (zh) * | 2024-03-13 | 2025-01-07 | 荣耀终端有限公司 | 一种蓝牙连接方法、电子设备及计算机可读存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108206997B (zh) | 2022-03-01 |
| CN108206997A (zh) | 2018-06-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2019114303A1 (zh) | 蓝牙连接方法及装置 | |
| US11816980B2 (en) | Method of pairing a remote control | |
| US10728796B2 (en) | Method for bluetooth communication, bluetooth system and electronic device | |
| CN112752324B (zh) | 智能设备的配网方法、装置、系统、电子设备及存储介质 | |
| CN108255653A (zh) | 一种产品的测试方法及其终端 | |
| CN112566078A (zh) | 设备连接方法及装置、存储介质及电子装置 | |
| WO2015143794A1 (zh) | 制作、升级方法及服务器、终端、升级系统和存储介质 | |
| CN113794602B (zh) | 一种设备测试方法、装置、终端设备和存储介质 | |
| CN105022687A (zh) | 自动化测试方案中滑动操作的实现方法及装置 | |
| WO2021042612A1 (zh) | 无线投屏方法、装置、设备及存储介质 | |
| CN106843990A (zh) | 一种应用程序管控方法和装置 | |
| CN112351471A (zh) | 设备接入网关的方法、网关设备及计算机可读存储介质 | |
| CN113285810A (zh) | 目标设备的登录方法及装置、存储介质及电子装置 | |
| CN110446197B (zh) | 一种智能设备的通信控制方法、装置、设备及存储介质 | |
| CN106101378B (zh) | 一种应用防沉迷的方法、装置以移动终端 | |
| CN115314427B (zh) | 一种协议测试方法、电子设备及芯片系统 | |
| CN106792474A (zh) | 音频蓝牙配对连接方法、装置及系统 | |
| CN117750371A (zh) | 一种无线网络接入方法、系统和终端设备 | |
| CN108259972B (zh) | 播放场景的显示控制方法及播放设备和介质产品 | |
| CN116015319A (zh) | 数传电台的抗同频干扰方法、发射机、接收机及系统 | |
| US20180219727A1 (en) | Method and apparatus for terminal configuration management | |
| CN108712497B (zh) | 应用模式共享方法、装置及系统 | |
| CN115134794A (zh) | 设备配对方法、装置、遥控设备及存储介质 | |
| EP4055891B1 (en) | Wireless network access point and method for operation thereof | |
| EP3958505A1 (en) | Information configuration method and apparatus, electronic equipment, storage medium, and program product |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18888891 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 10/11/2020) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18888891 Country of ref document: EP Kind code of ref document: A1 |