CN114866998A - Bluetooth connection method and Bluetooth device - Google Patents

Bluetooth connection method and Bluetooth device Download PDF

Info

Publication number
CN114866998A
CN114866998A CN202210787563.4A CN202210787563A CN114866998A CN 114866998 A CN114866998 A CN 114866998A CN 202210787563 A CN202210787563 A CN 202210787563A CN 114866998 A CN114866998 A CN 114866998A
Authority
CN
China
Prior art keywords
bluetooth
electronic device
electronic
tws headset
mobile phone
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210787563.4A
Other languages
Chinese (zh)
Other versions
CN114866998B (en
Inventor
胡晓慧
张勇
栗银伟
李永顺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210787563.4A priority Critical patent/CN114866998B/en
Publication of CN114866998A publication Critical patent/CN114866998A/en
Application granted granted Critical
Publication of CN114866998B publication Critical patent/CN114866998B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1041Mechanical or electronic switches, or control elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/18Management of setup rejection or failure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/19Connection re-establishment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R2420/00Details of connection covered by H04R, not provided for in its groups
    • H04R2420/07Applications of wireless loudspeakers or wireless microphones
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application provides a Bluetooth connection method and Bluetooth equipment, and relates to the technical field of short-distance communication. The Bluetooth device establishes Bluetooth connection with a plurality of electronic devices and is an input/output device of the plurality of electronic devices. In the process that the Bluetooth device processes the audio service of one electronic device in the plurality of electronic devices, if the Bluetooth device is disconnected with other electronic devices due to connection overtime, the Bluetooth device can automatically reconnect the other electronic devices once, active reconnection of the Bluetooth device is achieved, manual operation is not needed, and reconnection efficiency is improved. Moreover, the Bluetooth device is automatically connected with the other electronic devices once, so that the audio service of the electronic device is not affected, and the phenomenon of pause of the audio service is avoided.

Description

Bluetooth connection method and Bluetooth device
Technical Field
The present application relates to the field of short-distance communication technologies, and in particular, to a bluetooth connection method and a bluetooth device.
Background
With the development of random bluetooth headsets, True Wireless Stereo (TWS) headsets have been able to establish a wireless connection with two electronic devices (e.g., mobile phones, tablet computers, etc.) at the same time, which can handle audio services (e.g., playing music, making/receiving calls, etc.) of the two electronic devices.
TWS headsets during processing of audio traffic of one electronic device, the TWS headset may be disconnected from another electronic device for some reason. At this time, the TWS headset cannot handle the audio traffic of the other electronic device. If the user still needs to use the TWS headset to handle audio traffic of the other electronic device, first, the user needs to perform related operations on the other electronic device. The other electronic device then triggers the TWS headset to reconnect to the other electronic device to reestablish a connection with the other electronic device based on the operation.
However, the inventors found that at least the following problems exist in the prior art: after the related operation is required to be performed on the electronic device disconnected from the TWS headset, the TWS headset can be connected back to the electronic device, which results in a cumbersome connection back process and thus lower connection back efficiency.
Disclosure of Invention
In view of this, the present application provides a bluetooth connection method and a bluetooth device, which improve the backhaul efficiency.
In a first aspect, the present application provides a bluetooth connection method, which is applied to a bluetooth device that establishes bluetooth connections with a plurality of electronic devices; the Bluetooth device is an input/output device of the plurality of electronic devices, and is used for playing or acquiring audio corresponding to any one of the plurality of electronic devices; the method comprises the following steps:
the Bluetooth equipment interacts with a first electronic equipment in the plurality of electronic equipments to process the audio service of the first electronic equipment; wherein the first electronic device is any one of the plurality of electronic devices;
in the process of processing the audio service of the first electronic equipment, if the Bluetooth connection between the Bluetooth equipment and the second electronic equipment is disconnected, the Bluetooth equipment automatically connects back to the second electronic equipment; the second electronic device is at least one of the plurality of electronic devices except the first electronic device.
In this embodiment of the application, in the process that the bluetooth device processes the audio service of the first electronic device, if the bluetooth connection between the bluetooth device and the second electronic device is disconnected, the bluetooth device may automatically reconnect the second electronic device once to reestablish the bluetooth connection with the second electronic device, thereby implementing active reconnection of the bluetooth device. The Bluetooth device can automatically connect back to the second electronic device without the need of the user to perform relevant operations. And, because the bluetooth device only reconnects the second electronic device once in the process of processing the audio service of the first electronic device, the bluetooth device does not reconnect the second electronic device multiple times. Therefore, the time for the bluetooth device to connect back to the second electronic device to occupy the resource (such as the air interface resource) is short, so that the audio service of the first electronic device is not affected, and the audio service can be prevented from being blocked.
In a possible design, the bluetooth disconnection indicates a bluetooth disconnection overtime, and the bluetooth disconnection indicates that the bluetooth device or the second electronic device does not receive a data packet from the other party within a period of time.
In a possible design, after the automatic reconnection of the second electronic device fails, the bluetooth device stops automatically reconnecting the second electronic device, and determines whether the audio service of the first electronic device is finished;
and under the condition that the audio service of the first electronic equipment is determined to be finished, the Bluetooth equipment continues to automatically connect back to the second electronic equipment.
And the Bluetooth device continues to automatically reconnect the second electronic device, and the Bluetooth device can automatically reconnect the second electronic device every second preset time.
In this embodiment of the application, in the process of processing the audio service of the first electronic device by the bluetooth device, if the bluetooth connection between the bluetooth device and the second electronic device is disconnected, the bluetooth device may automatically connect back to the second electronic device once. If the second electronic device fails to be connected back, the Bluetooth device can stop automatically connecting back the second electronic device so as to prevent the audio service of the first electronic device from being blocked. Then, the bluetooth device may continue to automatically reconnect the second electronic device after the audio service of the first electronic device is ended, so as to improve the success rate of reconnecting the second electronic device on the basis of preventing the audio service of the first electronic device from being affected.
In a possible design, when the bluetooth device continues to automatically connect back to the second electronic device, the number of times of connection back corresponding to the second electronic device is counted. And if the continuous reconnection fails, the Bluetooth equipment stops automatically reconnecting the second electronic equipment after the first reconnection time is equal to the preset reconnection time.
The first connection times are the total times of the Bluetooth device automatically connecting the second electronic device; or the first connection times are the times that the Bluetooth device automatically connects the second electronic device after the audio service of the first electronic device is finished.
In this embodiment of the application, when the audio service of the first electronic device is ended, that is, the bluetooth device does not process the audio service of the first electronic device any more, it indicates that the bluetooth device connecting back to the second electronic device does not affect the audio service of the first electronic device. Therefore, the bluetooth device may continue to automatically connect back to the second electronic device, and count the number of times of connection back (i.e. the first number of times of connection back) corresponding to the second electronic device. And under the condition that the automatic reconnection of the second electronic equipment fails, the Bluetooth equipment judges whether the first reconnection time is equal to a preset reconnection time. If the first number of times of reconnection is equal to the preset number of times of reconnection, it indicates that although the bluetooth device has automatically reconnected the second electronic device for a plurality of times, but the reconnection is still not successful, and the second electronic device may be abnormal (for example, the second electronic device is too far away from the bluetooth device). Therefore, to avoid the reconnection causing a waste of resources, the bluetooth device stops automatically reconnecting the second electronic device. If the first reconnection time is less than the preset reconnection time, the Bluetooth device can continue to automatically reconnect the second electronic device and continue to update the reconnection time so as to judge whether to perform next automatic reconnection after the current reconnection failure by using the reconnection time.
In one possible design, the bluetooth device may be an earpiece of a TWS headset.
In one possible design, after the bluetooth device fails to connect back to the second electronic device, the bluetooth device stops automatically connecting back to the second electronic device;
after receiving the target trigger operation, the Bluetooth device responds to the target trigger operation and is connected back to the second electronic device; wherein the target triggering operation triggers the target earplug to be back-connected.
Wherein the target trigger operation comprises any one of: the earplugs are taken out of the box, the earplugs of the TWS earphone are uncovered, the earplugs are switched from an unworn state to a worn state, the two earplugs of the TWS earphone establish a Bluetooth connection, a user triggers the operation that the TWS earphone is connected back to the second electronic equipment on the second electronic equipment, and the user triggers the operation that the TWS earphone is connected with new electronic equipment.
In this embodiment of the application, in the process of processing the audio service of the first electronic device by the bluetooth device, if the bluetooth connection between the bluetooth device and the second electronic device is disconnected, the bluetooth device may automatically connect back to the second electronic device once. If the second electronic device fails to be connected back, the Bluetooth device can stop automatically connecting back the second electronic device so as to prevent the audio service of the first electronic device from being blocked. The bluetooth device may then continue to connect back to the second electronic device to establish a bluetooth connection with the second electronic device in dependence on the received other action, i.e. the target trigger operation, for the bluetooth device.
In a second aspect, the present application provides a bluetooth communication system comprising a plurality of electronic devices and a bluetooth device according to any one of the first aspect.
In a third aspect, the present application provides a bluetooth device comprising a memory, a wireless communication module, a receiver and microphone, and one or more processors; the memory, the wireless communication module, the headphones, and the microphone are coupled with the processor; wherein the wireless communication module is configured to wirelessly communicate with an electronic device, the memory having stored therein computer program code comprising computer instructions which, when executed by the processor, cause the bluetooth device to perform the bluetooth connection method according to any of the first aspect.
In one possible design, the bluetooth device includes a TWS headset.
In a fourth aspect, the present application provides a computer readable storage medium comprising computer instructions which, when run on a bluetooth device, cause the bluetooth device to perform the bluetooth connection method as defined in any one of the first aspects above.
In a fifth aspect, the present application provides a computer program product for causing a bluetooth device to perform the bluetooth connection method according to any one of the first aspect when the computer program product is run on the bluetooth device.
Drawings
Fig. 1 is a schematic diagram of a communication network architecture between a peripheral device and a master device according to an embodiment of the present disclosure;
fig. 2 is a communication diagram of a monitoring method according to an embodiment of the present disclosure;
fig. 3 is a communication schematic diagram of a forwarding method according to an embodiment of the present application;
fig. 4 is a schematic communication diagram of a plurality of main bodies of a peripheral device according to an embodiment of the present application;
fig. 5 is a schematic diagram of a communication network architecture of a TWS headset and a plurality of handsets according to an embodiment of the present application;
FIG. 6 is a schematic diagram illustrating an example product form of a TWS headset according to an embodiment of the present application;
FIG. 7 is a diagram illustrating an example of a hardware structure of an earplug of a TWS earphone according to an embodiment of the present application;
fig. 8 is a first flowchart illustrating a bluetooth connection method according to an embodiment of the present application;
fig. 9 is a flowchart illustrating a bluetooth connection method according to an embodiment of the present application.
Detailed Description
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present embodiment, "a plurality" means two or more unless otherwise specified.
In some usage scenarios, as shown in fig. 1, a peripheral device 101 (e.g., a bluetooth device such as a TWS headset) may establish a bluetooth connection with multiple electronic devices 100 (e.g., mobile phones) simultaneously to perform audio data transmission with any of the multiple electronic devices 100, so that the electronic devices 100 may process audio traffic of the multiple electronic devices 100. The electronic device 100 may be referred to as a Master (Master, abbreviated as M), and the peripheral device may be referred to as a Slave (Slave, abbreviated as S).
During audio data transmission by the peripheral device 101 with one of the plurality of electronic devices 100, the bluetooth connection between the peripheral device 101 and the other electronic device may be disconnected. At this time, the user may input an operation of connecting the peripheral device 101 on the target interface of the other electronic device, and the other electronic device attempts to establish a bluetooth connection with the peripheral device 101 again in response to the operation. On the one hand, this kind of loop connection is inefficient. On the other hand, if the user fails to find out in time that the bluetooth connection between the peripheral device 101 and the other electronic device is disconnected, the user cannot trigger in time, so that the other electronic device cannot try to establish the bluetooth connection with the peripheral device in time, which affects the peripheral device 101 to process the audio service of the other electronic device, and the user experience is poor.
On the other hand, if the user performs the relevant operation on the other electronic device, the peripheral device 101 is not yet connected back to the other electronic device. The user may continue to perform related operations on the other electronic device at this time, causing the peripheral device 101 to connect back to the other electronic device multiple times. However, since the air interface resource of the peripheral device 101 is limited, when the peripheral device 101 is connected back to the other electronic device, a certain proportion of the air interface resource needs to be occupied, which results in that the air interface resource occupied by the peripheral device 101 when transmitting the audio data corresponding to the electronic device is reduced. When the peripheral device 101 repeatedly connects back to the other electronic devices, the air interface resource corresponding to the electronic device 100 is continuously affected, and the audio service processed by the peripheral device 101 is blocked.
Although the peripheral device 101 can establish a bluetooth connection with a plurality of electronic devices 100 at the same time, it cannot process audio services of a plurality of electronic devices 100 at the same time, and can only process audio services of one electronic device. Therefore, in the process that the peripheral device 101 processes the audio service of one electronic device, when another electronic device needs to perform the audio service by using the peripheral device 101, the peripheral device 101 needs to perform switching of the audio service, so that the peripheral device 101 can process the audio service of the other electronic device.
Therefore, in view of the above problems, the present application provides a bluetooth connection method, in which a peripheral device can be bluetooth connected to a plurality of electronic devices at the same time. In the process that the peripheral device processes the audio service of one electronic device in the plurality of electronic devices, if the bluetooth connection between the peripheral device and the other electronic devices is disconnected due to connection overtime, the peripheral device can actively reconnect the other electronic devices once, so that the active reconnection of the peripheral device is realized. The peripheral equipment can automatically connect back to other electronic equipment without related operation of a user, and the back connection efficiency is improved. And, because the peripheral equipment will not connect back to the other electronic equipment many times in the course of processing the audio service of this electronic equipment. Therefore, the time for the peripheral device to connect back to the other electronic device to occupy the air interface resource is short, so that the audio service of the electronic device (i.e. the audio service processed by the peripheral device) is not affected, and the audio service is prevented from being blocked.
The electronic device may be, for example, a mobile phone (e.g., the mobile phone 200 shown in fig. 5), a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR) \ Virtual Reality (VR) device, a media player, a television, or the like, and the embodiment of the present application is not particularly limited to the specific form of the device.
The peripheral equipment can be TWS earphones, Bluetooth sound boxes, intelligent glasses and other equipment capable of carrying out Bluetooth communication. When the number of bodies included in the peripheral device is plural, one body or all bodies of the peripheral device may establish a bluetooth connection with the electronic device 100. A description will be made below, with reference to fig. 2 to 4, of a manner in which the peripheral device 101 establishes a bluetooth connection with one electronic device 100 when the peripheral device 101 includes a plurality of bodies, taking as an example that the peripheral device 101 includes two bodies, such as the device (S1) 101-1 and the device (S2).
In one example, one body of the peripheral device 101 establishes a bluetooth connection with the electronic device 100. As shown in fig. 2 or fig. 3, one principal of the peripheral device 101 (e.g., device 101-1) may take a primary role and another principal (e.g., device 101-2) may take a secondary role. For example, when the peripheral device 101 is a TWS headset, one earpiece (e.g., the left earpiece) of the TWS headset may serve a primary role as the primary earpiece; the other earplug (e.g., the right earplug) may serve a secondary role as a secondary earplug. Of course, the roles played by the two bodies of the peripheral device 101 may be exchanged. For example, the left earplug may serve as a secondary earplug, serving a secondary role; the right earplug may serve as the primary earplug, serving a primary role.
Wherein the electronic device 100 may establish a first bluetooth connection with a principal (e.g., device 101-1) that plays a primary role. A principal in a primary role, such as device 101-1, may establish a second bluetooth connection with a principal in a secondary role, such as device 101-2.
In some embodiments, as shown in FIG. 2, device 101-1 and device 101-2 may communicate audio data with electronic device 100 in a listening manner. In particular, the device 101-1 in the primary role may send the connection parameters of the first bluetooth connection to the device 101-2 in the secondary role via the second bluetooth connection. In this way, when the electronic device 100 transmits the audio data packet to the device 101-1 in the primary role through the first bluetooth connection, the device 101-2 in the secondary role can listen to the audio data packet transmitted by the electronic device 100 according to the connection parameters of the first bluetooth connection. In this way, both subjects of the peripheral device 101 can acquire the audio data packet from the electronic device 100.
In this embodiment, the peripheral device 101 establishing bluetooth connections with the plurality of electronic devices 100 respectively may be that the device 101-1 playing a main role establishes first bluetooth connections with the plurality of electronic devices respectively. Accordingly, when the bluetooth connection between the peripheral device 101 and the electronic device 100 is disconnected, it may be the first bluetooth connection between the device 101-1 taking the main role and the electronic device 100 is disconnected. That is, the device 101-1 having a main role may be a bluetooth device (such as a true wireless stereo headset shown in fig. 8 and 9) as described in the embodiments of the present application, and perform the method of the embodiments of the present application.
In other embodiments, as shown in FIG. 3, device 101-1 and device 101-2 may communicate audio data with electronic device 100 in a repeating manner. Specifically, when the electronic device 100 sends an audio packet to the device 101-1 in the primary role over the first bluetooth connection, the device 101-1 in the primary role may forward the audio packet to the device 101-2 in the secondary role. In this way, both bodies of the peripheral device 101 can also acquire the audio data packet from the electronic device 100.
In this embodiment, the peripheral device 101 establishing bluetooth connections with the plurality of electronic devices 100 respectively may be that the device 101-1 playing a main role establishes first bluetooth connections with the plurality of electronic devices respectively. Accordingly, when the bluetooth connection between the peripheral device 101 and the electronic device 100 is disconnected, it may be the first bluetooth connection between the device 101-1 taking the main role and the electronic device 100 is disconnected. That is, the device 101-1 having a main role may be a bluetooth device (such as a true wireless stereo headset shown in fig. 8 and 9) as described in the embodiments of the present application, and perform the method of the embodiments of the present application.
In another example, as shown in fig. 4, two bodies of the peripheral device 101 respectively establish a bluetooth connection with the electronic device 100. Specifically, the electronic device 100 supports the wireless connection with the devices 101-1 and 101-2 of the peripheral device 101 through bluetooth, respectively, to implement short-range data exchange. For example, the mobile phone supports the wireless connection with the left and right earplugs of the TWS headset through bluetooth respectively, so as to realize short-distance data exchange. For example, the device 101-1 and the device 101-2 may communicate audio data with the electronic device 100 based on the wireless connection. For example, device 101-1 and device 101-2 implement a call as audio input/output devices for electronic device 100. As another example, device 101-1 and device 101-2 implement music playback, etc., as output devices for electronic device 100.
In this embodiment, the peripheral device 101 respectively establishing bluetooth connections with the plurality of electronic devices 100 may be the device 101-1 and/or the device 101-2 of the peripheral device 101 respectively establishing bluetooth connections with the plurality of electronic devices. Accordingly, when the Bluetooth connection between the peripheral device 101 and the electronic device 100 is disconnected, the Bluetooth connection between the device 101-1 and the electronic device 100 may be disconnected, and/or the Bluetooth connection between the device 101-2 and the electronic device 100 may be disconnected. For example, in a case where the device 101-1 of the peripheral device 101 establishes bluetooth connections with the plurality of electronic devices 100, respectively, the bluetooth disconnection between the peripheral device 101 and the electronic device 100 may refer to the bluetooth disconnection between the device 101-1 and the electronic device 100. For another example, in a case where the device 101-2 of the peripheral device 101 establishes bluetooth connections with the plurality of electronic devices 100, the bluetooth disconnection between the peripheral device 101 and the electronic device 100 may be bluetooth disconnection between the device 101-2 and the electronic device 100. For another example, in a case where the device 101-1 and the device 101-2 of the peripheral device 101 respectively establish bluetooth connections with the plurality of electronic devices 100, the bluetooth disconnection between the peripheral device 101 and the electronic device 100 may refer to bluetooth disconnection between the device 101-1 and/or the device 101-2 and the electronic device 100. That is, the device 101-1 and/or the device 101-2 of the peripheral device 101 may perform the method of the embodiments of the present application as a bluetooth device (e.g., a true wireless stereo headset as shown in fig. 8 and 9) as described in the embodiments of the present application.
In this embodiment of the application, the establishing of the wireless connection between the peripheral device 101 and the electronic device 100 through bluetooth may specifically include: the electronic apparatus 100 establishes wireless connections with the two main bodies of the peripheral apparatus 101 through bluetooth, respectively. Short-range data exchange between the electronic device 100 and the two bodies of the peripheral device 101 can be realized based on respective wireless connections.
In the embodiment of the present application, after the wireless communication technology, such as bluetooth, is used to establish the wireless connection between the electronic device 100 and the peripheral device, the electronic device 100 may store the bluetooth address of the peripheral device in the internal memory. In some embodiments, when the peripheral device is a device comprising two bodies, such as a TWS headset, and the left and right earpieces of the TWS headset have respective bluetooth addresses, the electronic device 100 may store the bluetooth address association of the left and right earpieces of the TWS headset in the internal memory 1.
It should be understood that fig. 2 to 4 describe a process of connecting the peripheral device 101 to one electronic device 100 of a plurality of electronic devices, and the way of establishing the bluetooth connection with the peripheral device 101 by other electronic devices than the electronic device 100 of the plurality of electronic devices is similar to the process, and of course, the other electronic devices may also establish the bluetooth connection with the peripheral device by other ways, which is not limited in this application.
It should be noted that the data transmitted by the electronic device 100 and the peripheral device 101 includes, but is not limited to, the audio data. For example, the data transmitted by the electronic device 100 and the peripheral device 101 may also be picture or video data. For example, the peripheral device 101 is smart glasses, and the electronic device 100 may transmit picture or video data to lenses of the smart glasses. In the embodiment of the present application, the method of the embodiment of the present application is described by taking the example that the electronic device 100 and the peripheral device 101 transmit audio data.
As an example, the peripheral device 101 may be at least one ear plug of the TWS headset 201 shown in fig. 5, and the electronic device 100 may be the mobile phone 200 shown in fig. 5. Wherein the TWS headset 201 comprises two bodies, such as an earpiece 201-1 and an earpiece 201-2. Wherein, the earplug 201-1 may be a left earplug of the TWS headset 201, and the earplug 201-2 may be a right earplug; alternatively, the earplug 201-1 may be a right earplug of the TWS earpiece 201 and the earplug 201-2 a left earplug. One of the earplugs (e.g., the earplug 201-1) of the TWS headset 201 may serve as a primary earplug of the TWS headset, and the other earplug (e.g., the earplug 201-2) may serve as a secondary earplug of the TWS headset. The primary and secondary roles of the left and right earplugs of the TWS headset may be interchanged. In the embodiment of the present application, the structures of the earplugs 201-1 and 201-2 of the TWS headset 201 are shown in FIG. 7, which will be described in detail in the following embodiments.
As shown in fig. 6, the TWS headset 201 may include: a left earplug 201-1, a right earplug 201-2 and an earplug box 201-3. The earplug case may be used to receive left and right earplugs of a TWS headset. Fig. 6 is a schematic diagram showing an example of a product form of the TWS headset by way of example only, and the product form of the peripheral device provided by the embodiment of the present application includes, but is not limited to, the TWS headset 201 shown in fig. 6.
Please refer to fig. 7, which is a schematic structural diagram of an earplug (a left earplug or a right earplug) of a TWS earphone according to an embodiment of the present application. As shown in fig. 7, an earpiece (e.g., right earpiece 201-2) of the TWS headset 201 may include: a processor 210, a memory 220, a sensor 230, a wireless communication module 240, a receiver 250, a microphone 260, and a power supply 270.
The memory 220 may be used for storing, among other things, application code for establishing a wireless connection with another earpiece of the TWS headset 201, such as the right earpiece 201-2, and for enabling the earpiece to make a pairing connection with the electronic device 100 described above, such as the handset 200. The processor 210 may control execution of the above-mentioned application program code to implement the functionality of the earpieces of the TWS headset in the embodiments of the present application.
The memory 220 may also have stored therein a bluetooth address for uniquely identifying the earpiece and a bluetooth address of another earpiece of the TWS headset. In addition, the memory 220 may also store connection data with an electronic device that the earplug has been successfully paired with before. For example, the connection data may be a bluetooth address of the electronic device that was successfully paired with the earpiece. Based on the connection data, the ear bud can be automatically paired with the electronic device without having to configure a connection therewith, such as for legitimacy verification or the like. The bluetooth address may be a Media Access Control (MAC) address.
The sensor 230 may be a distance sensor or a proximity light sensor. The ear bud may determine whether it is being worn by the user via the sensor 230. For example, the earbud may utilize a proximity light sensor to detect whether an object is near the earbud to determine whether the earbud is being worn by a user. Upon determining that the ear bud is worn, the ear bud can open the receiver 250. In some embodiments, the earplug may further include a bone conduction sensor, incorporated into a bone conduction earpiece. By utilizing the bone conduction sensor, the earplug can acquire the vibration signal of the sound part vibration bone block, analyze the voice signal and realize the voice function. In other embodiments, the ear bud may further include a touch sensor for detecting a touch operation of a user. In other embodiments, the ear bud may further include a fingerprint sensor for detecting a user's fingerprint, identifying the user's identity, and the like. In other embodiments, the earplug may further comprise an ambient light sensor that adaptively adjusts parameters, such as volume, based on the perceived brightness of the ambient light.
A wireless communication module 240 for supporting short-range data exchange between the earpieces of the TWS headset and various electronic devices, such as the electronic device 100 described above. In some embodiments, the wireless communication module 240 may be a bluetooth transceiver. The earplugs of the TWS headset may establish a wireless connection with the electronic device 100 via the bluetooth transceiver to enable short-range data exchange therebetween.
At least one receiver 250, which may also be referred to as a "headset," may be used to convert the electrical audio signals into sound signals and play them. For example, when the earpieces of the TWS headset are used as the audio output device of the electronic device 100, the receiver 250 may convert the received audio electrical signal into a sound signal and play the sound signal.
At least one microphone 260, which may also be referred to as a "microphone," is used to convert sound signals into electrical audio signals. For example, when the ear-piece of the TWS headset 201 is used as the audio input device of the electronic device 100, the microphone 260 may collect the voice signal of the user and convert the voice signal into an audio electrical signal during the process of speaking (such as talking or making voice message) by the user. The audio electrical signal is the audio data in the embodiment of the present application.
A power supply 270 may be used to supply power to the various components contained in the earplugs of the TWS headset 201. In some embodiments, the power source 270 may be a battery, such as a rechargeable battery.
Typically, the TWS headset 201 will be equipped with an earbud cartridge (e.g., 201-3 shown in FIG. 6). The earplug case may be used to receive left and right earplugs of a TWS headset. As shown in FIG. 6, the earplug case 201-3 may be used to receive the left earplug 201-1 and the right earplug 201-2 of a TWS headset. In addition, the earpiece box may also charge the left and right earpieces of the TWS headset 201. Accordingly, in some embodiments, the above-described earplug may further comprise: an input/output interface 280. The input/output interface 280 may be used to provide any connection between earplugs of a TWS headset and an earpiece box, such as the earpiece box 201-3 described above.
In some embodiments, the input/output interface 280 may be an electrical connector. When the earplugs of the TWS headset 201 are disposed in the earbud box, the earplugs of the TWS headset 201 may be electrically connected to the earbud box (e.g., to an input/output interface of the earbud box) via the electrical connector. After this electrical connection is established, the earpiece box may charge the power supply 270 for the earpieces of the TWS headset. After this electrical connection is established, the earplugs of the TWS headset 201 may also be in data communication with the earpiece box. For example, the earplugs of the TWS headset 201 may receive pairing instructions from the earpiece box through the electrical connection. The pairing command is used to instruct the earpieces of the TWS headset 201 to turn on the wireless communication module 240 so that the earpieces of the TWS headset 201 can be paired with the electronic device 100 using a corresponding wireless communication protocol, such as bluetooth.
Of course, the earplugs of the TWS headset 201 described above may also not include the input/output interface 280. In this case, the ear buds may implement a charging or data communication function based on the wireless connection established with the ear bud case through the above-described wireless communication module 240.
Additionally, in some embodiments, an earbud cartridge (such as earbud cartridge 301 described above) may also include a processor, memory, and the like. The memory may be used to store application program code and be controlled in execution by the processor of the earplug case to implement the functionality of the earplug case. For example. When the user opens the lid of the earplug case, the processor of the earplug case may send a pairing command or the like to the earplugs of the TWS headset in response to the user opening the lid by executing application program code stored in the memory.
It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation to the earplug of the TWS earpiece 201. It may have more or fewer components than shown in fig. 7, may combine two or more components, or may have a different configuration of components. For example, the earplug may further include an indicator light (which may indicate the status of the earplug, such as power), a dust screen (which may be used with the earpiece), and the like. The various components shown in fig. 7 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 should be noted that the left and right earplugs of the TWS headset 201 may be identical in structure. For example, the left and right earplugs of the TWS earpiece 201 may both include the components shown in FIG. 7. Alternatively, the structure of the left and right earplugs of the TWS headset 201 may also be different. For example, one earpiece (e.g., the right earpiece) of the TWS headset 201 may include the components shown in fig. 7, while the other earpiece (e.g., the left earpiece) may include other components in fig. 7 in addition to the microphone 260.
In the embodiment of the application, the peripheral device establishes Bluetooth connection with a plurality of electronic devices simultaneously. In the process that the peripheral device processes the audio service (such as playing music) of one of the electronic devices, if the bluetooth connection between the peripheral device and the other electronic device is disconnected, the peripheral device may connect back to the other electronic device to reestablish the bluetooth connection with the other electronic device, thereby implementing automatic connection of the peripheral device, improving connection efficiency, and not affecting the audio service corresponding to the electronic device. The following takes two electronic devices as an example, where the two electronic devices are both mobile phones (i.e., the mobile phone 1 and the mobile phone 2), and the peripheral device is a TWS headset, and the technical solution of the present application will be described with reference to a specific example.
The bluetooth connection method provided by the embodiments of the present application is described in detail below with reference to the accompanying drawings. As shown in fig. 8, the method comprises the steps of:
s301, the real wireless stereo headset establishes Bluetooth connection with the mobile phone 1 and the mobile phone 2 respectively.
In an embodiment of the present application, the TWS headset may send a broadcast message to the outside. If the handset 1 has bluetooth enabled, the handset 1 may receive the broadcast message and the handset 1 may prompt the user that the associated bluetooth device (e.g., TWS headset) has been scanned. When a user selects the TWS headset as a connection device on the mobile phone 1, the mobile phone 1 can be connected with the TWS headset in a pairing manner, so that the TWS headset can establish a bluetooth connection with the mobile phone 1. Similarly, if the handset 2 has bluetooth enabled, the handset 2 may receive the broadcast message and the handset 1 may prompt the user that the associated bluetooth device (e.g., the TWS headset) has been scanned. When the user selects the TWS headset as the connection device on the mobile phone 2, the mobile phone 2 can be connected in a pairing manner with the TWS headset, so that the TWS headset can establish a bluetooth connection with the mobile phone 2.
In some embodiments, the TWS headset may first establish a bluetooth connection with the handset 1. Then, after the TWS headset has established a connection with the handset 1, the TWS headset may send a broadcast message to the outside again to establish a bluetooth connection with the handset 2 in response to a user-related operation (e.g., the user clicks the TWS headset a certain number of times, e.g., the user keeps holding down a switch key on an earpiece of the TWS headset to put the TWS headset into a bluetooth pairing state, etc.). Of course, the TWS headset may also establish a bluetooth connection with the handset 2 first, and then with the handset 1.
In some embodiments, the TWS headset establishes bluetooth connections with the mobile phones 1 and 2 respectively, and one earplug of the TWS headset may establish bluetooth connections with the mobile phones 1 and 2. For example, as shown in fig. 2 or fig. 3, the TWS headset may establish bluetooth connections with the mobile phone 1 and the mobile phone 2 respectively, that is, the main earpiece of the TWS headset establishes bluetooth connections with the mobile phone 1 and the mobile phone 2 respectively. For another example, as shown in fig. 4, both earplugs of the TWS headset can establish bluetooth connection with the host device, so that any one of the earplugs of the TWS headset can establish bluetooth connection with the mobile phone 1 and the mobile phone 2 respectively.
In other embodiments, the TWS headset establishes bluetooth connections with the mobile phone 1 and the mobile phone 2, and may be configured such that two earplugs of the TWS headset establish bluetooth connections with the mobile phone 1, and two earplugs of the TWS headset establish bluetooth connections with the mobile phone 2. For example, as shown in fig. 4, both earplugs of the TWS headset can establish a bluetooth connection with the host device, and thus, both earplugs of the TWS headset can establish a bluetooth connection with the mobile phone 1 and the mobile phone 2, respectively.
For example, the broadcast message may include at least one of a device name, a device type, a device model, a battery level, a wearing status, a connection status, or a service status of the TWS headset. Wherein the connection status information may indicate that the bluetooth connection has been established. The traffic status information may indicate whether the TWS headset is currently in an idle state, i.e. indicating whether the TWS headset is handling audio traffic.
Accordingly, after the TWS headset is connected to the mobile phone 1 and/or the mobile phone 2, the related information of the TWS headset may be displayed, for example, at least one of the device name, the device model, the power level, the wearing status, the service status information, the connection status information, and the like of the TWS headset.
S302, the true wireless stereo headset interacts with the mobile phone 1, and the true wireless stereo headset processes the audio service of the mobile phone 1.
The TWS headset may receive the audio data packet sent by the mobile phone 1 based on the bluetooth connection between the TWS headset and the mobile phone 1, and process the related audio service (such as playing music) of the mobile phone 1.
In one case, if there is a bluetooth connection between the primary earpiece of the TWS headset and the handset 1, the handset 1 may send audio data packets to the primary earpiece. The secondary earplug of the TWS headset may retrieve the audio data packet based on a listening mode or a forwarding mode.
In another case, if there is a bluetooth connection between two earplugs of the TWS headset and the mobile phone 1, respectively, the mobile phone 1 may send an audio data packet to each of the two earplugs based on the bluetooth connection between the two earplugs, respectively. In another case, if there is a bluetooth connection between one earpiece of the TWS headset and the handset 1, the other earpiece being in an unused state (e.g. the other earpiece is still in the earpiece box), the handset 1 may send an audio data packet to the one earpiece based on the bluetooth connection between it and the one earpiece.
In some embodiments, the TWS headset may still maintain a bluetooth connection with the handset 2 during the processing of the audio traffic of the handset 1. The TWS headset may continuously send packets to the handset 2 (e.g., periodically send packets to the handset 2) while the TWS headset is in bluetooth connection with the handset 2. After receiving the data packet, the mobile phone 2 may return a response message to the TWS headset, where the response message indicates that the mobile phone 2 has received the data packet. The data packet may include information such as the power level of the TWS headset.
And S303, in the process of processing the audio service of the mobile phone 1, if the Bluetooth connection between the true wireless stereo headset and the mobile phone 2 is disconnected, the true wireless stereo headset automatically connects back to the mobile phone 2.
Wherein the loopback represents a process of reconnecting the host device after the peripheral device is disconnected from the host device. Specifically, the reconnection may indicate a process that the TWS headset may send a paging (page) packet to the paired handset 2 after the connection between the TWS headset and the handset 2 is disconnected, so as to recover the connection.
In this embodiment, in the process of processing the audio service of the mobile phone 1, if the bluetooth connection between the TWS headset and the mobile phone 2 is disconnected due to a connection timeout, which indicates that the TWS headset cannot process the audio service of the mobile phone 2, the TWS headset automatically sends a page data packet to the mobile phone 2, and the mobile phone 2 is reconnected once. If the TWS headset still does not successfully establish a bluetooth connection with the handset 2 beyond a first preset time (e.g., 5 seconds), the TWS headset may determine that this reconnection failed and stop automatically reconnecting the handset 2. If the TWS earphone is successfully connected with the mobile phone 2 within the first preset time, the connection of the TWS earphone and the mobile phone 2 is successfully established, and the connection is successfully completed.
The connection timeout indicates that the mobile phone 2 does not receive a data packet from the TWS headset within a period of time, or the TWS headset does not receive response information from the mobile phone 2 within a period of time, due to the reason that the distance between the mobile phone 2 and the TWS headset is greater than a certain value, the Received Signal Strength IndicaTIon (RSSI) between the mobile phone 2 and the TWS headset is less than a preset threshold, and the like. In short, the connection timeout indicates that the mobile phone 2 or the TWS headset does not receive the information sent by the other party for a period of time.
In the embodiment of the present application, the TWS headset, which is used as an input/output device of the mobile phone 1 and the mobile phone 2, establishes a bluetooth connection with the mobile phone 1 and the mobile phone 2, respectively. In the process of processing the audio service of the mobile phone 1, if the bluetooth connection between the TWS headset and the mobile phone 2 is disconnected due to connection timeout, the TWS headset is connected back to the mobile phone 2 once, so that automatic connection of the TWS headset is realized, the connection process is simple, user operation is not needed, the connection efficiency can be effectively improved, and untimely connection caused by the fact that the user does not find the TWS headset is disconnected from the mobile phone 2 in time can be avoided, so that the TWS headset can process the audio service of the mobile phone 2 in time after the connection success. Moreover, because the mobile phone 2 is connected back only once, the time that the TWS headset occupies air interface resources when the mobile phone 2 is connected back is short, so that the influence on the audio service of the mobile phone 1 is small, and the phenomenon of blocking when the TWS headset plays audio data of the mobile phone 1 is avoided. For example, when a user plays a game using the handset 1, the TWS headset plays the game sound effects of the handset 1. And during the playing process of the game sound effect of the mobile phone 1 by the TWS earphone, the Bluetooth connection between the TWS earphone and the mobile phone 2 is disconnected. In order to avoid influencing the playing effect of the game sound effect, the TWS earphone is only connected with the mobile phone 2 in a loop, and the mobile phone 2 is not connected in a loop any more no matter whether the connection is successful or not, so that the phenomenon of pause in the game sound effect of the mobile phone 1 can be avoided, the game sound effect of the mobile phone 1 can be ensured to be synchronous with the game picture, and the user experience is improved. For another example, in the process that the user uses the TWS headset to play the music of the mobile phone 1, the bluetooth connection between the TWS headset and the mobile phone 2 is disconnected, and in order to avoid affecting the playing of the music of the mobile phone 1, the TWS headset is connected back to the mobile phone 2 only once, thereby ensuring that the TWS headset normally plays the music of the mobile phone 1.
In some embodiments, the TWS headset stops automatic reconnection after a failure to automatically reconnect the handset 2 once. The TWS headset may continue to reconnect the cell phone 2 after receiving the target trigger operation, i.e., the TWS headset may continue to reconnect the cell phone 2 in response to the target trigger operation if the target trigger operation is received after the TWS headset stops automatically reconnecting the cell phone 2. Wherein the target trigger operation may trigger the TWS headset to make N round trips. The N is a positive integer.
Illustratively, the above target triggering operation may be an operation in which the user turns on an ear plug box of the TWS headset. If the user wants the TWS headset to connect back to the handset 2, he may first put the TWS headset back into the ear-bud box after the service of the handset 1 is over. The user then opens the ear-bud box again and the TWS headset may connect back N times the handset 2 in response to this operation. If the number N is 7, correspondingly, if the TWS headset is not successfully reconnected after 7 times of reconnecting the handset 2, the TWS headset stops reconnecting the handset 2.
The above target triggering operation may be an operation in which the user takes out the TWS headset from the ear plug case. If the user wants the TWS headset to connect back to the handset 2, he may first put the TWS headset back into the ear-bud box after the service of the handset 1 is over. The user then reopens the earplug case and removes the TWS headset from the earplug case. The TWS headset may be connected back to the handset 2N times in response to a user's operation to remove the TWS headset from the earbud box. For example, the number of N times is 1 time. Accordingly, if the TWS headset is not successfully reconnected after being reconnected to the handset 2 for 1 time, the TWS headset stops reconnecting the handset 2.
The above target trigger operation may be an operation in which the user wears the TWS headset. If the user wants the TWS headset to connect back to the handset 2, he may re-wear the TWS headset. The TWS headset may be connected back to the handset 2N times in response to a user wearing the TWS headset. For example, the number of times N may be 1. Accordingly, if the TWS headset is not successfully reconnected after being reconnected to the handset 2 for 1 time, the TWS headset stops reconnecting the handset 2.
The target triggering operation may be an operation that the TWS headset is successfully paired with a new electronic device, that is, an operation that the user triggers the TWS headset to connect to the new electronic device. If the TWS headset is successfully paired with a new electronic device (e.g., a cell phone), the TWS headset will connect to the previously paired electronic device, and therefore the TWS headset will connect back to the cell phone 2N times if it is successfully configured with the new electronic device. For example, the number of N times is 1 time.
The above-mentioned target triggering operation may be a two-ear reconnection operation of the TWS headset. The two earplugs of a TWS headset are in a disconnected state for some reasons, such as too far distance between the two earplugs, one earplug outside the earplug case and the other earplug inside the earplug case, etc. If the two earplugs are connected again, at least one of the two earplugs can be connected with the mobile phone 2 for N times. For example, the number of N times is 1 time. Thus, the user may perform a first operation (e.g., pulling the distance between the two earplugs away) and then perform a second operation (e.g., pulling the distance between the two earplugs back closer) so that the TWS headset may perform a reconnect operation.
The target triggering operation may be an operation of the user to trigger the TWS headset to connect the mobile phone 2 back on the second electronic device, that is, the user inputs an operation of connecting the mobile phone 2 on the target interface of the mobile phone 2. The target interface indicates a configuration interface for the bluetooth connection. If the user wants the TWS headset to connect back to the handset 2, he can enter the relevant action on the target interface on the handset 2. The handset 2 receives the operation and sends a corresponding request to the TWS headset in response to the operation. The TWS headset receives the request and connects back to the handset 2N times in response to the request. For example, the number of times N may be 1.
It will be appreciated that the above target triggering operation may be performed in the event that the audio service of the handset 1 is terminated. And the above listed target triggering operation is only an example, and the target triggering operation may also be other types of operations, for example, when the user clicks the TWS headset for a set number of times. The TWS headset connects back to the handset 2 in response to the click operation; for another example, when the TWS headset has an on-off key, the user may touch the on-off key. The TWS headset reconnects the handset 2 in response to the click operation.
It should be noted that the disconnection of the bluetooth connection between the TWS headset and the mobile phone 2 may be the disconnection of the bluetooth connection between one earplug (such as the above-mentioned main earplug) of the TWS headset and the mobile phone 2, or the disconnection of the bluetooth connection between the two earplugs of the TWS headset and the mobile phone 2.
In other embodiments, after the automatic reconnection of the mobile phone 2 once fails, the TWS headset may further continue to automatically reconnect the mobile phone 2 after the audio service of the mobile phone 1 is ended, thereby improving the success rate of the reconnection on the basis of avoiding affecting the audio service of the mobile phone 1. As shown in fig. 9, this process specifically includes:
s401, Bluetooth connection is established between the true wireless stereo headset and the mobile phone 1 and the mobile phone 2 respectively.
S402, the true wireless stereo headset interacts with the mobile phone 1, and the true wireless stereo headset processes the audio service of the mobile phone 1.
S403, in the process of processing the audio service of the mobile phone 1, if the bluetooth connection between the wireless stereo headset and the mobile phone 2 is disconnected, the wireless stereo headset automatically connects back to the mobile phone 2.
The processes of S401 to S403 in this embodiment are similar to the processes of S301 to S303, and are not described herein again.
And S404, stopping automatically connecting the mobile phone 2 under the condition that the real wireless stereo headset fails to automatically connect the mobile phone 2.
S405, under the condition that the audio service of the mobile phone 1 is finished, the real wireless stereo headset automatically connects back the mobile phone 2 every second preset time, and the times of connection back are counted.
And S406, stopping automatic reconnection when the mobile phone 2 is reconnected successfully or the number of times of reconnection is equal to the preset number of times of reconnection.
In the embodiment of the present application, in the process of processing the audio service of the mobile phone 1, if the bluetooth connection between the TWS headset and the mobile phone 2 is disconnected due to a timeout connection, the TWS headset may automatically connect back to the mobile phone 2 once. Then, after the automatic reconnection fails, it indicates that the TWS headset still does not successfully establish the bluetooth connection with the mobile phone 2, and the TWS headset can determine whether the audio service of the mobile phone 1 is finished, so as to continue to automatically reconnect the mobile phone 2 after the audio service of the mobile phone 1 is finished, thereby avoiding the influence on the audio service of the mobile phone 1 caused by the TWS headset repeatedly reconnecting the mobile phone 2.
In some embodiments, the TWS headset may determine whether the audio service of the handset 1 is over by determining whether the audio data packet sent by the handset 1 is received. For example, if the TWS headset does not receive the audio data packet sent by the handset 1 for a period of time, the TWS headset may consider the audio service of the handset 1 to be over.
The mobile phone 1 may stop sending the audio data packet to the TWS headset after the audio service 1 is ended, so that the TWS headset may not receive the audio data packet sent by the mobile phone 1 within a period of time. The TWS headset cannot receive the audio data packet sent by the mobile phone 1, and may also be because the bluetooth between the TWS headset and the mobile phone 1 is disconnected, so that the mobile phone 1 cannot send the audio data packet to the mobile phone 1 any more. Of course, the TWS headset may not receive the audio data packet sent by the handset 1 for some time due to other reasons, and the description of the reason is omitted here.
In some embodiments, in the process of processing the audio service of the mobile phone 1, if the automatic reconnection of the mobile phone 2 fails, the TWS headset stops automatically reconnecting the mobile phone 2, and records the reason information for stopping reconnecting the mobile phone 2.
The reason information includes at least one of an audio service due to the use of the TWS headset by the handset 1 (i.e., the TWS headset handles the audio service of the handset 1) and an abnormality of the handset 2.
For example, a handset 2 anomaly may indicate that the distance between the handset 2 and the TWS headset is too long, the signal strength between the handset 2 and the TWS headset is too low, or the handset 2 is malfunctioning, etc.
Of course, after the TWS headset fails to automatically reconnect to the handset 2, the TWS headset may also be deactivated to the handset 2 for other reasons, for example, the user triggers the TWS headset to deactivate the handset, etc.
In the embodiment of the present application, when the audio service of the mobile phone 1 is finished, that is, the TWS headset does not process the audio service of the mobile phone 1 any more, it indicates that the TWS headset reconnecting to the mobile phone 2 does not affect the audio service of the mobile phone 1, and therefore, the TWS headset can continue to automatically reconnect to the mobile phone 2, and count the number of times of reconnection corresponding to the mobile phone 2. In case of failure to automatically reconnect the handset 2 again, the TWS headset determines whether the number of reconnects is equal to a preset number of reconnects. If the number of times of the reconnection equals the preset number of times of reconnection, indicating that although the TWS headset has automatically reconnected the handset 2 a number of times, there is no success of the reconnection, an abnormality may occur in the handset 2 (for example, the handset 2 is too far away from the TWS headset). Thus, to reduce the waste of resources caused by the reconnection, the TWS headset stops automatically reconnecting the handset 2.
If the number of times of the reconnection is less than the preset number of times of the reconnection, the TWS headset can continue to automatically reconnect the mobile phone 2, and continue to count the number of times of the reconnection, so as to determine whether to perform the next automatic reconnection after the current reconnection fails by using the number of times of the reconnection.
When the mobile phone 2 fails to be reconnected again, after a second preset time, the TWS headset may determine whether the number of reconnection times is equal to the preset number of reconnection times. And under the condition that the reconnection time is less than the preset reconnection time, the TWS earphone carries out the next automatic reconnection. Or, in case of failure of the mobile phone 2, the TWS headset determines whether the number of times of reconnection is equal to a preset number of times of reconnection. And when the reconnection time is less than the preset reconnection time, after a second preset time, the TWS earphone performs next automatic reconnection to realize periodic reconnection.
In some embodiments, the number of reconnections described above indicates the total number of times that the TWS headset automatically reconnects the handset 2 since the TWS headset was disconnected from the handset 2 due to a connection timeout. The initial value of the number of times of the reconnection is 0, and the TWS adds 1 to the number of times of the reconnection every time the TWS headset automatically reconnects the headset 2.
Illustratively, the preset number of reconnection times is 60 times. In the process that the TWS headset handles the audio service of the mobile phone 1, if the bluetooth connection between the TWS headset and the mobile phone 2 is disconnected, the TWS headset automatically reconnects the mobile phone 2 once, and the number of times of reconnection at this time becomes 1. If the TWS headset does not reconnect to the successful handset 2, then the automatic reconnection of the handset 2 is stopped. Then, after the audio service of the mobile phone 1 is finished, the TWS headset continues to automatically reconnect to the mobile phone 2 once, and the number of times of reconnection becomes 2. If the TWS earphone is not connected back to the successful mobile phone 2, the number of times of connection back is 2, and the number of times of connection back is smaller than the preset number of times of connection back, the TWS earphone still continues to automatically connect back to the mobile phone 2.
Then, if the continuous reconnection fails, the TWS headset continues to automatically reconnect the mobile phone 2 when the number of times of reconnection is less than the preset number of times of reconnection. In the case where the number of times of reconnection is 59 times, if the TWS headset has not yet reconnected to the successful handset 2, the TWS headset continues to automatically reconnect to the handset 2 once. At this time, the number of times of reconnection becomes 60. If the mobile phone 2 still fails to be reconnected, the TWS headset stops the mobile phone 2 since the number of times of the reconnection has been 60, which is equal to the preset number of times of reconnection.
In other embodiments, the number of reconnection indicates the total number of times that the TWS headset automatically reconnects the handset 2 after the audio service of the handset 1 is over. The initial value of the number of times of the reconnection is 0, and the TWS adds 1 to the number of times of the reconnection every time the TWS headset automatically reconnects the headset 2. For example, after the audio service of the handset 1 is finished, the TWS headset continues to automatically reconnect to the handset 2 once, and the number of times of reconnection becomes 1.
In an implementation manner, in the process that the TWS headset continues to automatically reconnect the mobile phone 2, if the TWS headset restarts processing the audio service of the mobile phone 1, that is, the TWS headset receives the audio data packet sent by the mobile phone 1 again, the TWS headset may stop automatically reconnecting the mobile phone 2 again, or after the TWS headset automatically reconnects the mobile phone 2 once, the TWS headset stops automatically reconnecting the mobile phone 2, so as to avoid an influence (for example, a audio jamming phenomenon) caused by the TWS headset reconnecting the mobile phone 2 on the audio service of the mobile phone 1. And after waiting for the audio service of handset 1 to end again, the TWS headset may continue back to handset 2 again.
It should be understood that, if the number of reconnection indicates the total number of times that the TWS headset automatically reconnects the mobile phone 2 since the TWS headset was disconnected from the mobile phone 2 due to a connection timeout, in the case that the mobile phone 2 continues to automatically reconnect the mobile phone 2 again, the number of reconnection corresponding to the mobile phone 2 at this time is the counted number of times that the TWS headset reconnects when the automatic reconnection of the mobile phone 2 was last stopped.
If the number of times of reconnection indicates the total number of times that the TWS headset automatically reconnects the mobile phone 2 after the audio service of the mobile phone 1 is ended, the number of times of reconnection corresponding to the mobile phone 2 is 0 at this time under the condition that the mobile phone 2 automatically continues to reconnect the mobile phone 2 again.
In some embodiments, after the audio service of the handset 1 is finished, the TWS headset may determine whether to continue to automatically reconnect the handset 2 according to the recorded reason information for stopping the reconnection of the handset 2. For example, if the reason information is target reason information (e.g. because the TWS headset is used by the handset 1 for audio service), then the handset 2 continues to be automatically connected back.
It was described above that a TWS headset can automatically reconnect to a handset 2 once during the course of handling the audio traffic of the handset 1 after the bluetooth connection between the TWS headset and the handset 2 has been disconnected. If the connection fails, the TWS headset may continue to automatically connect back to the mobile phone 2 multiple times after the audio service of the mobile phone 1 is finished. Another way of reconnecting will be described further below.
The TWS headset can automatically connect back to the mobile phone 2 directly after the audio service of the mobile phone 1 is finished, that is, under the condition that the bluetooth connection between the TWS headset and the mobile phone 2 is disconnected, if the TWS headset is processing the audio service of the mobile phone 1, the TWS does not automatically connect back to the mobile phone 2, but the TWS headset starts to automatically connect back to the mobile phone only after the audio service of the mobile phone 1 is finished, thereby avoiding the influence on the audio service of the mobile phone 1.
When the TWS headset starts to automatically reconnect the mobile phone 2, the number of times of reconnection can be counted, so as to determine whether to perform next reconnection by using the number of times of reconnection.
In the embodiment of the present application, in the process that the TWS headset processes the audio service of the mobile phone 1, if the bluetooth connection between the TWS headset and the mobile phone 2 is disconnected due to connection timeout, the TWS headset automatically reconnects the mobile phone 2 once first, so as to implement timely reconnection of the mobile phone 2. And if the return loss is lost, the TWS headset stops automatically returning the handset 2 to avoid causing a jam of the audio traffic of the handset 1. Then, the TWS headset may continue to automatically reconnect the mobile phone 2 after the audio service of the mobile phone 1 is finished until the reconnection success or the reconnection number reaches a preset number, so as to improve the success rate of reconnecting the mobile phone 2 on the basis of avoiding affecting the audio service of the mobile phone 1.
In some embodiments, the present application provides a computer readable storage medium comprising computer instructions that, when run on a bluetooth device, cause the bluetooth device to perform a bluetooth connection method as described above.
In some embodiments, the present application provides a computer program product which, when run on a bluetooth device, causes the bluetooth device to perform a bluetooth connection method as described above.
Through the description of the above embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a variety of media that can store program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (11)

