WO2022068517A1 - 蓝牙通信系统、蓝牙连接方法、电子设备及存储介质 - Google Patents

蓝牙通信系统、蓝牙连接方法、电子设备及存储介质 Download PDF

Info

Publication number
WO2022068517A1
WO2022068517A1 PCT/CN2021/116264 CN2021116264W WO2022068517A1 WO 2022068517 A1 WO2022068517 A1 WO 2022068517A1 CN 2021116264 W CN2021116264 W CN 2021116264W WO 2022068517 A1 WO2022068517 A1 WO 2022068517A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
bluetooth connection
parameter
information
bluetooth
Prior art date
Application number
PCT/CN2021/116264
Other languages
English (en)
French (fr)
Inventor
倪观军
朱宇洪
张小强
苏炯金
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP21874178.3A priority Critical patent/EP4210362A4/en
Publication of WO2022068517A1 publication Critical patent/WO2022068517A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W92/00Interfaces specially adapted for wireless communication networks
    • H04W92/16Interfaces between hierarchically similar devices
    • H04W92/18Interfaces between hierarchically similar devices between terminal devices

Definitions

  • the present application relates to the field of communication technologies, and more particularly to a Bluetooth communication system, a Bluetooth connection method, an electronic device and a storage medium in the communication field.
  • the two devices in order to ensure that different electronic devices can establish a connection with each other, the two devices usually need to negotiate parameters and exchange information according to a standard protocol process, and then establish a connection according to the negotiated information.
  • the present application provides a Bluetooth communication system, a Bluetooth connection method, an electronic device and a storage medium, which can solve the problem of long Bluetooth connection delay caused by parameter negotiation and information exchange in the Bluetooth connection process in the related art.
  • the present application provides a Bluetooth connection method, the method is applied to a Bluetooth communication system, the Bluetooth communication system includes a first electronic device and a second electronic device, and the method includes: the first electronic device sends a The second electronic device sends first version information of the first electronic device, where the first version information is used to indicate the version of the first electronic device; the first electronic device receives the confirmation sent by the second electronic device information, the confirmation information is used to indicate that the version of the second electronic device is the same as the version of the first electronic device; the first electronic device establishes a Bluetooth connection with the second electronic device according to the first Bluetooth connection parameter ; wherein, the first Bluetooth connection parameter is a Bluetooth connection parameter corresponding to the version of the first electronic device.
  • the Bluetooth connection parameters of the second electronic device are the same as the Bluetooth connection parameters of the first electronic device, so that the first electronic device learns that the versions of the two devices are the same , you can directly call the Bluetooth connection parameters shared by the two devices locally to establish a Bluetooth connection.
  • a paging establishment procedure needs to be completed between the two devices first.
  • the method further includes:
  • the first electronic device receives the first parameter change indication information sent by the second electronic device, the first parameter The change indication information is used to indicate the content of the change of the Bluetooth connection parameter of the second electronic device;
  • the first electronic device determines information used for establishing a Bluetooth connection with the second electronic device according to the first parameter change indication information.
  • the two devices can first determine whether the information of the opposite device has changed from the information used in the last connection. , if the information of the peer device changes, exchange the changed information to establish a connection; if the information of the peer device does not change, no need to exchange information, and directly call the stored information of the peer device to establish a connection.
  • the first electronic device determines information used to establish a Bluetooth connection with the second electronic device according to the first parameter change indication information, including:
  • the first electronic device determines the change content according to the stored Bluetooth connection parameters of the second electronic device and the change content indicated by the first parameter change instruction information. Describe the second Bluetooth connection parameters of the second electronic device;
  • the first electronic device establishes a Bluetooth connection with the second electronic device according to the first Bluetooth connection parameter and the second Bluetooth connection parameter.
  • the first electronic device determines the second Bluetooth connection parameter of the second electronic device according to the stored Bluetooth connection parameter of the second electronic device and the change content indicated by the first parameter change instruction information, including:
  • the first electronic device updates the stored Bluetooth connection parameters of the second electronic device using the modification content indicated by the first parameter modification instruction information to obtain the latest second Bluetooth connection parameters of the second electronic device.
  • the first electronic device determines, according to the first parameter change indication information, information used to establish a Bluetooth connection with the second electronic device, including:
  • the first electronic device locally obtains the stored Bluetooth connection parameters of the second electronic device from the first electronic device;
  • the first electronic device establishes a Bluetooth connection with the second electronic device according to the first Bluetooth connection parameter and the stored Bluetooth connection parameter of the second electronic device.
  • the two devices do not need to exchange information, and can directly call the stored information of the opposite device to establish a connection. In this way, the information exchange link in the Bluetooth connection process can be simplified, and the Bluetooth connection speed can be improved.
  • the second electronic device is further configured to: the first parameter change indication information is information obtained by marking with a mask marking method.
  • both devices can identify the changed information or nodes of the local device, and then the two devices exchange information identification, so that when a connection is established, the two devices can identify which information has changed based on the information identification, and renegotiate for the changed information.
  • the present application can simplify the connection establishment process, improve the Bluetooth connection speed, and avoid waste of air interface interaction resources.
  • the method further includes:
  • the first electronic device sends a second request message to the second electronic device, the second request message includes the Describe the first Bluetooth connection parameters of the first electronic device;
  • the first electronic device receives a second response message sent by the second electronic device, where the second response message includes a second Bluetooth connection parameter of the second electronic device;
  • the first electronic device establishes a Bluetooth connection with the second electronic device according to the first Bluetooth connection parameter and the second Bluetooth connection parameter.
  • the two devices can directly obtain the Bluetooth connection parameters of the other device from the local device without exchanging the Bluetooth connection parameters, and then the Bluetooth connection can be established without re-going A process of parameter negotiation and information exchange. If the versions of the Bluetooth communication protocol supported by the two devices are different, the two devices can establish a connection after exchanging information according to the traditional protocol standard process. In this way, the solution of the present application can simplify the information interaction link in the Bluetooth connection process, and improve the Bluetooth connection speed.
  • the sending, by the first electronic device, the first version information of the first electronic device to the second electronic device includes: the first electronic device sending the second electronic device a first request message, where the first request message includes the first version information;
  • the receiving, by the first electronic device, the confirmation information sent by the second electronic device includes: receiving, by the first electronic device, a first response message sent by the second electronic device to the first request message, The first response message includes the confirmation information.
  • the first Bluetooth connection parameter is a static parameter; the method further includes:
  • the first electronic device sends the dynamically changed third Bluetooth connection parameter of the first electronic device to the second electronic device; the first electronic device receives the second electronic device sent by the second electronic device
  • the fourth Bluetooth connection parameter of the device that changes dynamically; the first electronic device establishes with the second electronic device according to the first Bluetooth connection parameter, the third Bluetooth connection parameter and the fourth Bluetooth connection parameter Bluetooth connection.
  • the first aspect introduces the process of establishing a Bluetooth connection in different ways when the two devices have the same version and in different versions.
  • the two devices may also need to negotiate some dynamically changing parameters when connecting, such as connection establishment request, clock, frequency hopping parameters, etc. For these dynamically changing information and operations, the two devices can follow the normal process. interact.
  • the present application provides another Bluetooth connection method, the method comprising:
  • the first electronic device receives the first parameter change indication information sent by the second electronic device, where the first parameter change indication information is used to indicate the content of the change of the first Bluetooth connection parameter of the second electronic device;
  • the first electronic device determines the second parameter according to the stored first Bluetooth connection parameter and the changed content indicated by the first parameter change indication information the second Bluetooth connection parameter of the electronic device;
  • the first electronic device establishes a Bluetooth connection with the second electronic device according to the second Bluetooth connection parameter of the second electronic device and the third Bluetooth connection parameter of the first electronic device.
  • the above-mentioned third Bluetooth connection parameter is a Bluetooth connection parameter corresponding to the first electronic device stored locally by the first electronic device, and can be directly invoked locally from the first electronic device.
  • the first electronic device can acquire the changed Bluetooth connection parameters of the second electronic device, and use the Bluetooth connection parameters to store the first electronic device's stored first electronic device.
  • the Bluetooth connection parameters of the two electronic devices are updated.
  • the method before the first electronic device receives the first parameter change indication information sent by the second electronic device, the method further includes:
  • the first electronic device sends a first request message to the second electronic device, where the first request message is used to request to establish a Bluetooth connection with the second electronic device;
  • the first electronic device receives the first parameter change instruction information sent by the second electronic device, including:
  • the first electronic device receives the first response message to the first request message sent by the second electronic device, where the first response message includes the first parameter change indication information.
  • the local device can also send the local change information to the peer. device to instruct the peer device to refresh its stored information.
  • the two devices can interact with the information changing part when the connection is established, so that the connection establishment process can be simplified, the Bluetooth connection speed can be improved, and the waste of air interface interaction resources can be avoided.
  • the method further includes: when the first parameter change indication information indicates no content to be changed, the first electronic device connects according to the stored first Bluetooth connection parameters and the third Bluetooth connection parameter to establish a Bluetooth connection with the second electronic device.
  • the first parameter change indication information is information obtained by marking in a mask manner.
  • both devices can identify the changed information or node of the local device, and then the two devices exchange information identification, so that when establishing a connection, the two devices can identify which information has changed according to the information identification, and renegotiate the exchange for the changed information.
  • the present application can simplify the connection establishment process, improve the Bluetooth connection speed, and avoid waste of air interface interaction resources.
  • the method provided in the second aspect may be used to omit part of the connection interaction process.
  • a connection between non-peer devices other than a peer-to-peer device such as a TWS headset (eg, a headset is connected to a mobile phone)
  • the method provided in the second aspect may be used to omit part of the connection interaction process.
  • a Bluetooth connection combination such as a headset and a mobile phone
  • the peer information cannot be obtained before pairing, the information cannot be extracted locally according to the TWS binaural.
  • the pairing is established for the first time, after the exchange is established and negotiated according to the standard process, the static configuration and capability information of the peer end is obtained.
  • the local device records the information of the peer device.
  • connection When the connection is established next time, if the information of the peer device does not change, another negotiation exchange can be omitted; or part of the information of the peer device changes, then Only the changed information is exchanged to obtain all the parameters for the Bluetooth connection, and then the Bluetooth connection can be established, which can simplify the connection establishment process, improve the Bluetooth connection speed, and avoid the waste of air interface interaction resources.
  • the present application provides an electronic device, the electronic device comprising a unit for performing the method in the above-mentioned first aspect.
  • the electronic device may correspond to executing the method described in the first aspect.
  • the related description of the units in the electronic device please refer to the description of the first aspect, which is not repeated here for brevity.
  • the present application provides an electronic device comprising a unit for performing the method in the second aspect above.
  • the electronic device may correspond to executing the method described in the second aspect.
  • the units in the electronic device please refer to the description of the second aspect, which is not repeated here for brevity.
  • the present application provides a Bluetooth communication system, the Bluetooth communication system includes a first electronic device and a second electronic device;
  • the first electronic device configured to send first version information of the first electronic device to the second electronic device, where the first version information is used to indicate the version of the first electronic device;
  • the second electronic device is configured to receive the first version information sent by the first electronic device, and send the confirmation information to the first electronic device according to the first version information, and the confirmation The information is used to indicate that the version of the second electronic device is the same as the version of the first electronic device;
  • the first electronic device is further configured to receive the confirmation information sent by the second electronic device, and establish a Bluetooth connection with the second electronic device according to the first Bluetooth connection parameter;
  • the first Bluetooth connection parameter is a Bluetooth connection parameter corresponding to the version of the first electronic device.
  • the Bluetooth communication system corresponds to the method described in executing the method described in the first aspect.
  • the Bluetooth communication system corresponds to the method described in executing the method described in the first aspect.
  • the related description of the first electronic device and the second electronic device please refer to the description of the first aspect.
  • the description is omitted here. Repeat.
  • the present application further provides a Bluetooth communication system, the Bluetooth communication system includes a first electronic device and a second electronic device;
  • the second electronic device is configured to send first parameter change instruction information to the first electronic device, where the first parameter change instruction information is used to indicate the content of the change of the first Bluetooth connection parameter of the second electronic device ;
  • the first electronic device is configured to receive the first parameter change instruction information sent by the second electronic device, and according to the stored first Bluetooth connection parameter and the change content indicated by the first parameter change instruction information, determining a second Bluetooth connection parameter of the second electronic device;
  • the first electronic device is further configured to establish a Bluetooth connection with the second electronic device according to the second Bluetooth connection parameter of the second electronic device and the third Bluetooth connection parameter of the first electronic device.
  • the Bluetooth communication system corresponds to the method described in executing the method described in the second aspect.
  • the description of the first electronic device and the second electronic device please refer to the description of the second aspect.
  • the description is not repeated here. Repeat.
  • the present application provides an electronic device, the electronic device includes a processor, the processor is coupled with a memory, the memory is used for storing computer programs or instructions, and the processor is used for executing the computer programs or instructions stored in the memory, so that the first The methods of an aspect and any possible implementation thereof are performed.
  • the present application provides an electronic device, the electronic device includes a processor, the processor is coupled with a memory, the memory is used for storing computer programs or instructions, and the processor is used for executing the computer programs or instructions stored in the memory, so that the second The methods of an aspect and any possible implementation thereof are performed.
  • the present application provides a computer-readable storage medium on which a computer program (also referred to as instructions or codes) for implementing the method in the first aspect and/or the method in the second aspect is stored.
  • a computer program also referred to as instructions or codes
  • the computer program when executed by a computer, causes the computer to perform the method of the first aspect and any possible implementation thereof and/or the method of the second aspect and any possible implementation thereof.
  • the present application provides a chip (eg, a Bluetooth chip) including a processor.
  • the processor is configured to read and execute the computer program stored in the memory to perform the method of the first aspect and any possible implementation thereof and/or the method of the second aspect and any possible implementation thereof.
  • the chip further includes a memory, and the memory is connected to the processor through a circuit or a wire.
  • the present application provides a chip system including a processor.
  • the processor is configured to read and execute the computer program stored in the memory to perform the method of the first aspect and any possible implementation thereof and/or the method of the second aspect and any possible implementation thereof.
  • the electronic device When the electronic device is a chip system, it may be composed of a chip (eg, a Bluetooth chip), or may include a chip and other discrete devices.
  • a chip eg, a Bluetooth chip
  • the electronic device may be composed of a chip (eg, a Bluetooth chip), or may include a chip and other discrete devices.
  • the present application provides a computer program product, the computer program product comprising a computer program (also referred to as instructions or code) that, when executed by a computer, causes the computer to implement the first aspect and the same.
  • a computer program also referred to as instructions or code
  • FIG. 1 is a schematic diagram of a system architecture provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a Bluetooth protocol architecture provided by an embodiment of the present application.
  • FIG. 3 is one of the schematic flowcharts of a Bluetooth connection method provided by an embodiment of the present application.
  • FIG. 4 is a second schematic flowchart of a Bluetooth connection method provided by an embodiment of the present application.
  • FIG. 5 is a third schematic flowchart of a Bluetooth connection method provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of device pairing in a Bluetooth connection method provided by an embodiment of the present application.
  • FIG. 7 is a fourth schematic flowchart of a Bluetooth connection method provided by an embodiment of the present application.
  • FIG. 8 is one of the schematic structural block diagrams of an electronic device provided by an embodiment of the present application.
  • FIG. 9 is the second schematic structural block diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of hardware of an electronic device provided by an embodiment of the present application.
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • FIG. 1 shows a schematic diagram of the architecture of a communication system involved in various exemplary embodiments of the present application.
  • the communication system 100 may include a plurality of electronic devices supporting wireless communication technology.
  • the communication system 100 may include a Bluetooth headset 11 and a mobile phone 12, wherein the Bluetooth headset 11 includes a first headset 01 and a second headset 02, and a wireless connection can be established and maintained between the Bluetooth headset 11 and the mobile phone 12 through wireless communication technology; in addition , the first earphone 01 and the second earphone 02 can also be used as independent electronic devices supporting wireless communication technology, and can establish and maintain a wireless connection with each other through wireless communication technology.
  • the communication system 100 may further include a mobile phone 13, and a wireless connection may be established and maintained between the mobile phone 12 and the mobile phone 13 through a wireless communication technology.
  • the above wireless communication technology may be Bluetooth (bluetooth, BT), such as traditional Bluetooth or low energy Bluetooth (bluetooth low energy, BLE), or a general 2.4G/5G frequency band wireless communication technology.
  • Bluetooth bluetooth, BT
  • BLE Bluetooth low energy Bluetooth
  • BLE Bluetooth low energy Bluetooth
  • the above communication system 100 may include a Bluetooth headset and a mobile phone as shown in FIG. 1, and of course may also include a tablet computer, a wireless speaker, a wireless wristband, a wireless vehicle, a wireless smart glasses, a wireless watch, an augmented reality (augmented reality) reality, AR)/virtual reality (VR) devices, media players (eg MP3, MP4, etc.), laptops, ultra-mobile personal computers (UMPC), personal digital assistants (personal digital assistants) , PDA), TV or smart watch and other electronic devices supporting wireless communication technology, the embodiment of the present application does not specifically limit the device type of the electronic device in the communication system 100 .
  • a wireless connection eg, a Bluetooth connection
  • an electronic device capable of supporting the Bluetooth function is also referred to as a Bluetooth device.
  • the Bluetooth headset may be of various types, such as earplug type, in-ear type, head-mounted type, earmuff type, or ear-hook type Bluetooth headset.
  • the Bluetooth headset may include a first part and a second part that are worn on the user's left ear and right ear respectively, and can be connected by a connecting line, such as a neckband Bluetooth headset; or two independent parts, such as a true wireless stereo (true wireless stereo). stereo, TWS) headphones.
  • the Bluetooth headset is a headset that supports the Bluetooth communication protocol.
  • the Bluetooth communication protocol can be a traditional Bluetooth protocol, and can also be a BLE low-power Bluetooth protocol; of course, it can also be other new Bluetooth protocol types introduced in the future.
  • the version of the Bluetooth communication protocol may be any of the following versions: 1.0 series version, 2.0 series version, 3.0 series version, 4.0 series version, and other series versions to be launched in the future.
  • the TWS headset 11 includes a first headset 01 and a second headset 02, and both the first headset 01 and the second headset 02 are provided with a Bluetooth module, and the first headset 01 and the second headset 02 are provided with Bluetooth modules.
  • the first earphone 01 and the second earphone 02 can perform data transmission through the Bluetooth protocol, wherein the versions of the Bluetooth communication protocol of the two earphones may be the same or may be different. From the appearance of the TWS earphone 11, there is no connecting line between the first earphone 01 and the second earphone 02, which has the advantages of being convenient to carry and easy to use.
  • both the first earphone 01 and the second earphone 02 may include microphones, that is, the first earphone 01 and the second earphone 02 have the function of audio collection in addition to the function of audio playback.
  • the user can use the TWS earphone 11 in binaural mode or monaural mode.
  • the user wears the first earphone 01 or the second earphone 02 to perform audio services such as listening to music or answering/calling.
  • binaural mode the user can wear the two earphones on the left and right ears respectively for audio services such as listening to music or answering/calling.
  • binaural mode the two earphones are divided into main earphones and sub earphones.
  • the main and auxiliary roles of the two earphones can also be switched based on different conditions.
  • the earphone with higher battery power can be switched to the main earphone, and the earphone with lower battery power can be switched to the secondary earphone; for another example, it is assumed that the user wears the first earphone 01 and the second earphone 02 and the first earphone 01 is the main earphone and the second earphone
  • the headset 02 is a secondary headset. If the user takes off the first headset 01, the second headset 02 can be switched from the secondary headset to the primary headset, and the first headset 01 can be switched from the primary headset to the secondary headset or stop working after a preset duration. Or simply stop working.
  • the main earphone and the mobile phone can be paired and paired with the mobile phone through information exchange and parameter negotiation.
  • a wireless connection is established to realize wireless communication and business processing between the main headset and the mobile phone through the wireless connection.
  • the mobile phone 12 and the first earphone 01 can establish a wireless connection through information exchange and parameter negotiation. If the mobile phone 12 initiates an audio service, the mobile phone 12 can send the audio signal to the first earphone 01, The first earphone 01 plays the audio signal after receiving the audio signal.
  • the main earphone and the auxiliary earphone can pass the Information exchange and parameter negotiation, pairing and establishing a wireless connection, so as to realize wireless communication and service processing between the main headset and the secondary headset through the wireless connection.
  • the main earphone and the auxiliary earphone can be paired and established wirelessly through information exchange and parameter negotiation, and the main earphone and the mobile phone can also be connected. Pairing and establishing a wireless connection can be done via wireless communication technology.
  • wireless connection, wireless communication and service processing between the mobile phone and the main earphone, and between the main earphone and the auxiliary earphone are realized.
  • the mobile phone 12 and the first headset 01 can establish a wireless connection through information exchange and parameter negotiation; similarly, the first headset 01 and the second headset 02 can establish a wireless connection through information exchange and parameter negotiation. connect.
  • the mobile phone 12 can send the audio signal to the first earphone 01, and the first earphone 01 sends the audio signal to the second earphone 02 after receiving the audio signal, so that the first earphone 01 and the second earphone 01
  • the headphones 02 play the audio signal respectively.
  • the Bluetooth headset may support one or more of the following applications: HSP (headset profile) application, HFP (hands-free profile) application, and A2DP (advanced audio distribution profile) application.
  • HSP headset profile
  • HFP hands-free profile
  • A2DP advanced audio distribution profile
  • the HSP application represents the headset application, which provides the basic functions required for communication between the mobile phone and the headset, and the Bluetooth headset can be used as the audio input and output interface of the mobile phone.
  • HFP application stands for hands-free application.
  • HFP application adds some extended functions on the basis of HSP application.
  • the Bluetooth headset can control the call process of the mobile phone, such as: answering, hanging up, rejecting, voice dialing, etc.
  • A2DP applications are advanced audio transmission applications that support the transmission of stereo audio streams.
  • the devices need to follow the Bluetooth protocol to realize Bluetooth connection and information exchange.
  • the protocol system of Bluetooth technology also adopts a layered structure, forming a Bluetooth protocol stack from the bottom layer to the high layer, and each layer protocol defines the completed functions and usage. Data packet format to ensure interoperability between Bluetooth products.
  • the core protocols of Bluetooth include baseband protocol, link management protocol LMP, logical link control and adaptation protocol L2CAP and service discovery protocol SDP.
  • FIG. 2 shows a schematic diagram of a Bluetooth protocol architecture. The following describes several Bluetooth protocols involved in the embodiments of the present application with reference to FIG. 2 , so as to facilitate the understanding of those skilled in the art.
  • the baseband protocol is a protocol between the baseband and the link control layer, which is used to ensure the physical connection composed of radio frequency between each Bluetooth device in the piconet.
  • the radio frequency system of Bluetooth is a frequency modulation system, and any packet is sent on a designated time slot and a designated frequency. It uses query and paging processes to synchronize the sending frequency and clock between different devices, and provides two physical connection methods for baseband data packets, namely synchronous connection oriented link (SCO) and asynchronous connectionless (ACL), and Multiple data transmission can be realized on the same radio frequency; SCO and extended SCO (eSCO) can be used to transmit communication data that requires high time.
  • ACL applies to data packets
  • SCO applies to voice and the combination of voice and data.
  • a special channel is allocated for different data types (including connection management information and control information).
  • Various user modes can be used to transmit voice between Bluetooth devices, and connection-oriented voice packets need only be transmitted through the baseband and do not reach the L2CAP.
  • the voice mode is relatively simple in the Bluetooth system, and the voice can be transmitted only by opening the Bluetooth voice connection.
  • LMP Link manager protocol
  • L2CAP Logical link control and adaptation protocol
  • L2CAP is the upper-layer protocol of the baseband protocol, it can be considered that it works in parallel with LMP, the difference between L2CAP and LMP is: when the service data does not pass through During LMP, L2CAP provides services for the upper layer.
  • L2CAP provides logical channels, called L2CAP channels.
  • L2CAP provides connection-oriented and connectionless data services to upper-layer protocols. It adopts multiplexing technology, segmentation and reorganization technology, and group extraction technology.
  • L2CAP allows high-level protocols to send and receive data packets with a length of 64k bytes.
  • the baseband protocol provides two connection types, SCO and ACL
  • L2CAP only supports ACL.
  • service discovery protocol (service discovery protocol, SDP)
  • SDP service discovery protocol
  • connection process between different electronic devices needs to be implemented according to the standard process of the protocol, and the standard process includes the process of information exchange between the two parties in the connection.
  • some parameter negotiation and information exchange need to be performed between electronic devices, such as LMP feature support, exchange of version specifications, etc., key parameter negotiation, and SDP service query.
  • SDP service query an L2CAP channel needs to be established first, and then the query is performed, and the process is time-consuming. Therefore, the above-mentioned process of interaction of connection information will take a certain amount of time during the Bluetooth connection process, resulting in a long delay in the Bluetooth connection. How to reduce the Bluetooth connection delay to improve user experience is a technical problem that needs to be solved.
  • the present application proposes a Bluetooth connection method based on the above system architecture, which can simplify the connection information exchange process between devices.
  • the Bluetooth connection method is applied to the Bluetooth communication system, the Bluetooth communication system includes a first electronic device and a second electronic device, and the present application establishes a Bluetooth connection between the first electronic device and the second electronic device through the Bluetooth connection method.
  • the peer device information that needs to be acquired and negotiated during the Bluetooth connection process is fixed or modifiable (semi-static change) during the device life cycle, the information can be regarded as known information if it does not change. There is no need to repeat negotiation and acquisition each time you connect.
  • the software and hardware of the two earphones are the same, so most of the static information or semi-static information of the two earphones are consistent. Therefore, this application provides the following two possible implementations to simplify Bluetooth The information exchange link in the connection process.
  • the embodiment of the present application provides a Bluetooth connection method.
  • a Bluetooth connection method When two electronic devices need to establish a Bluetooth connection, it is possible to first determine whether the versions of the two electronic devices are consistent, and further determine whether the Bluetooth connection parameters need to be exchanged: If the versions are the same and the Bluetooth connection parameters of the two devices are the same, you can directly obtain the Bluetooth connection parameters of the other device from the local device without exchanging Bluetooth connection parameters to establish a Bluetooth connection, which simplifies the information exchange in the Bluetooth connection process. link to improve the Bluetooth connection speed.
  • the embodiment of the present application provides another Bluetooth connection method.
  • two electronic devices need to establish a Bluetooth connection, it can first determine whether the Bluetooth connection parameters of the other device have changed, and further determine whether an interactive Bluetooth connection is required. Parameters or which Bluetooth connection parameters need to be exchanged: If the Bluetooth connection parameters of the other device have not changed, you can directly obtain the stored Bluetooth connection parameters of the other device from the local device without interacting with the Bluetooth connection parameters to establish a Bluetooth connection; if When the Bluetooth connection parameters of the other device change, only the changed information can be exchanged to establish a Bluetooth connection, which can simplify the information exchange link in the Bluetooth connection process and improve the Bluetooth connection speed.
  • the Bluetooth connection method provided by the first embodiment of the present application and the Bluetooth connection method provided by the first embodiment are respectively exemplarily described below with reference to the accompanying drawings.
  • FIG. 3 is a flowchart of a Bluetooth connection method according to the first embodiment of the present application. Referring to FIG. 3 , the method 300 includes the following steps S301-S305.
  • the first electronic device sends first version information to the second electronic device, and the second electronic device receives the first version information sent by the first electronic device.
  • the above-mentioned first version information may be used to indicate the version of the first electronic device.
  • the version of the electronic device mentioned here may refer to the version of the Bluetooth communication protocol supported or updated recently by the electronic device, such as version 1.0 series, version 2.0 series, version 3.0 series, version 4.0 series, or other series versions to be launched in the future.
  • the first version information of the first electronic device indicates that the Bluetooth communication protocol supported by the first electronic device is version 4.0 series.
  • the above-mentioned version of the electronic device may also refer to the system version or the software version of the electronic device, which may be specifically determined according to actual usage requirements, which is not limited in the embodiments of the present application.
  • the first electronic device when the first electronic device scans the second electronic device or discovers the second electronic device, the first electronic device may send the first version information to the second electronic device to initiate Bluetooth connection.
  • the above-mentioned process of scanning or discovery may be realized through Bluetooth communication technology, and the process of scanning or discovery is the process of establishing paging between the first electronic device and the second electronic device, or it may be realized through other wireless communication technologies (such as near- Field communication technology), which can be determined according to actual usage requirements, which is not limited in this embodiment of the present application.
  • the following takes an example of establishing a Bluetooth connection after the paging of both devices is completed.
  • the first electronic device not only sends the first version information to the second electronic device, but also instructs the second electronic device to determine whether the Bluetooth communication protocol versions of the first electronic device and the second electronic device are consistent.
  • the electronic device that initiates the connection may be referred to as the master device, and the device that accepts the connection may be referred to as the slave device.
  • the first electronic device sends the first version information to the second electronic device, which is equivalent to initiating a connection.
  • the first electronic device is the master device; the second electronic device receives the first version information and can act as a slave device.
  • the second electronic device determines whether the first version information and the second version information are the same.
  • the second version information is used to indicate the version of the second electronic device.
  • the description of the second version information reference may be made to the above-mentioned detailed description of the first version information, which will not be repeated here.
  • the Bluetooth communication protocol versions of the first headset and the second headset may be the same, for example, the Bluetooth communication protocols supported by the two headsets are both versions 4.0 series; or, the first headset and the second headset
  • the version of the Bluetooth communication protocol may also be different.
  • the Bluetooth communication protocol supported by the first headset is the 3.0 series version
  • the Bluetooth communication protocol supported by the second headset is the 4.0 series version.
  • the second electronic device may judge whether the version of the second electronic device is the same as the version of the first electronic device according to the first version information and the second version information, and then determine the subsequent execution steps according to the judgment result: On the one hand, if the second electronic device determines that the first version information is the same as the second version information, that is, the two Bluetooth devices support the same version of the Bluetooth communication protocol, then continue to perform the following steps S303-S305; on the other hand, if The second electronic device determines that the first version information is different from the second version information, that is, the versions of the Bluetooth communication protocol supported by the two Bluetooth devices are different, and then continues to execute the following step S307 or S311.
  • the second electronic device sends confirmation information to the first electronic device, and the first electronic device receives the confirmation information sent by the second electronic device.
  • the confirmation information is used to indicate that the version of the second electronic device is the same as the version of the first electronic device. If the version of the first electronic device is the same as the version of the second electronic device, and the Bluetooth connection parameters corresponding to the same version are the same, the Bluetooth connection parameters stored locally by the first electronic device are the same as the Bluetooth connection parameters stored locally by the second electronic device, which is For convenience of description, the Bluetooth connection parameter corresponding to the same version is referred to as the first Bluetooth connection parameter in the first embodiment below.
  • the first electronic device locally obtains the first Bluetooth connection parameter from the first electronic device
  • the second electronic device locally obtains the first Bluetooth connection parameter from the second electronic device.
  • the first Bluetooth connection parameter is a Bluetooth connection parameter corresponding to the version of the first electronic device.
  • the first electronic device and the second electronic device establish a Bluetooth connection according to the first Bluetooth connection parameter.
  • the Bluetooth connection parameters of the two devices are the same, there is no need to exchange Bluetooth connection parameters, for example, there is no need to exchange LMP feature support and version specifications, and there is no need to perform SDP service query. It can directly obtain the Bluetooth connection parameters of the other device from the local device, and then the Bluetooth connection can be established, which can simplify the information exchange link in the Bluetooth connection process and improve the Bluetooth connection speed.
  • the method 300 may further include step S306 .
  • the second electronic device is in a discoverable and connectable state, and can be discovered through broadcast messages, and the first electronic device is in a listening state, and can discover other electronic devices by scanning broadcast messages.
  • the message broadcasted by the second electronic device may carry the device identification or Bluetooth address of the second electronic device. If the first electronic device scans the broadcast message, the first electronic device can discover the second electronic device according to the device identification or Bluetooth address carried in the broadcast message, and then send a paging message to the second electronic device. If the device returns a paging response to the second electronic device, the first electronic device and the second electronic device are successfully paging.
  • the first electronic device can send the first version information to the second electronic device, that is, initiate a connection to the second electronic device, and determine that the versions of the first electronic device and the second electronic device are the same.
  • the first electronic device and the second electronic device directly call the Bluetooth connection parameters shared by the two devices to establish the Bluetooth connection.
  • the Bluetooth connection method provided by the present application, when two electronic devices need to establish a Bluetooth connection, it is possible to first determine whether the versions of the two electronic devices are consistent, and further determine whether the Bluetooth connection parameters need to be exchanged: if the versions are consistent, the If the Bluetooth connection parameters are the same, you can directly obtain the Bluetooth connection parameters of the other device from the local device without exchanging the Bluetooth connection parameters to establish a Bluetooth connection, which can simplify the information exchange link in the Bluetooth connection process and improve the Bluetooth connection speed.
  • the above describes the Bluetooth connection method when the two devices have the same version.
  • the two devices can first judge the relative information of the opposite device. Whether the information used in the last connection has changed, if the information of the peer device has changed, exchange the changed information to establish the connection; if the information of the peer device has not changed, no need to exchange information, directly call the stored The information of the peer device can be established to establish a connection.
  • the Bluetooth connection method provided by the first embodiment of the present application may further include the following S307 - S309 , which describe the Bluetooth connection method in the case of different device versions. It should be noted that, in the first embodiment, it is assumed that the first electronic device and the second electronic device have been paired and connected before the connection is established this time, and both devices have stored the Bluetooth connection parameters of the opposite device in the local device. or information. For example, the first electronic device locally stores the Bluetooth connection parameters of the second electronic device.
  • the first electronic device receives the first parameter change indication information sent by the second electronic device.
  • the first parameter change indication information is used to indicate the change content of the Bluetooth connection parameter of the second electronic device
  • the first parameter change indication information indicates that the frequency hopping parameters of the second electronic device are changed.
  • the two devices need to conduct information negotiation on the frequency hopping parameters, so that the two devices are consistent in the frequency hopping parameters, so as to make the frequency hopping parameters faster. to establish a connection.
  • the first electronic device may send a first request message to the second electronic device, the The first request message is used to request to establish a Bluetooth connection with the second electronic device.
  • the second electronic device may send a first response message to the first electronic device according to the first request message, where the first response message includes the first parameter change indication information.
  • the first electronic device may acquire the first parameter change indication information from the first response message.
  • the first electronic device determines the second electronic device's second electronic device according to the stored Bluetooth connection parameters of the second electronic device and the changed content indicated by the first parameter change instruction information. Bluetooth connection parameters.
  • the local device can obtain the changed Bluetooth connection parameters of the peer device, and use the Bluetooth connection parameters to convert the Bluetooth connection parameters of the peer device that have been stored in the local device. Connection parameters are updated.
  • the Bluetooth connection parameters of the second electronic device are the Bluetooth connection parameters of the second electronic device that are stored locally by the first electronic device and used in the last connection with the second electronic device, and can be directly obtained from the first electronic device. directly obtained locally.
  • the first electronic device can refresh or replace the Bluetooth connection parameters of the second electronic device through the received first parameter change instruction information to obtain the latest Bluetooth connection parameters (ie, second Bluetooth connection parameters) of the second electronic device.
  • the first electronic device establishes a Bluetooth connection with the second electronic device according to the first Bluetooth connection parameter and the second Bluetooth connection parameter.
  • the second Bluetooth connection parameter is the latest Bluetooth connection parameter of the first electronic device stored locally by the first electronic device, and can also be directly called locally from the first electronic device.
  • the local device acquires the changed Bluetooth connection parameters of the opposite device, and uses the Bluetooth connection parameters to update the Bluetooth connection parameters of the opposite device that have been stored by the local device.
  • the local device can establish a Bluetooth connection by using the updated Bluetooth connection parameters of the opposite device and the Bluetooth connection parameters of the local device without interacting with the Bluetooth connection parameters that have not changed, which simplifies the information exchange in the Bluetooth connection process. to increase the speed of the Bluetooth connection.
  • the Bluetooth connection method provided by the embodiment of the present application further includes the following S310.
  • the first electronic device establishes a Bluetooth connection with the second electronic device according to the first Bluetooth connection parameter and the stored Bluetooth connection parameter of the second electronic device.
  • the two devices when the versions of the two devices are different, if the first parameter change indication information indicates that the first Bluetooth connection parameter has no content to be changed, the two devices do not need to exchange information, for example, there is no need to exchange LMP feature support and version specifications, etc. , no need to query the SDP service, etc., but can directly call the stored information of the peer device to establish a connection. In this way, the information exchange link in the Bluetooth connection process can be simplified, and the Bluetooth connection speed can be improved.
  • the present application executes the above-mentioned S308-S309 and the above-mentioned S310 alternatively, that is, the present application executes S308 and S309 when the first parameter change indication information indicates that there is changed content; when the first parameter change indication information indicates no change S310 is executed when the content is present.
  • the present application executes the above S303-S305 and the above S307-S309 (or S307 and S310) alternatively, that is, the present application executes S303-S305 when the device versions of both parties are the same; S307-S309 (or S307 and S310).
  • the present application may adopt the method of mask recording, and each omitted process point is mapped to a mask bit. If the local device information is changed, mark the mask bit.
  • the two devices exchange mask flags. If the information is changed, the two devices will initiate corresponding negotiation and interaction in the subsequent process for the changed part.
  • the second electronic device may use a mask marking method to mark the modification content of the Bluetooth connection parameter of the second electronic device to obtain the first parameter modification indication information.
  • the first electronic device may also use a mask marking method to mark the modification content of the Bluetooth connection parameters of the first electronic device to obtain the second parameter modification instruction information.
  • the mask bits may include 0 and 1, and can be marked as 0 for the information part that has not changed, and can be marked as 1 for the information part that has changed; of course, it can also be marked as the information part that has not changed. 1.
  • the information part that has changed can be marked as 0, which can be determined according to actual usage requirements, which is not limited in this embodiment of the present application.
  • the first electronic device receives the first parameter change instruction marked by mask bits sent by the second electronic device information, according to the above-mentioned marking rules, information exchange update and negotiation can be performed for the information part marked 1.
  • both devices can identify the changed information or nodes of the local device, and then the two devices exchange information identification, so that when a connection is established, the two devices can identify which information has changed based on the information identification, and renegotiate for the changed information.
  • the present application can simplify the connection establishment process, improve the Bluetooth connection speed, and avoid waste of air interface interaction resources.
  • the above describes a Bluetooth connection method in the case of different versions of the devices of the two parties, that is, when the versions of the devices of the two parties are different, exchange parameter change indication information, and determine the information to be exchanged according to the parameter change indication information.
  • the following describes another Bluetooth connection method with reference to FIG. 5 , that is, when the versions of the two devices are different, the Bluetooth connection can be performed according to a standard parameter negotiation and interaction process.
  • the Bluetooth connection method provided by the present application may further include the following S311-S312.
  • the second electronic device sends first negative information to the first electronic device, and the first electronic device receives the first negative information sent by the second electronic device.
  • the first negative information is used to indicate that the version of the second electronic device is different from that of the first electronic device.
  • the first electronic device and the second electronic device exchange their respective Bluetooth connection parameters to establish a Bluetooth connection.
  • the two electronic devices negotiate an interaction process according to standard parameters, negotiate and exchange information, and then establish a Bluetooth connection according to the negotiated information.
  • the first electronic device when the version of the second electronic device is different from the version of the first electronic device, the first electronic device sends a connection request message to the second electronic device, where the connection request message includes the Bluetooth connection parameters of the first electronic device. .
  • the second electronic device receives the connection request message sent by the second electronic device, and sends a response message to the first electronic device according to the connection request message, where the response message includes the Bluetooth connection parameters of the second electronic device.
  • the first electronic device receives the response message sent by the second electronic device, and then the first electronic device and the second electronic device establish a Bluetooth connection according to the Bluetooth connection parameters of the first electronic device and the Bluetooth connection parameters of the second electronic device.
  • the first electronic device sends the first version information to initiate a connection.
  • the embodiment of the present application is not limited to this.
  • the first electronic device may also A connection request message is sent to other electronic devices to initiate a connection, and the first version information is carried by the connection request message.
  • the first electronic device may send a first request message to the second electronic device, where the first request message is used to request A Bluetooth connection is established with the second electronic device, and the first request message includes first version information.
  • the second electronic device can compare the first version information with the second version information according to the first request message, obtain a comparison result, and then send the first electronic device to the first electronic device.
  • a response message the first response message includes confirmation information.
  • the first electronic device may determine whether the versions of the first electronic device and the second electronic device are the same according to the first response message. on the one hand.
  • the two devices can use the first Bluetooth connection parameters corresponding to the same version shared by the two devices to establish a Bluetooth connection without exchanging information, which simplifies the Bluetooth connection process.
  • the second electronic device sends a second response message to the first electronic device, and the first electronic device receives a second response message sent by the second electronic device, where the second response message includes the first negative information . Further, the first electronic device and the second electronic device exchange their respective Bluetooth connection parameters to establish a Bluetooth connection.
  • the first electronic device determines that its version is different from that of the second electronic device according to the second response message, it follows the transmitted protocol standard process, that is, negotiation and exchange of information, and then uses the negotiated information to establish a connection with the second electronic device.
  • Bluetooth connection
  • the two devices can directly obtain the Bluetooth connection parameters of the other device from the local device without exchanging the Bluetooth connection parameters. Establish a Bluetooth connection. If the versions of the Bluetooth communication protocol supported by the two devices are different, the two devices exchange information according to the traditional protocol standard process and establish a connection.
  • the above describes the process of establishing a Bluetooth connection in different ways for two devices under the same version and in different versions, which is realized without considering the dynamic factors in the connection establishment process, that is to say, the above-mentioned first Bluetooth connection
  • the parameters are static parameters.
  • the two devices may also need to negotiate some dynamically changing parameters when connecting, such as connection establishment request, clock, frequency hopping parameters, etc.
  • the two devices can interact according to the normal process.
  • the above-mentioned first request message and the above-mentioned first response message may also be used to carry dynamically changing parameters that need to be negotiated.
  • the versions of the first electronic device and the second electronic device are the same, after the first electronic device and the second electronic device are paired, some information and operations of the two devices may change dynamically.
  • the first electronic device and the second electronic device may interact with dynamically changing parameters, and then establish a Bluetooth connection according to the first Bluetooth connection parameters and the dynamically changing parameters.
  • the first electronic device sends the dynamically changed third Bluetooth connection parameter of the first electronic device to the second electronic device.
  • the second electronic device receives the third Bluetooth connection parameter, and sends the dynamically changed fourth Bluetooth connection parameter of the second electronic device to the first electronic device according to the third Bluetooth connection parameter.
  • the first electronic device may establish a Bluetooth connection with the second electronic device according to the first Bluetooth connection parameter, the third Bluetooth connection parameter and the fourth Bluetooth connection parameter.
  • the third Bluetooth connection parameter may include at least one of the following: connection request, clock, frequency hopping parameter, etc.
  • the fourth Bluetooth connection parameter may include at least one of the following: connection response, clock, frequency hopping parameter, and the like. In this way, the two devices can negotiate and exchange dynamically changing parameters under the condition of obtaining the static parameters of the opposite device, so as to realize the Bluetooth connection.
  • the Bluetooth connection method provided by the present application can save the link of negotiation and interaction when the connection is established again.
  • the changed information can be identified and identified to distinguish and identify, and information can be refreshed through negotiation and interaction when a connection is re-established after the information has changed.
  • the shared Bluetooth connection parameters can be shared and used, and there is no need to interactively transmit them to the other device. Only some dynamically changing parameters need to be negotiated interactively.
  • the Bluetooth connection can be established by changing the parameters, which can simplify the Bluetooth connection process and improve the Bluetooth connection speed.
  • the Bluetooth connection method provided by the first embodiment of the present application may be applicable to a scenario in which a Bluetooth connection is established between electronic devices of the same device model.
  • the first electronic device and the second electronic device are respectively the first earphone and the second earphone of the TWS earphone.
  • the first earphone is a main earphone, and the second earphone is a secondary earphone; or, the first earphone is a secondary earphone, and the second earphone is a main earphone, which is not limited in this embodiment of the present application.
  • the two earphones of the TWS work as a set, and the left and right earphones are equal devices. Therefore, except for parameters that need to be dynamically negotiated, the information on the opposite ear is completely acceptable. Obtained through this ear. In addition, considering that some information will change with the software version upgrade, these information are not dynamically changed, so they can be bound with the version. If the left and right ear versions are inconsistent, you need to go through the negotiation and interaction process, and you can wait for the binaural version to be upgraded. Crop the interaction again.
  • the left and right ear paging When the left and right ear paging is established, first check the version consistency of both ears. On the one hand, if the versions of the two ears are the same, the earphone extracts information from the earphone instead of obtaining it from the opposite ear through process interaction. Among them, for dynamically changing information and operations, such as connection establishment request, clock, frequency hopping parameters, etc., the interaction is performed according to the normal process. On the other hand, if the binaural versions are inconsistent, the negotiation and interaction are completed according to the standard Bluetooth connection establishment process.
  • the two earphones of the TWS earphone are paired and connected, as long as the versions of the two earphones are the same, it can be considered that the information related to the two earphone versions and capabilities are the same, and the static information of the opposite earphone can be directly It is extracted from the local earphone to replace the method of obtaining Bluetooth connection parameters through negotiation and interaction in related technologies, which can simplify the Bluetooth connection process and improve the Bluetooth connection speed.
  • the standard parameter negotiation and interaction process needs to be completed each time. Part of the negotiation and exchange process can be omitted when connecting, so the connection establishment delay can be shortened.
  • the above Bluetooth connection method may also be applicable to a scenario where a Bluetooth connection is established between electronic devices with different device models (for example, the electronic device and the second electronic device are a mobile phone and a speaker, respectively).
  • the Bluetooth connection method provided in the embodiments of the present application may not only be applicable to the scenario of each Bluetooth connection after pairing between devices, but also to the scenario of the first pairing connection between devices.
  • the connection process of the related technology it is usually in accordance with the standard process of the protocol, that is, the two parties need to negotiate and exchange information and then establish a connection according to the negotiated information. For the known information shared by both parties, if the negotiation is repeated every time a connection is made If it interacts with information, it will cause a waste of air interface interaction resources.
  • the Bluetooth connection method provided by the embodiment of the present application is to first determine whether the versions of the two devices are the same when establishing a connection.
  • the versions are the same and the connection parameters of the two devices are the same, there is no need to go through the negotiation and For information exchange, directly obtain the Bluetooth connection parameters of the other device from the local device, and then establish a Bluetooth connection, which can simplify the connection establishment process, improve the Bluetooth connection speed, and avoid the waste of air interface interaction resources.
  • the embodiments of the present application include, but are not limited to, the above-mentioned implementation methods in which one device determines whether the versions of two devices are the same, and then informs the other device of the judgment result.
  • the embodiments of the present application may also include other possible implementations.
  • the two devices can exchange their version information, and then the two devices can determine whether the versions of the two devices are the same.
  • the first electronic device sends the first version information to the second electronic device
  • the second electronic device sends the second version information to the first electronic device
  • the first electronic device associates the first version information of the local device with the peer device.
  • the second version information of the device is compared to determine whether the two device versions are the same; the second electronic device compares the second version information of the local device with the first version information of the opposite device to determine whether the two device versions are the same. same.
  • the implementation manner of determining whether the device versions are the same according to the device version information in the present application may include various possible manners, which are specifically determined according to actual usage requirements, which are not limited in the embodiments of the present application.
  • the Bluetooth connection method provided by the first embodiment of the embodiment of the present application is described above with reference to FIGS. 3-5
  • the Bluetooth connection method provided by the second embodiment of the embodiment of the present application is exemplarily described below with reference to FIGS. 6 and 7 .
  • the first electronic device and the second electronic device have been paired before the connection is established this time, and the two devices have stored the Bluetooth connection parameters of the opposite device in the local device or information, so that it can be called when the devices of both parties are connected again.
  • the pairing process between electronic devices is exemplarily described below with reference to FIG. 6 .
  • the first electronic device currently displays the setting interface 51, and the first electronic device receives the user's selection operation on the Bluetooth option 52 in the setting interface 51, as shown in (b) of FIG. 6 , the first electronic device displays a Bluetooth setting interface 53 in response to a user operation.
  • the Bluetooth setting interface 53 displays that Bluetooth is in an on state, and includes a paired device list 54 and an available device list 55, such as the paired device list 54 Including mobile phone 1 and mobile phone 2, for example, the list of available devices 55 includes FreeBuds 3, smart watches and Bluetooth speakers.
  • the first electronic device receives the user's selection operation on the FreeBuds 3 items in the available device list 55.
  • the first electronic device displays a Bluetooth pairing request interface on the Bluetooth setting interface 53 in response to the user operation. 56, used to prompt the user whether to pair with the headset FreeBuds 3.
  • the first electronic device receives the user's selection operation on the pairing item 57 in the Bluetooth pairing request interface 56, and the first electronic device responds to the user's operation and performs information exchange and negotiation with the headset FreeBuds 3, as shown in (d) in Figure 6 , the first electronic device hides the Bluetooth pairing request interface 56, and updates the Bluetooth setting interface 53, wherein three items of FreeBuds are added to the paired device list 54. In this way, the pairing of the first electronic device and the earphone is completed, and at this time, the first electronic device stores the Bluetooth connection parameters of the earphone.
  • the electronic device After the electronic device completes the first pairing, it obtains the Bluetooth connection parameters of the peer device, such as attribute information and feature capability information. Thereby, the connection delay introduced by the information exchange can be saved. On the other hand, if part of the information is changed due to version upgrade or other reasons, the two devices can interact and refresh the changed part of the information when the connection is established as needed.
  • Fig. 7 is a flowchart of a Bluetooth connection method according to the second embodiment of the present application.
  • the method 400 includes the following steps S401-S405.
  • the first electronic device and the second electronic device have been paired, and the first electronic device stores the Bluetooth connection parameters of the second electronic device (it is assumed to be called the first Bluetooth connection parameter), and the first electronic device stores the Bluetooth connection parameters of the second electronic device.
  • the second electronic device stores the Bluetooth connection parameters of the first electronic device (it is assumed to be called the third Bluetooth connection parameter).
  • the second electronic device sends the first parameter change instruction information to the first electronic device, and the first electronic device receives the first parameter change instruction information sent by the second electronic device.
  • the first parameter change indication information is used to indicate the content of the change of the first Bluetooth connection parameter of the second electronic device.
  • the first parameter change indication information indicates that the frequency hopping parameters of the second electronic device are changed.
  • the two devices need to conduct information negotiation on the frequency hopping parameters, so that the two devices are consistent in the frequency hopping parameters, so as to make the frequency hopping parameters faster. to establish a connection.
  • the second electronic device when the second electronic device scans the first electronic device or discovers the first electronic device, the second electronic device may send the first parameter change instruction information to the first electronic device, to initiate a Bluetooth connection.
  • the first electronic device when the first electronic device scans the second electronic device or discovers the second electronic device, the first electronic device may send a connection request message to the second electronic device to initiate a connection, and the second electronic device receives the connection In the case of the request message, the first parameter change instruction information is sent to the first electronic device.
  • the first electronic device when the first electronic device establishes a paging with the second electronic device, the first electronic device may send a first request message to the second electronic device, where the first request message is used to request to communicate with the second electronic device. Establish a Bluetooth connection.
  • the second electronic device may send a first response message to the first electronic device according to the first request message, where the first response message includes the first parameter change indication information. Further, after receiving the first response message, the first electronic device may acquire the first parameter change indication information from the first response message.
  • the first electronic device sends the first request message to the second electronic device, which is equivalent to initiating a connection.
  • the first electronic device is the main device; the second electronic device receives the first request message and sends it to the first electronic device.
  • the device feeds back the first response message, which is equivalent to accepting the connection, and the second electronic device can act as a slave device at this time.
  • a paging establishment procedure needs to be completed between the two devices first.
  • the description of the establishment of paging between the first electronic device and the second electronic device reference may be made to the detailed description of the establishment of paging between devices in the foregoing first embodiment, which will not be repeated here.
  • the first electronic device determines the second Bluetooth connection parameter of the second electronic device according to the stored first Bluetooth connection parameter and the changed content indicated by the first parameter change instruction information.
  • the local device can obtain the changed Bluetooth connection parameters of the opposite end device, and use the Bluetooth connection parameters to convert the stored data of the opposite end device in the local device.
  • a Bluetooth connection parameter is updated.
  • the first Bluetooth connection parameter is a Bluetooth connection parameter stored locally by the first electronic device and corresponding to the second electronic device, and can be directly obtained locally from the first electronic device.
  • the first electronic device can refresh or replace the first Bluetooth connection parameters by using the received first parameter change instruction information to obtain the latest Bluetooth connection parameters (ie, the second Bluetooth connection parameters) of the second electronic device.
  • the first electronic device and the second electronic device establish a Bluetooth connection according to the second Bluetooth connection parameter and the third Bluetooth connection parameter.
  • the third Bluetooth connection parameter is a Bluetooth connection parameter stored locally by the first electronic device and corresponding to the first electronic device, and can also be directly called locally from the first electronic device.
  • the local device acquires the changed Bluetooth connection parameters of the opposite device, and uses the Bluetooth connection parameters to update the Bluetooth connection parameters of the opposite device that have been stored by the local device.
  • the local device can establish a Bluetooth connection by using the updated Bluetooth connection parameters of the opposite device and the Bluetooth connection parameters of the local device without interacting with the Bluetooth connection parameters that have not changed, which simplifies the information exchange in the Bluetooth connection process. to increase the speed of the Bluetooth connection.
  • the first electronic device and the second electronic device establish a Bluetooth connection according to the stored first Bluetooth connection parameter and third Bluetooth connection parameter.
  • the first parameter change instruction information indicates that the Bluetooth connection parameters of the second electronic device have no content to be changed, then there is no need to exchange the information of the opposite end device, and the stored information of the opposite end device can be directly called to establish the connection. .
  • the information exchange link in the Bluetooth connection process can be simplified, and the Bluetooth connection speed can be improved.
  • the present application executes the above-mentioned S403-S404 and the above-mentioned S405 alternatively, that is, the present application executes S403-S404 when the first parameter change indication information indicates that there is changed content; when the first parameter change indication information indicates no change S405 is executed when the content is present.
  • the local device can also send the local change information to the peer. device to instruct the peer device to refresh its stored information.
  • the two devices can interact with the information changing part when the connection is established, so that the connection establishment process can be simplified, the Bluetooth connection speed can be improved, and the waste of air interface interaction resources can be avoided.
  • the first electronic device may send the second parameter change instruction information to the second electronic device, and the second electronic device receives the second parameter change instruction information sent by the second electronic device.
  • the second parameter change instruction information is used to indicate the content of the change of the Bluetooth connection parameters of the first electronic device.
  • the second electronic device may determine the third Bluetooth connection parameter of the first electronic device according to the modification content indicated by the second parameter modification instruction information.
  • the second parameter change indication information indicates that the clock parameters of the first electronic device are changed.
  • the two devices need to conduct information negotiation on the clock parameters, so that the two devices keep the same clock parameters, so that the connection can be established faster.
  • the first electronic device when sending the first request message to the second electronic device, may carry the second parameter change indication information through the first request message.
  • the second electronic device can change the The Bluetooth connection parameters of the electronic device are refreshed or replaced to obtain the latest Bluetooth connection parameters of the first electronic device. Further, after the second electronic device determines the latest Bluetooth connection parameters of the first electronic device, and the first electronic device determines the latest second Bluetooth connection parameters of the second electronic device, the second electronic device and the first electronic device can The latest Bluetooth connection parameters of the second electronic device and the latest Bluetooth connection parameters of the first electronic device establish a Bluetooth connection. In this way, the two devices can interact with the information changing part when the connection is established, so that the connection establishment process can be simplified, the Bluetooth connection speed can be improved, and the waste of air interface interaction resources can be avoided.
  • Bluetooth connection method when two electronic devices need to establish a Bluetooth connection, it is possible to first determine whether the Bluetooth connection parameters of the other device have changed, and further determine whether or not to exchange Bluetooth connection parameters or which Bluetooth connection parameters to be exchanged: if If the Bluetooth connection parameters of the counterpart device have not changed, you can directly obtain the stored Bluetooth connection parameters of the counterpart device from the local device without changing the Bluetooth connection parameters to establish a Bluetooth connection; if the Bluetooth connection parameters of the counterpart device change, then Only the changed information can be exchanged to establish a Bluetooth connection, which can simplify the information exchange link in the Bluetooth connection process and improve the Bluetooth connection speed.
  • the method provided by the second embodiment can be used to omit part of the connection interaction process.
  • the method provided by the second embodiment can be used to omit part of the connection interaction process.
  • the peer information cannot be obtained before pairing, the information cannot be extracted locally according to the TWS binaural method.
  • the static configuration and capability information of the opposite end is obtained.
  • the local device records the information of the peer device, and when the connection is established next time, another negotiation exchange can be omitted.
  • the two devices can mark the changed information.
  • the information of the other party's device it can interact and refresh the part of the information that has changed when the connection is established as needed.
  • the above-mentioned first parameter change indication information may be information obtained by marking with a mask marking method.
  • the present application adopts the method of mask recording, and each omitted process point is mapped to a mask bit. If the local device information is changed, mark the mask bit.
  • the two devices exchange mask flags. If the information is changed, the two devices will initiate corresponding negotiation and interaction in the subsequent process for the changed part.
  • the mask bits may include 0 and 1, and can be marked as 0 for the information part that has not changed, and can be marked as 1 for the information part that has changed; of course, it can also be marked as the information part that has not changed. 1.
  • the information part that has changed can be marked as 0, which can be determined according to actual usage requirements, which is not limited in this embodiment of the present application.
  • the first electronic device receives the first parameter change instruction marked by mask bits sent by the second electronic device information, according to the above-mentioned marking rules, information exchange update and negotiation can be performed for the information part marked 1.
  • both devices can identify the changed information or nodes of the local device, and then the two devices exchange information identification, so that when a connection is established, the two devices can identify which information has changed based on the information identification, and renegotiate for the changed information.
  • the present application can simplify the connection establishment process, improve the Bluetooth connection speed, and avoid waste of air interface interaction resources.
  • the second embodiment needs to obtain the peer device information through the first pairing and record it, and use mask bits to indicate subsequent changes to the information. .
  • the second embodiment needs to obtain the peer device information through the first pairing and record it, and use mask bits to indicate subsequent changes to the information.
  • some unnecessary negotiation interactions can be cut out when the information does not change or partially changes. For example, as long as the information does not change, it will not Trigger connection-based information negotiation and exchange; for another example, if the information changes, initiate a corresponding negotiation interaction for the changed part. Therefore, through the improvement of the solution of the present application, the interaction process can be tailored in the connection, and the connection speed can be accelerated.
  • connection process of related technologies it is usually in accordance with the standard process of the protocol, that is, the two parties need to negotiate and exchange information and then establish a connection according to the negotiated information.
  • the negotiation and Information interaction will result in a waste of air interface interaction resources.
  • the solution of the present application can target the unchanged information without interactively obtaining it again during the connection, and for the information that has changed due to version upgrade or other reasons, it can be performed on the part of the changed information when the connection is established as needed. Therefore, the connection delay caused by information exchange can be shortened. Therefore, the present application can improve the Bluetooth connection speed, and can avoid the waste of air interface interaction resources.
  • the Bluetooth connection method provided by the present application can be applied to the following scenarios 1 and 2, and information exchange and parameter negotiation in the connection process can be omitted by the Bluetooth connection method.
  • Scenario 2 For information that may be semi-statically changed, the methods described in the following a) or b) are used to omit information exchange and parameter negotiation in the connection process.
  • the version information is exchanged first. If the version has not been updated, the confirmation information has not changed from the last connection, and the subsequent process does not need to be negotiated and exchanged;
  • the embodiments of the present application do not specifically limit the specific structure of the execution body of the methods provided by the embodiments of the present application, as long as the program in which the codes of the methods provided by the embodiments of the present application are recorded can be executed to execute the methods according to the embodiments of the present application.
  • the execution body of the method provided in the embodiment of the present application may be the first electronic device, or a functional module in the first electronic device that can call the program and execute the program.
  • the first electronic device may include a hardware structure and/or a software module, and implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a certain function of the above functions is performed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
  • FIG. 8 is a schematic block diagram of an electronic device 700 according to an embodiment of the present application.
  • the electronic device 700 includes a transceiver unit 701 and a processing unit 702;
  • the transceiver unit 701 is configured to send first version information of the electronic device 700 to the second electronic device when the electronic device 700 establishes paging with the second electronic device, where the first version information is used to indicate the version of the electronic device 700 ;
  • the transceiver unit 701 is further configured to receive confirmation information sent by the second electronic device, where the confirmation information is used to indicate that the version of the second electronic device is the same as the version of the electronic device 700;
  • the processing unit 702 is configured to establish a Bluetooth connection with the second electronic device according to the first Bluetooth connection parameter; wherein the first Bluetooth connection parameter is the Bluetooth connection parameter corresponding to the version of the electronic device 700 .
  • the transceiver unit 701 is further configured to receive first parameter change indication information sent by the second electronic device when the version of the second electronic device is different from the version of the electronic device 700, the first The parameter change indication information is used to indicate the change content of the Bluetooth connection parameter of the second electronic device;
  • the processing unit 702 is further configured to determine the second Bluetooth connection parameter of the second electronic device according to the stored Bluetooth connection parameter of the second electronic device and the change content indicated by the first parameter change instruction information;
  • the processing unit 702 is further configured to establish a Bluetooth connection with the second electronic device according to the first Bluetooth connection parameter and the second Bluetooth connection parameter.
  • the transceiver unit 701 is further configured to, if the first parameter change indication information indicates that the content of the first Bluetooth connection parameter has not been changed, according to the first Bluetooth connection parameter and the stored Bluetooth connection parameter of the second electronic device , and establish a Bluetooth connection with the second electronic device.
  • the first parameter change indication information is information obtained by marking with a mask marking method.
  • the transceiver unit 701 is specifically configured to send a first request message to a second electronic device, and receive a first response message to the first request message sent by the second electronic device;
  • the request message includes first version information, and the first response message includes confirmation information.
  • the first Bluetooth connection parameter is a static parameter
  • the transceiver unit 701 is further configured to send the dynamically changed third Bluetooth connection parameter of the electronic device 700 to the second electronic device; and receive the transmission from the second electronic device The dynamically changing fourth Bluetooth connection parameter of the second electronic device.
  • the processing unit 702 is further configured to establish a Bluetooth connection with the second electronic device according to the first Bluetooth connection parameter, the third Bluetooth connection parameter and the fourth Bluetooth connection parameter.
  • the transceiver unit 701 is further configured to send a second request message to the second electronic device when the confirmation information indicates that the version of the second electronic device is different from the version of the electronic device 700, the second The request message includes the first Bluetooth connection parameter of the electronic device 700;
  • the transceiver unit 701 is further configured to receive a second response message sent by the second electronic device, where the second response message includes second Bluetooth connection parameters of the second electronic device;
  • the processing unit 702 is further configured to establish a Bluetooth connection with the second electronic device according to the first Bluetooth connection parameter and the second Bluetooth connection parameter.
  • the electronic device 700 may correspond to executing the method steps corresponding to the first electronic device described in the first embodiment of the present application, and the above-mentioned and other operations and/or functions of the modules in the electronic device 700 are respectively for realizing The corresponding flow of the method is not repeated here for brevity.
  • the electronic device When establishing a Bluetooth connection with another electronic device, the electronic device provided by the embodiment of the present application can first determine whether the versions of the two electronic devices are consistent, and further determine whether the Bluetooth connection parameters need to be exchanged: if the versions are consistent, the Bluetooth connection between the two devices If the parameters are the same, you can directly obtain the Bluetooth connection parameters of the other device from the local device without interacting with the Bluetooth connection parameters to establish a Bluetooth connection, which can simplify the information exchange link in the Bluetooth connection process and improve the Bluetooth connection speed.
  • FIG. 9 is a schematic block diagram of an electronic device 800 according to an embodiment of the present application.
  • the electronic device 800 includes a transceiver unit 801 and a processing unit 802;
  • a transceiver unit 801 configured to receive first parameter change indication information sent by the second electronic device, where the first parameter change indication information is used to indicate the content of the change of the first Bluetooth connection parameter of the second electronic device;
  • the processing unit 802 is configured to determine the second Bluetooth connection parameter of the second electronic device according to the stored first Bluetooth connection parameter and the change content indicated by the first parameter change instruction information;
  • the processing unit 802 is further configured to establish a Bluetooth connection with the second electronic device according to the second Bluetooth connection parameter of the second electronic device and the third Bluetooth connection parameter of the first electronic device.
  • the transceiver unit 801 is further configured to send a first request message to the second electronic device before receiving the first parameter change indication information sent by the second electronic device, the first request message using requesting to establish a Bluetooth connection with the second electronic device; and the transceiver unit 801 is further configured to receive a first response message to the first request message sent by the second electronic device, where the first response message includes first parameter change indication information .
  • the processing unit 802 is further configured to, when the first parameter change indication information indicates that the first Bluetooth connection parameter has not changed content, according to the stored first Bluetooth connection parameter and the third Bluetooth connection parameter, A Bluetooth connection is established with the second electronic device.
  • the first parameter change indication information is information obtained by marking with a mask marking method.
  • the electronic device When establishing a Bluetooth connection with another electronic device, the electronic device provided by the embodiment of the present application can first determine whether the Bluetooth connection parameters of the other device have changed, and further determine whether the Bluetooth connection parameters need to be exchanged or which Bluetooth connection parameters need to be exchanged: if When the Bluetooth connection parameters of the other device change, only the changed information can be exchanged to establish a Bluetooth connection, which can simplify the information exchange link in the Bluetooth connection process and improve the Bluetooth connection speed.
  • FIG. 10 is a schematic hardware diagram of an electronic device 200 provided by an embodiment of the present application.
  • the electronic device 200 may be an example of the Bluetooth headset or mobile phone described in FIG. 1 .
  • the electronic device 200 may include: a processor 201, a memory 202, a wireless communication module 203, an audio module 204, a power supply module 205, etc., and these components may pass through one or more communication buses or signal lines (in the figure not shown) to communicate.
  • a processor 201 a processor 201
  • a memory 202 may include: a processor 201, a memory 202, a wireless communication module 203, an audio module 204, a power supply module 205, etc., and these components may pass through one or more communication buses or signal lines (in the figure not shown) to communicate.
  • Each component of the electronic device will be described in detail below with reference to FIG. 2 .
  • the processor 201 is the control center of the electronic device, uses various interfaces and lines to connect various parts of the electronic device, and executes the operation of the electronic device by running or executing the application program stored in the memory 202 and calling the data stored in the memory 202.
  • the processor 101 may include one or more processing units, and different processing units may be independent devices or integrated into one or more processors 201 .
  • the processor 201 may specifically be an integrated control chip, or may be composed of a circuit including various active and/or passive components, and the circuit is configured to perform the functions belonging to the processor 201 described in the embodiments of the present application.
  • the processor 201 may be configured to execute related application programs and call related modules to implement the functions of the Bluetooth headset 11 in the embodiment of the present application. For example, physical connection and/or service specification connection between the Bluetooth headset 11 and the mobile phone 12 is implemented.
  • the processor 201 may adopt a central processing unit (central processing unit, CPU).
  • the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGAs off-the-shelf programmable gate arrays
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the processor 201 uses one or more integrated circuits to execute related programs, so as to implement the technical solutions provided by the embodiments of the present application.
  • the memory 202 is used to store application programs and data, and the processor 201 executes various functions of the electronic device and data processing by running the application programs and data stored in the memory 202 .
  • the memory 202 mainly includes a storage program area and a storage data area, wherein the storage program area can store an operating system and an application program required for at least one function; the storage data area can store data created according to the use of the electronic device.
  • the memory 202 can store program codes for physical connection and/or service specification connection between the Bluetooth headset 11 and the mobile phone 12, program codes for charging the Bluetooth headset 11, and Bluetooth The program code for wireless pairing and connection between the earphone 11 and the mobile phone 12, etc.
  • the memory 202 may include read-only memory, random access memory, and may also include non-volatile memory, such as magnetic disk storage devices, flash memory devices, or other volatile solid-state storage devices, etc., and provides instructions and data to the processor 201 .
  • Memory 202 may store various operating systems. The above-mentioned memory 202 may be independent of the processor 201 and connected to the processor 201 through the above-mentioned communication bus; or, the memory 202 may also be integrated with the processor 201 .
  • the wireless communication module 203 can be used to support wireless connection and wireless communication between electronic devices through wireless communication technology.
  • the wireless communication module 203 may be a Bluetooth chip.
  • the Bluetooth headset 11 can be paired with the Bluetooth chip of the mobile phone 12 through the Bluetooth chip and establish a wireless connection, so as to realize wireless communication and services between the Bluetooth headset 11 and the mobile phone 12 through the wireless connection deal with.
  • a Bluetooth chip can support basic rate (basic rate, BR)/enhanced data rate (EDR) Bluetooth and BLE, for example, it can receive/send paging (page) information, receive/send BLE broadcast messages, and so on.
  • the wireless communication module 203 may further include an antenna.
  • the wireless communication module 203 receives electromagnetic waves via the antenna, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 201 .
  • the wireless communication module 203 can also receive the signal to be sent from the processor 201, perform frequency modulation on it, amplify it, and then convert it into an electromagnetic wave for radiation through the antenna.
  • the audio module 204 can be used to manage audio data and realize the input and output of audio streams by the electronic device.
  • the audio module 204 may include a speaker 2041 (or earpiece, receiver) component for outputting audio streams, a microphone 2042 (or a microphone, microphone), a microphone pickup circuit matched with the microphone, and the like.
  • the speaker 2041 can be used to convert audio electrical signals into sound signals and play them.
  • Microphone 2042 may be used to convert sound signals into audio electrical signals.
  • the power supply module 205 can supply power to various components.
  • the power supply module 205 includes a battery and a power management chip.
  • the battery can be logically connected to the processor 201 through the power management chip, so that the power supply module 205 can manage functions such as charging, discharging, and power consumption management. .
  • the electronic device may also include a display (or display screen), or may not include a display.
  • the display can be used to display the display interface of the APP, such as the currently playing song, etc.
  • the display includes a display panel, and the display panel may adopt a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (organic light-emitting diode, OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode ( active-matrix organic light emitting diode, AMOLED), flexible light emitting diode (flex light-emitting diode, FLED), quantum dot light emitting diode (quantum dot light emitting diode, QLED) and so on.
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • OLED active matrix organic light emitting diode or an active matrix organic light emitting diode
  • active-matrix organic light emitting diode active-matrix organic light emit
  • a touch sensor may be provided in the display to form a touch screen, which is not limited in this embodiment of the present application.
  • a touch sensor is used to detect touches on or near it.
  • the touch sensor can communicate the detected touch operation to the processor 201 to determine the type of touch event.
  • the processor 201 may provide visual output related to touch operations through a display.
  • the electronic device may further include more devices, such as a USB interface, a sensor, and the like, which are not described in detail in the embodiments of the present application.
  • the various components shown in Figure 2 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing or application specific integrated circuits. It can be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device.
  • An electronic device may also include more or fewer components than shown, or some components may be combined, or some components may be split, or a different arrangement of components.
  • the electronic device 200 may further include a bus.
  • the memory 202 and the wireless communication module 203 may be connected to the processor 201 through a bus.
  • the bus may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, or the like.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the processor 201 in the electronic device 200 shown in FIG. 10 may correspond to the processing unit 702 in the apparatus 700 in FIG. 8
  • the wireless communication module 203 may correspond to the apparatus 700 in FIG. 8 Transceiver unit 701 in
  • the above-mentioned and other operations and/or functions of each unit in the electronic device 700 are respectively to implement the corresponding flow of the method, and are not repeated here for the sake of brevity.
  • the processor 201 executes the computer-executed instructions in the memory 202 to execute the operation steps of the above-mentioned methods through the electronic device 700 .
  • the processor 201 in the electronic device 200 shown in FIG. 10 may correspond to the processing unit 802 in the apparatus 800 in FIG. 9
  • the wireless communication module 203 may correspond to the apparatus 800 in FIG. 9 .
  • Transceiver unit 801 in the above-mentioned and other operations and/or functions of each unit in the electronic device 800 are respectively to implement the corresponding flow of the method, and are not repeated here for the sake of brevity.
  • the processor 201 executes the computer-executed instructions in the memory 202 to execute the operation steps of the above-mentioned methods through the electronic device 800 .
  • the electronic device in this embodiment of the present application may be a mobile terminal or a non-mobile terminal.
  • the mobile terminal may be a mobile phone, a wireless headset, a wireless speaker, a wireless bracelet, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted terminal, a wearable device, an ultra-mobile personal computer (UMPC), A netbook or a personal digital assistant (personal digital assistant, PDA), etc.
  • the non-mobile terminal may be a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which are not specifically limited in the embodiments of the present application.
  • an embodiment of the present application further provides an electronic device, including a processor 201 as shown in FIG. 9, a memory 202, a computer program stored in the memory 202 and executable on the processor 201, the computer program being When executed, the processor 201 implements each process of the above-mentioned Bluetooth connection method embodiments, and can achieve the same technical effect. To avoid repetition, details are not described here.
  • embodiments of the present application further provide a computer-readable medium, where program codes are stored in the computer-readable medium, and when the computer program codes are run on a computer, the computer can execute the above aspects method in .
  • the embodiments of the present application further provide a computer program product
  • the computer program product includes: computer program code, when the computer program code runs on the computer, the computer program code enables the computer to perform the above aspects.
  • the terminal device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer.
  • the hardware layer may include hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory (also called main memory).
  • the operating system of the operating system layer may be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a Windows operating system.
  • the application layer may include applications such as browsers, address books, word processing software, and instant messaging software.
  • Computer readable media may include, but are not limited to, magnetic storage devices (eg, hard disks, floppy disks, or magnetic tapes, etc.), optical disks (eg, compact discs (CDs), digital versatile discs (DVDs), etc. ), smart cards and flash memory devices (eg, erasable programmable read-only memory (EPROM), cards, stick or key drives, etc.).
  • magnetic storage devices eg, hard disks, floppy disks, or magnetic tapes, etc.
  • optical disks eg, compact discs (CDs), digital versatile discs (DVDs), etc.
  • smart cards and flash memory devices eg, erasable programmable read-only memory (EPROM), cards, stick or key drives, etc.
  • Various storage media described herein may represent one or more devices and/or other machine-readable media for storing information.
  • the term "machine-readable medium” may include, but is not limited to, wireless channels and various other media capable of storing, containing, and/or carrying instructions and/or data.
  • processors mentioned in the embodiments of the present application may be a central processing unit (central processing unit, CPU), and may also be other general-purpose processors, digital signal processors (digital signal processors, DSP), application-specific integrated circuits ( application specific integrated circuit, ASIC), off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory mentioned in the embodiments of the present application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be random access memory RAM.
  • RAM can be used as an external cache.
  • RAM may include the following forms: static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM) , double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM,
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • double data rate SDRAM double data rate SDRAM
  • DDR SDRAM double data rate SDRAM
  • enhanced synchronous dynamic random access memory enhanced synchronous dynamic random access memory
  • ESDRAM synchronous link dynamic random access memory
  • SLDRAM synchronous link dynamic random access memory
  • direct memory bus random access memory direct rambus RAM, DR RAM
  • the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components
  • the memory storage module
  • memory described herein is intended to include, but not be limited to, these and any other suitable types of memory.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the above-mentioned units or modules is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined. Either it can be integrated into another system, or some features can be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, which may be in electrical, mechanical or other forms.
  • the units described above as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above functions are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium.
  • the technical solution of the present application or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a computer software product, and the computer software product is stored in a storage
  • the computer software product includes several instructions, the instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium may include, but is not limited to: U disk, removable hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disks or optical disks, etc. medium of code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