1. A Bluetooth connection method is applied to Bluetooth equipment, and the Bluetooth equipment establishes Bluetooth connection with a plurality of electronic equipment; the Bluetooth device is used for playing or acquiring audio corresponding to any one of the plurality of electronic devices; the method comprises the following steps:
the Bluetooth equipment interacts with first electronic equipment in the plurality of electronic equipment and processes audio service of the first electronic equipment;
in the process of processing the audio service of the first electronic device, if the Bluetooth connection between the Bluetooth device and the second electronic device is disconnected, the Bluetooth device automatically connects back to the second electronic device; the second electronic device is at least one electronic device of the plurality of electronic devices except the first electronic device.
2. The method of claim 1, further comprising:
after the automatic reconnection of the second electronic equipment fails, the Bluetooth equipment stops automatically reconnecting the second electronic equipment and judges whether the audio service of the first electronic equipment is finished or not;
and under the condition that the audio service of the first electronic equipment is determined to be finished, the Bluetooth equipment continues to automatically connect back to the second electronic equipment.
3. The method of claim 2, further comprising:
the Bluetooth equipment stops automatically reconnecting the second electronic equipment after the first reconnection time is equal to a preset reconnection time;
the first connection times are the total times of the Bluetooth device automatically connecting the second electronic device; or the first connection times are the times that the Bluetooth device automatically connects the second electronic device after the audio service of the first electronic device is finished.
4. The method of claim 2 or 3, wherein the determining whether the audio service of the first electronic device is finished comprises:
and if the Bluetooth equipment does not receive the audio data packet corresponding to the first electronic equipment within the preset time, determining that the audio service of the first electronic equipment is ended.
5. The method of claim 2, further comprising:
under the condition that the Bluetooth equipment stops automatically connecting back to the second electronic equipment, the Bluetooth equipment records the reason information of stopping connecting back corresponding to the second electronic equipment;
wherein the reason information for stopping reconnection comprises at least one of the following: and the Bluetooth equipment processes the audio service of the first electronic equipment and the abnormity of the second electronic equipment.
6. The method of claim 5, wherein the Bluetooth device continuing to automatically reconnect to the second electronic device in the event that the determination is made that the audio service of the first electronic device is over, comprises:
under the condition that the audio service of the first electronic device is determined to be finished, the Bluetooth device acquires reason information of the second electronic device corresponding to the connection stopping;
and under the condition that the reason information for stopping reconnection indicates that the Bluetooth equipment processes the audio service of the first electronic equipment, continuing to automatically reconnect the second electronic equipment.
7. The method of claim 1, wherein the Bluetooth device comprises an earpiece of a true wireless stereo TWS headset; the method further comprises the following steps:
after the automatic reconnection of the second electronic equipment fails, the Bluetooth equipment stops automatically reconnecting the second electronic equipment;
the Bluetooth device responds to a target trigger operation and is connected back to the second electronic device;
wherein the target trigger operation comprises any one of: the earplugs are taken out of the box, the earplugs of the TWS earphone are uncovered, the earplugs are switched from an unworn state to a worn state, the two earplugs of the TWS earphone establish a Bluetooth connection, a user triggers the operation that the TWS earphone is connected back to the second electronic equipment on the second electronic equipment, and the user triggers the operation that the TWS earphone is connected with new electronic equipment.
8. A Bluetooth communication system, characterized in that it comprises a plurality of electronic devices and a Bluetooth device as claimed in any one of claims 1 to 7.
9. A bluetooth device, characterized in that the bluetooth device comprises a memory, a wireless communication module, a receiver and a microphone and one or more processors; the memory, the wireless communication module, the headphones, and the microphone are coupled with the processor; wherein the wireless communication module is for wirelessly communicating with an electronic device, the memory having stored therein computer program code comprising computer instructions which, when executed by the processor, cause the bluetooth device to perform the bluetooth connection method of any of claims 1 to 7.
10. The bluetooth device of claim 9, wherein the bluetooth device comprises a TWS headset.
11. A computer storage medium comprising computer instructions that, when run on a bluetooth device, cause the bluetooth device to perform the bluetooth connection method of any one of claims 1 to 7.
CN202210787563.4A 2022-07-06 2022-07-06 Bluetooth connection method and Bluetooth device Active CN114866998B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210787563.4A CN114866998B (en) 2022-07-06 2022-07-06 Bluetooth connection method and Bluetooth device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210787563.4A CN114866998B (en) 2022-07-06 2022-07-06 Bluetooth connection method and Bluetooth device

Publications (2)

Publication Number Publication Date
CN114866998A true CN114866998A (en) 2022-08-05
CN114866998B CN114866998B (en) 2022-11-11

Family

ID=82626258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210787563.4A Active CN114866998B (en) 2022-07-06 2022-07-06 Bluetooth connection method and Bluetooth device

Country Status (1)

Country Link
CN (1) CN114866998B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024109399A1 (en) * 2022-11-22 2024-05-30 荣耀终端有限公司 State notification method and apparatus

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110191442A (en) * 2019-04-18 2019-08-30 华为技术有限公司 A kind of Bluetooth connecting method, equipment and system
CN111601199A (en) * 2020-02-17 2020-08-28 华为技术有限公司 Wireless earphone box and system
CN112272417A (en) * 2020-10-23 2021-01-26 海信视像科技股份有限公司 double-Bluetooth sound box reconnection method and display device
US20210068194A1 (en) * 2018-01-08 2021-03-04 Samsung Electronics Co., Ltd. Electronic device for controlling establishment or release of communication connection, and operating method therefor
US20210176810A1 (en) * 2017-12-04 2021-06-10 Samsung Electronics Co., Ltd. Method and device for reconnecting bluetooth communication
US20210203454A1 (en) * 2019-12-31 2021-07-01 Samsung Electronics Co., Ltd. Method for transceiving data in bluetooth network environment and electronic device thereof
CN113395690A (en) * 2021-06-25 2021-09-14 斑马网络技术有限公司 Automatic connection method, device, equipment and storage medium for Bluetooth equipment
CN113490158A (en) * 2021-07-07 2021-10-08 荣耀终端有限公司 Bluetooth device pairing connection method, electronic device, Bluetooth device and terminal system
CN114095899A (en) * 2021-11-12 2022-02-25 山西大鲲智联科技有限公司 Communication signal detection method and device, electronic equipment and computer readable medium
CN114339383A (en) * 2021-04-30 2022-04-12 海信视像科技股份有限公司 Display device and multi-Bluetooth audio output method

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210176810A1 (en) * 2017-12-04 2021-06-10 Samsung Electronics Co., Ltd. Method and device for reconnecting bluetooth communication
US20210068194A1 (en) * 2018-01-08 2021-03-04 Samsung Electronics Co., Ltd. Electronic device for controlling establishment or release of communication connection, and operating method therefor
CN110191442A (en) * 2019-04-18 2019-08-30 华为技术有限公司 A kind of Bluetooth connecting method, equipment and system
US20210203454A1 (en) * 2019-12-31 2021-07-01 Samsung Electronics Co., Ltd. Method for transceiving data in bluetooth network environment and electronic device thereof
CN111601199A (en) * 2020-02-17 2020-08-28 华为技术有限公司 Wireless earphone box and system
WO2021164556A1 (en) * 2020-02-17 2021-08-26 华为技术有限公司 Wireless earphone case and system
CN112272417A (en) * 2020-10-23 2021-01-26 海信视像科技股份有限公司 double-Bluetooth sound box reconnection method and display device
CN114339383A (en) * 2021-04-30 2022-04-12 海信视像科技股份有限公司 Display device and multi-Bluetooth audio output method
CN113395690A (en) * 2021-06-25 2021-09-14 斑马网络技术有限公司 Automatic connection method, device, equipment and storage medium for Bluetooth equipment
CN113490158A (en) * 2021-07-07 2021-10-08 荣耀终端有限公司 Bluetooth device pairing connection method, electronic device, Bluetooth device and terminal system
CN114095899A (en) * 2021-11-12 2022-02-25 山西大鲲智联科技有限公司 Communication signal detection method and device, electronic equipment and computer readable medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
林嘉涛等: "基于Android平台的车载蓝牙电话免提系统的研究", 《电子测量技术》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024109399A1 (en) * 2022-11-22 2024-05-30 荣耀终端有限公司 State notification method and apparatus