本申请提供了一种蓝牙通信系统、蓝牙连接方法、电子设备及存储介质,涉及通信技术领域。在两个电子设备需要建立蓝牙连接时,可以先判断两个电子设备的版本是否一致,进一步确定是否需要交互蓝牙连接参数:若版本一致,则无需交互蓝牙连接参数,直接从本端设备处获取双方设备共有的蓝牙连接参数以建立蓝牙连接。若双方设备已存储对端设备的信息,则可以先判断对端设备信息是否发生变更,如对端设备信息有变更,则交互变更信息以建立连接即可;若对端设备信息无变更,则无需交互信息,直接调用存储的对端设备信息以建立连接即可。如此可简化蓝牙连接过程中的部分信息协商交换流程,提升蓝牙连接速度。

Description

蓝牙通信系统、蓝牙连接方法、电子设备及存储介质
本申请要求于2020年09月30日提交国家知识产权局、申请号为202011063166.X、申请名称为“蓝牙通信系统、蓝牙连接方法、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,并且更具体地涉及通信领域中的一种蓝牙通信系统、蓝牙连接方法、电子设备及存储介质。
背景技术
目前,为了保证不同电子设备彼此之间能够建立连接,双方设备通常需要按照协议标准流程进行参数协商和信息交互,然后根据协商好的信息建立连接。
然而,参数协商和信息交互的流程涉及大量的蓝牙参数信息交互,且每次建立连接时均需要进行参数协商和信息交互,这一流程在蓝牙连接过程中会占用一定时间,从而造成设备蓝牙连接的时延较长。因此,如何缩短蓝牙连接时延是需要解决的技术问题。
发明内容
本申请提供了一种蓝牙通信系统、蓝牙连接方法、电子设备及存储介质,可以解决相关技术中蓝牙连接过程中由于参数协商和信息交互造成蓝牙连接时延较长的问题。
第一方面,本申请提供了一种蓝牙连接方法,所述方法应用于蓝牙通信系统,所述蓝牙通信系统包括第一电子设备和第二电子设备,所述方法包括:第一电子设备向第二电子设备发送所述第一电子设备的第一版本信息,所述第一版本信息用于指示所述第一电子设备的版本;所述第一电子设备接收所述第二电子设备发送的确认信息,所述确认信息用于指示所述第二电子设备的版本与所述第一电子设备的版本相同;所述第一电子设备根据第一蓝牙连接参数与所述第二电子设备建立蓝牙连接;其中,所述第一蓝牙连接参数为所述第一电子设备的版本对应的蓝牙连接参数。
由于第二电子设备的版本与第一电子设备的版本相同,因此第二电子设备的蓝牙连接参数与第一电子设备的蓝牙连接参数相同,这样第一电子设备在获知两个设备版本相同的情况下,直接可以从本地调用这两个设备共有的蓝牙连接参数建立蓝牙连接。
通过上述方案,在两个电子设备需要建立蓝牙连接时,可以先判断两个电子设备的版本是否一致,进一步确定是否需要交互蓝牙连接参数:若版本一致,双方设备的蓝牙连接参数是一致的,则可以无需交互蓝牙连接参数,直接从本端设备处获取对方设备的蓝牙连接参数以建立蓝牙连接,如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
在一种可能实施例中,在两个设备建立蓝牙连接之前,两个设备之间首先需要完成寻呼建立流程。
在第一方面的一种可能实现方式中,所述方法还包括:
在所述第二电子设备的版本与所述第一电子设备的版本不同的情况下,所述第一电子设备接收所述第二电子设备发送的第一参数变更指示信息,所述第一参数变更指示信息用于指示所述第二电子设备的蓝牙连接参数的变更内容;
所述第一电子设备根据所述第一参数变更指示信息,确定与所述第二电子设备建立蓝牙连接所采用的信息。
通过上述方案,对于双方设备版本不同的情况,若双方设备之前配对连接过且存储对端设备的信息,则双方设备可以先判断对端设备信息相对于上一次连接时所采用的信息是否发生变更,如对端设备信息发生变更,则交互发生变更的信息以建立连接即可;若对端设备信息没有发生变更,则无需交互信息,直接调用存储的对端设备的信息以建立连接即可。
在一种可能实施例中,所述第一电子设备根据所述第一参数变更指示信息,确定与所述第二电子设备建立蓝牙连接所采用的信息,包括:
若所述第一参数变更指示信息指示有变更内容,则所述第一电子设备根据存储的所述第二电子设备的蓝牙连接参数和所述第一参数变更指示信息指示的变更内容,确定所述第二电子设备的第二蓝牙连接参数;
所述第一电子设备根据所述第一蓝牙连接参数和所述第二蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
其中,第一电子设备根据存储的第二电子设备的蓝牙连接参数和第一参数变更指示信息指示的变更内容,确定第二电子设备的第二蓝牙连接参数,包括:
第一电子设备采用第一参数变更指示信息指示的变更内容,对存储的第二电子设备的蓝牙连接参数进行更新,得到第二电子设备最新的第二蓝牙连接参数。
在另一种可能实施例中,所述第一电子设备根据所述第一参数变更指示信息,确定与所述第二电子设备建立蓝牙连接所采用的信息,包括:
若所述第一参数变更指示信息指示无变更内容,则所述第一电子设备从第一电子设备本地获取已存储的所述第二电子设备的蓝牙连接参数;
所述第一电子设备根据所述第一蓝牙连接参数和存储的所述第二电子设备的蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
在双方设备版本不同情况下,若第一参数变更指示信息指示第一蓝牙连接参数无变更内容,则双方设备无需交互信息,直接调用存储的对端设备的信息以建立连接即可。如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
在第一方面的一种可能实现方式中,所述第二电子设备还用于,所述第一参数变更指示信息是采用掩码标记方式标记得到的信息。
通过上述方案,双方设备可以对本端设备发生变更的信息或节点进行标识,进而双方设备交互信息标识,这样在建立连接时双方设备可以根据信息标识,识别哪些信息发生变更,并针对变更信息重新协商交互,而无需针对未发生变更的信息进行交互及协商,如此可省略部分连接交互流程。因此,本申请可以简化连接建立流程,可提升蓝牙连接速度,并且可以避免空口交互资源的浪费。
在第一方面的一种可能实现方式中,所述方法还包括:
在所述第二电子设备的版本与所述第一电子设备的版本不同的情况下,所述第一电子设备向所述第二电子设备发送第二请求消息,所述第二请求消息包括所述第一电子设备的第一蓝牙连接参数;
所述第一电子设备接收所述第二电子设备发送的第二响应消息,所述第二响应消息包 括所述第二电子设备的第二蓝牙连接参数;
所述第一电子设备根据所述第一蓝牙连接参数和所述第二蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
在上述方案中,若两个设备支持的蓝牙通信协议版本相同,则双方设备可以无需交互蓝牙连接参数,直接从本端设备处获取对方设备的蓝牙连接参数,即可建立蓝牙连接,无需重新走一遍参数协商和信息交互的流程。若两个设备支持的蓝牙通信协议版本不同,则双方设备可以按照传统的协议标准流程交互信息后建立连接。如此,本申请方案可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
在第一方面的一种可能实现方式中,所述第一电子设备向第二电子设备发送所述第一电子设备的第一版本信息,包括:所述第一电子设备向第二电子设备发送第一请求消息,所述第一请求消息包括所述第一版本信息;
其中,所述第一电子设备接收所述第二电子设备发送的确认信息,包括:所述第一电子设备接收所述第二电子设备发送的对所述第一请求消息的第一响应消息,所述第一响应消息包括所述确认信息。
在第一方面的一种可能实现方式中,所述第一蓝牙连接参数为静态参数;所述方法还包括:
所述第一电子设备向所述第二电子设备发送所述第一电子设备的动态变化的第三蓝牙连接参数;所述第一电子设备接收所述第二电子设备发送的所述第二电子设备的动态变化的第四蓝牙连接参数;所述第一电子设备根据所述第一蓝牙连接参数、所述第三蓝牙连接参数和所述第四蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
第一方面介绍了两个设备在版本相同情况下以及在版本不同情况下分别采用不同方式建立蓝牙连接的过程,是基于不考虑建立连接过程中的动态因素而实现的,在实际实现时,在两个设备版本相同的情况下,双方设备在连接时可能还需要协商一些动态变化参数,例如连接建立请求、时钟、跳频参数等,对于这些动态变化的信息和操作,双方设备可以按照正常流程进行交互。
第二方面,本申请提供了另一种蓝牙连接方法,所述方法包括:
第一电子设备接收第二电子设备发送的第一参数变更指示信息,所述第一参数变更指示信息用于指示所述第二电子设备的第一蓝牙连接参数的变更内容;
若所述第一参数变更指示信息指示有变更内容,则所述第一电子设备根据存储的所述第一蓝牙连接参数和所述第一参数变更指示信息指示的变更内容,确定所述第二电子设备的第二蓝牙连接参数;
所述第一电子设备根据所述第二电子设备的第二蓝牙连接参数和所述第一电子设备的第三蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
通过上述方案,在两个电子设备需要建立蓝牙连接时,可以先判断对方设备的蓝牙连接参数是否有变化,进一步确定是否需要交互蓝牙连接参数或者需要交互哪些蓝牙连接参数:若对方设备的蓝牙连接参数发生变化,则可以仅交互发生变化的信息以建立蓝牙连接,如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
其中,上述第三蓝牙连接参数为第一电子设备本地存储的与第一电子设备对应的蓝牙连接参数,可以直接从第一电子设备本地直接调用。
可选的,若第二电子设备的蓝牙连接参数发生变更,则第一电子设备可以获取第二电子设备发生变更的蓝牙连接参数,并采用该蓝牙连接参数,将第一电子设备已存储的第二电子设备的蓝牙连接参数进行更新。
在第二方面的一种可能实现方式中,在所述第一电子设备接收第二电子设备发送的第一参数变更指示信息之前,所述方法还包括:
所述第一电子设备向所述第二电子设备发送第一请求消息,所述第一请求消息用于请求与所述第二电子设备建立蓝牙连接;
其中,所述第一电子设备接收第二电子设备发送的第一参数变更指示信息,包括:
所述第一电子设备接收所述第二电子设备发送的对第一请求消息的所述第一响应消息,所述第一响应消息包括所述第一参数变更指示信息。
需要说明的是,以上是以本端设备获取对端设备的变更信息为例说明的,在实际实现时,本端设备在信息发生变更的情况下,也可以将本端变更信息发送给对端设备,以指示对端设备将其存储的信息进行刷新。如此,双方设备可以在连接建立时针对信息变更部分进行交互,如此可以简化连接建立流程,可提升蓝牙连接速度,并且可以避免空口交互资源的浪费。
在第二方面的一种可能实现方式中,所述方法还包括:在所述第一参数变更指示信息指示无变更内容的情况下,所述第一电子设备根据存储的所述第一蓝牙连接参数和所述第三蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
通过上述方案,在两个电子设备需要建立蓝牙连接时,可以先判断对方设备的蓝牙连接参数是否有变化,进一步确定是否需要交互蓝牙连接参数或者需要交互哪些蓝牙连接参数:若对方设备的蓝牙连接参数未发生变化,则可以无需交互蓝牙连接参数,直接从本端设备处获取已存储的对方设备的蓝牙连接参数以建立蓝牙连接;若对方设备的蓝牙连接参数发生变化,则可以仅交互发生变化的信息以建立蓝牙连接,如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
在第二方面的一种可能实现方式中,所述第一参数变更指示信息是采用掩码方式标记得到的信息。这样,双方设备可以对本端设备发生变更的信息或节点进行标识,进而双方设备交互信息标识,这样在建立连接时双方设备可以根据信息标识,识别哪些信息发生变更,并针对变更信息重新协商交互,而无需针对未发生变更的信息进行交互及协商,如此可省略部分连接交互流程。因此,本申请可以简化连接建立流程,可提升蓝牙连接速度,并且可以避免空口交互资源的浪费。
需要说明的是,对于除TWS耳机这种对等设备之外的非对等设备间的连接(如耳机连接手机),可以采用第二方面提供的方法省略部分连接交互流程。例如对于耳机和手机这样的蓝牙连接组合,由于配对前无法获知对端信息,因此无法按照TWS双耳这样从本地提取信息。需要在首次建立配对时,按照标准流程建立并协商交换后,即获取了对端静态配置和能力信息。本端设备将对端设备的信息记录下来,在下一次建立连接时,若对端设备的信息没有发生变更,则可以省去再一次的协商交换;或对端设备的信息有一部分发生变更,则仅交互发生变更的信息,从而获取到用于蓝牙连接的所有参数,即可建立蓝牙连接,如此可以简化连接建立流程,可提升蓝牙连接速度,并且可以避免空口交互资源的浪费。
第三方面,本申请提供一种电子设备,所述电子设备包括用于执行上述第一方面中的方法的单元。该电子设备可对应于执行上述第一方面中描述的方法,该电子设备中的单元的相关描述请参照上述第一方面的描述,为了简洁,在此不再赘述。
第四方面,本申请提供一种电子设备,所述电子设备包括用于执行上述第二方面中的方法的单元。该电子设备可对应于执行上述第二方面中描述的方法,该电子设备中的单元的相关描述请参照上述第二方面的描述,为了简洁,在此不再赘述。
第五方面,本申请提供一种蓝牙通信系统,所述蓝牙通信系统包括第一电子设备和第二电子设备;
所述第一电子设备,用于向第二电子设备发送所述第一电子设备的第一版本信息,所述第一版本信息用于指示所述第一电子设备的版本;
所述第二电子设备,用于接收所述第一电子设备发送的所述第一版本信息,并根据所述第一版本信息,向所述第一电子设备发送所述确认信息,所述确认信息用于指示所述第二电子设备的版本与所述第一电子设备的版本相同;
所述第一电子设备,还用于接收所述第二电子设备发送的所述确认信息,并根据第一蓝牙连接参数与所述第二电子设备建立蓝牙连接;
其中,所述第一蓝牙连接参数为所述第一电子设备的版本对应的蓝牙连接参数。
其中,该蓝牙通信系统对应于执行上述第一方面中描述的方法中描述的方法,第一电子设备和第二电子设备的相关描述请参照上述第一方面的描述,为了简洁,在此不再赘述。
第六方面,本申请还提供一种蓝牙通信系统,所述蓝牙通信系统包括第一电子设备和第二电子设备;
所述第二电子设备,用于向所述第一电子设备发送第一参数变更指示信息,所述第一参数变更指示信息用于指示所述第二电子设备的第一蓝牙连接参数的变更内容;
所述第一电子设备,用于接收第二电子设备发送的所述第一参数变更指示信息,并根据存储的所述第一蓝牙连接参数和所述第一参数变更指示信息指示的变更内容,确定所述第二电子设备的第二蓝牙连接参数;
所述第一电子设备,还用于根据所述第二电子设备的第二蓝牙连接参数和所述第一电子设备的第三蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
其中,该蓝牙通信系统对应于执行上述第二方面中描述的方法中描述的方法,第一电子设备和第二电子设备的相关描述请参照上述第二方面的描述,为了简洁,在此不再赘述。
第七方面,本申请提供一种电子设备,所述电子设备包括处理器,处理器与存储器耦合,存储器用于存储计算机程序或指令,处理器用于执行存储器存储的计算机程序或指令,使得第一方面及其任意可能的实现方式中的方法被执行。
第八方面,本申请提供一种电子设备,所述电子设备包括处理器,处理器与存储器耦合,存储器用于存储计算机程序或指令,处理器用于执行存储器存储的计算机程序或指令,使得第二方面及其任意可能的实现方式中的方法被执行。
第九方面,本申请提供一种计算机可读存储介质,其上存储有用于实现第一方面中的方法和/或第二方面中的方法的计算机程序(也可称为指令或代码)。
例如,该计算机程序被计算机执行时,使得该计算机可以执行第一方面及其任意可能的实现方式中的方法和/或第二方面及其任意可能的实现方式中的方法。
第十方面,本申请提供一种芯片(例如蓝牙芯片),包括处理器。处理器用于读取并执行存储器中存储的计算机程序,以执行第一方面及其任意可能的实现方式中的方法和/或第二方面及其任意可能的实现方式中的方法。
可选地,所述芯片还包括存储器,存储器与处理器通过电路或电线连接。
第十一方面,本申请提供一种芯片系统,包括处理器。处理器用于读取并执行存储器中存储的计算机程序,以执行第一方面及其任意可能的实现方式中的方法和/或第二方面及其任意可能的实现方式中的方法。
该电子设备是芯片系统时,可以由芯片(例如蓝牙芯片)构成,也可以包含芯片和其他分立器件。
第十二方面,本申请提供一种计算机程序产品,所述计算机程序产品包括计算机程序(也可称为指令或代码),所述计算机程序被计算机执行时使得所述计算机实现第一方面及其任意可能的实现方式中的方法和/或第二方面及其任意可能的实现方式中的方法。
可以理解的是,上述提供的电子设备、蓝牙通信系统、计算机可读存储介质、计算机程序产品或方法等均用于上文所提供的蓝牙连接方法中,因此,其所能达到的有益效果可参考对应的蓝牙连接方法中的有益效果。
本申请的这些方面或其他方面在以下实施例的描述中会更加简明易懂。
附图说明
图1是本申请实施例提供的一种系统架构示意图。
图2是本申请实施例提供的一种蓝牙协议架构的示意图。
图3是本申请实施例提供的一种蓝牙连接方法的流程示意图之一。
图4是本申请实施例提供的一种蓝牙连接方法的流程示意图之二。
图5是本申请实施例提供的一种蓝牙连接方法的流程示意图之三。
图6是本申请实施例提供的一种蓝牙连接方法中的设备配对的示意图。
图7是本申请实施例提供的一种蓝牙连接方法的流程示意图之四。
图8是本申请实施例提供的一种电子设备的示意性结构框图之一。
图9是本申请实施例提供的一种电子设备的示意性结构框图之二。
图10是本申请实施例提供的一种电子设备的硬件示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。
在本申请的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。并且,在本申请的描述中,除非另有说明,“多个”是指两个或多于两个。另外,为了便于清楚描述本申请实施例的技术方案,本申请实施例中所述的“第一”和“第二”等是用于区别不同的对象,或者用于区别对同一对象的不同处理,而不是用于描述对象的特定顺序。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有 的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
图1示出了本申请的各个示例性实施例所涉及的通信系统的架构示意图。如图1所示,通信系统100可以包括多个支持无线通信技术的电子设备。例如,通信系统100可以包括蓝牙耳机11和手机12,其中蓝牙耳机11包括第一耳机01和第二耳机02,该蓝牙耳机11与手机12之间可以通过无线通信技术建立并保持无线连接;此外,第一耳机01与第二耳机02也可以作为支持无线通信技术的独立电子设备,彼此之间可以通过无线通信技术建立并保持无线连接。再例如,通信系统100还可以包括手机13,手机12和手机13之间可以通过无线通信技术建立并保持无线连接。
可选的,上述无线通信技术可以是蓝牙(bluetooth,BT),例如传统蓝牙或者低功耗蓝牙(bluetooth low energy,BLE),或者通用2.4G/5G频段无线通信技术等。
可选的,上述通信系统100可以包括如图1所示的蓝牙耳机和手机等,当然还可以包括平板电脑,无线音箱,无线手环,无线车载,无线智能眼镜,无线手表,增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备,媒体播放器(例如MP3、MP4等)、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、个人数字助理(personal digital assistant,PDA)、电视或智能手表等支持支持无线通信技术的电子设备,本申请实施例对通信系统100中的电子设备的设备类型不予具体限定。这些电子设备之间可以通过无线通信技术建立并保持无线连接(例如蓝牙连接)。需要说明的是,能够支持蓝牙功能的电子设备也被称为蓝牙设备。
示例性的,以电子设备为蓝牙耳机为例进行说明,蓝牙耳机可以有多种类型,例如可以是耳塞式、入耳式、头戴式、耳罩式或挂耳式蓝牙耳机等。蓝牙耳机可以包括分别佩戴于用户左耳和右耳的第一部分和第二部分,可以通过连接线相连,例如颈带式蓝牙耳机;也可以是相互独立的两部分,例如真无线立体声(true wireless stereo,TWS)耳机。
本申请中,蓝牙耳机为支持蓝牙通信协议的耳机。其中,蓝牙通信协议可以为传统蓝牙协议,还可以为BLE低功耗蓝牙协议;当然,还可以是未来推出的其他新的蓝牙协议类型。从蓝牙协议的版本角度而言,蓝牙通信协议的版本可以为下述中的任一版本:1.0系列版本、2.0系列版本、3.0系列版本、4.0系列版本、未来推出的其他系列版本。
示例性的,以蓝牙耳机为TWS耳机为例,如图1所示,TWS耳机11包括第一耳机01和第二耳机02,第一耳机01和第二耳机02内均设置有蓝牙模块,第一耳机01和第二耳机02可以通过蓝牙协议进行数据传输,其中这两个耳机的蓝牙通信协议版本可能相同,也可能不同。TWS耳机11从外观上看,第一耳机01和第二耳机02之间没有连接线,具有携带方便、易于使用的优点。可选的,第一耳机01和第二耳机02均可以包括麦克风,也就是说,第一耳机01和第二耳机02除了具有音频播放的功能外,还具有音频采集的功能。
在实际实现时,用户可以在双耳模式或单耳模式下使用TWS耳机11。在单耳模式下,用户佩戴第一耳机01,或者佩戴第二耳机02,进行听音乐或接/打电话等音频业务。在双耳模式下,用户可以左右耳分别佩戴这两个耳机进行听音乐或接/打电话等音频业务。在双耳模式下,这两个耳机有主耳机和副耳机之分。并且,在TWS耳机的使用过程中,两个耳机的主、副角色还可以基于不同的条件进行切换。例如,电量较高的耳机可以切换为 主耳机,电量较低的耳机可以切换为副耳机;再例如,假设用户佩戴第一耳机01和第二耳机02且第一耳机01为主耳机以及第二耳机02为副耳机,若用户摘掉第一耳机01,则此时第二耳机02可以从副耳机切换为主耳机,第一耳机01从主耳机切换为副耳机或者在预设时长后停止工作或直接停止工作。
一方面,在单耳模式下,若用户佩戴第一耳机01而未佩戴第二耳机02,此时第一耳机01为主耳机,则主耳机和手机可以通过信息交互及参数协商,进行配对并建立无线连接,以通过该无线连接实现主耳机和手机之间的无线通信和业务处理。示例性的,如图1所示,手机12与第一耳机01可以通过信息交互及参数协商,建立无线连接,若手机12发起音频业务,则手机12可以将音频信号发送给第一耳机01,第一耳机01接收到音频信号之后播放该音频信号。
另一方面,在双耳模式下,若用户佩戴第一耳机01和第二耳机02,此时第一耳机01和第二耳机02分别为主耳机和副耳机,则主耳机和副耳机可以通过信息交互及参数协商,进行配对并建立无线连接,以通过该无线连接实现主耳机和副耳机之间的无线通信和业务处理。
再一方面,在双耳模式下,若用户佩戴第一耳机01和第二耳机02,则主耳机和副耳机可以通过信息交互及参数协商,进行配对并建立无线连接,并且主耳机和手机也可以通过无线通信技术进行配对并建立无线连接。从而,实现手机与主耳机之间,主耳机与副耳机之间的无线连接、无线通信和业务处理。示例性的,如图1所示,手机12与第一耳机01可以通过信息交互及参数协商,建立无线连接;同样,第一耳机01与第二耳机02可以通过信息交互及参数协商,建立无线连接。例如,若手机12发起音频业务,则手机12可以将音频信号发送给第一耳机01,第一耳机01接收到音频信号之后将音频信号发送给第二耳机02,使得第一耳机01和第二耳机02分别播放该音频信号。
在一些实施例中,蓝牙耳机可以支持下述应用中的一种或多种:HSP(headset profile)应用、HFP(hands-free profile)应用、A2DP(advanced audio distribution profile)应用。其中,HSP应用代表耳机应用,提供手机与耳机之间通信所需的基本功能,蓝牙耳机可以作为手机的音频输入和输出接口。HFP应用代表免提应用,HFP应用在HSP应用的基础上增加了某些扩展功能,蓝牙耳机可以控制手机的通话过程,例如:接听、挂断、拒接、语音拨号等。A2DP应用为高级音频传送应用,支持传输立体声音频流。
在上述图1所示的通信系统100中,设备之间需要遵循蓝牙协议,实现蓝牙连接及信息交换。与开放系统互联参考模型(open system interconnection reference model,OSI)一样,蓝牙技术的协议体系也采用了分层结构,从底层到高层形成了蓝牙协议栈,各层协议定义了所完成的功能和使用数据分组格式,以保证蓝牙产品间的互操作性。其中,蓝牙的核心协议包括基带协议、链路管理协议LMP、逻辑链路控制和适配协议L2CAP和业务发现协议SDP等。为便于理解本申请实施例,图2示出了蓝牙协议架构的示意图。下面结合图2,对本申请实施例中涉及的这几个蓝牙协议进行解释说明,以便于本领域技术人员理解。
(1)基带协议(baseband),为基带与链路控制层的协议,用于确保微微网内各蓝牙设备之间由射频构成的物理连接。蓝牙的射频系统是一个调频系统,其任一分组在指定时隙、指定频率上发送。它使用查询和分页进程同步不同设备间的发送频率和时钟,为基带 数据分组提供了两种物理连接方式,即面向连接(synchronous connection oriented link,SCO)和无连接(asynchronous connectionless,ACL),而且在同一射频上可实现多路数据传送;SCO和扩展的SCO(extended SCO,eSCO)可以用于传输对时间要求很高的通信数据。ACL适用于数据分组,SCO适用于话音以及话音与数据的组合。对于不同数据类型(包括连接管理信息和控制信息)都分配一个特殊通道。可使用各种用户模式在蓝牙设备间传送话音,面向连接的话音分组只需经过基带传输,而不到达L2CAP。话音模式在蓝牙系统内相对简单,只需开通蓝牙话音连接就可以传送话音。
(2)链路管理协议(link manager protocol,LMP),负责各蓝牙设备间连接的建立和设置。LMP通过连接的发起、交换和核实进行身份验证和加密,通过协商确定基带数据分组大小;还控制无线设备的节能模式和工作周期,以及微微网络内设备单元的连接状态。
(3)逻辑链路控制和适配协议(logical link control and adaptation protocol,L2CAP),L2CAP是基带协议的上层协议,可以认为其与LMP并行工作,L2CAP和LMP的区别在于:当业务数据不经过LMP时,L2CAP为上层提供服务。L2CAP提供逻辑信道,称为L2CAP信道。L2CAP向上层协议提供面向连接的和无连接的数据服务,它采用了多路技术、分割和重组技术、群提取技术。L2CAP允许高层协议以64k字节长度收发数据分组。虽然基带协议提供了SCO和ACL两种连接类型,但L2CAP只支持ACL。
(4)业务发现协议(service discovery protocol,SDP),发现业务在蓝牙技术框架中起着至关重要的作用,它是所有用户模式的基础。通过使用SDP,可以查询到设备的信息和服务类型,从而在蓝牙设备间建立相应的连接。
目前,不同电子设备之间的连接过程需要按照协议标准流程实现,该标准流程包括连接双方信息交互流程。具体的,在连接过程中,按照协议标准流程,电子设备之间需要进行一些参数协商和信息交互,比如LMP的特性支持、版本规格等交换,关键参数协商,SDP业务查询等。特别是SDP业务查询,需要先建立L2CAP信道,再进行查询,其过程是比较耗时的。因此,上述连接信息交互的流程在蓝牙连接过程中会占用一定时间,造成蓝牙连接时延较长。如何降低蓝牙连接时延以提升用户体验,是需要解决的技术问题。
鉴于上述情况,本申请基于上述系统架构提出一种蓝牙连接方法,可简化设备间的连接信息交互流程。该蓝牙连接方法应用于该蓝牙通信系统,该蓝牙通信系统包括第一电子设备和第二电子设备,本申请通过该蓝牙连接方法在第一电子设备与第二电子设备之间建立蓝牙连接。
由于蓝牙连接过程中需要获取和协商的对端设备信息,在设备生命周期内是固定的或者可修改的(半静态变化),因此这些信息在没有发生变化的情况下可以作为已知信息看待,不需要在每次连接时重复进行协商和获取。特别是TWS耳机,其两个耳机的软硬件是一样的,所以两个耳机的大部分静态信息或半静态信息是一致的,因此本申请基于此提供了如下两种可能的实施方式来简化蓝牙连接过程中的信息交互环节。
在第一实施方式中,本申请实施例提供一种蓝牙连接方法,在两个电子设备需要建立蓝牙连接时,可以先判断两个电子设备的版本是否一致,进一步确定是否需要交互蓝牙连接参数:若版本一致,双方设备的蓝牙连接参数是一致的,则可以无需交互蓝牙连接参数,直接从本端设备处获取对方设备的蓝牙连接参数以建立蓝牙连接,如此可简化蓝牙连接过 程中的信息交互环节,提升蓝牙连接速度。
在第二实施方式中,本申请实施例提供另一种蓝牙连接方法,在两个电子设备需要建立蓝牙连接时,可以先判断对方设备的蓝牙连接参数是否有变化,进一步确定是否需要交互蓝牙连接参数或者需要交互哪些蓝牙连接参数:若对方设备的蓝牙连接参数未发生变化,则可以无需交互蓝牙连接参数,直接从本端设备处获取已存储的对方设备的蓝牙连接参数以建立蓝牙连接;若对方设备的蓝牙连接参数发生变化,则可以仅交互发生变化的信息以建立蓝牙连接,如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
下面结合附图对本申请第一实施方式提供的蓝牙连接方法和第一实施方式提供的蓝牙连接方法分别进行示例性说明。
图3是根据本申请第一实施方式示出的一种蓝牙连接方法的流程图,参照图3所示,该方法300包括下述的步骤S301-S305。
S301,第一电子设备向第二电子设备发送第一版本信息,第二电子设备接收第一电子设备发送的第一版本信息。
在第一实施方式中,上述第一版本信息可以用于指示第一电子设备的版本。这里提到的电子设备的版本可以指电子设备支持或最近更新的蓝牙通信协议的版本,例如1.0系列版本、2.0系列版本、3.0系列版本、4.0系列版本,或者未来推出的其他系列版本。示例性的,第一电子设备的第一版本信息指示第一电子设备支持的蓝牙通信协议为4.0系列版本。当然,上述电子设备的版本还可以指电子设备的系统版本或者软件版本,具体可以根据实际使用需求确定,本申请实施例不作限定。
可选的,在第一实施方式中,在第一电子设备扫描到第二电子设备或发现第二电子设备的情况下,第一电子设备可以向第二电子设备发送第一版本信息,以发起蓝牙连接。其中,上述扫描或发现的过程可以是通过蓝牙通信技术实现的,该扫描或发现的过程即第一电子设备与第二电子设备建立寻呼的过程,也可以是通过其他无线通信技术(例如近场通信技术)实现的,具体可以根据实际使用需求确定,本申请实施例不作限定。为了便于说明,下文以双方设备寻呼完成后建立蓝牙连接为例进行示例性说明。
可选的,第一电子设备不但向第二电子设备发送第一版本信息,而且指示第二电子设备判断第一电子设备和第二电子设备的蓝牙通信协议版本是否一致。
需要说明的是,通常发起连接的电子设备可称为主设备,接受连接的设备可称为从设备。这里第一电子设备向第二电子设备发送第一版本信息,相当于发起连接,此时第一电子设备为主设备;第二电子设备接收第一版本信息,可作为从设备。
S302,第二电子设备判断第一版本信息与第二版本信息是否相同。
其中,该第二版本信息用于指示第二电子设备的版本。对于该第二版本信息的描述可以参见上述对第一版本信息的详细描述,此处不再赘述。
在实际实现中,以TWS耳机为例,第一耳机和第二耳机的蓝牙通信协议版本可能相同,例如两个耳机支持的蓝牙通信协议均为4.0系列版本;或者,第一耳机和第二耳机的蓝牙通信协议版本也可能不同,例如第一耳机支持的蓝牙通信协议为3.0系列版本,第二耳机支持的蓝牙通信协议为4.0系列版本。
在本申请实施例中,第二电子设备可以根据第一版本信息和第二版本信息,判断第二电子设备的版本与第一电子设备的版本是否相同,然后根据判断结果来确定后续执行步 骤:一方面,若第二电子设备判断第一版本信息与第二版本信息相同,即这两个蓝牙设备支持的蓝牙通信协议版本相同,则继续执行下述的步骤S303-S305;另一方面,若第二电子设备判断第一版本信息与第二版本信息不同,即这两个蓝牙设备支持的蓝牙通信协议版本不同,则继续执行下述的步骤S307或者S311。
S303,若版本相同,则第二电子设备向第一电子设备发送确认信息,第一电子设备接收第二电子设备发送的确认信息。
其中,确认信息用于指示第二电子设备的版本与第一电子设备的版本相同。若第一电子设备的版本和第二电子设备的版本相同,相同版本对应的蓝牙连接参数相同,则第一电子设备本地存储的蓝牙连接参数与第二电子设备本地存储的蓝牙连接参数相同,为例便于说明,下面在第一实施方式中将该相同版本对应的蓝牙连接参数称为第一蓝牙连接参数。
S304,第一电子设备从第一电子设备本地获取第一蓝牙连接参数,第二电子设备从第二电子设备本地获取第一蓝牙连接参数。
其中,该第一蓝牙连接参数为第一电子设备的版本对应的蓝牙连接参数。
S305,第一电子设备和第二电子设备根据第一蓝牙连接参数建立蓝牙连接。
在第一实施方式中,若版本一致,即双方设备的蓝牙连接参数是一致的,则可以无需交互蓝牙连接参数,例如无需交换LMP的特性支持和版本规格等,无需进行SDP业务查询等,而是可以直接从本端设备处获取对方设备的蓝牙连接参数,即可建立蓝牙连接,如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
在一种可能实施例中,在两个设备发起蓝牙连接之前,两个设备之间首先需要完成寻呼建立流程。示例性的,参考图3,在步骤S301之前,方法300还可以包括步骤S306。
S306,第一电子设备和第二电子设备建立寻呼。
示例性的,假设第二电子设备处于可发现且可连接状态,可通过广播消息被发现,并且第一电子设备处于侦听状态,可通过扫描广播消息,发现其他电子设备。其中,第二电子设备广播的消息中可以携带第二电子设备的设备标识或蓝牙地址。若第一电子设备扫描到该广播消息,则第一电子设备可以根据广播消息中携带的设备标识或蓝牙地址,发现第二电子设备,进而向第二电子设备发送寻呼消息,若第一电子设备向第二电子设备返回寻呼响应,则第一电子设备和第二电子设备寻呼成功。
进一步的,在寻呼成功之后,第一电子设备可以向第二电子设备发送第一版本信息,即向第二电子设备发起连接,并且在判断第一电子设备和第二电子设备的版本相同的情况下,第一电子设备与第二电子设备直接调用双方设备共有的蓝牙连接参数,建立蓝牙连接。
通过本申请提供的一种蓝牙连接方法,在两个电子设备需要建立蓝牙连接时,可以先判断两个电子设备的版本是否一致,进一步确定是否需要交互蓝牙连接参数:若版本一致,双方设备的蓝牙连接参数是一致的,则可以无需交互蓝牙连接参数,直接从本端设备处获取对方设备的蓝牙连接参数以建立蓝牙连接,如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
上面描述了双方设备版本相同情况下的蓝牙连接方法,而对于双方设备版本不同的情况,若双方设备之前配对连接过且存储对端设备的信息,则双方设备可以先判断对端设备信息相对于上一次连接时所采用的信息是否发生变更,如对端设备信息发生变更,则交互发生变更的信息以建立连接即可;若对端设备信息没有发生变更,则无需交互信息,直接 调用存储的对端设备的信息以建立连接即可。
示例性的,结合图3,如图4所示,本申请第一实施方式提供的蓝牙连接方法还可以包括下述的S307-S309,描述了双方设备版本不同情况下的蓝牙连接方法。需要说明的是,在第一实施方式中,假设第一电子设备和第二电子设备在本次建立连接之前已经配对连接过,并且双方设备已经在本端设备处存储对端设备的蓝牙连接参数或信息。例如,第一电子设备本地存储有第二电子设备的蓝牙连接参数。
S307,在确认信息指示第二电子设备的版本与第一电子设备的版本不同的情况下,第一电子设备接收第二电子设备发送的第一参数变更指示信息。
其中,该第一参数变更指示信息用于指示第二电子设备的蓝牙连接参数的变更内容;
示例性的,第一参数变更指示信息指示第二电子设备的跳频参数发生变更,此时双方设备需要针对跳频参数进行信息协商,使得双方设备在跳频参数上保持一致,以使得更快地建立连接。
可选的,在第一实施方式中,在确认信息指示第二电子设备的版本与第一电子设备的版本不同的情况下,第一电子设备可以向第二电子设备发送第一请求消息,该第一请求消息用于请求与第二电子设备建立蓝牙连接。相应地,第二电子设备在接收到该第一请求消息后,可以根据第一请求消息,向第一电子设备发送第一响应消息,该第一响应消息包括第一参数变更指示信息。进一步的,第一电子设备在接收到该第一响应消息后,可以从第一响应消息中获取第一参数变更指示信息。
S308,若第一参数变更指示信息指示有变更内容,则第一电子设备根据存储的第二电子设备的蓝牙连接参数和第一参数变更指示信息指示的变更内容,确定第二电子设备的第二蓝牙连接参数。
示例性的,若对端设备的蓝牙连接参数发生变更,则本端设备可以获取对端设备发生变更的蓝牙连接参数,并采用该蓝牙连接参数,将本端设备已存储的对端设备的蓝牙连接参数进行更新。
需要说明的是,第二电子设备的蓝牙连接参数为第一电子设备本地存储的、与第二电子设备上次连接时采用的第二电子设备的蓝牙连接参数,是可以直接从第一电子设备本地直接获取到的。第一电子设备可以通过接收到的第一参数变更指示信息对第二电子设备的蓝牙连接参数进行信息刷新或替换,得到第二电子设备最新的蓝牙连接参数(即第二蓝牙连接参数)。
S309,第一电子设备根据第一蓝牙连接参数和第二蓝牙连接参数,与第二电子设备建立蓝牙连接。
其中,第二蓝牙连接参数为第一电子设备本地存储的第一电子设备最新的蓝牙连接参数,也是可以直接从第一电子设备本地直接调用的。
在第一实施方式中,本端设备获取对端设备发生变更的蓝牙连接参数,并采用该蓝牙连接参数,将本端设备已存储的对端设备的蓝牙连接参数进行更新。本端设备采用更新后的对方设备的蓝牙连接参数以及本端设备的蓝牙连接参数,即可建立蓝牙连接,而无需交互未发生变更的蓝牙连接参数,如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
以上是针对第一参数变更指示信息指示第一蓝牙连接参数存在变更内容的情况说明 的,下面针对第一参数变更指示信息指示第一蓝牙连接参数无变更内容的情况进行说明。如图4所示,本申请实施例提供的蓝牙连接方法还包括下述的S310。
S310,若第一参数变更指示信息指示无变更内容,则第一电子设备根据第一蓝牙连接参数和存储的第二电子设备的蓝牙连接参数,与第二电子设备建立蓝牙连接。
在第一实施方式中,在双方设备版本不同情况下,若第一参数变更指示信息指示第一蓝牙连接参数无变更内容,则双方设备无需交互信息,例如无需交换LMP的特性支持和版本规格等,无需进行SDP业务查询等,而是可以直接调用存储的对端设备的信息以建立连接即可。如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
需要说明的是,本申请择一执行上述的S308-S309以及上述的S310,即本申请在第一参数变更指示信息指示有变更内容时执行S308和S309;在第一参数变更指示信息指示无变更内容时执行S310。
还需要说明的是,本申请择一执行上述的S303-S305以及上述的S307-S309(或者S307和S310),即本申请在双方设备版本相同时执行S303-S305;在双方设备版本不同时执行S307-S309(或者S307和S310)。
可选的,在第一实施方式中,由于部分信息可能会在版本升级等情况下发生改变,因此本申请可以采用掩码记录的方式,每一个省略的流程点都映射到一个掩码比特。如果本端设备信息发生变更时,标记该掩码比特。当连接寻呼建立时,首先双方设备交换掩码标记,如果信息发生了变更,那么双方设备针对变更部分,在后续流程中发起相应的协商交互。
具体的,第二电子设备可以采用掩码标记方式标记第二电子设备的蓝牙连接参数的变更内容,得到第一参数变更指示信息。当然,第一电子设备也可以采用掩码标记方式标记第一电子设备的蓝牙连接参数的变更内容,得到第二参数变更指示信息。
示例性的,掩码比特可以包括0和1,对于未发生变更的信息部分可标记为0,对于发生变更的信息部分可标记为1;当然,也可以对于未发生变更的信息部分可标记为1,对于发生变更的信息部分可标记为0,具体可以根据实际使用需求确定,本申请实施例不作限定。
例如,以未发生变更的信息部分标记为0,发生变更的信息部分标记为1的标记规则为例,第一电子设备接收到第二电子设备发送的采用掩码比特标记的第一参数变更指示信息,可以根据上述标记规则,针对标记1的信息部分进行信息交互更新及协商。
通过上述方案,双方设备可以对本端设备发生变更的信息或节点进行标识,进而双方设备交互信息标识,这样在建立连接时双方设备可以根据信息标识,识别哪些信息发生变更,并针对变更信息重新协商交互,而无需针对未发生变更的信息进行交互及协商,如此可省略部分连接交互流程。因此,本申请可以简化连接建立流程,可提升蓝牙连接速度,并且可以避免空口交互资源的浪费。
上面结合图4描述了双方设备版本不同情况下的一种蓝牙连接方法,即在双方设备版本不同情况下,交互参数变更指示信息,并根据参数变更指示信息确定需要交互的信息。下面结合图5,描述另一种蓝牙连接方法,即双方设备版本不同的情况下,可以按照标准的参数协商交互流程进行蓝牙连接。结合图3,如图5所示,本申请提供的蓝牙连接方法还可以包括下述的S311-S312。
S311,若版本不同,则第二电子设备向第一电子设备发送第一否定信息,第一电子设备接收第二电子设备发送的第一否定信息。
其中,第一否定信息用于指示第二电子设备的版本与第一电子设备的版本不同。
S312,第一电子设备与第二电子设备交互各自的蓝牙连接参数,建立蓝牙连接。
具体的,在两个设备支持的蓝牙通信协议版本不同的情况下,两个电子设备按照标准的参数协商交互流程,双方协商和交互信息,然后根据协商好的信息建立蓝牙连接。
示例性的,在第二电子设备的版本与第一电子设备的版本不同的情况下,第一电子设备向第二电子设备发送连接请求消息,该连接请求消息包括第一电子设备的蓝牙连接参数。第二电子设备接收第二电子设备发送的连接请求消息,并根据该连接请求消息,向第一电子设备发送响应消息,该响应消息包括第二电子设备的蓝牙连接参数。进一步的,第一电子设备接收第二电子设备发送的响应消息,然后第一电子设备和第二电子设备根据第一电子设备的蓝牙连接参数和第二电子设备的蓝牙连接参数,建立蓝牙连接。
需要说明的是,以上仅仅是示例性的描述,对于标准的参数协商交互流程的描述具体可以参见相关技术中对于标准的参数协商交互流程的相关描述,此处不予赘述。
需要说明的是,以上是以第一电子设备发送第一版本信息来发起连接的为例示例性的说明的,在实际实现时,本申请实施例不限于此,例如,第一电子设备还可以向其他电子设备发送连接请求消息来发起连接,并通过连接请求消息承载第一版本信息。
具体的,如图5所示,在第一电子设备与第二电子设备建立寻呼的情况下,第一电子设备可以向第二电子设备发送第一请求消息,该第一请求消息用于请求与第二电子设备建立蓝牙连接,并且该第一请求消息包括第一版本信息。相应地,第二电子设备在接收到该第一请求消息后,可以根据第一请求消息,将第一版本信息和第二版本信息进行比较,得到比较结果,然后向第一电子设备发送第一响应消息,该第一响应消息包括确认信息。进一步的,第一电子设备在接收到该第一响应消息后,可以根据第一响应消息,确定第一电子设备与第二电子设备版本是否相同。一方面。若版本相同,双方设备可以采用双方设备共有的相同版本对应的第一蓝牙连接参数建立蓝牙连接,而无需交互信息,如此可简化蓝牙连接流程。另一方面,若版本不同,则第二电子设备向第一电子设备发送第二响应消息,第一电子设备接收第二电子设备发送的第二响应消息,该第二响应消息包括第一否定信息。进一步的,第一电子设备与第二电子设备交互各自的蓝牙连接参数,建立蓝牙连接。即,第一电子设备在根据第二响应消息,确定其与第二电子设备版本不同时,按照传送的协议标准流程,即协商和交互信息,然后采用协商好的信息,与第二电子设备建立蓝牙连接。
综上所述,在第一实施方式中,若两个设备支持的蓝牙通信协议版本相同,则双方设备可以无需交互蓝牙连接参数,直接从本端设备处获取对方设备的蓝牙连接参数,即可建立蓝牙连接。若两个设备支持的蓝牙通信协议版本不同,则双方设备按照传统的协议标准流程交互信息后建立连接。
以上介绍了两个设备在版本相同情况下以及在版本不同情况下分别采用不同方式建立蓝牙连接的过程,是基于不考虑建立连接过程中的动态因素而实现的,也就是说上述第一蓝牙连接参数为静态参数。在实际实现时,在两个设备版本相同的情况下,双方设备在连接时可能还需要协商一些动态变化参数,例如连接建立请求、时钟、跳频参数等,对于 这些动态变化的信息和操作,双方设备可以按照正常流程进行交互。其中,上述第一请求消息和上述第一响应消息还可以用于承载需要协商的动态变化参数。假设第一电子设备与第二电子设备的版本相同,在第一电子设备与第二电子设备配对后,双方设备的一些信息和操作可能会发生动态变化。在此情况下,第一电子设备和第二电子设备可以交互动态变化参数,然后根据第一蓝牙连接参数和动态变化参数建立蓝牙连接。
示例性的,第一电子设备向第二电子设备发送第一电子设备的动态变化的第三蓝牙连接参数。然后,第二电子设备接收第三蓝牙连接参数,并根据第三蓝牙连接参数,向第一电子设备发送第二电子设备的动态变化的第四蓝牙连接参数。然后,第一电子设备可以根据第一蓝牙连接参数、第三蓝牙连接参数和第四蓝牙连接参数,与第二电子设备建立蓝牙连接。其中,第三蓝牙连接参数可以包括以下至少一项:连接请求、时钟、跳频参数等,类似地,第四蓝牙连接参数可以包括以下至少一项:连接响应、时钟、跳频参数等。如此,双方设备可以在获取对端设备的静态参数的情况下,协商并交互动态变化的参数,实现蓝牙连接。
本申请实施例中,对于蓝牙配对建立后没有变化的信息,通过本申请提供的蓝牙连接方法,可以省去在再次连接建立时进行协商和交互的环节。对于可能随着版本升级出现半静态变化的信息,可以通过标识变化信息以进行区分和识别,并在信息变化后再次建立连接时可以通过协商和交互进行信息刷新。
这样,版本相同的双方设备在建立蓝牙连接时,共有的蓝牙连接参数可以共享使用,无需交互传输给对方设备,仅需要交互协商一些动态变化参数,进而通过共有的蓝牙连接参数以及协商好的动态变化参数即可建立蓝牙连接,如此可简化蓝牙连接过程,提升蓝牙连接速度。
需要说明的是,本申请第一实施方式提供的蓝牙连接方法可以适用于设备型号相同的电子设备之间建立蓝牙连接的场景。示例性的,第一电子设备和第二电子设备分别为TWS耳机的第一耳机和第二耳机。可选的,第一耳机为主耳机,第二耳机为副耳机;或者,第一耳机为副耳机,第二耳机为主耳机,本申请实施例对此不作限定。
示例性的,针对TWS耳机的双耳互连这种场景,通常TWS的两个耳机是成套工作的,左右耳机是对等的设备,所以除了需要动态协商的参数外,对耳的信息完全可以通过本耳获取。此外,考虑到有一些信息会随软件版本升级变化,这些信息又非动态变化,因此可以与版本进行绑定,如果左右耳版本不一致,则需要走协商交互流程,可以待双耳版本升级一致后再裁剪交互。
当左右耳寻呼建立时,先检查双耳的版本一致性,一方面,如果双耳版本一致,则耳机通过从本耳机提取信息,替代通过流程交互从对耳获取。其中,对于动态变化的信息和操作,如连接建立请求、时钟、跳频参数等,则按照正常流程进行交互。另一方面,如果双耳版本不一致,则按照标准的蓝牙连接建立流程完成协商和交互。
综上所述,TWS耳机的两个耳机在进行配对连接时,只要两个耳机的版本一致,可以认为两个耳机版本和能力相关的信息都是一致的,对于对端耳机静态的信息直接可以从本端耳机处提取,替代相关技术中通过协商交互来获取蓝牙连接参数的方式,如此可简化蓝牙连接过程,提升蓝牙连接速度。与现有方案中在TWS双耳机首次配对以及后续连接时,每次都要完成标准的参数协商交互流程相比,在本申请实施例提供的蓝牙连接方法中, TWS双耳机在首次配对以及后续连接时可以省去部分协商交换流程,因此可以缩短连接建立时延。
当然,上述蓝牙连接方法还可以适用于设备型号不同的电子设备(例如电子设备和第二电子设备分别为手机和音箱)之间建立蓝牙连接的场景。
需要说明的是,本申请实施例提供的蓝牙连接方法不仅可以适用于设备间配对后的每次蓝牙连接的场景,而且也适用于设备间首次配对连接的场景。在两个电子设备首次配对连接时,可以先判断两个电子设备支持的蓝牙通信协议版本是否相同,若版本相同,则双方设备采用双方设备共有的蓝牙连接参数或信息进行配对并建立蓝牙连接;若版本不同,则按照标准的参数协商交互流程交互双方设备各自的蓝牙连接参数或信息以配对连接。
在相关技术的连接流程中,通常是按照协议标准流程,即双方需要协商和交互信息后根据协商好的信息建立连接,对于双方共有的已知信息,如果在每次连接时都重新走一遍协商和信息交互,那么会造成空口交互资源的浪费。与相关技术相比,本申请实施例提供的蓝牙连接方法是在建立连接时先判断两个设备版本是否一致,即若版本一致,两个设备的连接参数相同,则没有必要重新走一遍协商和信息交互,直接从本端设备处获取对方设备的蓝牙连接参数,即可建立蓝牙连接,如此可以简化连接建立流程,可提升蓝牙连接速度,并且可以避免空口交互资源的浪费。
需要说明的是,本申请实施例包括但不限于上述由一方设备判断两个设备的版本是否相同,然后告知对方设备判断结果的实现方式,在实际实现时,本申请实施例还可以包括其他可能的实现方式,例如,双方设备可以交互各自的版本信息,再由双方设备判断两个设备的版本是否相同。示例性的,第一电子设备向第二电子设备发送第一版本信息,第二电子设备向第一电子设备发送第二版本信息,第一电子设备将本端设备的第一版本信息与对端设备的第二版本信息进行比较,以判断两个设备版本是否相同;第二电子设备将本端设备的第二版本信息与对端设备的第一版本信息进行比较,以判断两个设备版本是否相同。本申请根据设备版本信息判断设备版本是否相同的实现方式可以包括多种可能方式,具体根据实际使用需求确定,本申请实施例不作限定。
以上结合图3-图5对本申请实施例第一实施方式提供的蓝牙连接方法作了介绍,下面结合图6和图7对本申请实施例第二实施方式提供的蓝牙连接方法进行示例性说明。
首先需要说明的是,在第二实施方式中,假设第一电子设备和第二电子设备在本次建立连接之前已经配对过,并且双方设备在本端设备处已存储对端设备的蓝牙连接参数或信息,以便于后续双方设备再次连接时调用。下面结合图6示例性的说明电子设备之间配对过程。
如图6中的(a)所示,第一电子设备当前显示设置界面51,第一电子设备接收用户对设置界面51中的蓝牙选项52的选中操作,如图6中的(b)所示,第一电子设备响应于用户操作,显示蓝牙设置界面53,该蓝牙设置界面53中显示蓝牙处于开启状态,并且包括已配对的设备列表54以及可用设备列表55,例如已配对的设备列表54中包括手机1和手机2,例如可用设备列表55中包括FreeBuds 3、智能手表和蓝牙音箱。第一电子设备接收用户对可用设备列表55中FreeBuds 3项的选中操作,如图6中的(c)所示,第一电子设备响应于用户操作,在蓝牙设置界面53上显示蓝牙配对请求界面56,用于提示用户是否要与耳机FreeBuds 3配对。第一电子设备接收用户对蓝牙配对请求界面56中的配对 项57的选中操作,第一电子设备响应于用户操作,与耳机FreeBuds 3进行信息交互和协商,如图6中的(d)所示,第一电子设备隐藏蓝牙配对请求界面56,并且更新蓝牙设置界面53,其中已配对的设备列表54中增加FreeBuds 3项。如此,第一电子设备与耳机配对完成,此时第一电子设备存储耳机的蓝牙连接参数。
由于电子设备完成首次配对后,即获取了对端设备的蓝牙连接参数,例如属性信息和特性能力信息,一方面,如果这些信息在下次连接时未曾改变,则不需要在连接时再次交互获取,从而节省信息交互引入的连接时延。另一方面,如果由于版本升级或其他原因引起这些信息中部分信息发生改变,则双方设备可以按需在连接建立时针对信息变更部分进行交互并刷新。
图7是根据本申请第二实施方式示出的一种蓝牙连接方法的流程图,参照图7所示,该方法400包括下述的步骤S401-S405。
S401,第一电子设备和第二电子设备建立寻呼。
首先需要说明的是,在S401之前,第一电子设备和第二电子设备已经配对过,并且第一电子设备存储有第二电子设备的蓝牙连接参数(假设称为第一蓝牙连接参数),第二电子设备存储有第一电子设备的蓝牙连接参数(假设称为第三蓝牙连接参数)。
S402,第二电子设备向第一电子设备发送第一参数变更指示信息,第一电子设备接收第二电子设备发送的第一参数变更指示信息。
其中,第一参数变更指示信息用于指示第二电子设备的第一蓝牙连接参数的变更内容。
示例性的,第一参数变更指示信息指示第二电子设备的跳频参数发生变更,此时双方设备需要针对跳频参数进行信息协商,使得双方设备在跳频参数上保持一致,以使得更快地建立连接。
可选的,在第二实施方式中,在第二电子设备扫描到第一电子设备或发现第一电子设备的情况下,第二电子设备可以向第一电子设备发送第一参数变更指示信息,以发起蓝牙连接。或者,在第一电子设备扫描到第二电子设备或发现第二电子设备的情况下,第一电子设备可以向第二电子设备发送连接请求消息,以发起连接,第二电子设备在接收到连接请求消息的情况下,向第一电子设备发送第一参数变更指示信息。示例性的,在第一电子设备与第二电子设备建立寻呼的情况下,第一电子设备可以向第二电子设备发送第一请求消息,该第一请求消息用于请求与第二电子设备建立蓝牙连接。相应地,第二电子设备在接收到该第一请求消息后,可以根据第一请求消息,向第一电子设备发送第一响应消息,该第一响应消息包括第一参数变更指示信息。进一步的,第一电子设备在接收到该第一响应消息后,可以从第一响应消息中获取第一参数变更指示信息。
需要说明的是,这里第一电子设备向第二电子设备发送第一请求消息,相当于发起连接,此时第一电子设备为主设备;第二电子设备接收第一请求消息并向第一电子设备反馈第一响应消息,相当于接受连接,此时第二电子设备可作为从设备。
在第二实施方式中,在两个设备发起蓝牙连接之前,两个设备之间首先需要完成寻呼建立流程。对于第一电子设备和第二电子设备建立寻呼的描述具体可以参见上述第一实施方式中对于设备间建立寻呼的详细描述,此处不再赘述。
S403,若第一参数变更指示信息指示有变更内容,第一电子设备根据存储的第一蓝牙 连接参数和第一参数变更指示信息指示的变更内容,确定第二电子设备的第二蓝牙连接参数。
示例性的,若对端设备的蓝牙连接参数发生变更,则本端设备可以获取对端设备发生变更的蓝牙连接参数,并采用该蓝牙连接参数,将本端设备已存储的对端设备的第一蓝牙连接参数进行更新。
需要说明的是,第一蓝牙连接参数为第一电子设备本地存储的与第二电子设备对应的蓝牙连接参数,是可以直接从第一电子设备本地直接获取到的。第一电子设备可以通过接收到的第一参数变更指示信息对第一蓝牙连接参数进行信息刷新或替换,得到第二电子设备最新的蓝牙连接参数(即第二蓝牙连接参数)。
S404,第一电子设备和第二电子设备根据第二蓝牙连接参数和第三蓝牙连接参数建立蓝牙连接。
其中,第三蓝牙连接参数为第一电子设备本地存储的与第一电子设备对应的蓝牙连接参数,也是可以直接从第一电子设备本地直接调用的。
在第二实施方式中,本端设备获取对端设备发生变更的蓝牙连接参数,并采用该蓝牙连接参数,将本端设备已存储的对端设备的蓝牙连接参数进行更新。本端设备采用更新后的对方设备的蓝牙连接参数以及本端设备的蓝牙连接参数,即可建立蓝牙连接,而无需交互未发生变更的蓝牙连接参数,如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
S405,若第一参数变更指示信息指示无变更内容,则第一电子设备和第二电子设备根据存储的第一蓝牙连接参数和第三蓝牙连接参数建立蓝牙连接。
在第二实施方式中,若第一参数变更指示信息指示第二电子设备的蓝牙连接参数无变更内容,则无需交互对端设备的信息,直接调用存储的对端设备的信息以建立连接即可。如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
需要说明的是,本申请择一执行上述的S403-S404以及上述的S405,即本申请在第一参数变更指示信息指示有变更内容时执行S403-S404;在第一参数变更指示信息指示无变更内容时执行S405。
需要说明的是,以上是以本端设备获取对端设备的变更信息为例说明的,在实际实现时,本端设备在信息发生变更的情况下,也可以将本端变更信息发送给对端设备,以指示对端设备将其存储的信息进行刷新。如此,双方设备可以在连接建立时针对信息变更部分进行交互,如此可以简化连接建立流程,可提升蓝牙连接速度,并且可以避免空口交互资源的浪费。
示例性的,第一电子设备可以向第二电子设备发送第二参数变更指示信息,第二电子设备接收第二电子设备发送的第二参数变更指示信息。其中,第二参数变更指示信息用于指示第一电子设备的蓝牙连接参数的变更内容。然后,第二电子设备可以根据第二参数变更指示信息指示的变更内容,确定第一电子设备的第三蓝牙连接参数。
例如,第二参数变更指示信息指示第一电子设备的时钟参数发生变更,此时双方设备需要针对时钟参数进行信息协商,使得双方设备在时钟参数上保持一致,以使得更快地建立连接。
可选的,第一电子设备可以在向第二电子设备发送第一请求消息时,通过第一请求消 息承载该第二参数变更指示信息。
类似于第一电子设备根据第一参数变更指示信息对本端存储的第二电子设备的蓝牙连接参数进行信息刷新或替换,第二电子设备可以根据第二参数变更指示信息,对本端存储的第一电子设备的蓝牙连接参数进行信息刷新或替换,得到第一电子设备最新的蓝牙连接参数。进一步的,在第二电子设备确定第一电子设备最新的蓝牙连接参数,以及第一电子设备确定第二电子设备最新的第二蓝牙连接参数之后,第二电子设备和第一电子设备可以根据第二电子设备最新的蓝牙连接参数和第一电子设备最新的蓝牙连接参数建立蓝牙连接。如此,双方设备可以在连接建立时针对信息变更部分进行交互,如此可以简化连接建立流程,可提升蓝牙连接速度,并且可以避免空口交互资源的浪费。
通过本申请提供的蓝牙连接方法,在两个电子设备需要建立蓝牙连接时,可以先判断对方设备的蓝牙连接参数是否有变化,进一步确定是否需要交互蓝牙连接参数或者需要交互哪些蓝牙连接参数:若对方设备的蓝牙连接参数未发生变化,则可以无需交互蓝牙连接参数,直接从本端设备处获取已存储的对方设备的蓝牙连接参数以建立蓝牙连接;若对方设备的蓝牙连接参数发生变化,则可以仅交互发生变化的信息以建立蓝牙连接,如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
需要说明的是,对于除TWS耳机这种对等设备之外的非对等设备间的连接(如耳机连接手机),可以采用第二实施方式提供的方法省略部分连接交互流程。具体的,对于耳机和手机这样的蓝牙连接组合,由于配对前无法获知对端信息,因此无法按照TWS双耳这样从本地提取信息。但是,在首次建立配对时,按照标准流程建立并协商交换后,即获取了对端静态配置和能力信息。本端设备将对端设备的信息记录下来,在下一次建立连接时,就可以省去再一次的协商交换。
可选的,在本申请第二实施方式提供的蓝牙连接方法中,如果由于版本升级或其他原因引起这些信息中部分信息发生改变,则双方设备可以标记发生改变的这些信息,当双方设备交互标记后识别到对方设备有信息变化时,可以按需在连接建立时针对信息变更部分进行交互并刷新。例如,上述第一参数变更指示信息可以是采用掩码标记方式标记得到的信息。
在第二实施方式中,由于部分信息可能会在版本升级等情况下发生改变,因此本申请采用掩码记录的方式,每一个省略的流程点都映射到一个掩码比特。如果本端设备信息发生变更时,标记该掩码比特。当连接寻呼建立时,首先双方设备交换掩码标记,如果信息发生了变更,那么双方设备针对变更部分,在后续流程中发起相应的协商交互。
示例性的,掩码比特可以包括0和1,对于未发生变更的信息部分可标记为0,对于发生变更的信息部分可标记为1;当然,也可以对于未发生变更的信息部分可标记为1,对于发生变更的信息部分可标记为0,具体可以根据实际使用需求确定,本申请实施例不作限定。
例如,以未发生变更的信息部分标记为0,发生变更的信息部分标记为1的标记规则为例,第一电子设备接收到第二电子设备发送的采用掩码比特标记的第一参数变更指示信息,可以根据上述标记规则,针对标记1的信息部分进行信息交互更新及协商。
通过上述方案,双方设备可以对本端设备发生变更的信息或节点进行标识,进而双方设备交互信息标识,这样在建立连接时双方设备可以根据信息标识,识别哪些信息发生变 更,并针对变更信息重新协商交互,而无需针对未发生变更的信息进行交互及协商,如此可省略部分连接交互流程。因此,本申请可以简化连接建立流程,可提升蓝牙连接速度,并且可以避免空口交互资源的浪费。
需要说明的是,与上述第一实施方式的TWS耳机双耳连接场景不同之处在于,第二实施方式需要通过首次配对获取对端设备信息后进行记录,并用掩码比特来指示信息的后续变更。考虑常规的蓝牙连接组合,通过本端设备存储对端设备信息的方式,可以在信息不发生变化或者发生部分变化的情况下裁剪一些不必要的协商交互,例如只要信息没有发生变化,就不会触发基于连接的信息协商和交换;再例如,若信息发生变化,则针对变更部分,发起相应的协商交互。因此,通过本申请方案的改进,可以在连接中裁剪交互流程,加快连接速度。
在相关技术的连接流程中,通常是按照协议标准流程,即双方需要协商和交互信息后根据协商好的信息建立连接,对于一些不变化的信息,如果在每次连接时都重新走一遍协商和信息交互,那么会造成空口交互资源的浪费。与相关技术相比,本申请方案可以针对未变更的信息,无需在连接时再次交互获取,以及对于由于版本升级或其他原因引起发生变更的信息,可以按需在连接建立时针对信息变更部分进行交互,从而可以缩短由于信息交互引入的连接时延。因此,本申请可以提升蓝牙连接速度,并且可以避免空口交互资源的浪费。
综上所述,本申请提供的蓝牙连接方法可以应用于下述场景1和场景2,通过该蓝牙连接方法可省去连接过程中信息交互和参数协商。
场景1、在首次配对连接后,对产品生命周期不会变更的信息,在连接双方中进行记录,在下次连接时不再进行交互。
场景2、对于可能半静态变更的信息,采用下述a)或b)所述方式省去连接过程中信息交互和参数协商。
a)与版本关联的信息,在连接寻呼成功后,先交换版本信息,如果版本未曾更新,则确认信息相对上次连接没有变化,后续流程不需要再进行协商和交换;
b)对信息项进行比特掩码标识,在连接寻呼成功后,先交换掩码比特,如果未曾变化则不需要在后续流程中进行协商和交换。如果信息发生变化,则针对变更部分,发起相应的协商和交互。
本文中描述的各个实施例可以为独立的方案,也可以根据内在逻辑进行组合,以实现不同的技术效果,这些方案都落入本申请的保护范围中。
本申请实施例并未对本申请实施例提供的方法的执行主体的具体结构进行特别限定,只要能够通过运行记录有本申请实施例提供的方法的代码的程序,以根据本申请实施例提供的方法实现即可。例如,本申请实施例提供的方法的执行主体可以是第一电子设备,或者是第一电子设备中能够调用程序并执行程序的功能模块。为了实现上述本申请实施例提供的方法中的各功能,第一电子设备可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。
图8为本申请实施例提供的一种电子设备700的示意性框图。该电子设备700包括收 发单元701和处理单元702;
收发单元701,用于在电子设备700与第二电子设备建立寻呼的情况下,向第二电子设备发送电子设备700的第一版本信息,该第一版本信息用于指示电子设备700的版本;
收发单元701,还用于接收第二电子设备发送的确认信息,该确认信息用于指示第二电子设备的版本与电子设备700的版本相同;
处理单元702,用于根据第一蓝牙连接参数与第二电子设备建立蓝牙连接;其中,第一蓝牙连接参数为电子设备700的版本对应的蓝牙连接参数。
在一种可能实施例中,收发单元701,还用于在第二电子设备的版本与电子设备700的版本不同的情况下,接收第二电子设备发送的第一参数变更指示信息,该第一参数变更指示信息用于指示第二电子设备的蓝牙连接参数的变更内容;
处理单元702,还用于根据存储的第二电子设备的蓝牙连接参数和第一参数变更指示信息指示的变更内容,确定第二电子设备的第二蓝牙连接参数;
处理单元702,还用于根据第一蓝牙连接参数和第二蓝牙连接参数,与第二电子设备建立蓝牙连接。
在一种可能实施例中,收发单元701,还用于若第一参数变更指示信息指示第一蓝牙连接参数未变更内容,则根据第一蓝牙连接参数和存储的第二电子设备的蓝牙连接参数,与第二电子设备建立蓝牙连接。
在一种可能实施例中,所述第一参数变更指示信息为采用掩码标记方式标记得到的信息。
在一种可能实施例中,收发单元701,具体用于向第二电子设备发送第一请求消息,并接收所述第二电子设备发送的对第一请求消息的第一响应消息;该第一请求消息包括第一版本信息,该第一响应消息包括确认信息。
在一种可能实施例中,第一蓝牙连接参数为静态参数;收发单元701,还用于向第二电子设备发送电子设备700的动态变化的第三蓝牙连接参数;并接收第二电子设备发送的第二电子设备的动态变化的第四蓝牙连接参数。处理单元702,还用于根据第一蓝牙连接参数、第三蓝牙连接参数和第四蓝牙连接参数,与第二电子设备建立蓝牙连接。
在一种可能实施例中,收发单元701,还用于在确认信息指示第二电子设备的版本与电子设备700的版本不同的情况下,向第二电子设备发送第二请求消息,该第二请求消息包括电子设备700的第一蓝牙连接参数;
收发单元701,还用于接收第二电子设备发送的第二响应消息,该第二响应消息包括第二电子设备的第二蓝牙连接参数;
处理单元702,还用于根据第一蓝牙连接参数和第二蓝牙连接参数,与第二电子设备建立蓝牙连接。
根据本申请实施例的电子设备700可对应于执行本申请第一实施方式中描述的第一电子设备对应的方法步骤,并且电子设备700中的模块的上述和其它操作和/或功能分别为了实现方法的相应流程,为了简洁,在此不再赘述。
本申请实施例提供的电子设备,在与另一电子设备建立蓝牙连接时,可以先判断两个电子设备的版本是否一致,进一步确定是否需要交互蓝牙连接参数:若版本一致,双方设备的蓝牙连接参数是一致的,则可以无需交互蓝牙连接参数,直接从本端设备处获取对方 设备的蓝牙连接参数以建立蓝牙连接,如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
图9为本申请实施例提供的一种电子设备800的示意性框图。该电子设备800包括收发单元801和处理单元802;
收发单元801,用于接收第二电子设备发送的第一参数变更指示信息,该第一参数变更指示信息用于指示第二电子设备的第一蓝牙连接参数的变更内容;
处理单元802,用于根据存储的第一蓝牙连接参数和第一参数变更指示信息指示的变更内容,确定第二电子设备的第二蓝牙连接参数;
处理单元802,还用于根据第二电子设备的第二蓝牙连接参数和第一电子设备的第三蓝牙连接参数,与第二电子设备建立蓝牙连接。
在一种可能实施例中,收发单元801,还用于在接收第二电子设备发送的第一参数变更指示信息之前,向所述第二电子设备发送第一请求消息,该第一请求消息用于请求与第二电子设备建立蓝牙连接;并且,收发单元801,还用于接收第二电子设备发送的对第一请求消息的第一响应消息,该第一响应消息包括第一参数变更指示信息。
在一种可能实施例中,处理单元802,还用于在第一参数变更指示信息指示第一蓝牙连接参数未变更内容的情况下,根据存储的第一蓝牙连接参数和第三蓝牙连接参数,与第二电子设备建立蓝牙连接。
在一种可能实施例中,第一参数变更指示信息是采用掩码标记方式标记得到的信息。
本申请实施例提供的电子设备,在与另一电子设备建立蓝牙连接时,可以先判断对方设备的蓝牙连接参数是否有变化,进一步确定是否需要交互蓝牙连接参数或者需要交互哪些蓝牙连接参数:若对方设备的蓝牙连接参数发生变化,则可以仅交互发生变化的信息以建立蓝牙连接,如此可简化蓝牙连接过程中的信息交互环节,提升蓝牙连接速度。
图10是本申请实施例提供的电子设备200的硬件示意性图。该电子设备200可以为图1所描述的蓝牙耳机或者手机的一种示例。如图10所示,电子设备200可以包括:处理器201、存储器202、无线通信模块203、音频模块204和电源模块205等,这些部件可通过一根或多根通信总线或信号线(图中未示出)进行通信。下面结合图2对电子设备的各个部件进行具体的介绍。
处理器201是电子设备的控制中心,利用各种接口和线路连接电子设备的各个部分,通过运行或执行存储在存储器202内的应用程序,以及调用存储在存储器202内的数据,执行电子设备的各种功能和处理数据。处理器101可以包括一个或多个处理单元,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器201中。处理器201具体可以是集成的控制芯片,也可以由包括各种有源和/或无源部件的电路组成,且该电路被配置为执行本申请实施例描述的属于处理器201的功能。以电子设备为蓝牙耳机11为例,处理器201可以用于执行相关应用程序,调用相关模块以实现本申请实施例中蓝牙耳机11的功能。例如,实现蓝牙耳机11与手机12之间进行物理连接和/或业务规范连接。
应理解,在本申请实施例中,该处理器201可以采用中央处理单元(central processing unit,CPU)。该处理器还可以是其它通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate Array,FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻 辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。或者该处理器201采用一个或多个集成电路,用于执行相关程序,以实现本申请实施例所提供的技术方案。
存储器202用于存储应用程序以及数据,处理器201通过运行存储在存储器202的应用程序以及数据,执行电子设备的各种功能以及数据处理。存储器202主要包括存储程序区以及存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可以存储根据使用电子设备时所创建的数据。以电子设备为蓝牙耳机11为例,存储器202可以存储用于蓝牙耳机11与手机12之间进行物理连接和/或业务规范连接的程序代码,用于蓝牙耳机11进行充电的程序代码,以及蓝牙耳机11与手机12进行无线配对连接的程序代码等。
此外,存储器202可以包括只读存储器,随机存取存储器,还可以包括非易失存储器,例如磁盘存储器件、闪存器件或其他易失性固态存储器件等,并向处理器201提供指令和数据。存储器202可以存储各种操作系统。上述存储器202可以独立于处理器201,通过上述通信总线与处理器201相连接;或者,存储器202也可以和处理器201集成在一起。
无线通信模块203可以用于支持通过无线通信技术实现电子设备之间的无线连接和无线通信,例如结合图1所示,蓝牙耳机11和手机12可以通过各自的无线通信模块203实现数据交换。在一些实施例中,该无线通信模块203可以为蓝牙芯片。如结合图1所示,蓝牙耳机11可以通过该蓝牙芯片,与手机12的蓝牙芯片之间进行配对并建立无线连接,以通过该无线连接实现蓝牙耳机11和手机12之间的无线通信和业务处理。通常,蓝牙芯片可以支持基础速率(basic rate,BR)/增强速率(enhanced data rate,EDR)蓝牙和BLE,例如可以收/发寻呼(page)信息,收/发BLE广播消息等。
另外,无线通信模块203还可以包括天线,无线通信模块203经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器201。无线通信模块203还可以从处理器201接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。
音频模块204可以用于管理音频数据,实现电子设备输入和输出音频流。音频模块204可以包括用于输出音频流的扬声器2041(或称听筒、受话器)组件,麦克风2042(或称话筒,传声器),与麦克风相配合的麦克收音电路等。扬声器2041可以用于将音频电信号转换成声音信号并播放。麦克风2042可以用于将声音信号转换为音频电信号。
电源模块205可以向各个部件供电,比如电源模块205包括电池和电源管理芯片,电池可以通过电源管理芯片与处理器201逻辑相连,从而通过电源模块205实现管理充电、放电、以及功耗管理等功能。
在一些实施例中,电子设备还可以包含显示器(或显示屏),也可以不包含显示器。显示器可以用于显示APP的显示界面,比如当前播放的歌曲等。显示器包括显示面板,显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,显示器中可以设置触摸传感器,形成触摸屏,本申请实施例不作限定。触摸 传感器用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给处理器201,以确定触摸事件类型。处理器201可以通过显示器提供与触摸操作相关的视觉输出。
在一些实施例中,电子设备还可以包含更多的器件,例如USB接口、传感器等,本申请实施例不多赘述。图2示出的各种部件可以在包括一个或多个信号处理或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。可以理解的是,本申请实施例示意的结构并不构成对电子设备的具体限定。电子设备还可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。
可选的,电子设备200还可以包括总线。其中,存储器202、无线通信模块203可以通过总线与处理器201连接。总线可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。
在一种可能的实现方式中,图10所示的电子设备200中的处理器201可以对应于图8中的装置700中的处理单元702,无线通信模块203可以对应于图8中的装置700中的收发单元701。并且,电子设备700中的各个单元的上述和其它操作和/或功能分别为了实现方法的相应流程,为了简洁,在此不再赘述。在电子设备200运行时,该处理器201执行存储器202中的计算机执行指令以通过电子设备700执行上述方法的操作步骤。
在一种可能的实现方式中,图10所示的电子设备200中的处理器201可以对应于图9中的装置800中的处理单元802,无线通信模块203可以对应于图9中的装置800中的收发单元801。并且,电子设备800中的各个单元的上述和其它操作和/或功能分别为了实现方法的相应流程,为了简洁,在此不再赘述。在电子设备200运行时,该处理器201执行存储器202中的计算机执行指令以通过电子设备800执行上述方法的操作步骤。
需要说明的是,本申请实施例中的电子设备可以为移动终端,也可以为非移动终端。示例性的,移动终端可以为手机、无线耳机、无线音箱、无线手环、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动终端可以为个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。
可选的,本申请实施例还提供一种电子设备,包括如图9所示的处理器201,存储器202,存储在存储器202上并可在处理器201上运行的计算机程序,该计算机程序被处理器201执行时实现上述蓝牙连接方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
可选地,在一些实施例中,本申请实施例还提供了一种计算机可读介质,该计算机可读介质存储有程序代码,当计算机程序代码在计算机上运行时,使得计算机执行上述各方面中的方法。
可选地,在一些实施例中,本申请实施例还提供了一种计算机程序产品,该计算机程序产品包括:计算机程序代码,当计算机程序代码在计算机上运行时,使得计算机执行上述各方面中的方法。
在本申请实施例中,终端设备包括硬件层、运行在硬件层之上的操作系统层,以及运 行在操作系统层上的应用层。其中,硬件层可以包括中央处理器(central processing unit,CPU)、内存管理单元(memory management unit,MMU)和内存(也称为主存)等硬件。操作系统层的操作系统可以是任意一种或多种通过进程(process)实现业务处理的计算机操作系统,例如,Linux操作系统、Unix操作系统、Android操作系统、iOS操作系统或windows操作系统等。应用层可以包含浏览器、通讯录、文字处理软件、即时通信软件等应用。
本申请的各个方面或特征可以实现成方法、装置或使用标准编程和/或工程技术的制品。本文中使用的术语“制品”可以涵盖可从任何计算机可读器件、载体或介质访问的计算机程序。例如,计算机可读介质可以包括但不限于:磁存储器件(例如,硬盘、软盘或磁带等),光盘(例如,压缩盘(compact disc,CD)、数字通用盘(digital versatile disc,DVD)等),智能卡和闪存器件(例如,可擦写可编程只读存储器(erasable programmable read-only memory,EPROM)、卡、棒或钥匙驱动器等)。
本文描述的各种存储介质可代表用于存储信息的一个或多个设备和/或其它机器可读介质。术语“机器可读介质”可以包括但不限于:无线信道和能够存储、包含和/或承载指令和/或数据的各种其它介质。
应理解,本申请实施例中提及的处理器可以是中央处理单元(central processing unit,CPU),还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
还应理解,本申请实施例中提及的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器RAM。例如,RAM可以用作外部高速缓存。作为示例而非限定,RAM可以包括如下多种形式:静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,
ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。
需要说明的是,当处理器为通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件时,存储器(存储模块)可以集成在处理器中。
还需要说明的是,本文描述的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件 还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的保护范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,上述单元或模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。此外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
上述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上,或者说对现有技术做出贡献的部分,或者该技术方案的部分,可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,该计算机软件产品包括若干指令,该指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。前述的存储介质可以包括但不限于:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (24)

  1. 一种蓝牙通信系统,其特征在于,所述系统包括第一电子设备和第二电子设备;
    所述第一电子设备,用于向所述第二电子设备发送第一版本信息,所述第一版本信息用于指示所述第一电子设备的版本;
    所述第二电子设备,用于接收所述第一电子设备发送的所述第一版本信息,并根据所述第一版本信息,向所述第一电子设备发送所述确认信息,所述确认信息用于指示所述第二电子设备的版本与所述第一电子设备的版本相同;
    所述第一电子设备,还用于接收所述第二电子设备发送的所述确认信息,并根据第一蓝牙连接参数与所述第二电子设备建立蓝牙连接;
    其中,所述第一蓝牙连接参数为所述第一电子设备的版本对应的蓝牙连接参数。
  2. 根据权利要求1所述的系统,其特征在于,
    所述第二电子设备,还用于若根据所述第一版本信息指示的所述第一电子设备的版本确定所述第一电子设备的版本与所述第二电子设备的版本不同时,向所述第一电子设备发送第一参数变更指示信息;
    所述第一电子设备还用于:
    接收所述第二电子设备发送的第一参数变更指示信息,所述第一参数变更指示信息用于指示所述第二电子设备的蓝牙连接参数是否变更以及变更内容;
    若所述第一参数变更指示信息指示有变更内容,则根据存储的所述第二电子设备的蓝牙连接参数和所述第一参数变更指示信息指示的变更内容,确定所述第二电子设备的第二蓝牙连接参数;
    根据所述第一蓝牙连接参数和所述第二蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
  3. 根据权利要求2所述的系统,其特征在于,
    所述第一电子设备,还用于若所述第一参数变更指示信息指示无变更内容,则根据所述第一蓝牙连接参数和存储的所述第二电子设备的蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
  4. 根据权利要求2或3所述的系统,其特征在于,
    所述第二电子设备,还用于采用掩码标记方式标记所述第二电子设备的蓝牙连接参数的变更内容,得到所述第一参数变更指示信息。
  5. 根据权利要求1至3中任一项所述的系统,其特征在于,
    所述第一电子设备,还用于在所述第二电子设备的版本与所述第一电子设备的版本不同的情况下,向所述第二电子设备发送第二请求消息,所述第二请求消息包括所述第一电子设备的第一蓝牙连接参数;
    所述第二电子设备,还用于接收所述第二电子设备发送的所述第二请求消息,并根据所述第二请求消息,向所述第一电子设备发送第二响应消息,所述第二响应消息包括所述第二电子设备的第二蓝牙连接参数;
    所述第一电子设备,还用于接收所述第二电子设备发送的所述第二响应消息,并根据所述第一蓝牙连接参数和所述第二蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
  6. 根据权利要求1至5中任一项所述的系统,其特征在于,
    所述第一电子设备,具体用于向第二电子设备发送第一请求消息,所述第一请求消息包括所述第一版本信息;
    所述第二电子设备,具体用于接收所述第一电子设备发送的所述第一请求消息,并根据所述第一请求消息,向所述第一电子设备发送第一响应消息,所述第一响应消息包括所述确认信息;
    所述第一电子设备,具体还用于接收所述第二电子设备发送的所述第一响应消息。
  7. 根据权利要求1所述的系统,其特征在于,所述第一蓝牙连接参数为静态参数;
    所述第一电子设备,具体用于向所述第二电子设备发送所述第一电子设备的动态变化的第三蓝牙连接参数;
    所述第二电子设备,具体用于接收所述第三蓝牙连接参数,并根据所述第三蓝牙连接参数,向所述第一电子设备发送所述第二电子设备的动态变化的第四蓝牙连接参数;
    所述第一电子设备,具体用于根据所述第一蓝牙连接参数、所述第三蓝牙连接参数和所述第四蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
  8. 一种蓝牙通信系统,其特征在于,所述系统包括第一电子设备和第二电子设备;
    所述第二电子设备,用于在与所述第一电子设备建立寻呼的情况下,向所述第一电子设备发送第一参数变更指示信息,所述第一参数变更指示信息用于指示所述第二电子设备的第一蓝牙连接参数的变更内容;
    所述第一电子设备,用于接收第二电子设备发送的所述第一参数变更指示信息,并根据存储的所述第一蓝牙连接参数和所述第一参数变更指示信息指示的变更内容,确定所述第二电子设备的第二蓝牙连接参数;
    所述第一电子设备,还用于根据所述第二电子设备的第二蓝牙连接参数和所述第一电子设备的第三蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
  9. 根据权利要求8所述的系统,其特征在于,所述第一电子设备还用于:
    在所述第一参数变更指示信息指示所述第一蓝牙连接参数未变更内容的情况下,根据存储的所述第一蓝牙连接参数和所述第三蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
  10. 根据权利要求8或9所述的系统,其特征在于,
    所述第二电子设备,还用于在向所述第一电子设备发送第一参数变更指示信息之前,采用掩码标记方式标记所述第二电子设备的第一蓝牙连接参数的变更内容,得到所述第一参数变更指示信息。
  11. 根据权利要求8至10中任一项所述的系统,其特征在于,
    所述第二电子设备,具体用于接收所述第一电子设备发送的所述第一请求消息,并根据所述第一请求消息,向所述第一电子设备发送第一响应消息,所述第一响应消息包括所述第一参数变更指示信息;
    所述第一电子设备,具体还用于接收所述第二电子设备发送的所述第一响应消息。
  12. 一种蓝牙连接方法,其特征在于,所述方法包括:
    第一电子设备向第二电子设备发送第一版本信息,所述第一版本信息用于指示所述第一电子设备的版本;
    所述第一电子设备接收所述第二电子设备发送的确认信息,所述确认信息用于指示所述第二电子设备的版本与所述第一电子设备的版本相同;
    所述第一电子设备根据第一蓝牙连接参数与所述第二电子设备建立蓝牙连接;
    其中,所述第一蓝牙连接参数为所述第一电子设备的版本对应的蓝牙连接参数。
  13. 根据权利要求12所述的方法,其特征在于,所述方法还包括:
    在所述第二电子设备的版本与所述第一电子设备的版本不同的情况下,接收所述第二电子设备发送的第一参数变更指示信息,所述第一参数变更指示信息用于指示所述第二电子设备的蓝牙连接参数的变更内容;
    根据存储的所述第二电子设备的蓝牙连接参数和所述第一参数变更指示信息指示的变更内容,确定所述第二电子设备的第二蓝牙连接参数;
    根据所述第一蓝牙连接参数和所述第二蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
  14. 根据权利要求13所述的方法,其特征在于,所述方法还包括:
    若所述第一参数变更指示信息指示所述第一蓝牙连接参数未变更内容,则根据所述第一蓝牙连接参数和存储的所述第二电子设备的蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
  15. 根据权利要求13或14所述的方法,其特征在于,所述第一参数变更指示信息为采用掩码标记方式标记得到的信息。
  16. 根据权利要求12至14中任一项所述的方法,其特征在于,所述方法还包括:
    在所述第二电子设备的版本与所述第一电子设备的版本不同的情况下,所述第一电子设备向所述第二电子设备发送第二请求消息,所述第二请求消息包括所述第一电子设备的第一蓝牙连接参数;
    所述第一电子设备接收所述第二电子设备发送的第二响应消息,所述第二响应消息包括所述第二电子设备的第二蓝牙连接参数;
    所述第一电子设备根据所述第一蓝牙连接参数和所述第二蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
  17. 根据权利要求12至16中任一项所述的方法,其特征在于,所述第一电子设备向第二电子设备发送第一版本信息,包括:
    所述第一电子设备向第二电子设备发送第一请求消息,所述第一请求消息包括所述第一版本信息;
    其中,所述第一电子设备接收所述第二电子设备发送的确认信息,包括:
    所述第一电子设备接收所述第二电子设备发送的对所述第一请求消息的第一响应消息,所述第一响应消息包括所述确认信息。
  18. 根据权利要求12所述的方法,其特征在于,所述第一蓝牙连接参数为静态参数;
    所述方法还包括:
    所述第一电子设备向所述第二电子设备发送所述第一电子设备的动态变化的第三蓝牙连接参数;
    所述第一电子设备接收所述第二电子设备发送的所述第二电子设备的动态变化的第四蓝牙连接参数;
    所述第一电子设备根据所述第一蓝牙连接参数、所述第三蓝牙连接参数和所述第四蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
  19. 一种蓝牙连接方法,其特征在于,所述方法包括:
    第一电子设备接收第二电子设备发送的第一参数变更指示信息,所述第一参数变更指示信息用于指示所述第二电子设备的第一蓝牙连接参数的变更内容;
    所述第一电子设备根据存储的所述第一蓝牙连接参数和所述第一参数变更指示信息指示的变更内容,确定所述第二电子设备的第二蓝牙连接参数;
    所述第一电子设备根据所述第二电子设备的第二蓝牙连接参数和所述第一电子设备的第三蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
  20. 根据权利要求19所述的方法,其特征在于,所述方法还包括:
    在所述第一参数变更指示信息指示无变更内容的情况下,所述第一电子设备根据存储的所述第一蓝牙连接参数和所述第三蓝牙连接参数,与所述第二电子设备建立蓝牙连接。
  21. 根据权利要求19或20所述的方法,其特征在于,所述第一参数变更指示信息是采用掩码标记方式标记得到的信息。
  22. 根据权利要求19至21中任一项所述的方法,其特征在于,在所述第一电子设备接收所述第二电子设备发送的第一参数变更指示信息之前,所述方法还包括:
    所述第一电子设备向所述第二电子设备发送第一请求消息,所述第一请求消息用于请求与所述第二电子设备建立蓝牙连接;
    其中,所述第一电子设备接收第二电子设备发送的第一参数变更指示信息,包括:
    所述第一电子设备接收所述第二电子设备发送的对第一请求消息的所述第一响应消息,所述第一响应消息包括所述第一参数变更指示信息。
  23. 一种电子设备,其特征在于,包括处理器,所述处理器与存储器耦合,所述处理器用于执行所述存储器中存储的计算机程序或指令,以使得所述电子设备实现如权利要求12至18中任一项所述的方法和/或如权利要求19至22中任一项所述的方法。
  24. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,当所述计算机程序在电子设备上运行时,使得所述电子设备执行如权利要求12至18中任一项所述的方法和/或如权利要求19至22中任一项所述的方法。
PCT/CN2021/116264 2020-09-30 2021-09-02 蓝牙通信系统、蓝牙连接方法、电子设备及存储介质 WO2022068517A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP21874178.3A EP4210362A4 (en) 2020-09-30 2021-09-02 BLUETOOTH COMMUNICATION SYSTEM, BLUETOOTH CONNECTION METHOD, ELECTRONIC DEVICE AND STORAGE MEDIUM

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011063166.X 2020-09-30
CN202011063166.XA CN114339696A (zh) 2020-09-30 2020-09-30 蓝牙通信系统、蓝牙连接方法、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022068517A1 true WO2022068517A1 (zh) 2022-04-07

Family

ID=80951129

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/116264 WO2022068517A1 (zh) 2020-09-30 2021-09-02 蓝牙通信系统、蓝牙连接方法、电子设备及存储介质

Country Status (3)

Country Link
EP (1) EP4210362A4 (zh)
CN (1) CN114339696A (zh)
WO (1) WO2022068517A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116056077A (zh) * 2022-08-04 2023-05-02 荣耀终端有限公司 一种蓝牙通信方法及相关电子设备

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116056051B (zh) * 2022-06-06 2023-10-27 荣耀终端有限公司 蓝牙连接控制方法、系统和设备
CN117202143A (zh) * 2022-12-20 2023-12-08 荣耀终端有限公司 连接参数的更新方法、蓝牙设备及可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090233550A1 (en) * 2008-03-13 2009-09-17 Samsung Electronics Co. Ltd. Service connection system and method for bluetooth device
CN107889092A (zh) * 2017-11-30 2018-04-06 广东欧珀移动通信有限公司 蓝牙设备通信控制方法、装置、终端设备及存储介质
CN108206997A (zh) * 2017-12-15 2018-06-26 中兴通讯股份有限公司 蓝牙连接方法及装置
US20190373430A1 (en) * 2018-06-01 2019-12-05 Apple Inc. Bluetooth Profile Fast Connect
CN111104186A (zh) * 2019-12-26 2020-05-05 惠州Tcl移动通信有限公司 蓝牙配置文件的加载方法及装置、存储介质、终端设备

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109618319A (zh) * 2019-01-02 2019-04-12 百度在线网络技术(北京)有限公司 通信连接建立方法、装置、电子设备及可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090233550A1 (en) * 2008-03-13 2009-09-17 Samsung Electronics Co. Ltd. Service connection system and method for bluetooth device
CN107889092A (zh) * 2017-11-30 2018-04-06 广东欧珀移动通信有限公司 蓝牙设备通信控制方法、装置、终端设备及存储介质
CN108206997A (zh) * 2017-12-15 2018-06-26 中兴通讯股份有限公司 蓝牙连接方法及装置
US20190373430A1 (en) * 2018-06-01 2019-12-05 Apple Inc. Bluetooth Profile Fast Connect
CN111104186A (zh) * 2019-12-26 2020-05-05 惠州Tcl移动通信有限公司 蓝牙配置文件的加载方法及装置、存储介质、终端设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4210362A4

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116056077A (zh) * 2022-08-04 2023-05-02 荣耀终端有限公司 一种蓝牙通信方法及相关电子设备
CN116056077B (zh) * 2022-08-04 2023-11-14 荣耀终端有限公司 一种蓝牙通信方法、电子设备及计算机可读存储介质

Also Published As

Publication number Publication date
CN114339696A (zh) 2022-04-12
EP4210362A1 (en) 2023-07-12
EP4210362A4 (en) 2024-02-28

Similar Documents

Publication Publication Date Title
US10524300B2 (en) Wireless low-latency audio content sharing
WO2022068517A1 (zh) 蓝牙通信系统、蓝牙连接方法、电子设备及存储介质
WO2020107485A1 (zh) 一种蓝牙连接方法及设备
CN112868244B (zh) 一种点对多点的数据传输方法及设备
WO2020132839A1 (zh) 应用于tws耳机单双耳切换的音频数据传输方法及设备
EP3893109B1 (en) Method and device for connecting bluetooth devices
JP2022529033A (ja) ブルートゥース接続方法、デバイス、およびシステム
US8660055B2 (en) Pseudo hub-and-spoke wireless audio network
WO2020077512A1 (zh) 语音通话方法、电子设备及系统
US20160299739A1 (en) Method for controlling data streaming using bluetooth communication
WO2023130105A1 (en) Bluetooth enabled intercom with hearing aid functionality
WO2024055494A1 (zh) 基于蓝牙耳机的通话方法、装置及存储介质
WO2021043277A1 (zh) 配置蓝牙连接参数的方法和电子设备
WO2024037134A1 (zh) 通信方法及相关装置
WO2022213689A1 (zh) 一种音频设备间语音互通的方法及设备
US10687178B2 (en) Phone-less member of group communication constellations
WO2023103732A1 (zh) 耳机设备的状态控制方法、装置、耳机设备及存储介质
CN115175159B (zh) 一种蓝牙耳机播放方法及设备
WO2022160967A1 (zh) 通信方法、移动设备、电子设备和计算机可读存储介质
WO2021239032A1 (zh) 蓝牙协议连接方法、装置、存储介质及相关设备
CN113709906A (zh) 无线音频系统、无线通讯方法及设备
WO2024016885A1 (zh) 蓝牙连接方法、装置、电子设备及计算机可读存储介质
WO2023029938A1 (zh) Tws耳机解耦分享方法、装置、设备及存储介质
WO2023051204A1 (zh) 跨设备连接方法、电子设备及存储介质
WO2022134734A1 (zh) 无线通讯方法及系统

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: 21874178

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021874178

Country of ref document: EP

Effective date: 20230402

NENP Non-entry into the national phase

Ref country code: DE