Also Published As

Publication number Publication date
CN114866998B (en) 2022-11-11

Similar Documents

Publication Publication Date Title
CN112789866B (en) Audio data transmission method and equipment applied to TWS earphone single-ear and double-ear switching
WO2021042942A1 (en) Wireless earphones and wireless earphone system
US20210219041A1 (en) Voice data transmission method, wireless earphone and tws earphone
EP3849223B1 (en) Bluetooth headset device and communication method for the same
CN112042212B (en) Audio data transmission method and electronic equipment
CN111436041B (en) Method and device for switching master and slave Bluetooth earphones, bluetooth earphones and system
WO2020019820A1 (en) Microphone hole blockage detection method and related product
WO2020019843A1 (en) Microphone hole blockage detection method and related product
US11553268B2 (en) Wireless headset
CN111447603A (en) Data transmission method and device
CN111436043A (en) Communication method, device, equipment and system of double-wireless Bluetooth communication network
CN113038316A (en) Earphone control method and device, Bluetooth earphone and storage medium
CN114866998B (en) Bluetooth connection method and Bluetooth device
WO2023061127A1 (en) Communication method and apparatus, earphone set, and computer readable medium
CN114245362B (en) Device reconnection method and Bluetooth peripheral
CN110958516B (en) Wireless earphone
CN115426341B (en) Wireless audio/video device and wireless communication method
WO2020082387A1 (en) Method for changing audio channel, and related device
CN113301113B (en) Profile version determination method, system, electronic equipment and computer storage medium
CN115967927A (en) Bluetooth connection method and device, earphone and storage medium
CN113038317A (en) Earphone control method and device, Bluetooth earphone and storage medium
CN114079837A (en) Wireless earphone, earphone storage box and wireless earphone system
CN115119098B (en) Audio playing control method, TWS earphone and storage medium
CN115175065B (en) Broadcasting method, TWS headset and storage medium
CN116074986B (en) Bluetooth connection method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant