WO2023103732A1 - State control method and apparatus for earphone device, earphone device and storage medium - Google Patents
State control method and apparatus for earphone device, earphone device and storage medium Download PDFInfo
- Publication number
- WO2023103732A1 WO2023103732A1 PCT/CN2022/132512 CN2022132512W WO2023103732A1 WO 2023103732 A1 WO2023103732 A1 WO 2023103732A1 CN 2022132512 W CN2022132512 W CN 2022132512W WO 2023103732 A1 WO2023103732 A1 WO 2023103732A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- earphone
- electronic device
- bluetooth
- state
- connection
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R1/00—Details of transducers, loudspeakers or microphones
- H04R1/10—Earpieces; Attachments therefor ; Earphones; Monophonic headphones
- H04R1/1041—Mechanical or electronic switches, or control elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R1/00—Details of transducers, loudspeakers or microphones
- H04R1/10—Earpieces; Attachments therefor ; Earphones; Monophonic headphones
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Definitions
- the present application relates to the field of communication technologies, and in particular to a method and device for controlling the state of an earphone device, an earphone device, and a storage medium.
- earphones have become one of the indispensable electronic devices in users' daily work and life. With the development of electronic technology, earphones also have more and more perfect functions to meet users' needs for earphones in different scenarios. need.
- the wireless earphone device is also favored by more and more users because of its flexible use, convenience, and high sound quality. At present, when the user wants the wireless earphone device to enter the working state specified in the communication, it needs to be realized through cumbersome interactive operations, which affects the normal use of the wireless earphone device by the user.
- the application discloses a method and device for controlling the state of an earphone device, the earphone device and a storage medium.
- the embodiment of the present application discloses a method for controlling the state of an earphone device.
- the earphone device includes a first earphone, a second earphone, and an earphone box.
- the method includes:
- the first earphone When only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box;
- the first earphone controls the first earphone and/or the second earphone to enter the working state specified by the target instruction according to the target instruction;
- the working state includes a pairing state
- the pairing state refers to a state in which the first earphone and/or the second earphone can be discovered by other electronic devices.
- the embodiment of the present application discloses a method for controlling the state of an earphone device.
- the earphone device includes a first earphone, a second earphone, and an earphone box.
- the method includes:
- the first earphone When only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box;
- the first earphone controls the first earphone and the second earphone to enter a single use state or a common use state, wherein the single use state refers to the first earphone and the second earphone
- the earphones are configured with different bluetooth addresses
- the common use state refers to a state in which the first earphone and the second earphone share the same bluetooth address.
- the embodiment of the present application discloses a device for controlling the state of an earphone device.
- the earphone device includes a first earphone, a second earphone, and an earphone box.
- the device includes:
- An instruction receiving module configured to receive, by the first earphone, the target instruction sent by the earphone box when only the first earphone is placed in the earphone box;
- a state control module configured for the first earphone to control the first earphone and/or the second earphone to enter the working state specified by the target instruction according to the target instruction;
- the working state includes a pairing state;
- the pairing state refers to a state in which the first earphone and/or the second earphone can be discovered by other electronic devices.
- the embodiment of the present application discloses a device for controlling the state of an earphone device.
- the earphone device includes a first earphone, a second earphone, and an earphone box.
- the device includes:
- An instruction receiving module configured to receive, by the first earphone, the target instruction sent by the earphone box when the first earphone is placed in the earphone box;
- a state control module used for the first earphone to control the first earphone and the second earphone to enter a single use state or a joint use state according to the target instruction, wherein the single use state refers to the The state in which the first earphone and the second earphone are configured with different bluetooth addresses, and the common use state refers to the state in which the first earphone and the second earphone share the same bluetooth address.
- the embodiment of the present application discloses an earphone device, including a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor realizes any of the above-mentioned method.
- the embodiment of the present application discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any one of the methods described above is implemented.
- Fig. 1 is an application scene diagram of a state control method of an earphone device in an embodiment
- Fig. 2 is a flow chart of a state control method of an earphone device in an embodiment
- FIG. 3A is a schematic diagram of the sequence of controlling the first earphone to enter the pairing state in an embodiment
- FIG. 3B is a schematic diagram of the sequence of the first earphone controlling the second earphone to enter the pairing state in an embodiment
- FIG. 3C is a timing diagram of controlling the first earphone and the second earphone to enter the pairing state together in one embodiment
- Fig. 4 is a flow chart of the scene where the earphone device is in the rush to connect in one embodiment
- FIG. 5 is an interaction sequence diagram in an embodiment of a headset device snatching connection scenario
- FIG. 6 is a flow chart showing that the earphone device needs to simultaneously or continuously establish Bluetooth connections with two electronic devices in one embodiment
- Fig. 7 is an interaction sequence diagram of an earphone device connecting two electronic devices in an embodiment
- Fig. 8 is a flow chart of controlling the first earphone and the second earphone to enter the common use state in one embodiment
- Fig. 9 is a flow chart of a method for controlling the state of an earphone device in another embodiment
- Fig. 10 is a block diagram of a state control device of an earphone device in an embodiment
- Fig. 11 is a block diagram of a state control device of an earphone device in another embodiment
- Fig. 12 is a structural block diagram of an earphone device in one embodiment.
- first, second and the like used in this application may be used to describe various elements herein, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element.
- a first headset could be termed a second headset, and, similarly, a second headset could be termed a first headset, without departing from the scope of the present application.
- Both the first earphone and the second earphone are earphones, but they are not the same earphone.
- the term “plurality” used in this application refers to two or more than two.
- the term “and/or” used in this application refers to one of them, or any combination of multiple of them.
- the wireless headset device when the user wants the wireless headset device to enter the working state specified in the communication, it needs to be realized through cumbersome interactive operations. Putting it into the earphone box, and then pressing the pairing button on the earphone box to let the wireless earphone device enter the pairing state, the operation is cumbersome, and it will affect the normal use of the wireless earphone device by the user, causing inconvenience to the user.
- Embodiments of the present application provide a state control method and device for earphone equipment, earphone equipment, and storage media, which can simplify the way of controlling the earphone equipment to enter the specified working state in communication, and the operation is more convenient without affecting the user's ability to use the earphone. normal use of the device.
- Fig. 1 is an application scene diagram of a method for controlling the state of an earphone device in an embodiment.
- the earphone device 10 may include an earphone 110, an earphone 120, and an earphone box 130.
- the earphone device 10 may include but not limited to wireless earphones such as in-ear earphones and earbud earphones. Further, the earphone device 10 may be a true wireless earphone. Stereo (True Wireless Stereo, TWS) Bluetooth headset, etc.
- the earphone 110 and/or the earphone 120 can establish a communication connection with other electronic devices 20, and receive and play audio output transmitted by other electronic devices.
- the other electronic devices 20 may include, but are not limited to, wearable devices, vehicle-mounted terminals, mobile phones, tablet computers, laptop PCs (Personal Computers, personal computers), PDAs (Personal Digital Assistants, personal digital assistants) and other devices.
- the earphone 110 and the earphone 120 support wireless communication.
- the communication connection between the earphone 110 and/or the earphone 120 and other electronic devices 20 may include but not limited to a Bluetooth connection.
- the Bluetooth connection, the BLE connection established based on the BLE (Bluetooth Low Energy, Bluetooth Low Energy) protocol, and the LE Audio Bluetooth connection established based on the BLE Audio (Bluetooth Low Energy Audio, Bluetooth Low Energy Audio) protocol, etc. the classic Bluetooth protocol generally refers to the Bluetooth protocol below the Bluetooth protocol version 4.0, and the BLE protocol generally refers to the Bluetooth protocol above the Bluetooth protocol version 4.0.
- the BLE Audio technology solves the problem that the BLE connection can only transmit data with a small amount of data, but cannot transmit audio data.
- the BLE Audio protocol supports LC3 (Low Complexity Communications Codec, low-power audio codec) encoded audio Data, so that the transmission of audio data can better take into account various aspects of power consumption, real-time performance and sound quality.
- the user when the user needs the earphone device 10 to enter the specified working state in the communication, for example, it needs to enter the pairing state in the Bluetooth communication, or it needs to enter the individual use state or the common use state in the Bluetooth communication, Any one of the earphone 110 and the earphone 120 can be placed in the earphone box 130, so that the earphone device 10 enters the working state specified in the communication.
- the earphone 120 is outside the earphone box 130 at this time, and the user can perform control operations on the earphone box 130 .
- the earphone box 130 detects a control operation, it can send a target command to the earphone 110, and the earphone 110 can control the earphone 110 and/or the earphone 120 to enter the working state specified by the target command according to the received target command.
- the operation method is more convenient, and the user can still use the headset that is not placed in the earphone box 130 normally. Headphones will not affect the normal use of the user.
- a method for controlling the state of an earphone device is provided, which can be applied to the above-mentioned earphone device, and the method may include the following steps:
- Step 210 when only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box.
- the first earphone may be any earphone in the earphone device, for example, it may be the left earphone of the earphone device, or it may be the right earphone of the earphone device.
- any earphone in the earphone device can be placed in the earphone box, while the other earphone (ie the second earphone) is outside the earphone box.
- the first earphone After the first earphone is placed in the earphone box, the first earphone can perform signal transmission with the earphone box through a port (such as a signal transmission pin, etc.) in the earphone box.
- a port such as a signal transmission pin, etc.
- the user After placing the first earphone in the earphone box, the user can control the earphone box, and the earphone device can send a target instruction to the first earphone according to the detected control operation, and the target instruction can be used to instruct the first earphone to control the first earphone And/or the second earphone enters the specified working state.
- the operation mode of the control operation on the earphone box is not limited.
- an operation button may be provided on the earphone box, and the user may trigger the control operation by pressing the operation button; or an There is a touchpad, and the user triggers the control operation through touch operations on the touchpad (such as touch operations such as clicking, long pressing, and sliding); one or more sensors (such as pressure sensors, distance sensor, acceleration sensor, etc.), touch operations are detected by sensors (such as pressing operations are detected by pressure sensors, gesture operations are detected by distance sensors, shaking operations are detected by acceleration sensors), etc., but are not limited thereto.
- Step 220 according to the target instruction, the first earphone controls the first earphone and/or the second earphone to enter the working state specified by the target instruction.
- the first earphone after receiving the target instruction sent by the earphone box, the first earphone can control itself to enter the working state specified by the target instruction according to the target instruction.
- a communication connection such as a classic Bluetooth connection or a BLE connection
- the first earphone after the first earphone receives the target instruction sent by the earphone box, it can send a message to the second earphone Send the target command to control the second earphone to enter the working state specified by the target command; the first earphone can also send the target command to the second earphone while controlling itself to enter the working state specified by the target command to control the second earphone The two earphones enter the working state specified by the target instruction.
- the working state for controlling the first earphone and/or the second earphone to enter may include a pairing state
- the pairing state refers to a state in which the first earphone and/or the second earphone can be discovered by other electronic devices.
- the first earphone and/or the second earphone are in the pairing state, the first earphone and/or the second earphone are in a discoverable state or in a discoverable and connectable state, wherein the discoverable state refers to the inquiry scan mode being turned on Status, discoverable and connectable status refers to enabling inquiry scan mode and page scan mode at the same time.
- first earphone and/or the second earphone turn on the inquiry scan mode other electronic devices can scan and search for the earphone device, and when the first earphone and/or the second earphone turn on the page scan mode, other electronic devices can establish with the earphone device Bluetooth connection.
- the first earphone and the second earphone can share the same bluetooth address (such as the same classic bluetooth address), so relative to other electronic devices Say, the first earphone and the second earphone will be considered as a bluetooth device.
- other electronic devices can turn on the Bluetooth scanning function to scan the surrounding Bluetooth devices, and scan to the first The bluetooth address shared by the earphone and the second earphone, other electronic devices can send a bluetooth connection request based on the scanned bluetooth address.
- the first earphone and/or the second earphone can receive the bluetooth connection request, and establish a bluetooth connection with other electronic devices according to the bluetooth connection request. Since other electronic devices do not store connection records corresponding to the earphone device (eg, have not been connected to the earphone device before, or have been connected but the connection record has been deleted, etc.), therefore, pairing can be performed during the establishment of the Bluetooth connection.
- the pairing may include processes such as exchanging pairing codes and agreeing on keys between the two, so as to ensure the security of transmission.
- the first earphone and the second earphone can distinguish between the master earphone and the slave earphone, wherein the master earphone can refer to the earphone that can directly communicate with other earphones An earphone that establishes a Bluetooth connection with an electronic device, and a slave earphone refers to an earphone that does not directly establish a Bluetooth connection with other electronic devices.
- the slave earphone can monitor the Bluetooth connection between the master earphone and other electronic devices, or the master earphone can forward the data transmitted through the Bluetooth connection with other electronic devices to the slave earphone to realize master-slave synchronization.
- the first earphone when the first earphone receives the target instruction sent by the earphone box to indicate to enter the pairing state, if the current master-slave relationship of the first earphone is the master device, it can control itself to enter the pairing state and communicate with other electronic devices.
- the device establishes a Bluetooth connection. If the current master-slave relationship of the first earphone is a slave device, the target command can be sent to the second earphone, so that the second earphone with the current master-slave relationship as the master device enters the pairing state, and the second earphone can be connected with other electronic devices.
- the device establishes a Bluetooth connection; or, if the current master-slave relationship of the first earphone is a slave device, it can control itself to enter the pairing state, and establish a Bluetooth connection with other electronic devices, and then synchronize the connection information corresponding to other electronic devices to the
- the second earphone enables the Bluetooth connection object of other electronic devices to switch from the first earphone to the second earphone.
- the connection information may include but not limited to frequency hopping information, channel information, clock information, and the like.
- the first earphone can adopt different strategies to control the first earphone and/or the second earphone to enter the pairing state according to the current master-slave relationship, so as to ensure that other electronic devices can scan correctly and establish a Bluetooth connection with the master device, ensuring the stability of the Bluetooth connection .
- the first earphone may enter a pairing state, and the first earphone and the second earphone may respectively use different Bluetooth addresses.
- the other electronic device can scan the current Bluetooth address of the first headset, and send a Bluetooth connection request to the first headset based on the scanned Bluetooth address, so as to establish a Bluetooth connection with the first headset. Pairing also needs to be performed during the process of establishing a Bluetooth connection with the first earphone.
- Bluetooth connection involved in the above embodiments can be understood as including the establishment of physical links such as ACL (Asynchronous Connectionless, asynchronous connectionless link) and/or SCO (Synchronous Connection Oriented, connection-oriented synchronous link) road, or including transmission links that establish upper-layer protocol connections, such as A2DP (Advanced Audio Distribution Profile, Bluetooth audio transmission model agreement), HFP (Hands-free Profile, hands-free protocol) and other connections, there is no restriction on this, according to Business requirements or refer to the provisions of the relevant Bluetooth protocol.
- ACL Asynchronous Connectionless, asynchronous connectionless link
- SCO Synchronous Connection Oriented, connection-oriented synchronous link
- transmission links that establish upper-layer protocol connections such as A2DP (Advanced Audio Distribution Profile, Bluetooth audio transmission model agreement), HFP (Hands-free Profile, hands-free protocol) and other connections
- FIG. 3A is a timing diagram of controlling the first earphone to enter the pairing state in an embodiment.
- the earphone A is placed in the earphone box, and the earphone box sends the earphone A a target instruction for instructing to enter the pairing state according to the detected control operation.
- Headphone A enters the pairing state according to the target command (for example, the inquiry scan mode and page scan mode are turned on at the same time)
- the electronic device C can send a scan request to the earphone A in the pairing state
- the earphone A can return the scan to the electronic device C according to the scanning request response.
- the electronic device C may send a Bluetooth connection request to the headset A, and establish a Bluetooth connection with the headset A.
- FIG. 3B is a schematic diagram of a sequence in which the first earphone controls the second earphone to enter the pairing state in an embodiment.
- a Bluetooth connection can be established between earphone A and earphone B.
- the earphone A is placed in the earphone box, and the earphone box sends the earphone A a target instruction for indicating to enter the pairing state according to the detected control operation.
- Earphone A can forward the target instruction to earphone B, and earphone B enters the pairing state according to the target instruction (such as turning on the inquiry scan mode and page scan mode at the same time).
- the electronic device C may send a scan request to the earphone B in the pairing state, and the earphone B may return a scan response to the electronic device C according to the scan request. After receiving the scan response, the electronic device C can send a Bluetooth connection request to the earphone B, and establish a Bluetooth connection with the earphone B.
- FIG. 3C is a timing diagram of controlling the first earphone and the second earphone to enter the pairing state together in an embodiment.
- a Bluetooth connection can be established between the earphone A and the earphone B.
- the earphone A is placed in the earphone box, and the earphone box sends the earphone A a target instruction for indicating to enter the pairing state according to the detected control operation.
- Earphone A enters the pairing state according to the target instruction, and forwards the target instruction to earphone B, and earphone B enters the pairing state according to the target instruction.
- Electronic device C may send a scan request, and earphone A and/or earphone B in a pairing state may receive the scan request and return a scan response to electronic device C. After receiving the scanning response, electronic device C may send a Bluetooth connection request, and earphone A and/or earphone B may establish a Bluetooth connection with electronic device C according to the received Bluetooth connection request.
- the first earphone when only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box, and the first earphone controls the first earphone and/or the second earphone to enter according to the target instruction.
- the working state specified by the target directive In this embodiment of the application, the user only needs to place one earphone in the earphone box into the earphone box to trigger the first earphone and/or the second earphone in the earphone device to enter the specified working state in the communication.
- the operation is more convenient, and the method of controlling the earphone device to enter the working state specified in the communication is simplified, and It will not affect the normal use of the earphone device by the user.
- the step of receiving the target instruction sent by the earphone box by the first earphone may include: when only the first earphone is placed in the earphone box, If the earphone box detects the control operation, the earphone box sends the target instruction corresponding to the operation information to the first earphone according to the operation information of the control operation, so that the first earphone receives the target instruction.
- the headphone box When the headphone box detects a control operation, it can obtain the operation information of the control operation, and generate the target instruction corresponding to the operation information, wherein the operation information includes the operation time corresponding to the control operation, the identification of the operation component, the operation direction and the operation force, etc. one or more of.
- the types of corresponding operation information may be different.
- the control operation is an operation of pressing an operation button
- the operation information may include at least one of the operation component identification (used to identify the operation button that has been pressed), operation duration, etc.
- the operation information may include at least one of operation duration, operation direction, and operation force, but is not limited thereto, and may be set according to actual needs.
- the earphone box After the earphone box acquires the operation information of the control operation, it can judge whether the control operation is an operation of controlling to enter the pairing state according to the operation information. It can be judged whether the operation information satisfies the first operation condition, wherein the first operation condition is the operation condition corresponding to the pairing state, if the earphone box determines that the operation information meets the first operation condition, it means that the detected control operation is to control entering the pairing state operation, a first control instruction may be sent to the first earphone, where the first control instruction is used to indicate to enter the pairing state. The first earphone can control the first earphone and/or the second earphone to enter a pairing state according to the first control instruction.
- the earphone box can generate different target instructions for different working states, and each working state can be in one-to-one correspondence with the operating conditions.
- the working state may also include a single use state and/or a joint use state, wherein the single use state refers to the state in which the first earphone and the second earphone are configured as different bluetooth addresses.
- the common use state refers to the state in which the first earphone and the second earphone share (that is, share) the same Bluetooth address (as in the first earphone
- the bluetooth addresses of the first earphone and the second earphone are both address X).
- the bluetooth addresses of the first earphone and the second earphone are different, they can be recognized as different bluetooth devices by external electronic devices, so they can respectively establish bluetooth connections with the same or different electronic devices. There can be no synchronization between the second earphones.
- the single use state may correspond to the second operating condition
- the joint use state may correspond to the third operating condition.
- the second operating condition may be different from the first operating condition
- the third operating condition may also be different from the first operating condition
- the second operating condition may be the same as or different from the third operating condition.
- the earphone box After acquiring the operation information of the control operation, if the earphone box determines that the operation information satisfies the second operation condition, it can send a second control instruction to the first earphone, and the second control instruction is used to instruct the first The earphone and the second earphone enter the independent use state. If the first earphone receives the second control instruction, then control the first earphone and/or the second earphone to change the configured bluetooth address, so that the first earphone and the second earphone are switched from the common use state to the independent use state.
- the earphone box After the earphone box obtains the operation information of the control operation, if it determines that the operation information satisfies the third operation condition, it can send a third control instruction to the first earphone, and the third control instruction is used to instruct the first The earphone and the second earphone enter the common use state. If the first earphone receives the third control instruction, then control the first earphone and/or the second earphone to change the configured bluetooth address, so that the first earphone and the second earphone are switched from the single use state to the common use state.
- the earphone box detects that the operation information of the control operation satisfies the second operating condition, then it can determine that the detected control operation is an operation for controlling entering the single use state, and can send the first earphone A second control instruction is sent, and the second control instruction is used to control the first earphone and the second earphone to be switched to an independent use state. If the earphone box detects that the operation information of the control operation satisfies the third operation condition, it can determine that the detected control operation is an operation to control entering the common use state, and can send a third control instruction to the first earphone, and the third control instruction uses Control the first earphone and the second earphone to switch to the common use state.
- the earphone box If the second operating condition is the same as the third operating condition, if the earphone box detects that the operation information of the control operation satisfies the second operating condition (ie, the third operating condition), it can send a second control instruction (ie, the third operating condition) to the first earphone.
- control instruction the two can be the same control instruction.
- the first earphone switches to the single use state if the current state is the common use state, and switches to the common use state if the current state is the single use state.
- the same control operation can be used to control the first earphone and the second earphone to switch back and forth between the independent use state and the joint use state, and the operation is more convenient.
- the first earphone and the second earphone when the first earphone and the second earphone are switched from the shared use state to the single use state, it may be that the first earphone changes the Bluetooth address to a different bluetooth address from that of the second earphone.
- the bluetooth addresses of the first earphone and the second earphone are both address X, then the first earphone can change the bluetooth address to address Y.
- the first earphone and the second earphone are switched from the joint use state to the single use state, and the second earphone may also change the bluetooth address to a bluetooth address different from that of the first earphone.
- the first earphone can send an address change instruction to the second earphone through the bluetooth connection with the second earphone, and the second earphone can change the bluetooth address to a bluetooth address different from that of the first earphone according to the address change instruction.
- the bluetooth addresses of the first earphone and the second earphone are both address X, then the second earphone can change the bluetooth address to address Y.
- the first earphone and the second earphone may also change the Bluetooth address at the same time, and configure them as different bluetooth addresses respectively.
- the Bluetooth addresses of the first earphone and the second earphone are both address X, then the first earphone can change the Bluetooth address to Y, and the second earphone can change the Bluetooth address to address Z, etc., but not limited to this.
- the bluetooth connection between the first earphone and the second earphone can be disconnected, then the first earphone and the second earphone can respectively establish bluetooth connections with different electronic devices , for example, the first headset establishes a Bluetooth connection with device A, the second headset establishes a Bluetooth connection with device B, and so on.
- the first earphone and the second earphone when the first earphone and the second earphone are switched from the single use state to the joint use state, it may be that the first earphone changes the bluetooth address to the same bluetooth address as that of the second earphone.
- the bluetooth address of the first earphone is address Y
- the bluetooth address of the second earphone is address X
- the first earphone can change the bluetooth address to address X.
- the first earphone and the second earphone switch from the single use state to the joint use state, or the second earphone changes the bluetooth address to the same bluetooth address as the first earphone.
- the first earphone can first establish a Bluetooth connection with the second earphone, and then send an address change command to the second earphone through the Bluetooth connection, and the second earphone can change the Bluetooth address to the same Bluetooth address as the first earphone according to the address change command.
- the bluetooth address of the first earphone is address Y
- the bluetooth address of the second earphone is address X
- the first earphone can change the bluetooth address to address Y.
- first earphone and the second earphone change the bluetooth address at the same time, so that the first earphone and the second earphone are configured with the same bluetooth address, which is not limited here.
- the first earphone changes the Bluetooth address, and the second earphone does not change the Bluetooth address, which can avoid The situation that the second earphone is disconnected from the external electronic device due to the change of the Bluetooth address of the second earphone does not affect the user's normal use of the earphone device.
- the user only needs to place one earphone in the earphone device into the earphone box, and perform corresponding control operations on the earphone box to trigger the first earphone and/or the second earphone in the earphone device Entering the working state specified in the communication simplifies the way of controlling the earphone device to enter the working state specified in the communication, the control is more flexible and convenient, and will not affect the normal use of the earphone device by the user.
- the working state may be a pairing state
- the method may further include the following steps:
- Step 402 when the first earphone and/or the second earphone are in the pairing state, the first earphone and/or the second earphone receive the scan request sent by the first electronic device, and send a scan response to the first electronic device according to the scan request .
- Step 404 when the headset device establishes Bluetooth connections with N second electronic devices, the first connection request sent by the first electronic device is received by the first headset and/or the second headset.
- N is the maximum number of Bluetooth connections supported by the headset device at the same time, and N is an integer greater than or equal to 1.
- the first earphone and/or the second earphone in the pairing state can simultaneously enable the inquiry scan mode and the page scan mode, and the first earphone and the second earphone can share the same bluetooth address.
- the first earphone and/or the second earphone with the inquiry scan mode enabled can receive the scan request sent by the first electronic device, and send a scan response to the first electronic device according to the scan request.
- the first electronic device may obtain the Bluetooth address shared by the first earphone and the second earphone (ie, the Bluetooth address of the earphone device) according to the scan response, and send a first connection request based on the Bluetooth address.
- the first connection request may be a paging (page) data packet, and the first electronic device may send the paging data packet in a frequency hopping manner to page the earphone device.
- the first earphone and/or the second earphone with the page scan mode turned on can scan (scan) the paging data packets sent externally at fixed intervals. If the paging data packets sent by the first electronic device are scanned, the first Connection request.
- the number of second electronic devices that the earphone device currently maintains a Bluetooth connection is less than N, indicating that the number of Bluetooth connections that the earphone device can support has not yet been reached. While maintaining the maximum data of the Bluetooth connection, the first earphone and/or the second earphone can establish a Bluetooth connection with the first electronic device in response to the first connection request.
- the earphone device establishes a Bluetooth connection with N second electronic devices, that is, the earphone device currently maintains a connection with N second electronic devices at the same time.
- Bluetooth connection the maximum number of Bluetooth connections that the headset device can maintain at the same time, if the first headset and/or the second headset receives the first connection request sent by the first electronic device, it needs to disconnect from one of the second electronic devices.
- the Bluetooth connection between the first electronic device and the earphone device can be successfully established by the first electronic device, which is equivalent to the first electronic device preempting the Bluetooth connection between the one of the second electronic devices and the earphone device.
- Step 406 perform disconnection processing corresponding to the target electronic device among the N second electronic devices through the second earphone, and process the first connection request through the first earphone, and establish a Bluetooth connection with the first electronic device; or, Perform disconnection processing corresponding to the target electronic device among the N second electronic devices through the first earphone, process the first connection request through the second earphone, and establish a Bluetooth connection with the first electronic device.
- the earphone device When the earphone device is in the scene of rushing to connect, it needs to disconnect the Bluetooth connection with a connected second electronic device.
- one of the earphones can perform disconnection processing. Open the Bluetooth connection between the earphone device and the target electronic device among the N second electronic devices, and process the first connection request through the other earphone, and the two earphones can perform disconnection and connection operations in parallel.
- the target electronic device Before the first earphone or the second earphone performs disconnection processing, the target electronic device may be determined from the N second electronic devices. As an implementation manner, the target electronic device may be any second electronic device among the N second electronic devices, and the target electronic device may be randomly selected from the N second electronic devices.
- the first earphone or the second earphone may select a second electronic device whose priority satisfies the priority condition from N second electronic devices as the target electronic device according to the priority of each second electronic device.
- the priority corresponding to each second electronic device may be acquired, and optionally, the priority of each second electronic device may be determined according to a device state parameter of each second electronic device.
- the device status parameters may include, but are not limited to, one or more of service data output parameters, sequence parameters used to characterize the order in which Bluetooth connections are established with headset devices, device type parameters, device remaining power parameters, and historical connection frequencies.
- the service data output parameter may be used to represent whether the second electronic device currently outputs service data to the earphone device through the Bluetooth connection.
- the priority of the second electronic device that is currently outputting service data to the earphone device may be higher than the priority of the second electronic device that is not currently outputting service data to the earphone device.
- the sequence parameter can be used to characterize the sequence of establishing the Bluetooth connection with the headset device.
- the first earphone and the second earphone can store the connection time when each second electronic device recently established a Bluetooth connection with the earphone device, and determine the connection time of each second electronic device according to the corresponding connection time of each second electronic device.
- the connection duration of this connection is the duration from the connection moment to the current moment.
- the sequence parameters of each second electronic device can be determined according to the connection duration of each second electronic device. The longer the connection duration, the higher the order indicated by the sequence parameter, that is, the earlier the second electronic device establishes Bluetooth with the headset device. connect.
- a connection queue can also be established, and the device information of each second electronic device can be stored in the connection queue in sequence according to the order in which each second electronic device establishes a Bluetooth connection with the headset device, and the more connected the second electronic device is in the connection queue.
- the second electronic device that is closer to the front indicates that the second electronic device establishes a Bluetooth connection with the earphone device earlier.
- the device type parameter may be used to characterize the device type of the second electronic device, and the device type may include but not limited to mobile phone, smart watch, wristband, smart home and so on.
- the priority corresponding to each device type can be preset, and the device type to which each second electronic device belongs can be determined according to the device type parameter of each second electronic device, and the priority corresponding to the device type to which the second electronic device belongs can be obtained.
- the parameter of the remaining power of the device may be used to represent the current remaining power of the second electronic device, and the priority of the second electronic device with a large remaining power of the device may be higher than that of the second electronic device with a small remaining power of the device.
- the historical connection frequency may be used to characterize the historical connection between the second electronic device and the earphone device, and the historical connection frequency may be the connection frequency in the past period of time (such as in the past week or month).
- the first earphone and the second earphone can store connection status data of each connected electronic device and the earphone device, and the connection status data can include device information, connection time, connection duration, etc. of each connected electronic device.
- the first earphone can count historical connection frequencies of N second electronic devices currently connected to the earphone device within a past period of time according to the stored connection status data.
- the priority of the second electronic device with a high historical connection frequency may be higher than that of the second electronic device with a low historical connection frequency.
- the priority corresponding to each second electronic device may be determined according to one or more device status parameters of each second electronic device. If the priority corresponding to each second electronic device is determined according to various device state parameters, weights may be assigned to each device state parameter.
- the device A may be any second electronic device, and the reference priority corresponding to each device state parameter may be determined first according to each device state parameter of device A, for example, device A
- the business data output parameter of the device A is 1, which means that the business data is currently being output to the headset device, and the reference priority corresponding to the business data output parameter can be 4; the remaining power parameter of the device A indicates that the current remaining power of the device A is greater than 50%.
- the reference priority corresponding to the remaining power of the device may be 2 or the like. Then, according to the reference priority corresponding to each device state parameter of device A, and the distribution weight of each device state parameter, weighted sum calculation or weighted average calculation can be performed to obtain the corresponding priority of device A.
- the method of determining the priority of each second electronic device is not limited to the above-mentioned methods, for example, priority rules can also be set directly, and the priority of the second electronic device that is currently outputting service data to the earphone device The highest, among the second electronic devices that currently do not output business data to the earphone device, the second electronic device with the lowest remaining power has the lowest priority, etc. Based on the priority rules and the device status parameters of each second electronic device, each The priority of the second electronic device.
- a second electronic device whose priority satisfies a priority condition may be selected from the N second electronic devices as the target electronic device.
- the priority condition may include a priority lower than a priority threshold, the lowest priority, etc. any kind.
- the second electronic device with the lowest priority can be directly selected as the target electronic device, or the second electronic device with the priority lower than the priority threshold can be selected first, if there are multiple second electronic devices with the priority lower than the priority threshold
- each second electronic device may be constantly changing according to specific situations, and is not necessarily fixed. It can be understood that, before the headset device receives the first connection request, if the priority of a certain second electronic device changes, it will select according to the latest priority of each second electronic device when receiving the Bluetooth connection request. target electronic device.
- each second electronic device may The bluetooth connection sequence, the first connected second electronic device A is disconnected first. If the first earphone enters the pairing state, if the second electronic device A transmits service data (such as voice data, audio data, etc.) to the first electronic device before the first earphone receives the first connection request sent by the first electronic device, Then the priority of the second electronic device A has changed. At this time, if the first earphone receives the first connection request, it will not disconnect the Bluetooth connection with the second electronic device A.
- service data such as voice data, audio data, etc.
- the second electronic device is determined according to the set priority rules. It can be seen that the headset device is not disconnected when it enters the pairing state, but is disconnected after receiving the first connection request, which guarantees the user's use of the headset device to a large extent.
- the first earphone or the second earphone After the first earphone or the second earphone determines the target electronic device, it can send a disconnection instruction to the target electronic device to disconnect the Bluetooth connection with the target electronic device.
- the second earphone is currently the master earphone of the earphone device, and the first earphone may currently be the slave earphone of the earphone device.
- the second earphone can respectively establish Bluetooth connections with the N second electronic devices.
- the second earphone receives data sent by any second electronic device, the second earphone sends the data to the first earphone through the Bluetooth connection with the first earphone, thereby realizing master-slave synchronization.
- the second earphone can synchronize the connection information of each second electronic device with the first earphone through the Bluetooth connection with the first earphone, so that the first earphone can connect the second earphone with the Nth electronic devices according to the connection information.
- the Bluetooth connection between the two electronic devices is monitored to achieve master-slave synchronization.
- the second earphone can directly disconnect the Bluetooth connection with the target electronic device, and send a disconnection instruction to the target electronic device.
- the first earphone can establish a Bluetooth connection with the first electronic device according to the first connection request sent by the first electronic device.
- the first earphone after the first earphone establishes a Bluetooth connection with the first electronic device, it can synchronize the connection information of the first electronic device to the second earphone.
- the connection information may include but not limited to frequency hopping information, channel information, clock information wait.
- the Bluetooth connection object of the first electronic device is switched from the first earphone to the second earphone, and the first earphone pairs with the second earphone and the first electronic device or, after the first earphone synchronizes the connection information of the first electronic device to the first earphone, the Bluetooth connection object of the first electronic device switches from the first earphone to the second earphone, and the second earphone The earphone synchronizes the data transmitted with the first electronic device to the first earphone.
- the second earphone After the second earphone acquires the connection information, it can directly perform data transmission with the first electronic device based on the connection information, and the physical link between the first earphone and the first electronic device is transitioned to the second earphone and the first electronic device. In the physical link between devices, the Bluetooth connection object of the first electronic device is switched from the first earphone to the second earphone.
- the first earphone can monitor the physical link between the second earphone and the first electronic device, or the second earphone can forward the data transmitted with the first electronic device to the first earphone to realize master-slave synchronization.
- all electronic devices that establish a Bluetooth connection with the earphone device can use the main earphone connection, monitor from the earphone, or receive the data forwarded by the master earphone from the earphone, which is more convenient for connected electronic devices management and data transfer.
- the second earphone can synchronize the disconnection information to the first earphone, and the disconnection information can at least include the device information of the target electronic device that disconnects the Bluetooth connection.
- the earphone may no longer monitor the Bluetooth connection between the target electronic device and the second earphone.
- FIG. 5 is an interaction sequence diagram in an embodiment of an interaction sequence diagram in a scenario of earphone device snatching connection.
- the earphone device can be a device that supports Bluetooth "one for two", and the earphone device can establish Bluetooth connections with electronic device A and electronic device B respectively.
- the electronic device C can be a device that does not store the device information corresponding to the earphone device, and the earphone device can enter the pairing state (the first earphone and/or the second earphone enter the pairing state, that is, open the inquiry scan and page scan modes at the same time), and To enter the pairing state, first maintain the Bluetooth connection with electronic device A and electronic device B.
- the electronic device C may send a scan request, and the first earphone and/or the second earphone may send a scan response to the electronic device C after receiving the scan request.
- the electronic device C may send a Bluetooth connection request to the headset device.
- the headset device After the headset device receives the Bluetooth connection request sent by the electronic device C, the second headset can perform disconnection processing corresponding to the target electronic device (for example, electronic device B in FIG. 5 ), and the first headset can process the Bluetooth connection request. , perform a Bluetooth connection with the electronic device C, and perform pairing with the electronic device C during the Bluetooth connection process.
- the second earphone can synchronize the disconnection information to the first earphone, and after the first earphone successfully establishes a bluetooth connection with the electronic device C, the first earphone can send The connection information of the second earphone is synchronized to realize information synchronization, so that the Bluetooth connection object of the electronic device C is switched from the first earphone to the second earphone.
- the first earphone when the earphone device is in a connection grabbing scene, the first earphone (ie, the slave earphone) may also perform disconnection processing corresponding to the target electronic device.
- the first earphone can monitor the Bluetooth connection between the second earphone and the target electronic device, and send a disconnection request to the target electronic device on the transmission channel between the second earphone and the target electronic device.
- the disconnection request can be used to trigger the disconnection of the Bluetooth connection between the target electronic device and the second earphone.
- the second earphone can process the first connection request sent by the first electronic device, and establish a Bluetooth connection with the first electronic device.
- the first connection request can be processed by the earphone with the page scan mode turned on after receiving the first connection request. Headphones in page scan mode are disconnected.
- the disconnection operation and the connection operation are performed in parallel through the first earphone and the second earphone respectively, which can improve the interaction between the first electronic device and the earphone device. Increase the speed of robbing and improve the efficiency of robbing. And after the disconnection operation and connection operation are completed, the first earphone and the second earphone perform information synchronization, which can more conveniently manage all established Bluetooth connections and ensure data transmission efficiency.
- the working state may be a pairing state
- the method may further include the following steps:
- Step 602 when the first earphone and/or the second earphone are in the pairing state, the first earphone and/or the second earphone receive the scan request sent by the first electronic device, and send a scan response to the first electronic device according to the scan request , and the first earphone and/or the second earphone receive the scan request sent by the third electronic device, and send a scan response to the third electronic device according to the scan request.
- the first earphone and/or the second earphone receive the scan request sent by the third electronic device, and send the scan response to the third electronic device according to the description of the scan request, which can be used with the first earphone and/or the second earphone to receive the first electronic device
- the method of sending a scan request and sending a scan response to the first electronic device according to the scan request is similar, and reference may be made to related descriptions in the foregoing embodiments, and details are not repeated here.
- Step 604 If the first connection request sent by the first electronic device and the second connection request sent by the third electronic device are received within the first time period, process the first connection request through the first earphone, and communicate with the first connection request.
- the electronic device establishes a bluetooth connection, processes the second connection request through the second earphone, and establishes a bluetooth connection with the third electronic device.
- the earphone device may be a device that supports the "one-to-many" function of Bluetooth, that is, the maximum number N of simultaneous establishment of Bluetooth connections supported by the earphone device is greater than or equal to 2.
- both the first earphone and the second earphone can turn on the page scan mode, and can receive Bluetooth connection requests sent by other electronic devices. If the first connection request sent by the first electronic device and the second connection request sent by the third electronic device are received within the first time period, it can indicate that the earphone device needs to establish connections with the first electronic device and the third electronic device at the same time or continuously. Bluetooth connection, it is very likely that the headset device will receive another Bluetooth connection request before processing one Bluetooth connection request.
- the Bluetooth connection with the first electronic device can be performed through the first earphone, and the Bluetooth connection with the second electronic device can be performed in parallel through the second earphone.
- the device and the second electronic device establish a Bluetooth connection. Change the process of establishing a connection serially into a process of establishing a connection in parallel to reduce the connection waiting time.
- the first time period may be set according to actual requirements, for example, the first time period may be 1 second, 2 seconds, and so on.
- the first time period can also be set according to the speed at which the earphone device establishes a Bluetooth connection. The faster the earphone device establishes a Bluetooth connection, the shorter the first time period is. The slower the earphone device establishes a Bluetooth connection, the first The time period can be longer. Further, the first time period may be a time period during which the earphone device normally establishes a Bluetooth connection with other electronic devices.
- a Bluetooth connection can be established between the first earphone and the second earphone, and after the Bluetooth connection is established between the first earphone and the first electronic device, the connection of the first electronic device can be synchronized to the second earphone through the first earphone Information; after the second earphone establishes a bluetooth connection with the third electronic device, the connection information of the third electronic device can be synchronized with the first earphone through the second earphone. Realize information synchronization between the first earphone and the second earphone.
- the second earphone may be a master earphone in the earphone device, and the first earphone may be a slave earphone in the earphone device.
- the Bluetooth connection object of the first electronic device can be switched from the first earphone to the second earphone, and the first earphone is compatible with the second earphone and the first electronic device.
- the Bluetooth connection object of the first electronic device can be switched from the first earphone to the second earphone, and the second earphone The earphone synchronizes the data transmitted with the first electronic device to the first earphone.
- the second earphone After the second earphone obtains the synchronous connection information of the first earphone, it can directly perform data transmission with the first electronic device based on the connection information, and the physical link between the first earphone and the first electronic device is transitioned to the second earphone With the physical link between the first electronic device, the Bluetooth connection object of the first electronic device is switched from the first earphone to the second earphone.
- the first earphone can monitor the bluetooth physical link between the second earphone and the first electronic device, or the second earphone can forward the data transmitted with the first electronic device to the first earphone to realize master-slave synchronization.
- the second earphone After the second earphone establishes a Bluetooth connection with the third electronic device, the second earphone can also synchronize the connection information of the third electronic device to the first earphone, and the first earphone can communicate with the second earphone and the third electronic device based on the connection information. Monitor the established Bluetooth connection between them. Through the information synchronization between the earphones, all electronic devices that establish a Bluetooth connection with the earphone device can be connected to the main earphone, and the slave earphone monitors or receives the data forwarded by the master earphone, which is more convenient to manage the connected electronic devices and data transmission.
- FIG. 7 is an interaction sequence diagram of an earphone device connecting two electronic devices in an embodiment.
- the earphone device can be a device that supports Bluetooth "one for two", and the earphone device enters a pairing state when it is not connected to any electronic device.
- the electronic device D nor the electronic device E stores the device information corresponding to the earphone device.
- the earphone device enters the pairing state (the first earphone and/or the second earphone enters the pairing state, and is in inquiry scan and page scan mode at the same time), electronic device D and electronic device E can scan the earphone device, and send a Bluetooth connection to the earphone device ask.
- the earphone device receives the Bluetooth connection request sent by the electronic device E and the electronic device F within the first time period, and the first earphone can process the Bluetooth connection request sent by the electronic device D, and perform a Bluetooth connection with the electronic device D, and perform the Bluetooth connection. pairing with electronic device D during the process.
- the second earphone can process the Bluetooth connection request sent by the electronic device E, and perform a Bluetooth connection with the electronic device E, and perform pairing with the electronic device E during the Bluetooth connection.
- the connection information of the electronic device D can be synchronized with the second earphone to realize information synchronization, so that the Bluetooth connection object of the electronic device D can be switched from the first earphone to the second earphone.
- the connection information of the electronic device E can be synchronized with the first earphone.
- the first earphone device may process the first connection request.
- the first earphone responds to the first connection request, it can send first information to the second earphone, and the first information can be used to notify the second earphone that the first earphone is processing the Bluetooth connection request;
- a second message can be sent to the second earphone, and the second message is used to notify the second earphone that the first earphone has completed the processing of the Bluetooth connection request.
- the second earphone receives the first information but has not received the second information, it means that the first earphone is still in the process of processing the first connection request of the first electronic device. If the second connection request is sent, the second earphone can process the second connection request sent by the third electronic device, and establish a Bluetooth connection with the third electronic device. It can increase the connection speed between the headset device and two electronic devices.
- the first connection request sent by the first electronic device firstly received by the earphone device can also be processed by the second earphone (ie, the master earphone), and then the first earphone (ie, the slave earphone) processes the first connection request sent by the earphone device.
- the received second connection request sent by the third electronic device is not limited in this embodiment of the present application.
- the headset device if the headset device has maintained Bluetooth connections with M second electronic devices before receiving the first connection request sent by the first electronic device and the second connection request sent by the second electronic device, if the M is an integer greater than or equal to 0 and less than or equal to N-2, then the headset device can also establish Bluetooth connections with N-M electronic devices, where N-M is greater than or equal to 2. Therefore, after receiving the first connection request sent by the first electronic device and the second connection request sent by the second electronic device, the earphone device can respectively establish a Bluetooth connection with the first electronic device and the third electronic device.
- the target electronic device in the second electronic device may be disconnected first, and then establish a Bluetooth connection with the first electronic device and the second electronic device respectively.
- Bluetooth connections can be established with the first electronic device and the third electronic device through the first earphone and the second earphone of the earphone device, and the first earphone and the second earphone can be connected in parallel without waiting for the earphone device Only after completing the Bluetooth connection process with one of the electronic devices can the Bluetooth connection be established with the other electronic device, which can increase the speed of establishing the Bluetooth connection between the earphone device and the two electronic devices, and improve the connection efficiency. And the information synchronization between the first earphone and the second earphone makes the Bluetooth connection object of the first electronic device switch from the first earphone to the second earphone, which can more conveniently manage all established Bluetooth connections and ensure data transmission efficiency.
- first electronic device and third electronic device may also be electronic devices that have been paired with the first electronic device (that is, store device information), and if there is no conflict, the above-mentioned The manners for establishing a Bluetooth connection described in each embodiment establish a Bluetooth connection with an earphone device.
- the Bluetooth connection in this embodiment of the present application may include any one of a classic Bluetooth connection and a Bluetooth Low Energy (Bluetooth Low Energy, BLE) connection.
- BLE Bluetooth Low Energy
- the earphone device the first earphone and/or the second earphone
- other electronic devices can scan and obtain the BLE broadcast, and establish a BLE Bluetooth connection with the earphone device.
- the working state includes a common use state.
- the step of controlling the first earphone and the second earphone to enter the working state specified by the target instruction may include: when the first earphone and the second earphone are not established In the case of Bluetooth connection, and in the case of establishing a Bluetooth connection between the second earphone and the fourth electronic device, the first earphone sends a broadcast signal, and the broadcast signal is used to trigger the fourth electronic device that receives the broadcast signal to send the broadcast signal to the second earphone.
- a connection instruction so that the second earphone establishes a bluetooth connection with the first earphone according to the connection instruction, and shares the same bluetooth address with the first earphone.
- the earphone device can support two use modes: the first earphone and the second earphone are used separately (that is, the state of single use), and the first earphone and the second earphone are used together (that is, the state of common use).
- the first earphone and the second earphone are respectively configured with different bluetooth addresses; when the first earphone and the second earphone are used together, the first earphone and the second earphone are configured with the same bluetooth address.
- the user can switch the earphone device between the single use state and the common use state according to actual needs. By placing the first earphone in the earphone box and triggering the corresponding control operation, the earphone device can be used independently. The state is switched to the common use state, or the headset device is switched from the common use state to the single use state.
- the first earphone can send a broadcast signal in response to the target instruction (such as the above-mentioned third control instruction) sent by the earphone box, so that the fourth electronic device that receives the broadcast signal sends a connection instruction to the second earphone according to the broadcast signal,
- the connection instruction can be used to instruct the second earphone to establish a Bluetooth connection with the first earphone.
- the broadcast signal may include a BLE broadcast signal
- the first earphone may send the BLE broadcast signal on the broadcast channel based on the BLE Bluetooth protocol when receiving the target instruction (such as the third control instruction) sent by the earphone box.
- the bluetooth module of the fourth electronic device can be in the scanning state, monitor each broadcast channel, and when scanning the BLE broadcast signal sent by the first earphone, through the bluetooth connection with the second earphone, Send a connection instruction to the second headset.
- the above-mentioned broadcast signal includes first specific information.
- the broadcast signal is used to trigger the fourth electronic device receiving the broadcast signal to send a connection instruction to the second earphone when determining that the first specific information is the same as the second specific information, so that the second earphone can communicate with the second earphone according to the connection instruction.
- the first earphone establishes a bluetooth connection and shares the same bluetooth address; wherein, the second specific information is sent by the second earphone to the fourth electronic device; or,
- the broadcast signal is used to trigger the fourth electronic device receiving the broadcast signal to send the first specific information and the connection instruction to the second earphone, so that the second earphone can determine the first specific information and the second specific information stored in the second earphone At the same time, establish a bluetooth connection with the first earphone according to the connection instruction, and share the same bluetooth address with the first earphone.
- the first earphone and the second earphone belonging to the same earphone device may pre-agreed with specific information, and respectively store the agreed specific information, and the specific information stored in the first earphone and the second earphone is the same.
- the specific information may be a character string composed of one or more of numbers, letters, symbols, etc., through which it can be identified that the first earphone and the second earphone are matching earphones and belong to the same earphone device.
- the specific information may be fixed specific information set by the earphone device before leaving the factory, and the specific information of each earphone device is different.
- the specific information may also be generated and stored in the first earphone and the second earphone each time the earphone device is switched to a state where the two earphones are used independently, and the specific information generated by the earphone device may be different each time.
- the second earphone may send the stored second specific information to the fourth electronic device.
- the first earphone receives the target instruction (such as the above-mentioned third control instruction), it can acquire the stored first specific information, and generate a broadcast signal carrying the first specific information for broadcast.
- the fourth electronic device can analyze the broadcast signal to obtain the first specific information, compare the analyzed first specific information with the second specific information sent by the second earphone, and determine whether the second are the same. If the first specific information is the same as the second feature information, it means that the broadcast signal is sent by the first earphone belonging to the same earphone device as the second earphone, and a connection instruction can be sent to the second earphone.
- the fourth electronic device after the fourth electronic device analyzes the first specific information obtained, it can also send the first specific information and the connection instruction to the second earphone, and the second earphone can combine the first specific information with the stored The second specific information is compared to determine whether the two are the same. If the first specific information is the same as the second characteristic information, a Bluetooth connection can be established with the first earphone according to the connection instruction in response to the connection instruction.
- the fourth electronic device or the second earphone can accurately identify the identity of the first earphone sending the broadcast signal through the first specific information carried in the broadcast signal, which improves the Bluetooth connection between the first earphone and the second earphone. accuracy.
- the above-mentioned broadcast signal may further include a bluetooth address corresponding to the first earphone when it is in a state of being used alone.
- the fourth electronic device can analyze the first specific information and the Bluetooth address corresponding to the first earphone, and send a connection instruction including the Bluetooth address to the second earphone.
- the second earphone can analyze the connection instruction to obtain the Bluetooth address of the first earphone, and send a Bluetooth connection request to the first earphone based on the Bluetooth address of the first earphone.
- the fourth electronic device connected to the second earphone is used to transfer information, so that the second earphone can obtain the Bluetooth address of the first earphone, and accurately initiate a Bluetooth connection request to the first earphone, ensuring This improves the reliability of the Bluetooth connection between the first earphone and the second earphone.
- the second earphone and the first earphone can share the same bluetooth address, and the same bluetooth address can be the bluetooth address of the second earphone or the bluetooth address of the first earphone, then The first earphone and the second earphone are in a common use state.
- FIG. 8 is a schematic diagram of a sequence interaction for controlling the first earphone and the second earphone to enter a common use state in an embodiment.
- the earphone device may include an earphone A, an earphone B, and an earphone box. No Bluetooth connection is established between the earphone A and the earphone B, and they are used separately.
- the earphone B establishes a bluetooth connection with the electronic device F, and sends the second specific information to the electronic device F.
- the earphone A can be placed in the earphone box, and corresponding control operations are performed on the earphone box.
- the earphone box When the earphone box detects the control operation, it can send a target instruction (such as the above-mentioned third control instruction) to the earphone A.
- the earphone A responds to the target instruction and sends a broadcast signal, which may carry the first specific information and the Bluetooth address of the earphone A.
- the electronic device F After receiving the broadcast signal, the electronic device F can analyze the broadcast signal to obtain the first specific information and the Bluetooth address of the earphone A.
- the electronic device F can compare the first specific information with the second specific information sent by the earphone B, and when it is determined that the first specific information is the same as the second specific information, send a connection instruction to the earphone B, and the connection instruction Contains the Bluetooth address of headset A.
- the headset B After receiving the connection instruction, the headset B can send a Bluetooth connection request to the headset A based on the Bluetooth address of the headset A included in the connection command, and establish a Bluetooth connection with the headset A. After earphone A and earphone B establish a Bluetooth connection, earphone A and earphone B can share the same bluetooth address, realize data synchronization, and jointly play audio data transmitted by the same electronic device.
- the first earphone when the first earphone has not established a Bluetooth connection with the second earphone, the first earphone sends a broadcast signal, and the broadcast signal is used to trigger the second earphone that receives the broadcast signal to establish a bluetooth connection with the first earphone.
- Bluetooth connection and share the same Bluetooth address with the first headset.
- the broadcast signal may include the first specific information and the Bluetooth address corresponding to the first earphone, and the broadcast signal may be used to trigger the second earphone receiving the broadcast signal to determine the first specific information and the second earphone stored in the second earphone.
- the specific information is the same, a Bluetooth connection request is sent to the first earphone according to the Bluetooth address, so that the first earphone responds to the Bluetooth connection request and establishes a Bluetooth connection with the second earphone.
- the second earphone receives the broadcast signal sent by the first earphone, it can analyze the broadcast signal to obtain the first specific information and the Bluetooth address of the first earphone. The second earphone can compare the analyzed first specific information with the stored second specific information to determine whether the two are the same. If the first specific information is the same as the second feature information, then the second earphone can send a Bluetooth connection request to the first earphone according to the Bluetooth address of the first earphone, thereby establishing a Bluetooth connection with the first earphone, and communicating with the first earphone After the Bluetooth connection is established, share the same Bluetooth address with the first headset.
- the user can switch the earphone device from the state where the two earphones are used separately to the state where the two earphones are used together by placing one earphone in the earphone box.
- it is necessary to place both earphones in the earphone box and perform corresponding operations on the earphone box to realize the state switching method, which is simpler and faster, improves the switching efficiency, and will not affect the normal use of the second earphone by the user.
- another earphone device state control method is provided, which can be applied to the above-mentioned earphone device.
- the earphone device can include a first earphone, a second earphone, and an earphone box.
- the method can be Include the following steps:
- Step 910 when only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box.
- step 910 includes: when only the first earphone is placed in the earphone box, if the earphone box detects a control operation, then the earphone box sends the first earphone to the first earphone according to the operation information of the control operation. Operating the target instruction corresponding to the information, so that the first earphone receives the target instruction.
- the operation information includes one or more of the operation duration corresponding to the control operation, the identification of the operation component, the direction of the operation, and the force of the operation.
- Step 920 the first earphone controls the first earphone and the second earphone to enter the independent use state or the common use state, wherein the independent use state means that the first earphone and the second earphone are configured with different Bluetooth addresses
- the common use state refers to the state where the first earphone and the second earphone share the same bluetooth address.
- the step of the earphone box sending the target instruction corresponding to the operation information to the first earphone according to the operation information of the control operation includes: if the earphone box determines that the operation information satisfies the second operation condition, then sending the first earphone to the first earphone Two control instructions; if the earphone box determines that the operation information satisfies the third operation condition, then send the third control instruction to the first earphone, and the third operation condition is different from the second operation condition.
- Step 920 including: if the first earphone receives the second control command, then controlling the first earphone and/or the second earphone to change the configured Bluetooth address, so that the first earphone and the second earphone can be switched from the common use state to the independent use state; if the first earphone receives the third control instruction, then control the first earphone and/or the second earphone to change the configured bluetooth address, so that the first earphone and the second earphone are switched from the single use state to the common use state.
- step 920 includes: if the earphone device is currently in the common use state, the first earphone controls the first earphone and the second earphone to enter the independent use state according to the target instruction; if the earphone device is currently in the independent use state, Then the first earphone controls the first earphone and the second earphone to enter a common use state according to the target instruction.
- controlling the first earphone and the second earphone to enter the independent use state includes: controlling the first earphone and/or the second earphone to change the configured Bluetooth address, so that the first earphone and the second earphone correspond to different Bluetooth address.
- the method further includes: disconnecting the Bluetooth connection between the first earphone and the second earphone.
- controlling the first earphone and the second earphone to enter the common use state includes: when the first earphone and the second earphone have not established a Bluetooth connection, the first earphone sends a broadcast signal, and the broadcast signal is used for The second earphone that receives the broadcast signal is triggered to establish a bluetooth connection with the first earphone, and shares the same bluetooth address with the first earphone.
- controlling the first earphone and the second earphone to enter the common use state includes: when the first earphone has not established a Bluetooth connection with the second earphone, and the second earphone has established a Bluetooth connection with the fourth electronic device, A broadcast signal is sent by the first earphone, and the broadcast signal is used to trigger the fourth electronic device that receives the broadcast signal to send a connection instruction to the second earphone, so that the second earphone establishes a Bluetooth connection with the first earphone according to the connection instruction, and connects with the second earphone.
- One headset shares the same bluetooth address.
- the user can switch the first earphone and the second earphone to the single use state or the common use state by placing one earphone in the earphone device into the earphone box. Both earphones are placed in the earphone box, and the state switching can be realized by performing corresponding operations on the earphone box, which is simpler and faster, improves the switching efficiency, and will not affect the normal use of the second earphone by the user.
- an apparatus 1000 for controlling the state of an earphone device includes a first earphone, a second earphone, and an earphone box.
- the state control device 1000 of the earphone device may include an instruction receiving module 1010 and a state control module 1020 .
- the instruction receiving module 1010 is configured to receive the target instruction sent by the earphone box by the first earphone when only the first earphone is placed in the earphone box.
- the state control module 1020 is used for the first earphone to control the first earphone and/or the second earphone to enter the working state specified by the target instruction according to the target instruction.
- the working state includes a pairing state;
- the pairing state refers to a state in which the first earphone and/or the second earphone can be discovered by other electronic devices.
- the state control apparatus 1000 of the earphone device includes not only the command receiving module 1010 and the state control module 1020 , but also a command sending module.
- the instruction sending module is used to send the target corresponding to the operation information to the first earphone according to the operation information of the control operation if the earphone box detects the control operation when only the first earphone is placed in the earphone box. command, so that the first earphone receives the target command.
- the operation information includes one or more of the operation duration corresponding to the control operation, the identification of the operation component, the direction of the operation, and the force of the operation.
- the instruction sending module is further configured to send the first control instruction to the first earphone if the earphone box determines that the operation information satisfies the first operation condition.
- the state control module 1020 is further configured to control the first earphone and/or the second earphone to enter the pairing state by the first earphone according to the first control instruction.
- the working state also includes a single use state and/or a common use state, wherein the single use state refers to a state in which the first earphone and the second earphone are configured with different Bluetooth addresses, and the common use state refers to It is a state where the first earphone and the second earphone share the same bluetooth address.
- the instruction sending module is also used to send a second control instruction to the first earphone if the earphone box determines that the operation information satisfies the second operating condition, and the second operating condition is different from the first operating condition; and/or, if the earphone box determines that the operation If the information satisfies the third operating condition, a third control instruction is sent to the first earphone, and the third operating condition is different from the first operating condition.
- the state control module 1020 is also used to control the first earphone and/or the second earphone to change the configured bluetooth address if the first earphone receives the second control command, so that the first earphone and the second earphone are switched from the common use state and/or, if the first earphone receives the third control command, then control the first earphone and/or the second earphone to change the bluetooth address of the configuration, so that the first earphone and the second earphone The state of single use is switched to the state of joint use.
- the user only needs to place one earphone in the earphone device into the earphone box, and perform corresponding control operations on the earphone box to trigger the first earphone and/or the second earphone in the earphone device Entering the working state specified in the communication simplifies the way of controlling the earphone device to enter the working state specified in the communication, the control is more flexible and convenient, and will not affect the normal use of the earphone device by the user.
- the state control apparatus 1000 of the earphone device includes not only the command receiving module 1010, the state control module 1020, and the command sending module, but also a scan response module and a connection module.
- the scanning response module is used to receive the scanning request sent by the first electronic device by the first earphone and/or the second earphone when the first earphone and/or the second earphone are in the pairing state, and send the scanning request to the first electronic device according to the scanning request. Send scan response.
- a connection module configured to receive the first connection request sent by the first electronic device by the first earphone and/or the second earphone when the earphone device establishes a Bluetooth connection with N second electronic devices; wherein, N is the earphone device Supporting the maximum number of Bluetooth connections maintained simultaneously, N is an integer greater than or equal to 1; and used to perform disconnection processing corresponding to the target electronic device in the N second electronic devices through the second earphone, and through the first earphone pair
- the first connection request is processed, and a Bluetooth connection is established with the first electronic device; or, the first earphone is used to perform disconnection processing corresponding to the target electronic device among the N second electronic devices, and the first connection is made through the second earphone.
- the request is processed, and a Bluetooth connection is established with the first electronic device.
- connection module is also used for the first earphone or the second earphone to select the second electronic device whose priority meets the priority condition from the N second electronic devices according to the priority of each second electronic device as the target electronic device.
- the disconnection operation and the connection operation are performed in parallel through the first earphone and the second earphone respectively, which can improve the interaction between the first electronic device and the earphone device. Increase the speed of robbing and improve the efficiency of robbing. And after the disconnection operation and connection operation are completed, the first earphone and the second earphone perform information synchronization, which can more conveniently manage all established Bluetooth connections and ensure data transmission efficiency.
- the maximum number N of Bluetooth connections supported by the headset device is an integer greater than or equal to 2.
- the scan response module is also used to receive the scan request sent by the first electronic device by the first earphone and/or the second earphone when the first earphone and/or the second earphone are in the pairing state, and send a request to the first electronic device according to the scan request.
- the device sends a scan response
- the first earphone and/or the second earphone receives a scan request sent by the third electronic device, and sends a scan response to the third electronic device according to the scan request.
- the connection module is further configured to process the first connection request through the first earphone if the first connection request sent by the first electronic device and the second connection request sent by the third electronic device are received within the first time period, Establishing a Bluetooth connection with the first electronic device, processing the second connection request through the second earphone, and establishing a Bluetooth connection with the third electronic device.
- the above-mentioned apparatus 1000 for controlling the state of an earphone device further includes a synchronization module.
- the synchronization module is used to synchronize the connection information of the first electronic device to the second earphone through the first earphone, so that the Bluetooth connection object of the first electronic device is switched from the first earphone to the second earphone, and the first earphone is connected to the second earphone.
- the second earphone, and the second earphone synchronizes the data transmitted with the first electronic device to the first earphone.
- Bluetooth connections can be established with the first electronic device and the third electronic device through the first earphone and the second earphone of the earphone device, and the first earphone and the second earphone can be connected in parallel without waiting for the earphone device Only after completing the Bluetooth connection process with one of the electronic devices can the Bluetooth connection be established with the other electronic device, which can increase the speed of establishing the Bluetooth connection between the earphone device and the two electronic devices, and improve the connection efficiency. And the information synchronization between the first earphone and the second earphone makes the Bluetooth connection object of the first electronic device switch from the first earphone to the second earphone, which can more conveniently manage all established Bluetooth connections and ensure data transmission efficiency.
- the working state includes a common use state.
- the state control module 1020 is further configured to send a broadcast signal by the first earphone when no Bluetooth connection is established between the first earphone and the second earphone, and the broadcast signal is used to trigger the second earphone and the first earphone that receive the broadcast signal Establish a Bluetooth connection and share the same Bluetooth address with the first headset.
- the working state includes common use of a Bluetooth address.
- the state control module 1020 is further configured to send a broadcast signal by the first earphone when the Bluetooth connection between the first earphone and the second earphone is not established, and the second earphone establishes a Bluetooth connection with the fourth electronic device.
- the signal is used to trigger the fourth electronic device receiving the broadcast signal to send a connection instruction to the second earphone, so that the second earphone establishes a Bluetooth connection with the first earphone according to the connection instruction, and shares the same Bluetooth address with the first earphone.
- the broadcast signal includes the first specific information
- the broadcast signal is also used to trigger the fourth electronic device that receives the broadcast signal to send a connection to the second earphone when it determines that the first specific information is the same as the second specific information. instructions, so that the second earphone establishes a bluetooth connection with the first earphone according to the connection instruction, and shares the same bluetooth address; wherein, the second specific information is that the second earphone sends a message to the fourth electronic device after establishing a bluetooth connection with the fourth electronic device.
- the broadcast signal is also used to trigger the fourth electronic device receiving the broadcast signal to send the first specific information and the connection instruction to the second earphone, so that the second earphone determines the first specific information and the stored second When the specific information is the same, establish a bluetooth connection with the first earphone according to the connection instruction, and share the same bluetooth address with the first earphone.
- the user can switch the earphone device from the state where the two earphones are used separately to the state where the two earphones are used together by placing one earphone in the earphone box.
- it is necessary to place both earphones in the earphone box and perform corresponding operations on the earphone box to realize the state switching method, which is simpler and faster, improves the switching efficiency, and will not affect the normal use of the second earphone by the user.
- an apparatus 1100 for controlling the state of an earphone device includes a first earphone, a second earphone, and an earphone box.
- the state control device 1100 of the earphone device includes an instruction receiving module 1110 and a state control module 1120 .
- the instruction receiving module 1110 is configured to receive the target instruction sent by the earphone box by the first earphone when the first earphone is placed in the earphone box.
- the state control module 1120 is configured to control the first earphone and the second earphone to enter a state of single use or a state of joint use by the first earphone according to the target instruction, wherein the state of single use means that the first earphone and the second earphone are configured are states of different bluetooth addresses, and the common use state refers to a state in which the first earphone and the second earphone share the same bluetooth address.
- the state control module 1120 is further configured to control the first earphone and/or the second earphone to change the configured Bluetooth address, so that the first earphone and the second earphone correspond to different Bluetooth addresses respectively. In one embodiment, the state control module 1120 is further configured to disconnect the Bluetooth connection between the first earphone and the second earphone.
- the state control module 1120 is further configured to send a broadcast signal by the first earphone when no Bluetooth connection is established between the first earphone and the second earphone, and the broadcast signal is used to trigger the first earphone receiving the broadcast signal.
- the second earphone establishes a bluetooth connection with the first earphone, and shares the same bluetooth address with the first earphone.
- the state control module 1120 is further configured to send a broadcast signal by the first earphone when the first earphone has not established a Bluetooth connection with the second earphone, and the second earphone has established a Bluetooth connection with the fourth electronic device , the broadcast signal is used to trigger the fourth electronic device receiving the broadcast signal to send a connection instruction to the second earphone, so that the second earphone establishes a Bluetooth connection with the first earphone according to the connection instruction, and shares the same Bluetooth address with the first earphone.
- the state control apparatus 1100 of the earphone device not only includes the command receiving module 1110 and the state control module 1120 , but also includes a command sending module.
- the instruction sending module is used to send the target instruction corresponding to the operation information to the first earphone according to the operation information of the control operation if the earphone box detects the control operation when only the first earphone is placed in the earphone box , so that the first earphone receives the target instruction.
- the operation information includes one or more of the operation duration corresponding to the control operation, the identification of the operation component, the direction of the operation, and the force of the operation.
- the instruction sending module is further configured to send the second control instruction to the first earphone if the earphone box determines that the operation information satisfies the second operation condition; and if the earphone box determines that the operation information satisfies the third operation condition, then A third control instruction is sent to the first earphone, and the third operating condition is different from the second operating condition.
- the state control module 1120 is also used to control the first earphone and/or the second earphone to change the configured bluetooth address if the first earphone receives the second control command, so that the first earphone and the second earphone are switched from the common use state It is in the state of independent use; if the first earphone receives the third control command, then control the first earphone and/or the second earphone to change the configured Bluetooth address, so that the first earphone and the second earphone can be switched from the state of sole use to common use state.
- the state control module 1120 is also used to control the first earphone and the second earphone to enter the independent use state according to the target instruction if the earphone device is currently in the common use state; In the use state, the first earphone controls the first earphone and the second earphone to enter the common use state according to the target instruction.
- the user can switch the first earphone and the second earphone to the single use state or the common use state by placing one earphone in the earphone device into the earphone box. Both earphones are placed in the earphone box, and the state switching can be realized by performing corresponding operations on the earphone box, which is simpler and faster, improves the switching efficiency, and will not affect the normal use of the second earphone by the user.
- Fig. 12 is a structural block diagram of an earphone device in one embodiment.
- the earphone device 1200 may include one or more of the following components: a processor 1210, a memory 1220 coupled to the processor 1210, wherein the memory 1220 may store one or more computer programs, one or more computer programs It may be configured to implement the methods described in the foregoing embodiments when executed by one or more processors 1210 .
- Processor 1210 may include one or more processing cores.
- the processor 1210 uses various interfaces and lines to connect various parts in the entire earphone device 1200, and executes or executes instructions, programs, code sets or instruction sets stored in the memory 1220, and calls data stored in the memory 1220 to execute Various functions of the headphone device 1200 and processing data.
- the processor 1210 may adopt at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). implemented in the form of hardware.
- DSP Digital Signal Processing
- FPGA Field-Programmable Gate Array
- PLA Programmable Logic Array
- the processor 1210 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a modem, and the like.
- CPU Central Processing Unit
- GPU Graphics Processing Unit
- the CPU mainly handles the operating system, user interface and application programs, etc.
- the GPU is used to render and draw the displayed content
- the modem is used to handle wireless communication. It can be understood that the above modem may also not be integrated into the processor 1210, but implemented by a communication chip alone.
- the memory 1220 may include a random access memory (Random Access Memory, RAM), and may also include a read-only memory (Read-Only Memory, ROM).
- the memory 1220 may be used to store instructions, programs, codes, sets of codes or sets of instructions.
- the memory 1220 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the foregoing method embodiments, and the like.
- the storage data area can also store data created by the headphone device 1200 during use, and the like.
- the earphone device 1200 may also include a Bluetooth module, and the Bluetooth module may be used to provide a Bluetooth communication function, establish a Bluetooth connection with other electronic devices, and perform Bluetooth data transmission.
- the bluetooth module can support one or more bluetooth protocols, such as classic bluetooth, BLE, etc.), but not limited thereto, and can change with the development of bluetooth protocols.
- the earphone device includes a first earphone, a second earphone, and an earphone box, and both the first earphone and the second earphone may include at least the above-mentioned processor 1210, memory 1220, and Bluetooth module.
- the earphone device 1200 may include more or less structural elements than those in the above structural block diagram, for example, including a power module, physical keys, sensors, etc., and it is not limited here.
- the embodiment of the present application discloses a computer-readable storage medium, which stores a computer program, wherein when the computer program is executed by a processor, the methods described in the foregoing embodiments are implemented.
- the embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be executed by a processor to implement the methods described in the foregoing embodiments.
- the processes in the methods of the above embodiments can be realized through computer programs to instruct related hardware, and the programs can be stored in a non-volatile computer-readable storage medium When the program is executed, it may include the processes of the embodiments of the above-mentioned methods.
- the storage medium may be a magnetic disk, an optical disk, a ROM, or the like.
- Non-volatile memory may include ROM, Programmable ROM (PROM), Erasable PROM (Erasable PROM, EPROM), Electrically Erasable PROM (Electrically Erasable PROM, EEPROM) or flash memory.
- Volatile memory can include random access memory (RAM), which acts as external cache memory.
- RAM can take many forms, such as static RAM (Static RAM, SRAM), dynamic RAM (Dynamic Random Access Memory, DRAM), synchronous DRAM (synchronous DRAM, SDRAM), double data rate SDRAM (Double data rate Data Rate SDRAM, DDR SDRAM), enhanced SDRAM (Enhanced Synchronous DRAM, ESDRAM), synchronous link DRAM (Synchlink DRAM, SLDRAM), memory bus direct RAM (Rambus DRAM, RDRAM) and direct memory bus dynamic RAM (Direct Rambus DRAM) , DRDRAM).
- static RAM Static RAM, SRAM
- dynamic RAM Dynamic Random Access Memory
- SDRAM synchronous DRAM
- double data rate SDRAM Double data rate Data Rate SDRAM, DDR SDRAM
- enhanced SDRAM Enhanced Synchronous DRAM, ESDRAM
- synchronous link DRAM Synchlink DRAM, SLDRAM
- memory bus direct RAM Rabus DRAM, RDRAM
- Direct Rambus DRAM Direct Rambus DRAM
- the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, located in one place, or distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
- the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Telephone Function (AREA)
Abstract
Disclosed are a state control method and apparatus for an earphone device, an earphone device and a storage medium. The earphone device comprises: a first earphone, a second earphone and an earphone box. The method comprises: in the case that only a first earphone is placed in an earphone box, the first earphone receives a target instruction sent by the earphone box; and the first earphone controls, according to the target instruction, the first earphone and/or the second earphone to enter a working state specified by the target instruction, wherein the working state comprises a pairing state which refers to a state that the first earphone and/or the second earphone can be discovered by another electronic device. According to the state control method and device for the earphone device, the earphone device and the storage medium, the mode of controlling the earphone device to enter a specified working state in communication can be simplified, the operation is more convenient, and the normal use of the earphone device by a user would not be affected.
Description
本申请要求于2021年12月08日提交、申请号为202111493252.9、发明名称为“耳机设备的状This application is required to be submitted on December 8, 2021, the application number is 202111493252.9, and the title of the invention is "State of the Earphone Device".
态控制方法、装置、耳机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本state control method, device, earphone device and storage medium", the entire content of which is incorporated by reference in this
申请中。Applying.
本申请涉及通信技术领域,具体涉及一种耳机设备的状态控制方法、装置、耳机设备及存储介质。The present application relates to the field of communication technologies, and in particular to a method and device for controlling the state of an earphone device, an earphone device, and a storage medium.
目前,耳机设备已成为用户日常工作及生活中不可缺少的电子设备之一,且随着电子技术的发展,耳机设备也具备越来越完善的功能,以满足用户在不同场景下对于耳机设备的需求。而无线耳机设备由于其具有使用灵活、便捷、音质高也受到越来越多用户的青睐。目前在用户想要让无线耳机设备进入到通信中指定的工作状态时,需要通过繁琐的交互操作才能够实现,影响了用户对无线耳机设备的正常使用。At present, earphones have become one of the indispensable electronic devices in users' daily work and life. With the development of electronic technology, earphones also have more and more perfect functions to meet users' needs for earphones in different scenarios. need. The wireless earphone device is also favored by more and more users because of its flexible use, convenience, and high sound quality. At present, when the user wants the wireless earphone device to enter the working state specified in the communication, it needs to be realized through cumbersome interactive operations, which affects the normal use of the wireless earphone device by the user.
发明内容Contents of the invention
本申请公开了一种耳机设备的状态控制方法、装置、耳机设备及存储介质。The application discloses a method and device for controlling the state of an earphone device, the earphone device and a storage medium.
本申请实施例公开了一种耳机设备的状态控制方法,所述耳机设备包括第一耳机、第二耳机和耳机盒,所述方法包括:The embodiment of the present application discloses a method for controlling the state of an earphone device. The earphone device includes a first earphone, a second earphone, and an earphone box. The method includes:
在仅所述第一耳机被放置在耳机盒的情况下,由所述第一耳机接收所述耳机盒发送的目标指令;When only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box;
所述第一耳机根据所述目标指令,控制所述第一耳机和/或所述第二耳机进入所述目标指令所指定的工作状态;The first earphone controls the first earphone and/or the second earphone to enter the working state specified by the target instruction according to the target instruction;
其中,所述工作状态包括配对状态,所述配对状态指的是所述第一耳机和/或所述第二耳机能够被其它电子设备发现的状态。Wherein, the working state includes a pairing state, and the pairing state refers to a state in which the first earphone and/or the second earphone can be discovered by other electronic devices.
本申请实施例公开了一种耳机设备的状态控制方法,所述耳机设备包括第一耳机、第二耳机及耳机盒,所述方法包括:The embodiment of the present application discloses a method for controlling the state of an earphone device. The earphone device includes a first earphone, a second earphone, and an earphone box. The method includes:
在仅所述第一耳机被放置在耳机盒的情况下,由所述第一耳机接收所述耳机盒发送的目标指令;When only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box;
所述第一耳机根据所述目标指令,控制所述第一耳机和所述第二耳机进入单独使用状态或共同使用状态,其中,所述单独使用状态指的是所述第一耳机及第二耳机被配置为不同的蓝牙地址的状态,所述共同使用状态指的是所述第一耳机及第二耳机共享同一蓝牙地址的状态。According to the target instruction, the first earphone controls the first earphone and the second earphone to enter a single use state or a common use state, wherein the single use state refers to the first earphone and the second earphone The earphones are configured with different bluetooth addresses, and the common use state refers to a state in which the first earphone and the second earphone share the same bluetooth address.
本申请实施例公开了一种耳机设备的状态控制装置,所述耳机设备包括第一耳机、第二耳机和耳机盒,所述装置包括:The embodiment of the present application discloses a device for controlling the state of an earphone device. The earphone device includes a first earphone, a second earphone, and an earphone box. The device includes:
指令接收模块,用于在仅所述第一耳机被放置在耳机盒的情况下,由所述第一耳机接收所述耳机盒发送的目标指令;An instruction receiving module, configured to receive, by the first earphone, the target instruction sent by the earphone box when only the first earphone is placed in the earphone box;
状态控制模块,用于由所述第一耳机根据所述目标指令,控制所述第一耳机和/或第二耳机进入所述目标指令所指定的工作状态;A state control module, configured for the first earphone to control the first earphone and/or the second earphone to enter the working state specified by the target instruction according to the target instruction;
其中,所述工作状态包括配对状态;所述配对状态指的是所述第一耳机和/或所述第二耳机能够被其它电子设备发现的状态。Wherein, the working state includes a pairing state; the pairing state refers to a state in which the first earphone and/or the second earphone can be discovered by other electronic devices.
本申请实施例公开了一种耳机设备的状态控制装置,所述耳机设备包括第一耳机、第二耳机及耳机盒,所述装置包括:The embodiment of the present application discloses a device for controlling the state of an earphone device. The earphone device includes a first earphone, a second earphone, and an earphone box. The device includes:
指令接收模块,用于在第一耳机被放置在耳机盒的情况下,由所述第一耳机接收所述耳机盒发送的目标指令;An instruction receiving module, configured to receive, by the first earphone, the target instruction sent by the earphone box when the first earphone is placed in the earphone box;
状态控制模块,用于由所述第一耳机根据所述目标指令,控制所述第一耳机和所述第二耳机进入单独使用状态或共同使用状态,其中,所述单独使用状态指的是所述第一耳机及第二耳机被配置为不同的蓝牙地址的状态,所述共同使用状态指的是所述第一耳机及第二耳机共享同一蓝牙地址的状态。A state control module, used for the first earphone to control the first earphone and the second earphone to enter a single use state or a joint use state according to the target instruction, wherein the single use state refers to the The state in which the first earphone and the second earphone are configured with different bluetooth addresses, and the common use state refers to the state in which the first earphone and the second earphone share the same bluetooth address.
本申请实施例公开了一种耳机设备,包括存储器及处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器实现如上任一所述的方法。The embodiment of the present application discloses an earphone device, including a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor realizes any of the above-mentioned method.
本申请实施例公开了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理 器执行时实现如上任一所述的方法。The embodiment of the present application discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any one of the methods described above is implemented.
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings that need to be used in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.
图1为一种实施例中耳机设备的状态控制方法的应用场景图;Fig. 1 is an application scene diagram of a state control method of an earphone device in an embodiment;
图2为一种实施例中耳机设备的状态控制方法的流程图;Fig. 2 is a flow chart of a state control method of an earphone device in an embodiment;
图3A为一个实施例中控制第一耳机进入配对状态的时序示意图;FIG. 3A is a schematic diagram of the sequence of controlling the first earphone to enter the pairing state in an embodiment;
图3B为一个实施例中第一耳机控制第二耳机进入配对状态的时序示意图;FIG. 3B is a schematic diagram of the sequence of the first earphone controlling the second earphone to enter the pairing state in an embodiment;
图3C为一个实施例中控制第一耳机及第二耳机一起进入配对状态的时序示意图;FIG. 3C is a timing diagram of controlling the first earphone and the second earphone to enter the pairing state together in one embodiment;
图4为一个实施例中耳机设备处于抢连场景的流程图;Fig. 4 is a flow chart of the scene where the earphone device is in the rush to connect in one embodiment;
图5为一个实施例中耳机设备抢连场景下的交互时序图;FIG. 5 is an interaction sequence diagram in an embodiment of a headset device snatching connection scenario;
图6为一个实施例中耳机设备需要同时或连续与两个电子设备建立蓝牙连接的流程图;FIG. 6 is a flow chart showing that the earphone device needs to simultaneously or continuously establish Bluetooth connections with two electronic devices in one embodiment;
图7为一个实施例中耳机设备连接两个电子设备的交互时序图;Fig. 7 is an interaction sequence diagram of an earphone device connecting two electronic devices in an embodiment;
图8为一个实施例中控制第一耳机及第二耳机进入共同使用状态的流程图;Fig. 8 is a flow chart of controlling the first earphone and the second earphone to enter the common use state in one embodiment;
图9为另一种实施例中耳机设备的状态控制方法的流程图;Fig. 9 is a flow chart of a method for controlling the state of an earphone device in another embodiment;
图10为一种实施例中耳机设备的状态控制装置的框图;Fig. 10 is a block diagram of a state control device of an earphone device in an embodiment;
图11为另一种实施例中耳机设备的状态控制装置的框图;Fig. 11 is a block diagram of a state control device of an earphone device in another embodiment;
图12为一个实施例中耳机设备的结构框图。Fig. 12 is a structural block diagram of an earphone device in one embodiment.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some, not all, embodiments of the application. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
需要说明的是,本申请实施例及附图中的术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "comprising" and "having" and any variations thereof in the embodiments of the present application and the drawings are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally further includes For other steps or units inherent in these processes, methods, products or apparatuses.
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一耳机称为第二耳机,且类似地,可将第二耳机称为第一耳机。第一耳机和第二耳机两者都是耳机,但其不是同一只耳机。本申请所使用的术语“多个”指的是两个及两个以上。本申请所使用的术语“和/或”指的是其中的一种方案,或是其中多种方案的任意组合。It can be understood that the terms "first", "second" and the like used in this application may be used to describe various elements herein, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element. For example, a first headset could be termed a second headset, and, similarly, a second headset could be termed a first headset, without departing from the scope of the present application. Both the first earphone and the second earphone are earphones, but they are not the same earphone. The term "plurality" used in this application refers to two or more than two. The term "and/or" used in this application refers to one of them, or any combination of multiple of them.
目前在用户想要让无线耳机设备进入到通信中指定的工作状态时,需要通过繁琐的交互操作才能够实现,例如,在用户需要让无线耳机设备进入配对状态时,需要先将两只耳机都放入到耳机盒中,再通过按压耳机盒上的配对按钮来让无线耳机设备进入配对状态,操作繁琐,且会对用户正常使用无线耳机设备产生影响,给用户带来不便。At present, when the user wants the wireless headset device to enter the working state specified in the communication, it needs to be realized through cumbersome interactive operations. Putting it into the earphone box, and then pressing the pairing button on the earphone box to let the wireless earphone device enter the pairing state, the operation is cumbersome, and it will affect the normal use of the wireless earphone device by the user, causing inconvenience to the user.
本申请实施例提供一种耳机设备的状态控制方法、装置、耳机设备及存储介质,能够简化控制耳机设备进入通信中指定的工作状态的方式,操作更为便捷,且不会影响到用户对耳机设备的正常使用。Embodiments of the present application provide a state control method and device for earphone equipment, earphone equipment, and storage media, which can simplify the way of controlling the earphone equipment to enter the specified working state in communication, and the operation is more convenient without affecting the user's ability to use the earphone. normal use of the device.
图1为一种实施例中耳机设备的状态控制方法的应用场景图。如图1所示,耳机设备10可包括耳机110、耳机120及耳机盒130,耳机设备10可包括但不限于入耳式耳机、耳塞式耳机等无线耳机,进一步地,耳机设备10可以是真无线立体声(True Wireless Stereo,TWS)蓝牙耳机等。Fig. 1 is an application scene diagram of a method for controlling the state of an earphone device in an embodiment. As shown in FIG. 1, the earphone device 10 may include an earphone 110, an earphone 120, and an earphone box 130. The earphone device 10 may include but not limited to wireless earphones such as in-ear earphones and earbud earphones. Further, the earphone device 10 may be a true wireless earphone. Stereo (True Wireless Stereo, TWS) Bluetooth headset, etc.
在一些实施例中,在耳机设备10处于使用状态下,耳机110和/或耳机120可与其它电子设备20建立通信连接,并接收其它电子设备传输的音频输出进行播放。该其它电子设备20可包括但不限于可穿戴设备、车载终端、手机、平板电脑、笔记本电脑PC(Personal Computer,个人电脑)、PDA(Personal Digital Assistant,个人数字助理)等设备。In some embodiments, when the earphone device 10 is in use, the earphone 110 and/or the earphone 120 can establish a communication connection with other electronic devices 20, and receive and play audio output transmitted by other electronic devices. The other electronic devices 20 may include, but are not limited to, wearable devices, vehicle-mounted terminals, mobile phones, tablet computers, laptop PCs (Personal Computers, personal computers), PDAs (Personal Digital Assistants, personal digital assistants) and other devices.
耳机110及耳机120支持无线通信,可选地,耳机110和/或耳机120与其它电子设备20之间的通信连接可包括但不限于蓝牙连接,该蓝牙连接可包括基于经典蓝牙协议建立的经典蓝牙连接、基于BLE(Bluetooth Low Energy,蓝牙低功耗)协议建立的BLE连接,以及基于BLE Audio(Bluetooth Low Energy Audio,蓝牙低功耗音频)协议建立的LE Audio蓝牙连接等中的至少一种。其中,经典蓝牙协议通常泛指在蓝牙协议4.0版本以下的蓝牙协议,BLE协议通常泛指在蓝牙协议4.0版本以上的蓝牙协议。而BLE Audio技术则是解决了利用BLE连接只能传输数据量较小的数据,而不能传输音频数据的问题,BLE Audio协议支持LC3(Low Complexity Communications Codec,低功耗音频编解码)编码的音频数据,使得音频数据的传输能够更好地兼顾功耗、实时性及音质等各方面的问题。The earphone 110 and the earphone 120 support wireless communication. Optionally, the communication connection between the earphone 110 and/or the earphone 120 and other electronic devices 20 may include but not limited to a Bluetooth connection. At least one of the Bluetooth connection, the BLE connection established based on the BLE (Bluetooth Low Energy, Bluetooth Low Energy) protocol, and the LE Audio Bluetooth connection established based on the BLE Audio (Bluetooth Low Energy Audio, Bluetooth Low Energy Audio) protocol, etc. . Among them, the classic Bluetooth protocol generally refers to the Bluetooth protocol below the Bluetooth protocol version 4.0, and the BLE protocol generally refers to the Bluetooth protocol above the Bluetooth protocol version 4.0. The BLE Audio technology solves the problem that the BLE connection can only transmit data with a small amount of data, but cannot transmit audio data. The BLE Audio protocol supports LC3 (Low Complexity Communications Codec, low-power audio codec) encoded audio Data, so that the transmission of audio data can better take into account various aspects of power consumption, real-time performance and sound quality.
在本申请实施例中,当用户需要耳机设备10进入通信中指定的工作状态,例如需要进入到蓝牙通信中的配对状态,或是需要进入到蓝牙通信中的单独使用状态或共同使用状态时,可将耳机110及耳机120中的任一只耳机放置到耳机盒130中,以实现让耳机设备10进入通信中指定的工作状态。In the embodiment of the present application, when the user needs the earphone device 10 to enter the specified working state in the communication, for example, it needs to enter the pairing state in the Bluetooth communication, or it needs to enter the individual use state or the common use state in the Bluetooth communication, Any one of the earphone 110 and the earphone 120 can be placed in the earphone box 130, so that the earphone device 10 enters the working state specified in the communication.
以将耳机110放置到耳机盒130为例,此时耳机120处于耳机盒130外部,用户可在耳机盒130上进行控制操作。耳机盒130在检测到控制操作时,可向耳机110发送目标指令,耳机110可根据接收的目标指令,控制耳机110和/或耳机120进入到该目标指令所指定的工作状态。相较于传统方式中需要将两只耳机均放置到耳机盒130才能触发控制耳机设备10进入指定的工作状态的方式,操作方式更为简便,且用户依然可以正常使用没有放置到耳机盒130的耳机,不会影响用户的正常使用。Taking the earphone 110 placed in the earphone box 130 as an example, the earphone 120 is outside the earphone box 130 at this time, and the user can perform control operations on the earphone box 130 . When the earphone box 130 detects a control operation, it can send a target command to the earphone 110, and the earphone 110 can control the earphone 110 and/or the earphone 120 to enter the working state specified by the target command according to the received target command. Compared with the traditional method in which both earphones need to be placed in the earphone box 130 to trigger and control the earphone device 10 to enter a designated working state, the operation method is more convenient, and the user can still use the headset that is not placed in the earphone box 130 normally. Headphones will not affect the normal use of the user.
如图2所示,在一个实施例中,提供一种耳机设备的状态控制方法,可应用于上述的耳机设备,该方法可包括以下步骤:As shown in FIG. 2, in one embodiment, a method for controlling the state of an earphone device is provided, which can be applied to the above-mentioned earphone device, and the method may include the following steps:
步骤210,在仅第一耳机被放置在耳机盒的情况下,由第一耳机接收耳机盒发送的目标指令。 Step 210, when only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box.
第一耳机可以是耳机设备中的任一只耳机,例如,可以是耳机设备的左耳机,也可以是耳机设备的右耳机。在用户需要让耳机设备进入通信中指定的工作状态时,可将耳机设备中的任一只耳机放置到耳机盒中,而另一只耳机(即第二耳机)则处于耳机盒外部。The first earphone may be any earphone in the earphone device, for example, it may be the left earphone of the earphone device, or it may be the right earphone of the earphone device. When the user needs the earphone device to enter the specified working state in the communication, any earphone in the earphone device can be placed in the earphone box, while the other earphone (ie the second earphone) is outside the earphone box.
在第一耳机被放置到耳机盒后,第一耳机可通过耳机盒中的端口(例如信号传输引脚等)与耳机盒进行信号传输。用户可在将第一耳机放置到耳机盒后,对耳机盒进行控制操作,耳机设备可根据检测到的控制操作向第一耳机发送目标指令,该目标指令可用于指示第一耳机控制第一耳机和/或第二耳机进入所指定的工作状态。After the first earphone is placed in the earphone box, the first earphone can perform signal transmission with the earphone box through a port (such as a signal transmission pin, etc.) in the earphone box. After placing the first earphone in the earphone box, the user can control the earphone box, and the earphone device can send a target instruction to the first earphone according to the detected control operation, and the target instruction can be used to instruct the first earphone to control the first earphone And/or the second earphone enters the specified working state.
在本申请实施例中,在耳机盒上进行的控制操作的操作方式可不作限制,例如,耳机盒上可设置有操作按钮,用户通过按压该操作按钮触发控制操作;或是耳机盒上可设置有触控板,用户通过对触控板进行的触控操作(比如点击、长按、滑动等触控操作)触发控制操作;耳机盒上也可设置有一种或多种传感器(如压力传感器、距离传感器、加速度传感器等),通过传感器检测触控操作(如通过压力传感器检测按压操作、通过距离传感器检测手势操作、通过加速度传感器检测晃动操作)等,但不限于此。In the embodiment of the present application, the operation mode of the control operation on the earphone box is not limited. For example, an operation button may be provided on the earphone box, and the user may trigger the control operation by pressing the operation button; or an There is a touchpad, and the user triggers the control operation through touch operations on the touchpad (such as touch operations such as clicking, long pressing, and sliding); one or more sensors (such as pressure sensors, distance sensor, acceleration sensor, etc.), touch operations are detected by sensors (such as pressing operations are detected by pressure sensors, gesture operations are detected by distance sensors, shaking operations are detected by acceleration sensors), etc., but are not limited thereto.
步骤220,第一耳机根据目标指令,控制第一耳机和/或第二耳机进入目标指令所指定的工作状态。 Step 220, according to the target instruction, the first earphone controls the first earphone and/or the second earphone to enter the working state specified by the target instruction.
作为一种实施方式,第一耳机接收到耳机盒发送的目标指令后,可根据该目标指令控制自身进入目标指令所指定的工作状态。作为另一种实施方式,当第一耳机与第二耳机之间建立有通信连接(如经典蓝牙连接或BLE连接)时,第一耳机接收到耳机盒发送的目标指令后,可向第二耳机发送该目标指令,以控制第二耳机进入目标指令所指定的工作状态;第一耳机也可在控制自身进入目标指令所指定的工作状态的同时,向第二耳机发送该目标指令,以控制第二耳机进入目标指令所指定的工作状态。As an implementation manner, after receiving the target instruction sent by the earphone box, the first earphone can control itself to enter the working state specified by the target instruction according to the target instruction. As another implementation, when a communication connection (such as a classic Bluetooth connection or a BLE connection) is established between the first earphone and the second earphone, after the first earphone receives the target instruction sent by the earphone box, it can send a message to the second earphone Send the target command to control the second earphone to enter the working state specified by the target command; the first earphone can also send the target command to the second earphone while controlling itself to enter the working state specified by the target command to control the second earphone The two earphones enter the working state specified by the target instruction.
在一些实施例中,控制第一耳机和/或第二耳机进入的工作状态可包括配对状态,该配对状态指的是第一耳机和/或第二耳机能够被其它电子设备发现的状态。在第一耳机和/或第二耳机处于配对状态时,第一耳机和/或第二耳机处于可发现状态或处于可发现及可连接状态,其中,可发现状态指的是开启inquiry scan模式的状态,可发现及可连接状态指的是同时开启inquiry scan模式及page scan模式。在第一耳机和/或第二耳机开启inquiry scan模式时,其它电子设备能够扫描搜索到耳机设备,在第一耳机和/或第二耳机开启page scan模式时,其它电子设备能够与耳机设备建立蓝牙连接。In some embodiments, the working state for controlling the first earphone and/or the second earphone to enter may include a pairing state, and the pairing state refers to a state in which the first earphone and/or the second earphone can be discovered by other electronic devices. When the first earphone and/or the second earphone are in the pairing state, the first earphone and/or the second earphone are in a discoverable state or in a discoverable and connectable state, wherein the discoverable state refers to the inquiry scan mode being turned on Status, discoverable and connectable status refers to enabling inquiry scan mode and page scan mode at the same time. When the first earphone and/or the second earphone turn on the inquiry scan mode, other electronic devices can scan and search for the earphone device, and when the first earphone and/or the second earphone turn on the page scan mode, other electronic devices can establish with the earphone device Bluetooth connection.
作为一种实施方式,在第一耳机与第二耳机之间建立蓝牙连接的情况下,第一耳机与第二耳机可共用同一蓝牙地址(如同一经典蓝牙地址),因此相对于其它电子设备来说,第一耳机与第二耳机会被认为是一个蓝牙设备。在第一耳机处于配对状态,或第二耳机处于配对状态,或第一耳机及第二耳机处于配对状态时,其它电子设备可开启蓝牙扫描功能对周围的蓝牙设备进行扫描,并扫描到第一耳机与第二耳机所共用的蓝牙地址,其它电子设备可基于扫描到的蓝牙地址发送蓝牙连接请求。第一耳机和/或第二耳机可接收到该蓝牙连接请求,并根据该蓝牙连接请求与其它电子设备建立蓝牙连接。由于其它电子设备没有存储与耳机设备对应的连接记录(如之前没有与耳机设备连接过,或是连接过但是连接记录被删除等),因此,建立蓝牙连接的过程中可进行配对(pairing)。可选地,该配对可包括相互交换配对码、约定二者之间的密钥等过程,以保障传输的安全性。As an implementation, when a Bluetooth connection is established between the first earphone and the second earphone, the first earphone and the second earphone can share the same bluetooth address (such as the same classic bluetooth address), so relative to other electronic devices Say, the first earphone and the second earphone will be considered as a bluetooth device. When the first earphone is in the pairing state, or the second earphone is in the pairing state, or the first earphone and the second earphone are in the pairing state, other electronic devices can turn on the Bluetooth scanning function to scan the surrounding Bluetooth devices, and scan to the first The bluetooth address shared by the earphone and the second earphone, other electronic devices can send a bluetooth connection request based on the scanned bluetooth address. The first earphone and/or the second earphone can receive the bluetooth connection request, and establish a bluetooth connection with other electronic devices according to the bluetooth connection request. Since other electronic devices do not store connection records corresponding to the earphone device (eg, have not been connected to the earphone device before, or have been connected but the connection record has been deleted, etc.), therefore, pairing can be performed during the establishment of the Bluetooth connection. Optionally, the pairing may include processes such as exchanging pairing codes and agreeing on keys between the two, so as to ensure the security of transmission.
在一些实施例中,在第一耳机与第二耳机可共用同一蓝牙地址时,第一耳机与第二耳机之间可区分主耳机及从耳机,其中,主耳机可指的是能够直接与其它电子设备建立蓝牙连接的耳机,从耳机则指的是不与其它电子设备直接建立蓝牙连接的耳机。从耳机可对主耳机与其它电子设备之间的蓝牙连接进行监听,或是由主耳机将与其它电子设备之间通过蓝牙连接传输的数据转发给从耳机,实现主从同步。In some embodiments, when the first earphone and the second earphone can share the same bluetooth address, the first earphone and the second earphone can distinguish between the master earphone and the slave earphone, wherein the master earphone can refer to the earphone that can directly communicate with other earphones An earphone that establishes a Bluetooth connection with an electronic device, and a slave earphone refers to an earphone that does not directly establish a Bluetooth connection with other electronic devices. The slave earphone can monitor the Bluetooth connection between the master earphone and other electronic devices, or the master earphone can forward the data transmitted through the Bluetooth connection with other electronic devices to the slave earphone to realize master-slave synchronization.
可选地,在第一耳机接收到耳机盒发送的用于指示进入配对状态的目标指令时,若第一耳机当前的主从关系为主设备,则可控制自身进入配对状态,并与其它电子设备建立蓝牙连接。若第一耳机当前的主从关系为从设备,则可将该目标指令发送给第二耳机,以使当前的主从关系为主设备的第二耳机进入配对状态,第二耳机可与其它电子设备建立蓝牙连接;或,若第一耳机当前的主从关系为从设备,则可控制自身进入配对状态,并在与其它电子设备建立蓝牙连接,再将与其它电子设备对应的连接信息同步给第二耳机,使得其它电子设备的蓝牙连接对象从第一耳机切换至第二耳机。其中,连接信息可包括但不限于跳频信息、信道信息、时钟信息等。第一耳机可根据当前的主从关系采用不同的策略控制第一耳机和/或第二耳机进入配对状态,保证其它电子设备能够正确扫描并与主设备建立蓝牙连接,保证了蓝牙连接的稳定性。Optionally, when the first earphone receives the target instruction sent by the earphone box to indicate to enter the pairing state, if the current master-slave relationship of the first earphone is the master device, it can control itself to enter the pairing state and communicate with other electronic devices. The device establishes a Bluetooth connection. If the current master-slave relationship of the first earphone is a slave device, the target command can be sent to the second earphone, so that the second earphone with the current master-slave relationship as the master device enters the pairing state, and the second earphone can be connected with other electronic devices. The device establishes a Bluetooth connection; or, if the current master-slave relationship of the first earphone is a slave device, it can control itself to enter the pairing state, and establish a Bluetooth connection with other electronic devices, and then synchronize the connection information corresponding to other electronic devices to the The second earphone enables the Bluetooth connection object of other electronic devices to switch from the first earphone to the second earphone. Wherein, the connection information may include but not limited to frequency hopping information, channel information, clock information, and the like. The first earphone can adopt different strategies to control the first earphone and/or the second earphone to enter the pairing state according to the current master-slave relationship, so as to ensure that other electronic devices can scan correctly and establish a Bluetooth connection with the master device, ensuring the stability of the Bluetooth connection .
作为另一种实施方式,若第一耳机与第二耳机之间未建立蓝牙连接,则第一耳机可进入配对状态,第一耳机与第二耳机可分别使用不同的蓝牙地址。其它电子设备可扫描到第一耳机当前的蓝牙地址,并基于扫描到的蓝牙地址向第一耳机发送蓝牙连接请求,以与第一耳机建立蓝牙连接。该与第一耳机建立蓝牙连接的过程中也需要进行配对。As another implementation manner, if no Bluetooth connection is established between the first earphone and the second earphone, the first earphone may enter a pairing state, and the first earphone and the second earphone may respectively use different Bluetooth addresses. The other electronic device can scan the current Bluetooth address of the first headset, and send a Bluetooth connection request to the first headset based on the scanned Bluetooth address, so as to establish a Bluetooth connection with the first headset. Pairing also needs to be performed during the process of establishing a Bluetooth connection with the first earphone.
需要说明的是,上述实施例中所涉及的建立蓝牙连接可理解为包括建立ACL(Asynchronous Connectionless,异步无连接链路)和/或SCO(Synchronous Connection Oriented,面向连接的同步链路)等物理链路,或者包括建立上层协议连接的传输链路,如A2DP(Advanced Audio Distribution Profile,蓝牙音频传输模型协定)、HFP(Hands-free Profile,免提协议)等连接,对此不做限制,具体根据业务需求或参考相关蓝牙协议的规定。It should be noted that the establishment of a Bluetooth connection involved in the above embodiments can be understood as including the establishment of physical links such as ACL (Asynchronous Connectionless, asynchronous connectionless link) and/or SCO (Synchronous Connection Oriented, connection-oriented synchronous link) road, or including transmission links that establish upper-layer protocol connections, such as A2DP (Advanced Audio Distribution Profile, Bluetooth audio transmission model agreement), HFP (Hands-free Profile, hands-free protocol) and other connections, there is no restriction on this, according to Business requirements or refer to the provisions of the relevant Bluetooth protocol.
示例性地,图3A为一个实施例中控制第一耳机进入配对状态的时序示意图。如图3A所示,耳机A被放置到耳机盒中,耳机盒根据检测到的控制操作,向耳机A发送用于指示进入配对状态的目标指令。耳机A根据该目标指令进入配对状态(如同时开启inquiry scan模式及page scan模式),电子设备C可向处于配对状态的耳机A发送扫描请求,耳机A可根据该扫描请求向电子设备C返回扫描响应。电子设备C在接收到扫描响应后,可向耳机A发送蓝牙连接请求,并与耳机A建立蓝牙连接。Exemplarily, FIG. 3A is a timing diagram of controlling the first earphone to enter the pairing state in an embodiment. As shown in FIG. 3A , the earphone A is placed in the earphone box, and the earphone box sends the earphone A a target instruction for instructing to enter the pairing state according to the detected control operation. Headphone A enters the pairing state according to the target command (for example, the inquiry scan mode and page scan mode are turned on at the same time), the electronic device C can send a scan request to the earphone A in the pairing state, and the earphone A can return the scan to the electronic device C according to the scanning request response. After receiving the scanning response, the electronic device C may send a Bluetooth connection request to the headset A, and establish a Bluetooth connection with the headset A.
示例性地,图3B为一个实施例中第一耳机控制第二耳机进入配对状态的时序示意图。如图3B所示,耳机A与耳机B之间可建立有蓝牙连接。耳机A被放置到耳机盒中,耳机盒根据检测到的控制操作,向耳机A发送用于指示进入配对状态的目标指令。耳机A可将该目标指令转发给耳机B,耳机B根据该目标指令进入配对状态(如同时开启inquiry scan模式及page scan模式)。电子设备C可向处于配对状态的耳机B发送扫描请求,耳机B可根据该扫描请求向电子设备C返回扫描响应。电子设备C在接收到扫描响应后,可向耳机B发送蓝牙连接请求,并与耳机B建立蓝牙连接。Exemplarily, FIG. 3B is a schematic diagram of a sequence in which the first earphone controls the second earphone to enter the pairing state in an embodiment. As shown in FIG. 3B , a Bluetooth connection can be established between earphone A and earphone B. The earphone A is placed in the earphone box, and the earphone box sends the earphone A a target instruction for indicating to enter the pairing state according to the detected control operation. Earphone A can forward the target instruction to earphone B, and earphone B enters the pairing state according to the target instruction (such as turning on the inquiry scan mode and page scan mode at the same time). The electronic device C may send a scan request to the earphone B in the pairing state, and the earphone B may return a scan response to the electronic device C according to the scan request. After receiving the scan response, the electronic device C can send a Bluetooth connection request to the earphone B, and establish a Bluetooth connection with the earphone B.
示例性地,图3C为一个实施例中控制第一耳机及第二耳机一起进入配对状态的时序示意图。如图3C所示,耳机A与耳机B之间可建立有蓝牙连接。耳机A被放置到耳机盒中,耳机盒根据检测到的控制操作,向耳机A发送用于指示进入配对状态的目标指令。耳机A根据该目标指令进入配对状态,并将该目标指令转发给耳机B,耳机B根据该目标指令进入配对状态。电子设备C可发送扫描请求,处于配对状态的耳机A和/或耳机B可接收到扫描请求,并向电子设备C返回扫描响应。电子设备C在接收到扫描响应后,可发送蓝牙连接请求,耳机A和/或耳机B可根据接收到的蓝牙连接请求与电子设备C建立蓝牙连接。Exemplarily, FIG. 3C is a timing diagram of controlling the first earphone and the second earphone to enter the pairing state together in an embodiment. As shown in FIG. 3C , a Bluetooth connection can be established between the earphone A and the earphone B. The earphone A is placed in the earphone box, and the earphone box sends the earphone A a target instruction for indicating to enter the pairing state according to the detected control operation. Earphone A enters the pairing state according to the target instruction, and forwards the target instruction to earphone B, and earphone B enters the pairing state according to the target instruction. Electronic device C may send a scan request, and earphone A and/or earphone B in a pairing state may receive the scan request and return a scan response to electronic device C. After receiving the scanning response, electronic device C may send a Bluetooth connection request, and earphone A and/or earphone B may establish a Bluetooth connection with electronic device C according to the received Bluetooth connection request.
在本申请实施例中,在仅第一耳机被放置在耳机盒的情况下,由第一耳机接收耳机盒发送的目标指令,第一耳机根据目标指令控制第一耳机和/或第二耳机进入目标指令所指定的工作状态。在本申请实施例中,用户只需要将耳机设备中的一只耳机放置到耳机盒中,即可触发耳机设备中的第一耳机和/或第二耳机进入通信中指定的工作状态,相较相于传统方式中要将两只耳机均放置到耳机盒才能触发耳机设备进入通信中指定的工作状态的方式,操作更为便捷,简化了控制耳机设备进入通信中指定的工作状态的方式,且不会影响到用户对耳机设备的正常使用。In the embodiment of the present application, when only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box, and the first earphone controls the first earphone and/or the second earphone to enter according to the target instruction. The working state specified by the target directive. In this embodiment of the application, the user only needs to place one earphone in the earphone box into the earphone box to trigger the first earphone and/or the second earphone in the earphone device to enter the specified working state in the communication. Compared with the traditional method in which both earphones are placed in the earphone box to trigger the earphone device to enter the working state specified in the communication, the operation is more convenient, and the method of controlling the earphone device to enter the working state specified in the communication is simplified, and It will not affect the normal use of the earphone device by the user.
在一些实施例中,步骤在仅第一耳机被放置在耳机盒的情况下,由第一耳机接收耳机盒发送的目标指令,可包括:在仅第一耳机被放置在耳机盒的情况下,若耳机盒检测到控制操作,则耳机盒根据控制操作的操作信息,向第一耳机发送与操作信息对应的目标指令,以使第一耳机接收到目标指令。In some embodiments, when only the first earphone is placed in the earphone box, the step of receiving the target instruction sent by the earphone box by the first earphone may include: when only the first earphone is placed in the earphone box, If the earphone box detects the control operation, the earphone box sends the target instruction corresponding to the operation information to the first earphone according to the operation information of the control operation, so that the first earphone receives the target instruction.
在耳机盒检测到控制操作时,可获取该控制操作的操作信息,并生成与操作信息对应的目标指令,其中,操作信息包括控制操作对应的操作时长、操作组件标识、操作方向及操作力度等中的一种或多种。针对不同操作方式的控制操作,对应的操作信息种类可不同。例如,控制操作为对操作按钮进行按压的操作,则操作信息可包括操作组件标识(用于标识检测到按压的操作按钮)、操作时长等中的至少一种;又例如,控制操作为对触控板进行的触控操作,则操作信息可包括操作时长、操作方向及操作力度等中的至少一种,但不限于此,可根据实际需求进行设置。When the headphone box detects a control operation, it can obtain the operation information of the control operation, and generate the target instruction corresponding to the operation information, wherein the operation information includes the operation time corresponding to the control operation, the identification of the operation component, the operation direction and the operation force, etc. one or more of. For control operations in different operation modes, the types of corresponding operation information may be different. For example, if the control operation is an operation of pressing an operation button, the operation information may include at least one of the operation component identification (used to identify the operation button that has been pressed), operation duration, etc.; For the touch operation performed by the control panel, the operation information may include at least one of operation duration, operation direction, and operation force, but is not limited thereto, and may be set according to actual needs.
耳机盒在获取控制操作的操作信息后,可根据该操作信息判断该控制操作是否为控制进入配对状态的操作。可判断该操作信息是否满足第一操作条件,其中,第一操作条件为配对状态对应的操作条件,若耳机盒确定该操作信息满足第一操作条件,说明检测到的控制操作为控制进入配对状态的操作,则可向第一耳机发送第一控制指令,该第一控制指令用于指示进入配对状态。第一耳机可根据第一控制指令,控制第一耳机和/或第二耳机进入配对状态。After the earphone box acquires the operation information of the control operation, it can judge whether the control operation is an operation of controlling to enter the pairing state according to the operation information. It can be judged whether the operation information satisfies the first operation condition, wherein the first operation condition is the operation condition corresponding to the pairing state, if the earphone box determines that the operation information meets the first operation condition, it means that the detected control operation is to control entering the pairing state operation, a first control instruction may be sent to the first earphone, where the first control instruction is used to indicate to enter the pairing state. The first earphone can control the first earphone and/or the second earphone to enter a pairing state according to the first control instruction.
在一些实施例中,若包含有多种不同的工作状态,则针对不同的工作状态,耳机盒可分别生成不同的目标指令,且各个工作状态可与操作条件一一对应。作为一种实施方式,工作状态除了包括配对状态以外,还可包括单独使用状态和/或共同使用状态,其中,单独使用状态指的是第一耳机及第二耳机被配置为不同的蓝牙地址的状态(如第一耳机的蓝牙地址为地址X,第二耳机的蓝牙地址为地址Y),共同使用状态指的是第一耳机及第二耳机共享(即共用)同一蓝牙地址的状态(如第一耳机与第二耳机的蓝牙地址均为地址X)。在单独使用状态下,由于第一耳机及第二耳机的蓝牙地址不同,可被外部的电子设备识别为不同的蓝牙设备,因此可分别与相同或不同的电子设备建立蓝牙连接,第一耳机与第二耳机之间可以不同步。In some embodiments, if there are multiple different working states, the earphone box can generate different target instructions for different working states, and each working state can be in one-to-one correspondence with the operating conditions. As an implementation, in addition to the pairing state, the working state may also include a single use state and/or a joint use state, wherein the single use state refers to the state in which the first earphone and the second earphone are configured as different bluetooth addresses. State (for example, the Bluetooth address of the first earphone is address X, and the Bluetooth address of the second earphone is address Y), the common use state refers to the state in which the first earphone and the second earphone share (that is, share) the same Bluetooth address (as in the first earphone The bluetooth addresses of the first earphone and the second earphone are both address X). In the state of single use, since the bluetooth addresses of the first earphone and the second earphone are different, they can be recognized as different bluetooth devices by external electronic devices, so they can respectively establish bluetooth connections with the same or different electronic devices. There can be no synchronization between the second earphones.
单独使用状态可对应第二操作条件,共同使用状态可对应第三操作条件。第二操作条件可与第一操作条件不同,第三操作条件也可与第一操作条件不同,第二操作条件与第三操作条件可相同,也可不同。The single use state may correspond to the second operating condition, and the joint use state may correspond to the third operating condition. The second operating condition may be different from the first operating condition, the third operating condition may also be different from the first operating condition, and the second operating condition may be the same as or different from the third operating condition.
作为一种实施方式,耳机盒在获取控制操作的操作信息后,若确定该操作信息满足第二操作条件,则可向第一耳机发送第二控制指令,该第二控制指令用于指示第一耳机及第二耳机进入单独使用状态。若第一耳机接收到第二控制指令,则控制第一耳机和/或第二耳机更改配置的蓝牙地址,以使第一耳机及第二耳机从共同使用状态切换为单独使用状态。As an implementation manner, after acquiring the operation information of the control operation, if the earphone box determines that the operation information satisfies the second operation condition, it can send a second control instruction to the first earphone, and the second control instruction is used to instruct the first The earphone and the second earphone enter the independent use state. If the first earphone receives the second control instruction, then control the first earphone and/or the second earphone to change the configured bluetooth address, so that the first earphone and the second earphone are switched from the common use state to the independent use state.
作为一种实施方式,耳机盒在获取控制操作的操作信息后,若确定该操作信息满足第三操作条件,则可向第一耳机发送第三控制指令,该第三控制指令用于指示第一耳机及第二耳机进入共同使用状态。若第一耳机接收到第三控制指令,则控制第一耳机和/或第二耳机更改配置的蓝牙地址,以使第一耳机及第二耳机从单独使用状态切换为共同使用状态。As an implementation manner, after the earphone box obtains the operation information of the control operation, if it determines that the operation information satisfies the third operation condition, it can send a third control instruction to the first earphone, and the third control instruction is used to instruct the first The earphone and the second earphone enter the common use state. If the first earphone receives the third control instruction, then control the first earphone and/or the second earphone to change the configured bluetooth address, so that the first earphone and the second earphone are switched from the single use state to the common use state.
若第二操作条件与第三操作条件不同,若耳机盒检测到控制操作的操作信息满足第二操作条件,则可确定检测到的控制操作为控制进入单独使用状态的操作,可向第一耳机发送第二控制指令,该第二控制指令用于控制第一耳机及第二耳机切换为单独使用状态。若耳机盒检测到控制操作的操作信息满足第三操作条件,则可确定检测到的控制操作为控制进入共同使用状态的操作,可向第一耳机发送第三控制指令,该第三控制指令用于控制第一耳机及第二耳机切换为共同使用状态。If the second operating condition is different from the third operating condition, if the earphone box detects that the operation information of the control operation satisfies the second operating condition, then it can determine that the detected control operation is an operation for controlling entering the single use state, and can send the first earphone A second control instruction is sent, and the second control instruction is used to control the first earphone and the second earphone to be switched to an independent use state. If the earphone box detects that the operation information of the control operation satisfies the third operation condition, it can determine that the detected control operation is an operation to control entering the common use state, and can send a third control instruction to the first earphone, and the third control instruction uses Control the first earphone and the second earphone to switch to the common use state.
若第二操作条件与第三操作条件相同,若耳机盒检测到控制操作的操作信息满足第二操作条件(即第三操作条件),则可向第一耳机发送第二控制指令(即第三控制指令,二者可为同一控制指令)。第一耳机在接收到该第二控制指令后,若当前的状态为共同使用状态,则切换至单独使用状态,若当前的状态为单独使用状态,则切换至共同使用状态。采用相同的控制操作即可控制第一耳机与第二耳机在单独使用状态与共同使用状态之间来回切换,操作更加便捷。If the second operating condition is the same as the third operating condition, if the earphone box detects that the operation information of the control operation satisfies the second operating condition (ie, the third operating condition), it can send a second control instruction (ie, the third operating condition) to the first earphone. control instruction, the two can be the same control instruction). After receiving the second control instruction, the first earphone switches to the single use state if the current state is the common use state, and switches to the common use state if the current state is the single use state. The same control operation can be used to control the first earphone and the second earphone to switch back and forth between the independent use state and the joint use state, and the operation is more convenient.
作为一种具体实施方式,第一耳机及第二耳机从共同使用状态切换为单独使用状态,可以是第一耳机将蓝牙地址更改为与第二耳机不同的蓝牙地址。例如,在共同使用状态下,第一耳机与第二耳机的蓝牙地址均为地址X,则第一耳机可以将蓝牙地址改为地址Y。As a specific implementation manner, when the first earphone and the second earphone are switched from the shared use state to the single use state, it may be that the first earphone changes the Bluetooth address to a different bluetooth address from that of the second earphone. For example, in the common use state, the bluetooth addresses of the first earphone and the second earphone are both address X, then the first earphone can change the bluetooth address to address Y.
第一耳机及第二耳机从共同使用状态切换为单独使用状态,也可以是第二耳机将蓝牙地址更改为与第一耳机不同的蓝牙地址。第一耳机可通过与第二耳机之间的蓝牙连接,向第二耳机发送地址变更指令,第二耳机可根据该地址变更指令将蓝牙地址更改为与第一耳机不同的蓝牙地址。例如,在共同使用状态下,第一耳机与第二耳机的蓝牙地址均为地址X,则第二耳机可将蓝牙地址改为地址Y。The first earphone and the second earphone are switched from the joint use state to the single use state, and the second earphone may also change the bluetooth address to a bluetooth address different from that of the first earphone. The first earphone can send an address change instruction to the second earphone through the bluetooth connection with the second earphone, and the second earphone can change the bluetooth address to a bluetooth address different from that of the first earphone according to the address change instruction. For example, in the common use state, the bluetooth addresses of the first earphone and the second earphone are both address X, then the second earphone can change the bluetooth address to address Y.
需要说明的是,第一耳机及第二耳机从共同使用状态切换为单独使用状态,也可以是由第一耳机与第二耳机同时更改蓝牙地址,分别配置为不同的蓝牙地址。例如,在共同使用状态下,第一耳机与第二耳机的蓝牙地址均为地址X,则第一耳机将蓝牙地址改为Y,第二耳机可将蓝牙地址改为地址Z 等,但不限于此。It should be noted that, when the first earphone and the second earphone are switched from the common use state to the single use state, the first earphone and the second earphone may also change the Bluetooth address at the same time, and configure them as different bluetooth addresses respectively. For example, in the common use state, the Bluetooth addresses of the first earphone and the second earphone are both address X, then the first earphone can change the Bluetooth address to Y, and the second earphone can change the Bluetooth address to address Z, etc., but not limited to this.
在第一耳机与第二耳机配置为不同的蓝牙地址后,第一耳机与第二耳机之间的蓝牙连接可断开,则第一耳机与第二耳机可分别与不同的电子设备建立蓝牙连接,例如,第一耳机与设备A建立蓝牙连接,第二耳机与设备B建立蓝牙连接等。After the first earphone and the second earphone are configured with different bluetooth addresses, the bluetooth connection between the first earphone and the second earphone can be disconnected, then the first earphone and the second earphone can respectively establish bluetooth connections with different electronic devices , for example, the first headset establishes a Bluetooth connection with device A, the second headset establishes a Bluetooth connection with device B, and so on.
作为一种具体实施方式,第一耳机及第二耳机从单独使用状态切换为共同使用状态,可以是第一耳机将蓝牙地址更改为与第二耳机相同的蓝牙地址。例如,在单独使用状态下,第一耳机的蓝牙地址为地址Y,第二耳机的蓝牙地址为地址X,则第一耳机可以将蓝牙地址改为地址X。As a specific implementation manner, when the first earphone and the second earphone are switched from the single use state to the joint use state, it may be that the first earphone changes the bluetooth address to the same bluetooth address as that of the second earphone. For example, in the state of single use, the bluetooth address of the first earphone is address Y, and the bluetooth address of the second earphone is address X, then the first earphone can change the bluetooth address to address X.
第一耳机及第二耳机从单独使用状态切换为共同使用状态,也可以是第二耳机将蓝牙地址更改为与第一耳机相同的蓝牙地址。第一耳机可先与第二耳机建立蓝牙连接,再通过该蓝牙连接向第二耳机发送地址变更指令,第二耳机可根据该地址变更指令将蓝牙地址更改为与第一耳机相同的蓝牙地址。例如,在单独使用状态下,第一耳机的蓝牙地址为地址Y,第二耳机的蓝牙地址为地址X,则第一耳机可以将蓝牙地址改为地址Y。The first earphone and the second earphone switch from the single use state to the joint use state, or the second earphone changes the bluetooth address to the same bluetooth address as the first earphone. The first earphone can first establish a Bluetooth connection with the second earphone, and then send an address change command to the second earphone through the Bluetooth connection, and the second earphone can change the Bluetooth address to the same Bluetooth address as the first earphone according to the address change command. For example, in the state of single use, the bluetooth address of the first earphone is address Y, and the bluetooth address of the second earphone is address X, then the first earphone can change the bluetooth address to address Y.
需要说明的是,也可以是第一耳机与第二耳机同时更改蓝牙地址,使第一耳机与第二耳机被配置为相同的蓝牙地址,在此不作限定。It should be noted that it is also possible that the first earphone and the second earphone change the bluetooth address at the same time, so that the first earphone and the second earphone are configured with the same bluetooth address, which is not limited here.
在一些实施例中,为了不影响用户正常使用耳机设备,则在第二耳机与外部的电子设备建立蓝牙连接的情况下,由第一耳机更改蓝牙地址,第二耳机不更改蓝牙地址,可避免出现因第二耳机的蓝牙地址发生变化导致与外部的电子设备断开连接的情况,不对用户正常使用耳机设备产生影响。In some embodiments, in order not to affect the normal use of the earphone device by the user, when the second earphone establishes a Bluetooth connection with an external electronic device, the first earphone changes the Bluetooth address, and the second earphone does not change the Bluetooth address, which can avoid The situation that the second earphone is disconnected from the external electronic device due to the change of the Bluetooth address of the second earphone does not affect the user's normal use of the earphone device.
在本申请实施例中,用户只需要将耳机设备中的一只耳机放置到耳机盒中,并对耳机盒进行相应的控制操作,即可触发耳机设备中的第一耳机和/或第二耳机进入通信中指定的工作状态,简化了控制耳机设备进入通信中指定的工作状态的方式,控制更为灵活、便捷,且不会影响到用户对耳机设备的正常使用。In this embodiment of the application, the user only needs to place one earphone in the earphone device into the earphone box, and perform corresponding control operations on the earphone box to trigger the first earphone and/or the second earphone in the earphone device Entering the working state specified in the communication simplifies the way of controlling the earphone device to enter the working state specified in the communication, the control is more flexible and convenient, and will not affect the normal use of the earphone device by the user.
如图4所示,在一个实施例中,工作状态可为配对状态,在控制第一耳机和/或第二耳机进入配对状态之后,该方法还可包括以下步骤:As shown in Figure 4, in one embodiment, the working state may be a pairing state, and after controlling the first earphone and/or the second earphone to enter the pairing state, the method may further include the following steps:
步骤402,在第一耳机和/或第二耳机处于配对状态时,由第一耳机和/或第二耳机接收第一电子设备发送的扫描请求,并根据扫描请求向第一电子设备发送扫描响应。 Step 402, when the first earphone and/or the second earphone are in the pairing state, the first earphone and/or the second earphone receive the scan request sent by the first electronic device, and send a scan response to the first electronic device according to the scan request .
步骤404,在耳机设备与N个第二电子设备建立蓝牙连接的情况下,由第一耳机和/或第二耳机接收第一电子设备发送的第一连接请求。其中,N为耳机设备支持同时建立蓝牙连接的最大数量,N为大于或等于1的整数。 Step 404, when the headset device establishes Bluetooth connections with N second electronic devices, the first connection request sent by the first electronic device is received by the first headset and/or the second headset. Wherein, N is the maximum number of Bluetooth connections supported by the headset device at the same time, and N is an integer greater than or equal to 1.
作为一种具体实施方式,处于配对状态的第一耳机和/或第二耳机可同时开启inquiry scan模式及page scan模式,第一耳机与第二耳机可共用同一蓝牙地址。开启inquiry scan模式的第一耳机和/或第二耳机可接收到第一电子设备发送的扫描请求,并根据扫描请求向第一电子设备发送扫描响应。第一电子设备可根据该扫描响应获取第一耳机与第二耳机共用的蓝牙地址(即耳机设备的蓝牙地址),并基于该蓝牙地址发送第一连接请求。As a specific implementation, the first earphone and/or the second earphone in the pairing state can simultaneously enable the inquiry scan mode and the page scan mode, and the first earphone and the second earphone can share the same bluetooth address. The first earphone and/or the second earphone with the inquiry scan mode enabled can receive the scan request sent by the first electronic device, and send a scan response to the first electronic device according to the scan request. The first electronic device may obtain the Bluetooth address shared by the first earphone and the second earphone (ie, the Bluetooth address of the earphone device) according to the scan response, and send a first connection request based on the Bluetooth address.
该第一连接请求可为寻呼(page)数据包,第一电子设备可采用跳频的方式发送寻呼数据包,以对该耳机设备进行寻呼。开启page scan模式的第一耳机和/或第二耳机可采用固定间隔地扫描(scan)外部发送的寻呼数据包,若扫描到第一电子设备发送的寻呼数据包,即接收到第一连接请求。The first connection request may be a paging (page) data packet, and the first electronic device may send the paging data packet in a frequency hopping manner to page the earphone device. The first earphone and/or the second earphone with the page scan mode turned on can scan (scan) the paging data packets sent externally at fixed intervals. If the paging data packets sent by the first electronic device are scanned, the first Connection request.
若在第一耳机和/或第二耳机接收第一电子设备发送的第一连接请求时,耳机设备当前保持蓝牙连接的第二电子设备的数量小于N,说明还未达到耳机设备所能支持的同时保持蓝牙连接的最大数据,则第一耳机和/或第二耳机可响应该第一连接请求,与第一电子设备建立蓝牙连接。If when the first earphone and/or the second earphone receive the first connection request sent by the first electronic device, the number of second electronic devices that the earphone device currently maintains a Bluetooth connection is less than N, indicating that the number of Bluetooth connections that the earphone device can support has not yet been reached. While maintaining the maximum data of the Bluetooth connection, the first earphone and/or the second earphone can establish a Bluetooth connection with the first electronic device in response to the first connection request.
若在第一耳机和/或第二耳机接收第一电子设备发送的第一连接请求时,耳机设备与N个第二电子设备建立蓝牙连接,即耳机设备当前同时与N个第二电子设备保持蓝牙连接,耳机设备所能同时保持的蓝牙连接达到最大数量,若第一耳机和/或第二耳机接收到第一电子设备发送的第一连接请求,则需要断开与其中一个第二电子设备的蓝牙连接,第一电子设备才能够与耳机设备成功建立蓝牙连接,相当于第一电子设备抢占了该其中一个第二电子设备与耳机设备的蓝牙连接。If when the first earphone and/or the second earphone receive the first connection request sent by the first electronic device, the earphone device establishes a Bluetooth connection with N second electronic devices, that is, the earphone device currently maintains a connection with N second electronic devices at the same time. Bluetooth connection, the maximum number of Bluetooth connections that the headset device can maintain at the same time, if the first headset and/or the second headset receives the first connection request sent by the first electronic device, it needs to disconnect from one of the second electronic devices The Bluetooth connection between the first electronic device and the earphone device can be successfully established by the first electronic device, which is equivalent to the first electronic device preempting the Bluetooth connection between the one of the second electronic devices and the earphone device.
步骤406,通过第二耳机进行与N个第二电子设备中的目标电子设备对应的断连处理,并通过第一耳机对第一连接请求进行处理,与第一电子设备建立蓝牙连接;或,通过第一耳机进行与N个第二电子设备中的目标电子设备对应的断连处理,并通过第二耳机对第一连接请求进行处理,与第一电子设备建立蓝牙连接。 Step 406, perform disconnection processing corresponding to the target electronic device among the N second electronic devices through the second earphone, and process the first connection request through the first earphone, and establish a Bluetooth connection with the first electronic device; or, Perform disconnection processing corresponding to the target electronic device among the N second electronic devices through the first earphone, process the first connection request through the second earphone, and establish a Bluetooth connection with the first electronic device.
在耳机设备处于抢连场景时,需要断开与一个已连接的第二电子设备的蓝牙连接,在本申请实施例中,可由其中的一只耳机进行断连处理,该断连处理可用于断开耳机设备与N个第二电子设备中的 目标电子设备之间的蓝牙连接,并通过另一只耳机处理第一连接请求,两只耳机可并行进行断连操作及连接操作。When the earphone device is in the scene of rushing to connect, it needs to disconnect the Bluetooth connection with a connected second electronic device. In the embodiment of this application, one of the earphones can perform disconnection processing. Open the Bluetooth connection between the earphone device and the target electronic device among the N second electronic devices, and process the first connection request through the other earphone, and the two earphones can perform disconnection and connection operations in parallel.
在第一耳机或第二耳机进行断连处理之前,可先从N个第二电子设备中确定目标电子设备。作为一种实施方式,目标电子设备可以是N个第二电子设备中的任一第二电子设备,可随机从N个第二电子设备中选择目标电子设备。Before the first earphone or the second earphone performs disconnection processing, the target electronic device may be determined from the N second electronic devices. As an implementation manner, the target electronic device may be any second electronic device among the N second electronic devices, and the target electronic device may be randomly selected from the N second electronic devices.
作为另一种实施方式,可由第一耳机或第二耳机根据各个第二电子设备的优先级,从N个第二电子设备中选择优先级满足优先级条件的第二电子设备作为目标电子设备。As another implementation manner, the first earphone or the second earphone may select a second electronic device whose priority satisfies the priority condition from N second electronic devices as the target electronic device according to the priority of each second electronic device.
可获取各个第二电子设备对应的优先级,可选地,各个第二电子设备的优先级可以是根据各个第二电子设备的设备状态参数进行确定的。设备状态参数可包括但不限于业务数据输出参数、用于表征与耳机设备建立蓝牙连接的先后顺序的顺序参数、设备类型参数、设备剩余电量参数、历史连接频率中的一种或多种。The priority corresponding to each second electronic device may be acquired, and optionally, the priority of each second electronic device may be determined according to a device state parameter of each second electronic device. The device status parameters may include, but are not limited to, one or more of service data output parameters, sequence parameters used to characterize the order in which Bluetooth connections are established with headset devices, device type parameters, device remaining power parameters, and historical connection frequencies.
其中,业务数据输出参数可用于表征第二电子设备当前是否通过蓝牙连接向耳机设备输出业务数据。当前正在向耳机设备输出业务数据的第二电子设备的优先级可高于当前未向耳机设备输出业务数据的第二电子设备的优先级。Wherein, the service data output parameter may be used to represent whether the second electronic device currently outputs service data to the earphone device through the Bluetooth connection. The priority of the second electronic device that is currently outputting service data to the earphone device may be higher than the priority of the second electronic device that is not currently outputting service data to the earphone device.
顺序参数可用于表征与耳机设备建立蓝牙连接的先后顺序。作为一种实施方式,第一耳机及第二耳机中可存储有各个第二电子设备最近与耳机设备建立蓝牙连接的连接时刻,并根据各个第二电子设备对应的连接时刻确定各个第二电子设备本次连接的连接持续时长,该连接持续时长即为连接时刻到当前时刻的时长。可根据各个第二电子设备的连接持续时长确定各个第二电子设备的顺序参数,连接持续时长越长,顺序参数指示的顺序越靠前,也即表示第二电子设备越早与耳机设备建立蓝牙连接。The sequence parameter can be used to characterize the sequence of establishing the Bluetooth connection with the headset device. As an implementation, the first earphone and the second earphone can store the connection time when each second electronic device recently established a Bluetooth connection with the earphone device, and determine the connection time of each second electronic device according to the corresponding connection time of each second electronic device. The connection duration of this connection, the connection duration is the duration from the connection moment to the current moment. The sequence parameters of each second electronic device can be determined according to the connection duration of each second electronic device. The longer the connection duration, the higher the order indicated by the sequence parameter, that is, the earlier the second electronic device establishes Bluetooth with the headset device. connect.
作为另一种实施方式,也可建立连接队列,可按照各个第二电子设备与耳机设备建立蓝牙连接的顺序依次将各个第二电子设备的设备信息存入连接队列中,在连接队列中排列越靠前的第二电子设备,表示该第二电子设备越早与耳机设备建立蓝牙连接。可选地,越早与耳机设备建立蓝牙连接的第二电子设备的优先级可越低。As another implementation manner, a connection queue can also be established, and the device information of each second electronic device can be stored in the connection queue in sequence according to the order in which each second electronic device establishes a Bluetooth connection with the headset device, and the more connected the second electronic device is in the connection queue. The second electronic device that is closer to the front indicates that the second electronic device establishes a Bluetooth connection with the earphone device earlier. Optionally, the earlier the second electronic device establishes the Bluetooth connection with the earphone device, the lower its priority.
设备类型参数可用于表征第二电子设备的设备类型,该设备类型可包括但不限于手机、智能手表、手环、智能家居等。可预先设置各个设备类型对应的优先级,可根据各个第二电子设备的设备类型参数确定各个第二电子设备所属的设备类型,并获取该所属的设备类型对应的优先级。The device type parameter may be used to characterize the device type of the second electronic device, and the device type may include but not limited to mobile phone, smart watch, wristband, smart home and so on. The priority corresponding to each device type can be preset, and the device type to which each second electronic device belongs can be determined according to the device type parameter of each second electronic device, and the priority corresponding to the device type to which the second electronic device belongs can be obtained.
设备剩余电量参数可用于表征第二电子设备的当前剩余电量,设备剩余电量大的第二电子设备的优先级可高于设备剩余电量小的第二电子设备的优先级。The parameter of the remaining power of the device may be used to represent the current remaining power of the second electronic device, and the priority of the second electronic device with a large remaining power of the device may be higher than that of the second electronic device with a small remaining power of the device.
历史连接频率可用于表征第二电子设备与耳机设备的历史连接情况,该历史连接频率可以是过去一段时间内(如过去1周内、过去1个月内)的连接频率等。第一耳机及第二耳机中可对每个连接的电子设备与耳机设备的连接情况数据进行存储,该连接情况数据可包括每个连接的电子设备的设备信息、连接时刻、连接持续时长等。第一耳机可根据存储的连接情况数据,统计当前与耳机设备连接的N个第二电子设备在过去一段时间内的历史连接频率。历史连接频率高的第二电子设备的优先级可高于历史连接频率低的第二电子设备的优先级。The historical connection frequency may be used to characterize the historical connection between the second electronic device and the earphone device, and the historical connection frequency may be the connection frequency in the past period of time (such as in the past week or month). The first earphone and the second earphone can store connection status data of each connected electronic device and the earphone device, and the connection status data can include device information, connection time, connection duration, etc. of each connected electronic device. The first earphone can count historical connection frequencies of N second electronic devices currently connected to the earphone device within a past period of time according to the stored connection status data. The priority of the second electronic device with a high historical connection frequency may be higher than that of the second electronic device with a low historical connection frequency.
可根据各个第二电子设备的一种或多种设备状态参数确定各个第二电子设备对应的优先级。若依据多种设备状态参数确定各个第二电子设备对应的优先级,针对各个设备状态参数可分别分配权重。以第二电子设备中的设备A为例,该设备A可以是任一第二电子设备,可先根据设备A的各个设备状态参数确定与各个设备状态参数对应的基准优先级,例如,设备A的业务数据输出参数为1,表示当前正向耳机设备输出业务数据,则业务数据输出参数对应的基准优先级可为4;设备A的设备剩余电量参数指示设备A的当前剩余电量大于50%,则设备剩余电量对应的基准优先级可为2等。再根据设备A的各个设备状态参数对应的基准优先级,以及各个设备状态参数的分配权重,可进行加权和计算或加权平均计算,以得到设备A对应的优先级。The priority corresponding to each second electronic device may be determined according to one or more device status parameters of each second electronic device. If the priority corresponding to each second electronic device is determined according to various device state parameters, weights may be assigned to each device state parameter. Taking device A in the second electronic device as an example, the device A may be any second electronic device, and the reference priority corresponding to each device state parameter may be determined first according to each device state parameter of device A, for example, device A The business data output parameter of the device A is 1, which means that the business data is currently being output to the headset device, and the reference priority corresponding to the business data output parameter can be 4; the remaining power parameter of the device A indicates that the current remaining power of the device A is greater than 50%. Then the reference priority corresponding to the remaining power of the device may be 2 or the like. Then, according to the reference priority corresponding to each device state parameter of device A, and the distribution weight of each device state parameter, weighted sum calculation or weighted average calculation can be performed to obtain the corresponding priority of device A.
需要说明的是,确定各个第二电子设备的优先级的方式并不仅限于上述几种方式,例如,也可直接设置优先级规则,当前正在向耳机设备输出业务数据的第二电子设备的优先级最高,当前未向耳机设备输出业务数据的第二电子设备中,当前剩余电量最低的第二电子设备的优先级最低等,基于优先级规则及各个第二电子设备的设备状态参数,可确定各个第二电子设备的优先级。It should be noted that the method of determining the priority of each second electronic device is not limited to the above-mentioned methods, for example, priority rules can also be set directly, and the priority of the second electronic device that is currently outputting service data to the earphone device The highest, among the second electronic devices that currently do not output business data to the earphone device, the second electronic device with the lowest remaining power has the lowest priority, etc. Based on the priority rules and the device status parameters of each second electronic device, each The priority of the second electronic device.
可从N个第二电子设备中选择优先级满足优先级条件的第二电子设备作为目标电子设备,可选地,该优先级条件可包括优先级低于优先级阈值、优先级最低等中的任一种。进一步地,可直接选择优先级最低的第二电子设备作为目标电子设备,也可先选择优先级低于优先级阈值的第二电子设备,若存在多个优先级低于优先级阈值的第二电子设备,可以随机选择其中的一个作为目标电子设备,也可从 中选择优先级最低的第二电子设备作为目标电子设备。基于各个第二电子设备的优先级确定目标电子设备,可使得断开蓝牙连接的目标电子设备更贴合用户需求,可减少断开蓝牙连接给用户的正常使用造成不良影响。A second electronic device whose priority satisfies a priority condition may be selected from the N second electronic devices as the target electronic device. Optionally, the priority condition may include a priority lower than a priority threshold, the lowest priority, etc. any kind. Further, the second electronic device with the lowest priority can be directly selected as the target electronic device, or the second electronic device with the priority lower than the priority threshold can be selected first, if there are multiple second electronic devices with the priority lower than the priority threshold One of the electronic devices may be randomly selected as the target electronic device, or the second electronic device with the lowest priority may be selected as the target electronic device. Determining the target electronic device based on the priority of each second electronic device can make the target electronic device disconnected from the bluetooth connection more suitable for the user's needs, and can reduce the negative impact on the normal use of the user caused by the disconnection of the bluetooth connection.
需要说明的是,各个第二电子设备的优先级可以是根据具体情况不断变化的,不一定是固定的。可以理解的,在耳机设备未接收到第一连接请求之前,如果某个第二电子设备的优先级发生了变化,则在接收到蓝牙连接请求时会按照各个第二电子设备最新的优先级选择目标电子设备。It should be noted that the priority of each second electronic device may be constantly changing according to specific situations, and is not necessarily fixed. It can be understood that, before the headset device receives the first connection request, if the priority of a certain second electronic device changes, it will select according to the latest priority of each second electronic device when receiving the Bluetooth connection request. target electronic device.
例如,若第一耳机进入配对状态,第一耳机收到第一电子设备发送的第一连接请求时,如果各第二电子设备均没有向耳机设备传输业务数据,则可以按照各个第二电子设备的蓝牙连接顺序,优先断开最先连接的第二电子设备A。若第一耳机进入配对状态,如果在第一耳机接收到第一电子设备发送的第一连接请求前,第二电子设备A向第一电子设备传输业务数据(如语音数据、音频数据等),那么第二电子设备A的优先级发生了变化,此时,如果第一耳机收到该第一连接请求,则不会断开与第二电子设备A的蓝牙连接,此时具体断开哪个第二电子设备根据设定的优先级规则确定。可以见得,耳机设备不在进入配对状态就断开连接,而是在收到第一连接请求后才断开连接较大程度的保障了用户对耳机设备的使用。For example, if the first earphone enters the pairing state, when the first earphone receives the first connection request sent by the first electronic device, if none of the second electronic devices transmits service data to the earphone device, then each second electronic device may The bluetooth connection sequence, the first connected second electronic device A is disconnected first. If the first earphone enters the pairing state, if the second electronic device A transmits service data (such as voice data, audio data, etc.) to the first electronic device before the first earphone receives the first connection request sent by the first electronic device, Then the priority of the second electronic device A has changed. At this time, if the first earphone receives the first connection request, it will not disconnect the Bluetooth connection with the second electronic device A. At this time, which first earphone will be disconnected? The second electronic device is determined according to the set priority rules. It can be seen that the headset device is not disconnected when it enters the pairing state, but is disconnected after receiving the first connection request, which guarantees the user's use of the headset device to a large extent.
第一耳机或第二耳机在确定目标电子设备后,可向目标电子设备发送断连指令,以断开与目标电子设备之间的蓝牙连接。After the first earphone or the second earphone determines the target electronic device, it can send a disconnection instruction to the target electronic device to disconnect the Bluetooth connection with the target electronic device.
可选地,由于第一耳机被放置在耳机盒中,因此,第二耳机当前是耳机设备的主耳机,第一耳机当前可以是耳机设备的从耳机。第二耳机可与N个第二电子设备分别建立蓝牙连接。作为一种实施方式,若第二耳机接收到任一第二电子设备发送的数据,则第二耳机通过与第一耳机的蓝牙连接,将数据发送给第一耳机,实现主从同步。作为另一种实施方式,第二耳机可通过与第一耳机的蓝牙连接,向第一耳机同步各个第二电子设备的连接信息,以使第一耳机根据连接信息对第二耳机与N个第二电子设备之间的蓝牙连接进行监听,实现主从同步。Optionally, since the first earphone is placed in the earphone box, the second earphone is currently the master earphone of the earphone device, and the first earphone may currently be the slave earphone of the earphone device. The second earphone can respectively establish Bluetooth connections with the N second electronic devices. As an implementation manner, if the second earphone receives data sent by any second electronic device, the second earphone sends the data to the first earphone through the Bluetooth connection with the first earphone, thereby realizing master-slave synchronization. As another implementation, the second earphone can synchronize the connection information of each second electronic device with the first earphone through the Bluetooth connection with the first earphone, so that the first earphone can connect the second earphone with the Nth electronic devices according to the connection information. The Bluetooth connection between the two electronic devices is monitored to achieve master-slave synchronization.
在耳机设备处于抢连场景时,第二耳机可直接断开与目标电子设备之间的蓝牙连接,并向目标电子设备发送断连指令。第一耳机可根据第一电子设备发送的第一连接请求与第一电子设备建立蓝牙连接。在一些实施例中,第一耳机与第一电子设备建立蓝牙连接后,可向第二耳机同步第一电子设备的连接信息,该连接信息可包括但不限于跳频信息、信道信息、时钟信息等。在第一耳机将第一电子设备的连接信息同步给第二耳机之后,第一电子设备的蓝牙连接对象从第一耳机切换至第二耳机,且第一耳机对第二耳机与第一电子设备之间的蓝牙连接进行监听;或,在第一耳机将第一电子设备的连接信息同步给第一耳机之后,第一电子设备的蓝牙连接对象从第一耳机切换至第二耳机,且第二耳机将与第一电子设备之间传输的数据同步给第一耳机。When the earphone device is in the connection grabbing scene, the second earphone can directly disconnect the Bluetooth connection with the target electronic device, and send a disconnection instruction to the target electronic device. The first earphone can establish a Bluetooth connection with the first electronic device according to the first connection request sent by the first electronic device. In some embodiments, after the first earphone establishes a Bluetooth connection with the first electronic device, it can synchronize the connection information of the first electronic device to the second earphone. The connection information may include but not limited to frequency hopping information, channel information, clock information wait. After the first earphone synchronizes the connection information of the first electronic device to the second earphone, the Bluetooth connection object of the first electronic device is switched from the first earphone to the second earphone, and the first earphone pairs with the second earphone and the first electronic device or, after the first earphone synchronizes the connection information of the first electronic device to the first earphone, the Bluetooth connection object of the first electronic device switches from the first earphone to the second earphone, and the second earphone The earphone synchronizes the data transmitted with the first electronic device to the first earphone.
第二耳机在获取到该连接信息后,可基于该连接信息直接与第一电子设备进行数据传输,第一耳机与第一电子设备之间的物理链路过渡切换为第二耳机与第一电子设备之间的物理链路,第一电子设备的蓝牙连接对象从第一耳机切换至第二耳机。第一耳机可对第二耳机与第一电子设备之间的物理链路进行监听,或由第二耳机将与第一电子设备之间传输的数据转发给第一耳机,实现主从同步。通过耳机之间的信息同步,可使得所有与耳机设备建立蓝牙连接的电子设备,都是采用主耳机连接、从耳机监听或从耳机接收主耳机转发的数据的方式,更方便对连接的电子设备进行管理及数据传输。After the second earphone acquires the connection information, it can directly perform data transmission with the first electronic device based on the connection information, and the physical link between the first earphone and the first electronic device is transitioned to the second earphone and the first electronic device. In the physical link between devices, the Bluetooth connection object of the first electronic device is switched from the first earphone to the second earphone. The first earphone can monitor the physical link between the second earphone and the first electronic device, or the second earphone can forward the data transmitted with the first electronic device to the first earphone to realize master-slave synchronization. Through the information synchronization between the earphones, all electronic devices that establish a Bluetooth connection with the earphone device can use the main earphone connection, monitor from the earphone, or receive the data forwarded by the master earphone from the earphone, which is more convenient for connected electronic devices management and data transfer.
在一些实施例中,在第二耳机完成断连处理后,第二耳机可向第一耳机同步断连信息,该断连信息可至少包括断开蓝牙连接的目标电子设备的设备信息,第一耳机可不再对目标电子设备与第二耳机之间的蓝牙连接进行监听。In some embodiments, after the second earphone completes the disconnection process, the second earphone can synchronize the disconnection information to the first earphone, and the disconnection information can at least include the device information of the target electronic device that disconnects the Bluetooth connection. The earphone may no longer monitor the Bluetooth connection between the target electronic device and the second earphone.
示例性地,图5为一个实施例中耳机设备抢连场景下的交互时序图。如图5所示,耳机设备可为支持蓝牙“一拖二”的设备,耳机设备可与电子设备A及电子设备B分别建立蓝牙连接。电子设备C可为没有存储与耳机设备对应的设备信息的设备,耳机设备可进入配对状态(第一耳机和/或第二耳机进入配对状态,即同时开启inquiry scan及page scan模式),并在进入配对状态先保持与电子设备A及电子设备B的蓝牙连接。电子设备C可发送扫描请求,第一耳机和/或第二耳机在接收到该扫描请求后,可向电子设备C发送扫描响应。在电子设备C确定需要与耳机设备进行蓝牙连接时,可向耳机设备发送蓝牙连接请求。耳机设备在接收到电子设备C发送的蓝牙连接请求后,第二耳机可进行与目标电子设备(例如,图5中的电子设备B)对应的断连处理,第一耳机可处理该蓝牙连接请求,与电子设备C进行蓝牙连接,在进行蓝牙连接的过程中与电子设备C进行配对。在第二耳机断开与目标电子设备之间的蓝牙连接后,第二耳机可向第一耳机同步断连信息,以及在第一耳机成功与电子设备C建立蓝牙连接后,第一耳机可向第二耳机同步连接信息,实现信息同步,使电子设备C的蓝牙连接对 象从第一耳机切换至第二耳机。Exemplarily, FIG. 5 is an interaction sequence diagram in an embodiment of an interaction sequence diagram in a scenario of earphone device snatching connection. As shown in FIG. 5 , the earphone device can be a device that supports Bluetooth "one for two", and the earphone device can establish Bluetooth connections with electronic device A and electronic device B respectively. The electronic device C can be a device that does not store the device information corresponding to the earphone device, and the earphone device can enter the pairing state (the first earphone and/or the second earphone enter the pairing state, that is, open the inquiry scan and page scan modes at the same time), and To enter the pairing state, first maintain the Bluetooth connection with electronic device A and electronic device B. The electronic device C may send a scan request, and the first earphone and/or the second earphone may send a scan response to the electronic device C after receiving the scan request. When the electronic device C determines that a Bluetooth connection with the headset device is required, it may send a Bluetooth connection request to the headset device. After the headset device receives the Bluetooth connection request sent by the electronic device C, the second headset can perform disconnection processing corresponding to the target electronic device (for example, electronic device B in FIG. 5 ), and the first headset can process the Bluetooth connection request. , perform a Bluetooth connection with the electronic device C, and perform pairing with the electronic device C during the Bluetooth connection process. After the second earphone disconnects the bluetooth connection with the target electronic device, the second earphone can synchronize the disconnection information to the first earphone, and after the first earphone successfully establishes a bluetooth connection with the electronic device C, the first earphone can send The connection information of the second earphone is synchronized to realize information synchronization, so that the Bluetooth connection object of the electronic device C is switched from the first earphone to the second earphone.
可选地,在耳机设备处于抢连场景时,也可由第一耳机(即从耳机)进行与目标电子设备对应的断连处理。在耳机设备处于抢连场景时,第一耳机可监听第二耳机与目标电子设备之间的蓝牙连接,并在第二耳机与目标电子设备的传输信道上向目标电子设备发送断连请求,该断连请求可用于触发目标电子设备与第二耳机之间的蓝牙连接断开。第二耳机可处理第一电子设备发送的第一连接请求,并建立与第一电子设备之间的蓝牙连接。Optionally, when the earphone device is in a connection grabbing scene, the first earphone (ie, the slave earphone) may also perform disconnection processing corresponding to the target electronic device. When the earphone device is in the connection grabbing scene, the first earphone can monitor the Bluetooth connection between the second earphone and the target electronic device, and send a disconnection request to the target electronic device on the transmission channel between the second earphone and the target electronic device. The disconnection request can be used to trigger the disconnection of the Bluetooth connection between the target electronic device and the second earphone. The second earphone can process the first connection request sent by the first electronic device, and establish a Bluetooth connection with the first electronic device.
需要说明的是,若仅第一耳机或仅第二耳机开启page scan模式,则可由开启page scan模式的耳机在接收到第一连接请求后,对该第一连接请求进行处理,并由未开启page scan模式的耳机进行断连处理。It should be noted that if only the first earphone or only the second earphone turns on the page scan mode, the first connection request can be processed by the earphone with the page scan mode turned on after receiving the first connection request. Headphones in page scan mode are disconnected.
在本申请实施例中,在耳机设备出现第一电子设备抢占蓝牙连接的情况时,分别通过第一耳机及第二耳机并行进行断连操作以及连接操作,能够提高第一电子设备对耳机设备的抢连速度,提高抢连效率。且在断连操作及连接操作完成后,第一耳机与第二耳机进行信息同步,可更加方便对所有建立蓝牙连接的进行管理,保证数据传输效率。In the embodiment of the present application, when the first electronic device preempts the Bluetooth connection in the earphone device, the disconnection operation and the connection operation are performed in parallel through the first earphone and the second earphone respectively, which can improve the interaction between the first electronic device and the earphone device. Increase the speed of robbing and improve the efficiency of robbing. And after the disconnection operation and connection operation are completed, the first earphone and the second earphone perform information synchronization, which can more conveniently manage all established Bluetooth connections and ensure data transmission efficiency.
如图6所示,在一个实施例中,工作状态可为配对状态,在控制第一耳机和/或第二耳机进入配对状态之后,该方法还可包括以下步骤:As shown in Figure 6, in one embodiment, the working state may be a pairing state, and after controlling the first earphone and/or the second earphone to enter the pairing state, the method may further include the following steps:
步骤602,在第一耳机和/或第二耳机处于配对状态时,由第一耳机和/或第二耳机接收第一电子设备发送的扫描请求,并根据扫描请求向第一电子设备发送扫描响应,以及由第一耳机和/或第二耳机接收第三电子设备发送的扫描请求,并根据扫描请求向第三电子设备发送扫描响应。 Step 602, when the first earphone and/or the second earphone are in the pairing state, the first earphone and/or the second earphone receive the scan request sent by the first electronic device, and send a scan response to the first electronic device according to the scan request , and the first earphone and/or the second earphone receive the scan request sent by the third electronic device, and send a scan response to the third electronic device according to the scan request.
第一耳机和/或第二耳机接收第三电子设备发送的扫描请求,并根据扫描请求向第三电子设备发送扫描响应的描述,可与第一耳机和/或第二耳机接收第一电子设备发送的扫描请求,并根据扫描请求向第一电子设备发送扫描响应的方式类似,可参考上述各实施例中的相关描述,在此不再重复赘述。The first earphone and/or the second earphone receive the scan request sent by the third electronic device, and send the scan response to the third electronic device according to the description of the scan request, which can be used with the first earphone and/or the second earphone to receive the first electronic device The method of sending a scan request and sending a scan response to the first electronic device according to the scan request is similar, and reference may be made to related descriptions in the foregoing embodiments, and details are not repeated here.
步骤604,若在第一时间段内接收到第一电子设备发送的第一连接请求及第三电子设备发送的第二连接请求,则通过第一耳机对第一连接请求进行处理,与第一电子设备建立蓝牙连接,以及通过第二耳机对第二连接请求进行处理,与第三电子设备建立蓝牙连接。Step 604: If the first connection request sent by the first electronic device and the second connection request sent by the third electronic device are received within the first time period, process the first connection request through the first earphone, and communicate with the first connection request. The electronic device establishes a bluetooth connection, processes the second connection request through the second earphone, and establishes a bluetooth connection with the third electronic device.
耳机设备可以是支持蓝牙的“一拖多”功能的设备,即耳机设备支持同时建立蓝牙连接的最大数量N大于或等于2。在耳机设备进入配对状态后,第一耳机与第二耳机可均开启page scan模式,并可接收到其它电子设备发送的蓝牙连接请求。若在第一时间段内接收到第一电子设备发送的第一连接请求以及第三电子设备发送的第二连接请求,可说明耳机设备需要同时或连续与第一电子设备及第三电子设备建立蓝牙连接,极大可能会出现耳机设备在未处理完成一个蓝牙连接请求时就接收到另一蓝牙连接请求的情况。因此,可通过第一耳机与第一电子设备进行蓝牙连接,并通过第二耳机并行进行与第二电子设备的蓝牙连接,第一耳机与第二耳机可并行进行连接操作,分别与第一电子设备及第二电子设备建立蓝牙连接。将串行的建立连接的过程变为并行建立连接的过程,以减少连接等待时长。The earphone device may be a device that supports the "one-to-many" function of Bluetooth, that is, the maximum number N of simultaneous establishment of Bluetooth connections supported by the earphone device is greater than or equal to 2. After the earphone device enters the pairing state, both the first earphone and the second earphone can turn on the page scan mode, and can receive Bluetooth connection requests sent by other electronic devices. If the first connection request sent by the first electronic device and the second connection request sent by the third electronic device are received within the first time period, it can indicate that the earphone device needs to establish connections with the first electronic device and the third electronic device at the same time or continuously. Bluetooth connection, it is very likely that the headset device will receive another Bluetooth connection request before processing one Bluetooth connection request. Therefore, the Bluetooth connection with the first electronic device can be performed through the first earphone, and the Bluetooth connection with the second electronic device can be performed in parallel through the second earphone. The device and the second electronic device establish a Bluetooth connection. Change the process of establishing a connection serially into a process of establishing a connection in parallel to reduce the connection waiting time.
其中,第一时间段可根据实际需求进行设置,例如,第一时间段可为1秒、2秒等。第一时间段也可以根据耳机设备建立蓝牙连接的速度等进行设置,耳机设备建立蓝牙连接的速度越快,则第一时间段可越短,耳机设备建立蓝牙连接的速度越慢,则第一时间段可越长。进一步地,第一时间段可以是耳机设备正常与其它电子设备建立蓝牙连接的时长。Wherein, the first time period may be set according to actual requirements, for example, the first time period may be 1 second, 2 seconds, and so on. The first time period can also be set according to the speed at which the earphone device establishes a Bluetooth connection. The faster the earphone device establishes a Bluetooth connection, the shorter the first time period is. The slower the earphone device establishes a Bluetooth connection, the first The time period can be longer. Further, the first time period may be a time period during which the earphone device normally establishes a Bluetooth connection with other electronic devices.
在一些实施例中,第一耳机与第二耳机之间可建立蓝牙连接,在第一耳机与第一电子设备建立蓝牙连接之后,可通过第一耳机向第二耳机同步第一电子设备的连接信息;在第二耳机与第三电子设备建立蓝牙连接之后,可通过第二耳机向第一耳机同步第三电子设备的连接信息。实现第一耳机与第二耳机之间的信息同步。In some embodiments, a Bluetooth connection can be established between the first earphone and the second earphone, and after the Bluetooth connection is established between the first earphone and the first electronic device, the connection of the first electronic device can be synchronized to the second earphone through the first earphone Information; after the second earphone establishes a bluetooth connection with the third electronic device, the connection information of the third electronic device can be synchronized with the first earphone through the second earphone. Realize information synchronization between the first earphone and the second earphone.
在一些实施例中,第二耳机可以是耳机设备中的主耳机,第一耳机可以是耳机设备中的从耳机。在第一耳机向第二耳机同步第一电子设备的连接信息之后,第一电子设备的蓝牙连接对象可从第一耳机切换至第二耳机,且第一耳机对第二耳机与第一电子设备之间的蓝牙连接进行监听;或,在第一耳机向第二耳机同步第一电子设备的连接信息之后,第一电子设备的蓝牙连接对象可从第一耳机切换至第二耳机,且第二耳机将与第一电子设备之间传输的数据同步给第一耳机。In some embodiments, the second earphone may be a master earphone in the earphone device, and the first earphone may be a slave earphone in the earphone device. After the first earphone synchronizes the connection information of the first electronic device to the second earphone, the Bluetooth connection object of the first electronic device can be switched from the first earphone to the second earphone, and the first earphone is compatible with the second earphone and the first electronic device. or, after the first earphone synchronizes the connection information of the first electronic device to the second earphone, the Bluetooth connection object of the first electronic device can be switched from the first earphone to the second earphone, and the second earphone The earphone synchronizes the data transmitted with the first electronic device to the first earphone.
第二耳机在获取到第一耳机同步的连接信息后,可基于该连接信息直接与第一电子设备进行数据传输,第一耳机与第一电子设备之间的物理链路过渡切换为第二耳机与第一电子设备之间的物理链路,第一电子设备的蓝牙连接对象从第一耳机切换至第二耳机。第一耳机可对第二耳机与第一电子设备之间的蓝牙物理链路进行监听,或由第二耳机将与第一电子设备之间传输的数据转发给第一耳机,实现主从同步。After the second earphone obtains the synchronous connection information of the first earphone, it can directly perform data transmission with the first electronic device based on the connection information, and the physical link between the first earphone and the first electronic device is transitioned to the second earphone With the physical link between the first electronic device, the Bluetooth connection object of the first electronic device is switched from the first earphone to the second earphone. The first earphone can monitor the bluetooth physical link between the second earphone and the first electronic device, or the second earphone can forward the data transmitted with the first electronic device to the first earphone to realize master-slave synchronization.
在第二耳机与第三电子设备建立蓝牙连接后,第二耳机也可将第三电子设备的连接信息同步给第一耳机,第一耳机可基于该连接信息对第二耳机与第三电子设备之间的建立的蓝牙连接进行监听。通过耳机之间的信息同步,可使得所有与耳机设备建立蓝牙连接的电子设备,都是采用主耳机连接、从耳机监听或接收主耳机转发的数据的方式,更方便对连接的电子设备进行管理及数据传输。After the second earphone establishes a Bluetooth connection with the third electronic device, the second earphone can also synchronize the connection information of the third electronic device to the first earphone, and the first earphone can communicate with the second earphone and the third electronic device based on the connection information. Monitor the established Bluetooth connection between them. Through the information synchronization between the earphones, all electronic devices that establish a Bluetooth connection with the earphone device can be connected to the main earphone, and the slave earphone monitors or receives the data forwarded by the master earphone, which is more convenient to manage the connected electronic devices and data transmission.
示例性地,图7为一个实施例中耳机设备连接两个电子设备的交互时序图。如图7所示,耳机设备可为支持蓝牙“一拖二”的设备,耳机设备在未与任一电子设备连接情况下进入配对状态。电子设备D与电子设备E均没有存储与耳机设备对应的设备信息。耳机设备进入配对状态(第一耳机和/或第二耳机进入配对状诚,同时处于inquiry scan及page scan模式),电子设备D与电子设备E可扫描到耳机设备,并向耳机设备发送蓝牙连接请求。耳机设备在第一时间段内接收到电子设备E与电子设备F发送的蓝牙连接请求,第一耳机可处理电子设备D发送的蓝牙连接请求,并与电子设备D进行蓝牙连接,进行蓝牙连接的过程中与电子设备D进行配对。第二耳机可处理电子设备E发送的蓝牙连接请求,并与电子设备E进行蓝牙连接,进行蓝牙连接的过程中与电子设备E进行配对。在第一耳机成功与电子设备D建立蓝牙连接后,可向第二耳机同步电子设备D的连接信息,实现信息同步,使电子设备D的蓝牙连接对象从第一耳机切换至第二耳机。在第二耳机成功与电子设备E建立蓝牙连接后,可向第一耳机同步电子设备E的连接信息。Exemplarily, FIG. 7 is an interaction sequence diagram of an earphone device connecting two electronic devices in an embodiment. As shown in FIG. 7 , the earphone device can be a device that supports Bluetooth "one for two", and the earphone device enters a pairing state when it is not connected to any electronic device. Neither the electronic device D nor the electronic device E stores the device information corresponding to the earphone device. The earphone device enters the pairing state (the first earphone and/or the second earphone enters the pairing state, and is in inquiry scan and page scan mode at the same time), electronic device D and electronic device E can scan the earphone device, and send a Bluetooth connection to the earphone device ask. The earphone device receives the Bluetooth connection request sent by the electronic device E and the electronic device F within the first time period, and the first earphone can process the Bluetooth connection request sent by the electronic device D, and perform a Bluetooth connection with the electronic device D, and perform the Bluetooth connection. pairing with electronic device D during the process. The second earphone can process the Bluetooth connection request sent by the electronic device E, and perform a Bluetooth connection with the electronic device E, and perform pairing with the electronic device E during the Bluetooth connection. After the first earphone successfully establishes a Bluetooth connection with the electronic device D, the connection information of the electronic device D can be synchronized with the second earphone to realize information synchronization, so that the Bluetooth connection object of the electronic device D can be switched from the first earphone to the second earphone. After the second earphone successfully establishes the Bluetooth connection with the electronic device E, the connection information of the electronic device E can be synchronized with the first earphone.
在一些实施例中,若耳机设备先接收到第一电子设备发送的第一连接请求,可由第一耳机对该第一连接请求进行处理。第一耳机在响应该第一连接请求时,可向第二耳机发送第一信息,该第一信息可用于通知第二耳机,该第一耳机正在处理蓝牙连接请求;在第一耳机完成对第一连接请求的处理,成功与第一电子设备建立蓝牙连接后,则可向第二耳机发送第二信息,该第二信息用于通知第二耳机,第一耳机已处理完成蓝牙连接请求。若第二耳机接收到第一信息但还未接收到第二信息时,表示第一耳机还在处理第一电子设备的第一连接请求的过程中,若在此过程中接收到第三电子设备发送的第二连接请求,则第二耳机可处理第三电子设备发送的第二连接请求,与第三电子设备建立蓝牙连接。可提高耳机设备与两个电子设备的连接速度。In some embodiments, if the earphone device first receives the first connection request sent by the first electronic device, the first earphone may process the first connection request. When the first earphone responds to the first connection request, it can send first information to the second earphone, and the first information can be used to notify the second earphone that the first earphone is processing the Bluetooth connection request; For the processing of a connection request, after successfully establishing a Bluetooth connection with the first electronic device, a second message can be sent to the second earphone, and the second message is used to notify the second earphone that the first earphone has completed the processing of the Bluetooth connection request. If the second earphone receives the first information but has not received the second information, it means that the first earphone is still in the process of processing the first connection request of the first electronic device. If the second connection request is sent, the second earphone can process the second connection request sent by the third electronic device, and establish a Bluetooth connection with the third electronic device. It can increase the connection speed between the headset device and two electronic devices.
在一些实施例中,也可先由第二耳机(即主耳机)处理耳机设备先接收到的第一电子设备发送的第一连接请求,再由第一耳机(即从耳机)处理耳机设备后接收到的第三电子设备发送的第二连接请求,本申请实施例对此不作限制。In some embodiments, the first connection request sent by the first electronic device firstly received by the earphone device can also be processed by the second earphone (ie, the master earphone), and then the first earphone (ie, the slave earphone) processes the first connection request sent by the earphone device. The received second connection request sent by the third electronic device is not limited in this embodiment of the present application.
在一些实施例中,若在耳机设备接收到第一电子设备发送的第一连接请求及第二电子设备发送的第二连接请求之前,已经与M个第二电子设备保持蓝牙连接,若该M为大于或等于0,且小于或等于N-2的整数,则耳机设备还可与N-M个电子设备建立蓝牙连接,该N-M大于或等于2。因此,耳机设备在接收到第一电子设备发送的第一连接请求及第二电子设备发送的第二连接请求之后,可分别与第一电子设备及第三电子设备建立蓝牙连接。In some embodiments, if the headset device has maintained Bluetooth connections with M second electronic devices before receiving the first connection request sent by the first electronic device and the second connection request sent by the second electronic device, if the M is an integer greater than or equal to 0 and less than or equal to N-2, then the headset device can also establish Bluetooth connections with N-M electronic devices, where N-M is greater than or equal to 2. Therefore, after receiving the first connection request sent by the first electronic device and the second connection request sent by the second electronic device, the earphone device can respectively establish a Bluetooth connection with the first electronic device and the third electronic device.
在一些实施例中,在与耳机设备建立蓝牙连接的第二电子设备的数量达至N-1时,若在第一时间段内接收到第一电子设备发送的第一连接请求以及第三电子设备发送的第二连接请求,则可先对第二电子设备中的目标电子设备进行断连处理,再分别与第一电子设备及第二电子设备建立蓝牙连接。作为另一种实施方式,也可以与先接收到蓝牙连接请求的电子设备(比如第一电子设备)建立蓝牙连接,再对第二电子设备中的目标电子设备进行断连处理,并与另一电子设备(如第三电子设备)进行蓝牙连接。具体的断连处理方式及蓝牙连接过程可参考上述各实施例中的相关描述及蓝牙标准协议,在此不再赘述。In some embodiments, when the number of second electronic devices establishing Bluetooth connections with the headset device reaches N-1, if the first connection request sent by the first electronic device and the third electronic device are received within the first time period, For the second connection request sent by the device, the target electronic device in the second electronic device may be disconnected first, and then establish a Bluetooth connection with the first electronic device and the second electronic device respectively. As another implementation, it is also possible to establish a Bluetooth connection with the electronic device (such as the first electronic device) that first receives the Bluetooth connection request, and then perform disconnection processing on the target electronic device in the second electronic device, and communicate with another An electronic device (such as a third electronic device) performs a Bluetooth connection. For the specific disconnection processing method and the Bluetooth connection process, reference may be made to the relevant descriptions in the above-mentioned embodiments and the Bluetooth standard protocol, which will not be repeated here.
在本申请实施例中,可通过耳机设备的第一耳机及第二耳机分别与第一电子设备及第三电子设备建立蓝牙连接,第一耳机及第二耳机并行进行连接操作,无需等待耳机设备完成与其中一电子设备的蓝牙连接过程后才能够与另一电子设备建立蓝牙连接,能够提高耳机设备与两个电子设备建立蓝牙连接的速度,提高连接效率。且第一耳机与第二耳机进行信息同步,使得第一电子设备的蓝牙连接对象从第一耳机切换至第二耳机,可更加方便对所有建立蓝牙连接的进行管理,保证数据传输效率。In this embodiment of the application, Bluetooth connections can be established with the first electronic device and the third electronic device through the first earphone and the second earphone of the earphone device, and the first earphone and the second earphone can be connected in parallel without waiting for the earphone device Only after completing the Bluetooth connection process with one of the electronic devices can the Bluetooth connection be established with the other electronic device, which can increase the speed of establishing the Bluetooth connection between the earphone device and the two electronic devices, and improve the connection efficiency. And the information synchronization between the first earphone and the second earphone makes the Bluetooth connection object of the first electronic device switch from the first earphone to the second earphone, which can more conveniently manage all established Bluetooth connections and ensure data transmission efficiency.
需要说明的是,上述的第一电子设备及第三电子设备等,也可以是与第一电子设备配对过的电子设备(即存储有设备信息),在不冲突的情况下,也可采用上述各实施例中描述的建立蓝牙连接的方式与耳机设备建立蓝牙连接。It should be noted that the above-mentioned first electronic device and third electronic device, etc., may also be electronic devices that have been paired with the first electronic device (that is, store device information), and if there is no conflict, the above-mentioned The manners for establishing a Bluetooth connection described in each embodiment establish a Bluetooth connection with an earphone device.
可选地,本申请实施例中的蓝牙连接可包括经典蓝牙连接及蓝牙低能耗(Bluetooth Low Energy,BLE)连接中的任一种。在BLE连接场景中,耳机设备(第一耳机和/或第二耳机)可发送BLE广播,其它电子设备可扫描获取该BLE广播,并与耳机设备建立BLE蓝牙连接。Optionally, the Bluetooth connection in this embodiment of the present application may include any one of a classic Bluetooth connection and a Bluetooth Low Energy (Bluetooth Low Energy, BLE) connection. In the BLE connection scenario, the earphone device (the first earphone and/or the second earphone) can send a BLE broadcast, and other electronic devices can scan and obtain the BLE broadcast, and establish a BLE Bluetooth connection with the earphone device.
如图8所示,在一个实施例中,工作状态包括共同使用状态,步骤控制第一耳机和第二耳机进入 目标指令所指定的工作状态,可包括:在第一耳机与第二耳机未建立蓝牙连接的情况下,且第二耳机与第四电子设备建立蓝牙连接的情况下,由第一耳机发送广播信号,该广播信号用于触发接收到广播信号的第四电子设备向第二耳机发送连接指令,以使第二耳机根据连接指令与第一耳机建立蓝牙连接,并与第一耳机共享同一蓝牙地址。As shown in FIG. 8, in one embodiment, the working state includes a common use state. The step of controlling the first earphone and the second earphone to enter the working state specified by the target instruction may include: when the first earphone and the second earphone are not established In the case of Bluetooth connection, and in the case of establishing a Bluetooth connection between the second earphone and the fourth electronic device, the first earphone sends a broadcast signal, and the broadcast signal is used to trigger the fourth electronic device that receives the broadcast signal to send the broadcast signal to the second earphone. A connection instruction, so that the second earphone establishes a bluetooth connection with the first earphone according to the connection instruction, and shares the same bluetooth address with the first earphone.
在本申请实施例中,耳机设备可支持第一耳机与第二耳机分别单独使用(即单独使用状态),以及第一耳机与第二耳机共同使用(即共同使用状态)两种使用模式。在单独使用状态下,第一耳机与第二耳机被分别配置为不同的蓝牙地址,在第一耳机与第二耳机共同使用的状态下,第一耳机与第二耳机被配置为同一蓝牙地址。用户可根据实际需求让耳机设备在单独使用状态与共同使用状态两者之间进行切换,通过将第一耳机被置到耳机盒中,并触发相应的控制操作,即可让耳机设备从单独使用状态切换至共同使用状态,或是让耳机设备从共同使用状态切换为单独使用状态。In the embodiment of the present application, the earphone device can support two use modes: the first earphone and the second earphone are used separately (that is, the state of single use), and the first earphone and the second earphone are used together (that is, the state of common use). In the state of single use, the first earphone and the second earphone are respectively configured with different bluetooth addresses; when the first earphone and the second earphone are used together, the first earphone and the second earphone are configured with the same bluetooth address. The user can switch the earphone device between the single use state and the common use state according to actual needs. By placing the first earphone in the earphone box and triggering the corresponding control operation, the earphone device can be used independently. The state is switched to the common use state, or the headset device is switched from the common use state to the single use state.
在第二耳机与第四电子设备建立蓝牙连接,且第一耳机未与第二耳机建立蓝牙连接的情况下,第二耳机与第四电子设备未建立蓝牙连接,说明第一耳机与第二耳机当前处于单独使用状态。第一耳机可响应于耳机盒发送的目标指令(如上述的第三控制指令),发送广播信号,以使接收到该广播信号的第四电子设备根据该广播信号向第二耳机发送连接指令,该连接指令可用于指示第二耳机与第一耳机建立蓝牙连接。When the second earphone establishes a bluetooth connection with the fourth electronic device, and the first earphone does not establish a bluetooth connection with the second earphone, the second earphone does not establish a bluetooth connection with the fourth electronic device, indicating that the first earphone and the second earphone Currently in stand-alone use. The first earphone can send a broadcast signal in response to the target instruction (such as the above-mentioned third control instruction) sent by the earphone box, so that the fourth electronic device that receives the broadcast signal sends a connection instruction to the second earphone according to the broadcast signal, The connection instruction can be used to instruct the second earphone to establish a Bluetooth connection with the first earphone.
可选地,该广播信号可包括BLE广播信号,第一耳机在接收到耳机盒发送的目标指令(如上述的第三控制指令)时,可基于BLE蓝牙协议在广播信道上发送BLE广播信号。在一些实施例中,第四电子设备的蓝牙模块可处于扫描状态,对各个广播信道进行监听,并在扫描到第一耳机发送的BLE广播信号时,通过与第二耳机之间的蓝牙连接,向第二耳机发送连接指令。Optionally, the broadcast signal may include a BLE broadcast signal, and the first earphone may send the BLE broadcast signal on the broadcast channel based on the BLE Bluetooth protocol when receiving the target instruction (such as the third control instruction) sent by the earphone box. In some embodiments, the bluetooth module of the fourth electronic device can be in the scanning state, monitor each broadcast channel, and when scanning the BLE broadcast signal sent by the first earphone, through the bluetooth connection with the second earphone, Send a connection instruction to the second headset.
在一些实施例中,上述的广播信号包括第一特定信息。可选地,该广播信号用于触发接收到广播信号的第四电子设备在确定第一特定信息与第二特定信息相同时,向第二耳机发送连接指令,以使第二耳机根据连接指令与第一耳机建立蓝牙连接,并共享同一蓝牙地址;其中,第二特定信息是第二耳机发送给第四电子设备的;或,In some embodiments, the above-mentioned broadcast signal includes first specific information. Optionally, the broadcast signal is used to trigger the fourth electronic device receiving the broadcast signal to send a connection instruction to the second earphone when determining that the first specific information is the same as the second specific information, so that the second earphone can communicate with the second earphone according to the connection instruction. The first earphone establishes a bluetooth connection and shares the same bluetooth address; wherein, the second specific information is sent by the second earphone to the fourth electronic device; or,
广播信号用于触发接收到广播信号的第四电子设备将第一特定信息及连接指令发送给第二耳机,以使第二耳机在确定第一特定信息与第二耳机中存储的第二特定信息相同时,根据连接指令与第一耳机建立蓝牙连接,并与第一耳机共享同一蓝牙地址。The broadcast signal is used to trigger the fourth electronic device receiving the broadcast signal to send the first specific information and the connection instruction to the second earphone, so that the second earphone can determine the first specific information and the second specific information stored in the second earphone At the same time, establish a bluetooth connection with the first earphone according to the connection instruction, and share the same bluetooth address with the first earphone.
属于同一耳机设备的第一耳机及第二耳机可预先约定有特定信息,并分别存储该约定的特定信息,第一耳机与第二耳机存储的特定信息相同。进一步地,该特定信息可以是数字、字母、符号等中的一种或多种组成的字符串,通过该特定信息可识别第一耳机与第二耳机为匹配的耳机,属于同一耳机设备。可选地,该特定信息可以是耳机设备在出厂前设置的固定特定信息,每个耳机设备的特定信息不同。该特定信息也可以是耳机设备每次在切换到两只耳机分别单独使用的状态时,生成并存储到第一耳机及第二耳机中,耳机设备每次生成的特定信息可能不同。The first earphone and the second earphone belonging to the same earphone device may pre-agreed with specific information, and respectively store the agreed specific information, and the specific information stored in the first earphone and the second earphone is the same. Further, the specific information may be a character string composed of one or more of numbers, letters, symbols, etc., through which it can be identified that the first earphone and the second earphone are matching earphones and belong to the same earphone device. Optionally, the specific information may be fixed specific information set by the earphone device before leaving the factory, and the specific information of each earphone device is different. The specific information may also be generated and stored in the first earphone and the second earphone each time the earphone device is switched to a state where the two earphones are used independently, and the specific information generated by the earphone device may be different each time.
在一些实施例中,在第二耳机与第四电子设备建立蓝牙连接后,第二耳机可将存储的第二特定信息发送给第四电子设备。在第一耳机接收到目标指令(如上述的第三控制指令)后,可获取存储的第一特定信息,并生成携带有该第一特定信息的广播信号进行广播。第四电子设备在接收到该广播信号后,可对广播信号进行解析,得到第一特定信息,并将解析得到的第一特定信息与第二耳机发送的第二特定信息进行比对,判断二者是否相同。若该第一特定信息与该第二特征信息相同,说明该广播信号是与第二耳机属于同一耳机设备的第一耳机发送的,则可向第二耳机发送连接指令。In some embodiments, after the Bluetooth connection is established between the second earphone and the fourth electronic device, the second earphone may send the stored second specific information to the fourth electronic device. After the first earphone receives the target instruction (such as the above-mentioned third control instruction), it can acquire the stored first specific information, and generate a broadcast signal carrying the first specific information for broadcast. After receiving the broadcast signal, the fourth electronic device can analyze the broadcast signal to obtain the first specific information, compare the analyzed first specific information with the second specific information sent by the second earphone, and determine whether the second are the same. If the first specific information is the same as the second feature information, it means that the broadcast signal is sent by the first earphone belonging to the same earphone device as the second earphone, and a connection instruction can be sent to the second earphone.
在另一些实施例中,在第四电子设备解析得到的第一特定信息后,也可将第一特定信息及连接指令发送给第二耳机,第二耳机可将该第一特定信息与存储的第二特定信息进行比对,判断二者是否相同。若该第一特定信息与该第二特征信息相同,则可响应该连接指令,根据该连接指令与第一耳机建立蓝牙连接。In some other embodiments, after the fourth electronic device analyzes the first specific information obtained, it can also send the first specific information and the connection instruction to the second earphone, and the second earphone can combine the first specific information with the stored The second specific information is compared to determine whether the two are the same. If the first specific information is the same as the second characteristic information, a Bluetooth connection can be established with the first earphone according to the connection instruction in response to the connection instruction.
在本申请实施例中,第四电子设备或第二耳机通过广播信号中携带的第一特定信息可准确识别发送广播信号的第一耳机的身份,提高了第一耳机与第二耳机进行蓝牙连接的准确性。In the embodiment of the present application, the fourth electronic device or the second earphone can accurately identify the identity of the first earphone sending the broadcast signal through the first specific information carried in the broadcast signal, which improves the Bluetooth connection between the first earphone and the second earphone. accuracy.
在一些实施例中,上述的广播信号还可包括第一耳机在处于单独使用状态时所对应的蓝牙地址。第四电子设备在接收到第一耳机发送的广播信号后,可解析得到该第一特定信息及第一耳机对应的蓝牙地址,并向第二耳机发送包含该蓝牙地址的连接指令。第二耳机在接收到该连接指令后,可对该连接指令进行解析,得到第一耳机的蓝牙地址,并基于该第一耳机的蓝牙地址向第一耳机发送蓝牙连接请求。在本申请实施例,采用由与第二耳机连接的第四电子设备进行信息中转的方式,使得第二耳机能够获取到第一耳机的蓝牙地址,并准确向第一耳机发起蓝牙连接请求,保证了第一耳机与第二耳机 进行蓝牙连接的可靠性。In some embodiments, the above-mentioned broadcast signal may further include a bluetooth address corresponding to the first earphone when it is in a state of being used alone. After receiving the broadcast signal sent by the first earphone, the fourth electronic device can analyze the first specific information and the Bluetooth address corresponding to the first earphone, and send a connection instruction including the Bluetooth address to the second earphone. After receiving the connection instruction, the second earphone can analyze the connection instruction to obtain the Bluetooth address of the first earphone, and send a Bluetooth connection request to the first earphone based on the Bluetooth address of the first earphone. In the embodiment of this application, the fourth electronic device connected to the second earphone is used to transfer information, so that the second earphone can obtain the Bluetooth address of the first earphone, and accurately initiate a Bluetooth connection request to the first earphone, ensuring This improves the reliability of the Bluetooth connection between the first earphone and the second earphone.
在第二耳机与第一耳机建立蓝牙连接后,第二耳机与第一耳机可共享同一蓝牙地址,该同一蓝牙地址可以是第二耳机的蓝牙地址,也可以是第一耳机的蓝牙地址,则第一耳机与第二耳机处于共同使用状态。After the second earphone establishes the bluetooth connection with the first earphone, the second earphone and the first earphone can share the same bluetooth address, and the same bluetooth address can be the bluetooth address of the second earphone or the bluetooth address of the first earphone, then The first earphone and the second earphone are in a common use state.
示例性地,图8为一个实施例中控制第一耳机及第二耳机进入共同使用状态的时序交互示意图。如图8所示,耳机设备可包括耳机A、耳机B及耳机盒,耳机A与耳机B之间未建立蓝牙连接,分别单独使用。耳机B与电子设备F建立蓝牙连接,并向电子设备F发送第二特定信息。在用户需要将耳机A与耳机B从单独使用状态切换为共同使用状态时,可将耳机A放置到耳机盒中,并对耳机盒进行相应的控制操作。耳机盒在检测到控制操作时,可向耳机A发送目标指令(如上述的第三控制指令)。耳机A响应该目标指令,并发送广播信号,该广播信号可携带有第一特定信息及耳机A的蓝牙地址。电子设备F在接收到该广播信号,可对该广播信号进行解析,得到第一特定信息及耳机A的蓝牙地址。电子设备F可将该第一特定信息与耳机B发送的第二特定信息进行比对,并在确定该第一特定信息与该第二特定信息相同时,向耳机B发送连接指令,该连接指令包含耳机A的蓝牙地址。耳机B在接收到该连接指令后,可基于连接指令包含的耳机A的蓝牙地址,向耳机A发送蓝牙连接请求,并与耳机A建立蓝牙连接。在耳机A与耳机B建立蓝牙连接后,耳机A与耳机B可共享同一蓝牙地址,并实现数据同步,共同播放同一电子设备传输的音频数据。Exemplarily, FIG. 8 is a schematic diagram of a sequence interaction for controlling the first earphone and the second earphone to enter a common use state in an embodiment. As shown in FIG. 8 , the earphone device may include an earphone A, an earphone B, and an earphone box. No Bluetooth connection is established between the earphone A and the earphone B, and they are used separately. The earphone B establishes a bluetooth connection with the electronic device F, and sends the second specific information to the electronic device F. When the user needs to switch the earphone A and the earphone B from the independent use state to the common use state, the earphone A can be placed in the earphone box, and corresponding control operations are performed on the earphone box. When the earphone box detects the control operation, it can send a target instruction (such as the above-mentioned third control instruction) to the earphone A. The earphone A responds to the target instruction and sends a broadcast signal, which may carry the first specific information and the Bluetooth address of the earphone A. After receiving the broadcast signal, the electronic device F can analyze the broadcast signal to obtain the first specific information and the Bluetooth address of the earphone A. The electronic device F can compare the first specific information with the second specific information sent by the earphone B, and when it is determined that the first specific information is the same as the second specific information, send a connection instruction to the earphone B, and the connection instruction Contains the Bluetooth address of headset A. After receiving the connection instruction, the headset B can send a Bluetooth connection request to the headset A based on the Bluetooth address of the headset A included in the connection command, and establish a Bluetooth connection with the headset A. After earphone A and earphone B establish a Bluetooth connection, earphone A and earphone B can share the same bluetooth address, realize data synchronization, and jointly play audio data transmitted by the same electronic device.
在另一些实施例中,在第一耳机与第二耳机未建立蓝牙连接的情况下,由第一耳机发送广播信号,该广播信号用于触发接收到广播信号的第二耳机与第一耳机建立蓝牙连接,并与第一耳机共享同一蓝牙地址。In other embodiments, when the first earphone has not established a Bluetooth connection with the second earphone, the first earphone sends a broadcast signal, and the broadcast signal is used to trigger the second earphone that receives the broadcast signal to establish a bluetooth connection with the first earphone. Bluetooth connection, and share the same Bluetooth address with the first headset.
可选地,广播信号可包括第一特定信息及第一耳机对应的蓝牙地址,该广播信号可用于触发接收到广播信号的第二耳机在确定第一特定信息与第二耳机中存储的第二特定信息相同时,根据蓝牙地址向第一耳机发送蓝牙连接请求,以使第一耳机响应蓝牙连接请求,与第二耳机建立蓝牙连接。Optionally, the broadcast signal may include the first specific information and the Bluetooth address corresponding to the first earphone, and the broadcast signal may be used to trigger the second earphone receiving the broadcast signal to determine the first specific information and the second earphone stored in the second earphone. When the specific information is the same, a Bluetooth connection request is sent to the first earphone according to the Bluetooth address, so that the first earphone responds to the Bluetooth connection request and establishes a Bluetooth connection with the second earphone.
若第二耳机接收到第一耳机发送的广播信号,可对该广播信号进行解析,得到第一特定信息及第一耳机的蓝牙地址。第二耳机可将解析得到的第一特定信息与存储的第二特定信息进行比对,判断二者是否相同。若该第一特定信息与该第二特征信息相同,则第二耳机可根据第一耳机的蓝牙地址向第一耳机发送蓝牙连接请求,从而与第一耳机建立蓝牙连接,并在与第一耳机建立蓝牙连接后,与第一耳机共享同一蓝牙地址。If the second earphone receives the broadcast signal sent by the first earphone, it can analyze the broadcast signal to obtain the first specific information and the Bluetooth address of the first earphone. The second earphone can compare the analyzed first specific information with the stored second specific information to determine whether the two are the same. If the first specific information is the same as the second feature information, then the second earphone can send a Bluetooth connection request to the first earphone according to the Bluetooth address of the first earphone, thereby establishing a Bluetooth connection with the first earphone, and communicating with the first earphone After the Bluetooth connection is established, share the same Bluetooth address with the first headset.
在本申请实施例中,用户将耳机设备中的一只耳机的放置到耳机盒中即可实现耳机设备从两只耳机分别单独使用的状态切换为两只耳机共同使用的状态,相较于相关技术中需要将两只耳机都放置到耳机盒,并对耳机盒进行相应操作才能实现状态切换的方式,更为简便快捷,提高了切换效率,且不会影响用户对第二耳机的正常使用。In the embodiment of the present application, the user can switch the earphone device from the state where the two earphones are used separately to the state where the two earphones are used together by placing one earphone in the earphone box. In the technology, it is necessary to place both earphones in the earphone box and perform corresponding operations on the earphone box to realize the state switching method, which is simpler and faster, improves the switching efficiency, and will not affect the normal use of the second earphone by the user.
如图9所示,在一个实施例中,提供另一种耳机设备的状态控制方法,可应用于上述的耳机设备,该耳机设备可包括第一耳机、第二耳机及耳机盒,该方法可包括以下步骤:As shown in FIG. 9, in one embodiment, another earphone device state control method is provided, which can be applied to the above-mentioned earphone device. The earphone device can include a first earphone, a second earphone, and an earphone box. The method can be Include the following steps:
步骤910,在仅第一耳机被放置在耳机盒的情况下,由第一耳机接收耳机盒发送的目标指令。 Step 910, when only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box.
在一个实施例中,步骤910,包括:在仅第一耳机被放置在耳机盒的情况下,若耳机盒检测到控制操作,则耳机盒根据控制操作的操作信息,向第一耳机发送与该操作信息对应的目标指令,以使第一耳机接收到目标指令。In one embodiment, step 910 includes: when only the first earphone is placed in the earphone box, if the earphone box detects a control operation, then the earphone box sends the first earphone to the first earphone according to the operation information of the control operation. Operating the target instruction corresponding to the information, so that the first earphone receives the target instruction.
在一个实施例中,操作信息包括控制操作对应的操作时长、操作组件标识、操作方向及操作力度中的一种或多种。In one embodiment, the operation information includes one or more of the operation duration corresponding to the control operation, the identification of the operation component, the direction of the operation, and the force of the operation.
步骤920,第一耳机根据该目标指令,控制第一耳机和第二耳机进入单独使用状态或共同使用状态,其中,单独使用状态指的是第一耳机及第二耳机被配置为不同的蓝牙地址的状态,共同使用状态指的是第一耳机及第二耳机共享同一蓝牙地址的状态。 Step 920, according to the target instruction, the first earphone controls the first earphone and the second earphone to enter the independent use state or the common use state, wherein the independent use state means that the first earphone and the second earphone are configured with different Bluetooth addresses The common use state refers to the state where the first earphone and the second earphone share the same bluetooth address.
在一个实施例中,步骤耳机盒根据控制操作的操作信息,向第一耳机发送与操作信息对应的目标指令,包括:若耳机盒确定操作信息满足第二操作条件,则向第一耳机发送第二控制指令;若耳机盒确定操作信息满足第三操作条件,则向第一耳机发送第三控制指令,第三操作条件与第二操作条件不同。In one embodiment, the step of the earphone box sending the target instruction corresponding to the operation information to the first earphone according to the operation information of the control operation includes: if the earphone box determines that the operation information satisfies the second operation condition, then sending the first earphone to the first earphone Two control instructions; if the earphone box determines that the operation information satisfies the third operation condition, then send the third control instruction to the first earphone, and the third operation condition is different from the second operation condition.
步骤920,包括:若第一耳机接收到第二控制指令,则控制第一耳机和/或第二耳机更改配置的蓝牙地址,以使第一耳机及第二耳机从共同使用状态切换为单独使用状态;若第一耳机接收到第三控制指令,则控制第一耳机和/或第二耳机更改配置的蓝牙地址,以使第一耳机及第二耳机从单独使用状态切换为共同使用状态。 Step 920, including: if the first earphone receives the second control command, then controlling the first earphone and/or the second earphone to change the configured Bluetooth address, so that the first earphone and the second earphone can be switched from the common use state to the independent use state; if the first earphone receives the third control instruction, then control the first earphone and/or the second earphone to change the configured bluetooth address, so that the first earphone and the second earphone are switched from the single use state to the common use state.
在一个实施例中,步骤920,包括:若耳机设备当前处于共同使用状态,则第一耳机根据目标指令,控制第一耳机和第二耳机进入单独使用状态;若耳机设备当前处于单独使用状态,则第一耳机根据目标指令,控制第一耳机和第二耳机进入共同使用状态。In one embodiment, step 920 includes: if the earphone device is currently in the common use state, the first earphone controls the first earphone and the second earphone to enter the independent use state according to the target instruction; if the earphone device is currently in the independent use state, Then the first earphone controls the first earphone and the second earphone to enter a common use state according to the target instruction.
在一个实施例中,控制第一耳机和第二耳机进入单独使用状态,包括:控制第一耳机和/或第二耳机更改配置的蓝牙地址,以使第一耳机及第二耳机分别对应不同的蓝牙地址。在一个实施例中,该方法还包括:断开第一耳机与第二耳机之间的蓝牙连接。In one embodiment, controlling the first earphone and the second earphone to enter the independent use state includes: controlling the first earphone and/or the second earphone to change the configured Bluetooth address, so that the first earphone and the second earphone correspond to different Bluetooth address. In one embodiment, the method further includes: disconnecting the Bluetooth connection between the first earphone and the second earphone.
在一个实施例中,控制第一耳机和第二耳机进入共同使用状态,包括:在第一耳机与第二耳机未建立蓝牙连接的情况下,由第一耳机发送广播信号,该广播信号用于触发接收到广播信号的第二耳机与第一耳机建立蓝牙连接,并与第一耳机共享同一蓝牙地址。In one embodiment, controlling the first earphone and the second earphone to enter the common use state includes: when the first earphone and the second earphone have not established a Bluetooth connection, the first earphone sends a broadcast signal, and the broadcast signal is used for The second earphone that receives the broadcast signal is triggered to establish a bluetooth connection with the first earphone, and shares the same bluetooth address with the first earphone.
在一个实施例中,控制第一耳机和第二耳机进入共同使用状态,包括:在第一耳机与第二耳机未建立蓝牙连接,且第二耳机与第四电子设备建立蓝牙连接的情况下,由第一耳机发送广播信号,该广播信号用于触发接收到广播信号的第四电子设备向第二耳机发送连接指令,以使第二耳机根据连接指令与第一耳机建立蓝牙连接,并与第一耳机共享同一蓝牙地址。In one embodiment, controlling the first earphone and the second earphone to enter the common use state includes: when the first earphone has not established a Bluetooth connection with the second earphone, and the second earphone has established a Bluetooth connection with the fourth electronic device, A broadcast signal is sent by the first earphone, and the broadcast signal is used to trigger the fourth electronic device that receives the broadcast signal to send a connection instruction to the second earphone, so that the second earphone establishes a Bluetooth connection with the first earphone according to the connection instruction, and connects with the second earphone. One headset shares the same bluetooth address.
需要说明的是,本申请实施例提供的耳机设备的状态控制方法的描述,可参考上述各实施例中的相关描述,在此不再重复赘述。It should be noted that, for the description of the method for controlling the state of the earphone device provided in the embodiment of the present application, reference may be made to the relevant descriptions in the foregoing embodiments, and details are not repeated here.
在本申请实施例中,用户将耳机设备中的一只耳机的放置到耳机盒中即可实现第一耳机及第二耳机切换至单独使用状态或共同使用状态,相较于相关技术中需要将两只耳机都放置到耳机盒,并对耳机盒进行相应操作才能实现状态切换的方式,更为简便快捷,提高了切换效率,且不会影响用户对第二耳机的正常使用。In the embodiment of the present application, the user can switch the first earphone and the second earphone to the single use state or the common use state by placing one earphone in the earphone device into the earphone box. Both earphones are placed in the earphone box, and the state switching can be realized by performing corresponding operations on the earphone box, which is simpler and faster, improves the switching efficiency, and will not affect the normal use of the second earphone by the user.
如图10所示,在一个实施例中,提供一种耳机设备的状态控制装置1000,该耳机设备包括第一耳机、第二耳机及耳机盒。耳机设备的状态控制装置1000可包括指令接收模块1010及状态控制模块1020。As shown in FIG. 10 , in one embodiment, an apparatus 1000 for controlling the state of an earphone device is provided. The earphone device includes a first earphone, a second earphone, and an earphone box. The state control device 1000 of the earphone device may include an instruction receiving module 1010 and a state control module 1020 .
指令接收模块1010,用于在仅第一耳机被放置在耳机盒的情况下,由第一耳机接收耳机盒发送的目标指令。The instruction receiving module 1010 is configured to receive the target instruction sent by the earphone box by the first earphone when only the first earphone is placed in the earphone box.
状态控制模块1020,用于由第一耳机根据目标指令,控制第一耳机和/或第二耳机进入目标指令所指定的工作状态。The state control module 1020 is used for the first earphone to control the first earphone and/or the second earphone to enter the working state specified by the target instruction according to the target instruction.
其中,工作状态包括配对状态;配对状态指的是第一耳机和/或第二耳机能够被其它电子设备发现的状态。Wherein, the working state includes a pairing state; the pairing state refers to a state in which the first earphone and/or the second earphone can be discovered by other electronic devices.
在一个实施例中,耳机设备的状态控制装置1000,除了包括指令接收模块1010及状态控制模块1020,还包括指令发送模块。In one embodiment, the state control apparatus 1000 of the earphone device includes not only the command receiving module 1010 and the state control module 1020 , but also a command sending module.
指令发送模块,用于在仅第一耳机被放置在耳机盒的情况下,若耳机盒检测到控制操作,则由耳机盒根据控制操作的操作信息,向第一耳机发送与操作信息对应的目标指令,以使第一耳机接收到目标指令。The instruction sending module is used to send the target corresponding to the operation information to the first earphone according to the operation information of the control operation if the earphone box detects the control operation when only the first earphone is placed in the earphone box. command, so that the first earphone receives the target command.
在一个实施例中,操作信息包括控制操作对应的操作时长、操作组件标识、操作方向及操作力度中的一种或多种。In one embodiment, the operation information includes one or more of the operation duration corresponding to the control operation, the identification of the operation component, the direction of the operation, and the force of the operation.
在一个实施例中,指令发送模块,还用于若耳机盒确定操作信息满足第一操作条件,则向第一耳机发送第一控制指令。状态控制模块1020,还用于由第一耳机根据第一控制指令,控制第一耳机和/或第二耳机进入配对状态。In one embodiment, the instruction sending module is further configured to send the first control instruction to the first earphone if the earphone box determines that the operation information satisfies the first operation condition. The state control module 1020 is further configured to control the first earphone and/or the second earphone to enter the pairing state by the first earphone according to the first control instruction.
在一个实施例中,工作状态还包括单独使用状态和/或共同使用状态,其中,单独使用状态指的是第一耳机及第二耳机被配置为不同的蓝牙地址的状态,共同使用状态指的是第一耳机及第二耳机共享同一蓝牙地址的状态。In one embodiment, the working state also includes a single use state and/or a common use state, wherein the single use state refers to a state in which the first earphone and the second earphone are configured with different Bluetooth addresses, and the common use state refers to It is a state where the first earphone and the second earphone share the same bluetooth address.
指令发送模块,还用于若耳机盒确定操作信息满足第二操作条件,则向第一耳机发送第二控制指令,第二操作条件与第一操作条件不同;和/或,若耳机盒确定操作信息满足第三操作条件,则向第一耳机发送第三控制指令,第三操作条件与第一操作条件不同。The instruction sending module is also used to send a second control instruction to the first earphone if the earphone box determines that the operation information satisfies the second operating condition, and the second operating condition is different from the first operating condition; and/or, if the earphone box determines that the operation If the information satisfies the third operating condition, a third control instruction is sent to the first earphone, and the third operating condition is different from the first operating condition.
状态控制模块1020,还用于若第一耳机接收到第二控制指令,则控制第一耳机和/或第二耳机更改配置的蓝牙地址,以使第一耳机及第二耳机从共同使用状态切换为单独使用状态;和/或,还用于若第一耳机接收到第三控制指令,则控制第一耳机和/或第二耳机更改配置的蓝牙地址,以使第一耳机及第二耳机从单独使用状态切换为共同使用状态。The state control module 1020 is also used to control the first earphone and/or the second earphone to change the configured bluetooth address if the first earphone receives the second control command, so that the first earphone and the second earphone are switched from the common use state and/or, if the first earphone receives the third control command, then control the first earphone and/or the second earphone to change the bluetooth address of the configuration, so that the first earphone and the second earphone The state of single use is switched to the state of joint use.
在本申请实施例中,用户只需要将耳机设备中的一只耳机放置到耳机盒中,并对耳机盒进行相应的控制操作,即可触发耳机设备中的第一耳机和/或第二耳机进入通信中指定的工作状态,简化了控制 耳机设备进入通信中指定的工作状态的方式,控制更为灵活、便捷,且不会影响到用户对耳机设备的正常使用。In this embodiment of the application, the user only needs to place one earphone in the earphone device into the earphone box, and perform corresponding control operations on the earphone box to trigger the first earphone and/or the second earphone in the earphone device Entering the working state specified in the communication simplifies the way of controlling the earphone device to enter the working state specified in the communication, the control is more flexible and convenient, and will not affect the normal use of the earphone device by the user.
在一个实施例中,耳机设备的状态控制装置1000,除了包括指令接收模块1010、状态控制模块1020、指令发送模块,还包括扫描响应模块及连接模块。In one embodiment, the state control apparatus 1000 of the earphone device includes not only the command receiving module 1010, the state control module 1020, and the command sending module, but also a scan response module and a connection module.
扫描响应模块,用于在第一耳机和/或第二耳机处于配对状态时,由第一耳机和/或第二耳机接收第一电子设备发送的扫描请求,并根据扫描请求向第一电子设备发送扫描响应。The scanning response module is used to receive the scanning request sent by the first electronic device by the first earphone and/or the second earphone when the first earphone and/or the second earphone are in the pairing state, and send the scanning request to the first electronic device according to the scanning request. Send scan response.
连接模块,用于在耳机设备与N个第二电子设备建立蓝牙连接的情况下,由第一耳机和/或第二耳机接收第一电子设备发送的第一连接请求;其中,N为耳机设备支持同时保持蓝牙连接的最大数量,N为大于或等于1的整数;以及用于通过第二耳机进行与N个第二电子设备中的目标电子设备对应的断连处理,并通过第一耳机对第一连接请求进行处理,与第一电子设备建立蓝牙连接;或,通过第一耳机进行与N个第二电子设备中的目标电子设备对应的断连处理,并通过第二耳机对第一连接请求进行处理,与第一电子设备建立蓝牙连接。A connection module, configured to receive the first connection request sent by the first electronic device by the first earphone and/or the second earphone when the earphone device establishes a Bluetooth connection with N second electronic devices; wherein, N is the earphone device Supporting the maximum number of Bluetooth connections maintained simultaneously, N is an integer greater than or equal to 1; and used to perform disconnection processing corresponding to the target electronic device in the N second electronic devices through the second earphone, and through the first earphone pair The first connection request is processed, and a Bluetooth connection is established with the first electronic device; or, the first earphone is used to perform disconnection processing corresponding to the target electronic device among the N second electronic devices, and the first connection is made through the second earphone. The request is processed, and a Bluetooth connection is established with the first electronic device.
在一个实施例中,连接模块,还用于由第一耳机或第二耳机根据各个第二电子设备的优先级,从N个第二电子设备中选择优先级满足优先级条件的第二电子设备作为目标电子设备。In one embodiment, the connection module is also used for the first earphone or the second earphone to select the second electronic device whose priority meets the priority condition from the N second electronic devices according to the priority of each second electronic device as the target electronic device.
在本申请实施例中,在耳机设备出现第一电子设备抢占蓝牙连接的情况时,分别通过第一耳机及第二耳机并行进行断连操作以及连接操作,能够提高第一电子设备对耳机设备的抢连速度,提高抢连效率。且在断连操作及连接操作完成后,第一耳机与第二耳机进行信息同步,可更加方便对所有建立蓝牙连接的进行管理,保证数据传输效率。In the embodiment of the present application, when the first electronic device preempts the Bluetooth connection in the earphone device, the disconnection operation and the connection operation are performed in parallel through the first earphone and the second earphone respectively, which can improve the interaction between the first electronic device and the earphone device. Increase the speed of robbing and improve the efficiency of robbing. And after the disconnection operation and connection operation are completed, the first earphone and the second earphone perform information synchronization, which can more conveniently manage all established Bluetooth connections and ensure data transmission efficiency.
在一个实施例中,耳机设备支持同时保持的蓝牙连接的最大数量N为大于或等于2的整数。In one embodiment, the maximum number N of Bluetooth connections supported by the headset device is an integer greater than or equal to 2.
扫描响应模块,还用于在第一耳机和/或第二耳机处于配对状态时,由第一耳机和/或第二耳机接收第一电子设备发送的扫描请求,并根据扫描请求向第一电子设备发送扫描响应,以及由第一耳机和/或第二耳机接收第三电子设备发送的扫描请求,并根据扫描请求向第三电子设备发送扫描响应。The scan response module is also used to receive the scan request sent by the first electronic device by the first earphone and/or the second earphone when the first earphone and/or the second earphone are in the pairing state, and send a request to the first electronic device according to the scan request. The device sends a scan response, and the first earphone and/or the second earphone receives a scan request sent by the third electronic device, and sends a scan response to the third electronic device according to the scan request.
连接模块,还用于若在第一时间段内接收到第一电子设备发送的第一连接请求及第三电子设备发送的第二连接请求,则通过第一耳机对第一连接请求进行处理,与第一电子设备建立蓝牙连接,以及通过第二耳机对第二连接请求进行处理,与第三电子设备建立蓝牙连接。The connection module is further configured to process the first connection request through the first earphone if the first connection request sent by the first electronic device and the second connection request sent by the third electronic device are received within the first time period, Establishing a Bluetooth connection with the first electronic device, processing the second connection request through the second earphone, and establishing a Bluetooth connection with the third electronic device.
在一个实施例中,上述的耳机设备的状态控制装置1000,还包括同步模块。In one embodiment, the above-mentioned apparatus 1000 for controlling the state of an earphone device further includes a synchronization module.
同步模块,用于通过第一耳机向第二耳机同步第一电子设备的连接信息,以使第一电子设备的蓝牙连接对象从第一耳机切换至第二耳机,且第一耳机对第二耳机与第一电子设备之间的蓝牙连接进行监听;或,用于通过第一耳机向第二耳机同步第一电子设备的连接信息,以使第一电子设备的蓝牙连接对象从第一耳机切换至第二耳机,且第二耳机将与第一电子设备之间传输的数据同步给第一耳机。The synchronization module is used to synchronize the connection information of the first electronic device to the second earphone through the first earphone, so that the Bluetooth connection object of the first electronic device is switched from the first earphone to the second earphone, and the first earphone is connected to the second earphone. Monitor the Bluetooth connection with the first electronic device; or, use the first earphone to synchronize the connection information of the first electronic device to the second earphone, so that the Bluetooth connection object of the first electronic device is switched from the first earphone to the second earphone The second earphone, and the second earphone synchronizes the data transmitted with the first electronic device to the first earphone.
在本申请实施例中,可通过耳机设备的第一耳机及第二耳机分别与第一电子设备及第三电子设备建立蓝牙连接,第一耳机及第二耳机并行进行连接操作,无需等待耳机设备完成与其中一电子设备的蓝牙连接过程后才能够与另一电子设备建立蓝牙连接,能够提高耳机设备与两个电子设备建立蓝牙连接的速度,提高连接效率。且第一耳机与第二耳机进行信息同步,使得第一电子设备的蓝牙连接对象从第一耳机切换至第二耳机,可更加方便对所有建立蓝牙连接的进行管理,保证数据传输效率。In this embodiment of the application, Bluetooth connections can be established with the first electronic device and the third electronic device through the first earphone and the second earphone of the earphone device, and the first earphone and the second earphone can be connected in parallel without waiting for the earphone device Only after completing the Bluetooth connection process with one of the electronic devices can the Bluetooth connection be established with the other electronic device, which can increase the speed of establishing the Bluetooth connection between the earphone device and the two electronic devices, and improve the connection efficiency. And the information synchronization between the first earphone and the second earphone makes the Bluetooth connection object of the first electronic device switch from the first earphone to the second earphone, which can more conveniently manage all established Bluetooth connections and ensure data transmission efficiency.
在一个实施例中,工作状态包括共同使用状态。状态控制模块1020,还用于在第一耳机与第二耳机未建立蓝牙连接的情况下,由第一耳机发送广播信号,该广播信号用于触发接收到广播信号的第二耳机与第一耳机建立蓝牙连接,并与第一耳机共享同一蓝牙地址。In one embodiment, the working state includes a common use state. The state control module 1020 is further configured to send a broadcast signal by the first earphone when no Bluetooth connection is established between the first earphone and the second earphone, and the broadcast signal is used to trigger the second earphone and the first earphone that receive the broadcast signal Establish a Bluetooth connection and share the same Bluetooth address with the first headset.
在一个实施例中,工作状态包括共同使用蓝牙地址。状态控制模块1020,还用于在第一耳机与第二耳机未建立蓝牙连接的情况下,且第二耳机与第四电子设备建立蓝牙连接的情况下,由第一耳机发送广播信号,该广播信号用于触发接收到广播信号的第四电子设备向第二耳机发送连接指令,以使第二耳机根据连接指令与第一耳机建立蓝牙连接,并与第一耳机共享同一蓝牙地址。In one embodiment, the working state includes common use of a Bluetooth address. The state control module 1020 is further configured to send a broadcast signal by the first earphone when the Bluetooth connection between the first earphone and the second earphone is not established, and the second earphone establishes a Bluetooth connection with the fourth electronic device. The signal is used to trigger the fourth electronic device receiving the broadcast signal to send a connection instruction to the second earphone, so that the second earphone establishes a Bluetooth connection with the first earphone according to the connection instruction, and shares the same Bluetooth address with the first earphone.
在一个实施例中,广播信号包括第一特定信息,该广播信号还用于触发接收到广播信号的第四电子设备在确定第一特定信息与第二特定信息相同时,向第二耳机发送连接指令,以使第二耳机根据连接指令与第一耳机建立蓝牙连接,并共享同一蓝牙地址;其中,第二特定信息为第二耳机在与第四电子设备建立蓝牙连接后,向第四电子设备发送的;或,广播信号还用于触发接收到广播信号的第四电子设备将第一特定信息及连接指令发送给第二耳机,以使第二耳机在确定第一特定信息与存储的第二特定信息相同时,根据连接指令与第一耳机建立蓝牙连接,并与第一耳机共享同一蓝牙地址。In one embodiment, the broadcast signal includes the first specific information, and the broadcast signal is also used to trigger the fourth electronic device that receives the broadcast signal to send a connection to the second earphone when it determines that the first specific information is the same as the second specific information. instructions, so that the second earphone establishes a bluetooth connection with the first earphone according to the connection instruction, and shares the same bluetooth address; wherein, the second specific information is that the second earphone sends a message to the fourth electronic device after establishing a bluetooth connection with the fourth electronic device. or, the broadcast signal is also used to trigger the fourth electronic device receiving the broadcast signal to send the first specific information and the connection instruction to the second earphone, so that the second earphone determines the first specific information and the stored second When the specific information is the same, establish a bluetooth connection with the first earphone according to the connection instruction, and share the same bluetooth address with the first earphone.
在本申请实施例中,用户将耳机设备中的一只耳机的放置到耳机盒中即可实现耳机设备从两只耳机分别单独使用的状态切换为两只耳机共同使用的状态,相较于相关技术中需要将两只耳机都放置到 耳机盒,并对耳机盒进行相应操作才能实现状态切换的方式,更为简便快捷,提高了切换效率,且不会影响用户对第二耳机的正常使用。In the embodiment of the present application, the user can switch the earphone device from the state where the two earphones are used separately to the state where the two earphones are used together by placing one earphone in the earphone box. In the technology, it is necessary to place both earphones in the earphone box and perform corresponding operations on the earphone box to realize the state switching method, which is simpler and faster, improves the switching efficiency, and will not affect the normal use of the second earphone by the user.
如图11所示,在另一个实施例中,提供一种耳机设备的状态控制装置1100,该耳机设备包括第一耳机、第二耳机及耳机盒。耳机设备的状态控制装置1100包括指令接收模块1110及状态控制模块1120。As shown in FIG. 11 , in another embodiment, an apparatus 1100 for controlling the state of an earphone device is provided. The earphone device includes a first earphone, a second earphone, and an earphone box. The state control device 1100 of the earphone device includes an instruction receiving module 1110 and a state control module 1120 .
指令接收模块1110,用于在第一耳机被放置在耳机盒的情况下,由第一耳机接收耳机盒发送的目标指令。The instruction receiving module 1110 is configured to receive the target instruction sent by the earphone box by the first earphone when the first earphone is placed in the earphone box.
状态控制模块1120,用于由第一耳机根据该目标指令,控制第一耳机和第二耳机进入单独使用状态或共同使用状态,其中,单独使用状态指的是第一耳机及第二耳机被配置为不同的蓝牙地址的状态,共同使用状态指的是第一耳机及第二耳机共享同一蓝牙地址的状态。The state control module 1120 is configured to control the first earphone and the second earphone to enter a state of single use or a state of joint use by the first earphone according to the target instruction, wherein the state of single use means that the first earphone and the second earphone are configured are states of different bluetooth addresses, and the common use state refers to a state in which the first earphone and the second earphone share the same bluetooth address.
在一个实施例中,状态控制模块1120,还用于控制第一耳机和/或第二耳机更改配置的蓝牙地址,以使第一耳机及第二耳机分别对应不同的蓝牙地址。在一个实施例中,状态控制模块1120,还用于断开第一耳机与第二耳机之间的蓝牙连接。In one embodiment, the state control module 1120 is further configured to control the first earphone and/or the second earphone to change the configured Bluetooth address, so that the first earphone and the second earphone correspond to different Bluetooth addresses respectively. In one embodiment, the state control module 1120 is further configured to disconnect the Bluetooth connection between the first earphone and the second earphone.
在一个实施例中,状态控制模块1120,还用于在第一耳机与第二耳机未建立蓝牙连接的情况下,由第一耳机发送广播信号,该广播信号用于触发接收到广播信号的第二耳机与第一耳机建立蓝牙连接,并与第一耳机共享同一蓝牙地址。In one embodiment, the state control module 1120 is further configured to send a broadcast signal by the first earphone when no Bluetooth connection is established between the first earphone and the second earphone, and the broadcast signal is used to trigger the first earphone receiving the broadcast signal. The second earphone establishes a bluetooth connection with the first earphone, and shares the same bluetooth address with the first earphone.
在一个实施例中,状态控制模块1120,还用于在第一耳机与第二耳机未建立蓝牙连接,且第二耳机与第四电子设备建立蓝牙连接的情况下,由第一耳机发送广播信号,该广播信号用于触发接收到广播信号的第四电子设备向第二耳机发送连接指令,以使第二耳机根据连接指令与第一耳机建立蓝牙连接,并与第一耳机共享同一蓝牙地址。In one embodiment, the state control module 1120 is further configured to send a broadcast signal by the first earphone when the first earphone has not established a Bluetooth connection with the second earphone, and the second earphone has established a Bluetooth connection with the fourth electronic device , the broadcast signal is used to trigger the fourth electronic device receiving the broadcast signal to send a connection instruction to the second earphone, so that the second earphone establishes a Bluetooth connection with the first earphone according to the connection instruction, and shares the same Bluetooth address with the first earphone.
在一个实施例中,耳机设备的状态控制装置1100除了包括指令接收模块1110及状态控制模块1120,还包括指令发送模块。In one embodiment, the state control apparatus 1100 of the earphone device not only includes the command receiving module 1110 and the state control module 1120 , but also includes a command sending module.
指令发送模块,用于在仅第一耳机被放置在耳机盒的情况下,若耳机盒检测到控制操作,则耳机盒根据控制操作的操作信息,向第一耳机发送与操作信息对应的目标指令,以使第一耳机接收到目标指令。The instruction sending module is used to send the target instruction corresponding to the operation information to the first earphone according to the operation information of the control operation if the earphone box detects the control operation when only the first earphone is placed in the earphone box , so that the first earphone receives the target instruction.
在一个实施例中,操作信息包括控制操作对应的操作时长、操作组件标识、操作方向及操作力度中的一种或多种。In one embodiment, the operation information includes one or more of the operation duration corresponding to the control operation, the identification of the operation component, the direction of the operation, and the force of the operation.
在一个实施例中,指令发送模块,还用于若耳机盒确定操作信息满足第二操作条件,则向第一耳机发送第二控制指令;以及若耳机盒确定操作信息满足第三操作条件,则向第一耳机发送第三控制指令,第三操作条件与第二操作条件不同。In one embodiment, the instruction sending module is further configured to send the second control instruction to the first earphone if the earphone box determines that the operation information satisfies the second operation condition; and if the earphone box determines that the operation information satisfies the third operation condition, then A third control instruction is sent to the first earphone, and the third operating condition is different from the second operating condition.
状态控制模块1120,还用于若第一耳机接收到第二控制指令,则控制第一耳机和/或第二耳机更改配置的蓝牙地址,以使第一耳机及第二耳机从共同使用状态切换为单独使用状态;若第一耳机接收到第三控制指令,则控制第一耳机和/或第二耳机更改配置的蓝牙地址,以使第一耳机及第二耳机从单独使用状态切换为共同使用状态。The state control module 1120 is also used to control the first earphone and/or the second earphone to change the configured bluetooth address if the first earphone receives the second control command, so that the first earphone and the second earphone are switched from the common use state It is in the state of independent use; if the first earphone receives the third control command, then control the first earphone and/or the second earphone to change the configured Bluetooth address, so that the first earphone and the second earphone can be switched from the state of sole use to common use state.
在一个实施例中,状态控制模块1120,还用于若耳机设备当前处于共同使用状态,则第一耳机根据目标指令,控制第一耳机和第二耳机进入单独使用状态;若耳机设备当前处于单独使用状态,则第一耳机根据目标指令,控制第一耳机和第二耳机进入共同使用状态。In one embodiment, the state control module 1120 is also used to control the first earphone and the second earphone to enter the independent use state according to the target instruction if the earphone device is currently in the common use state; In the use state, the first earphone controls the first earphone and the second earphone to enter the common use state according to the target instruction.
在本申请实施例中,用户将耳机设备中的一只耳机的放置到耳机盒中即可实现第一耳机及第二耳机切换至单独使用状态或共同使用状态,相较于相关技术中需要将两只耳机都放置到耳机盒,并对耳机盒进行相应操作才能实现状态切换的方式,更为简便快捷,提高了切换效率,且不会影响用户对第二耳机的正常使用。In the embodiment of the present application, the user can switch the first earphone and the second earphone to the single use state or the common use state by placing one earphone in the earphone device into the earphone box. Both earphones are placed in the earphone box, and the state switching can be realized by performing corresponding operations on the earphone box, which is simpler and faster, improves the switching efficiency, and will not affect the normal use of the second earphone by the user.
图12为一个实施例中耳机设备的结构框图。如图12所示,耳机设备1200可以包括一个或多个如下部件:处理器1210、与处理器1210耦合的存储器1220,其中存储器1220可存储有一个或多个计算机程序,一个或多个计算机程序可以被配置为由一个或多个处理器1210执行时实现如上述各实施例描述的方法。Fig. 12 is a structural block diagram of an earphone device in one embodiment. As shown in Figure 12, the earphone device 1200 may include one or more of the following components: a processor 1210, a memory 1220 coupled to the processor 1210, wherein the memory 1220 may store one or more computer programs, one or more computer programs It may be configured to implement the methods described in the foregoing embodiments when executed by one or more processors 1210 .
处理器1210可以包括一个或者多个处理核。处理器1210利用各种接口和线路连接整个耳机设备1200内的各个部分,通过运行或执行存储在存储器1220内的指令、程序、代码集或指令集,以及调用存储在存储器1220内的数据,执行耳机设备1200的各种功能和处理数据。可选地,处理器1210可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。 处理器1210可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器1210中,单独通过一块通信芯片进行实现。 Processor 1210 may include one or more processing cores. The processor 1210 uses various interfaces and lines to connect various parts in the entire earphone device 1200, and executes or executes instructions, programs, code sets or instruction sets stored in the memory 1220, and calls data stored in the memory 1220 to execute Various functions of the headphone device 1200 and processing data. Optionally, the processor 1210 may adopt at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). implemented in the form of hardware. The processor 1210 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a modem, and the like. Among them, the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used to render and draw the displayed content; the modem is used to handle wireless communication. It can be understood that the above modem may also not be integrated into the processor 1210, but implemented by a communication chip alone.
存储器1220可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。存储器1220可用于存储指令、程序、代码、代码集或指令集。存储器1220可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现上述各个方法实施例的指令等。存储数据区还可以存储耳机设备1200在使用中所创建的数据等。The memory 1220 may include a random access memory (Random Access Memory, RAM), and may also include a read-only memory (Read-Only Memory, ROM). The memory 1220 may be used to store instructions, programs, codes, sets of codes or sets of instructions. The memory 1220 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the foregoing method embodiments, and the like. The storage data area can also store data created by the headphone device 1200 during use, and the like.
耳机设备1200还可包括蓝牙模块,蓝牙模块可用于提供蓝牙通信功能,与其它电子设备建立蓝牙连接,并进行蓝牙数据传输。蓝牙模块可支持一种或多种蓝牙协议,如经典蓝牙、BLE等),但不限于此,可随着蓝牙协议的发展而变化。The earphone device 1200 may also include a Bluetooth module, and the Bluetooth module may be used to provide a Bluetooth communication function, establish a Bluetooth connection with other electronic devices, and perform Bluetooth data transmission. The bluetooth module can support one or more bluetooth protocols, such as classic bluetooth, BLE, etc.), but not limited thereto, and can change with the development of bluetooth protocols.
在一些实施例中,耳机设备包括第一耳机、第二耳机及耳机盒,第一耳机及第二耳机中均可至少包括上述的处理器1210、存储器1220及蓝牙模块。In some embodiments, the earphone device includes a first earphone, a second earphone, and an earphone box, and both the first earphone and the second earphone may include at least the above-mentioned processor 1210, memory 1220, and Bluetooth module.
可以理解地,耳机设备1200可包括比上述结构框图中更多或更少的结构元件,例如,包括电源模块、物理按键、传感器等,还可在此不进行限定。It can be understood that the earphone device 1200 may include more or less structural elements than those in the above structural block diagram, for example, including a power module, physical keys, sensors, etc., and it is not limited here.
本申请实施例公开一种计算机可读存储介质,其存储计算机程序,其中,该计算机程序被处理器执行时实现如上述各实施例描述的方法。The embodiment of the present application discloses a computer-readable storage medium, which stores a computer program, wherein when the computer program is executed by a processor, the methods described in the foregoing embodiments are implemented.
本申请实施例公开一种计算机程序产品,该计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,且该计算机程序可被处理器执行时实现如上述各实施例描述的方法。The embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be executed by a processor to implement the methods described in the foregoing embodiments.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、ROM等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be realized through computer programs to instruct related hardware, and the programs can be stored in a non-volatile computer-readable storage medium When the program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a ROM, or the like.
如此处所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括ROM、可编程ROM(Programmable ROM,PROM)、可擦除PROM(Erasable PROM,EPROM)、电可擦除PROM(Electrically Erasable PROM,EEPROM)或闪存。易失性存储器可包括随机存取存储器(random access memory,RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM可为多种形式,诸如静态RAM(Static RAM,SRAM)、动态RAM(Dynamic Random Access Memory,DRAM)、同步DRAM(synchronous DRAM,SDRAM)、双倍数据率SDRAM(Double Data Rate SDRAM,DDR SDRAM)、增强型SDRAM(Enhanced Synchronous DRAM,ESDRAM)、同步链路DRAM(Synchlink DRAM,SLDRAM)、存储器总线直接RAM(Rambus DRAM,RDRAM)及直接存储器总线动态RAM(Direct Rambus DRAM,DRDRAM)。Any reference to memory, storage, database or other medium as used herein may include non-volatile and/or volatile memory. Suitable non-volatile memory may include ROM, Programmable ROM (PROM), Erasable PROM (Erasable PROM, EPROM), Electrically Erasable PROM (Electrically Erasable PROM, EEPROM) or flash memory. Volatile memory can include random access memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM can take many forms, such as static RAM (Static RAM, SRAM), dynamic RAM (Dynamic Random Access Memory, DRAM), synchronous DRAM (synchronous DRAM, SDRAM), double data rate SDRAM (Double data rate Data Rate SDRAM, DDR SDRAM), enhanced SDRAM (Enhanced Synchronous DRAM, ESDRAM), synchronous link DRAM (Synchlink DRAM, SLDRAM), memory bus direct RAM (Rambus DRAM, RDRAM) and direct memory bus dynamic RAM (Direct Rambus DRAM) , DRDRAM).
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定特征、结构或特性可以以任意适合的方式结合在一个或多个实施例中。本领域技术人员也应该知悉,说明书中所描述的实施例均属于可选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be understood that reference throughout the specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the present application. Thus, appearances of "in one embodiment" or "in an embodiment" in various places throughout the specification are not necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.
在本申请的各种实施例中,应理解,上述各过程的序号的大小并不意味着执行顺序的必然先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。In various embodiments of the present application, it should be understood that the sequence numbers of the above-mentioned processes do not necessarily mean the order of execution. The implementation of the examples constitutes no limitation.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可位于一个地方,或者也可以分布到多个网络单元上。可根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, located in one place, or distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
以上对本申请实施例公开的一种耳机设备的状态控制方法、装置、耳机设备及存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The above is a detailed introduction to the state control method, device, earphone device and storage medium of a headphone device disclosed in the embodiment of the present application. In this paper, specific examples are used to illustrate the principle and implementation of the present application. The above embodiments The description is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, based on the idea of this application, there will be changes in the specific implementation and application scope. In summary, the content of this specification should not be construed as limiting the application.
Claims (25)
- 一种耳机设备的状态控制方法,其特征在于,所述耳机设备包括第一耳机、第二耳机和耳机盒,所述方法包括:A method for controlling the state of an earphone device, wherein the earphone device includes a first earphone, a second earphone, and an earphone box, and the method includes:在仅所述第一耳机被放置在耳机盒的情况下,由所述第一耳机接收所述耳机盒发送的目标指令;When only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box;所述第一耳机根据所述目标指令,控制所述第一耳机和/或所述第二耳机进入所述目标指令所指定的工作状态;The first earphone controls the first earphone and/or the second earphone to enter the working state specified by the target instruction according to the target instruction;其中,所述工作状态包括配对状态,所述配对状态指的是所述第一耳机和/或所述第二耳机能够被其它电子设备发现的状态。Wherein, the working state includes a pairing state, and the pairing state refers to a state in which the first earphone and/or the second earphone can be discovered by other electronic devices.
- 根据权利要求1所述的方法,其特征在于,所述在仅所述第一耳机被放置在耳机盒的情况下,由所述第一耳机接收所述耳机盒发送的目标指令,包括:The method according to claim 1, wherein when only the first earphone is placed in the earphone box, receiving the target instruction sent by the earphone box by the first earphone comprises:在仅所述第一耳机被放置在耳机盒的情况下,若所述耳机盒检测到控制操作,则所述耳机盒根据所述控制操作的操作信息,向所述第一耳机发送与所述操作信息对应的目标指令,以使所述第一耳机接收到所述目标指令。In the case where only the first earphone is placed in the earphone box, if the earphone box detects a control operation, the earphone box sends the first earphone to the first earphone according to the operation information of the control operation. Operating the target instruction corresponding to the information, so that the first earphone receives the target instruction.
- 根据权利要求2所述的方法,其特征在于,所述操作信息包括所述控制操作对应的操作时长、操作组件标识、操作方向及操作力度中的一种或多种。The method according to claim 2, wherein the operation information includes one or more of operation duration corresponding to the control operation, operation component identification, operation direction, and operation force.
- 根据权利要求2或3所述的方法,其特征在于,所述耳机盒根据所述控制操作的操作信息,向所述第一耳机发送与所述操作信息对应的目标指令,包括:The method according to claim 2 or 3, wherein the earphone box sends a target instruction corresponding to the operation information to the first earphone according to the operation information of the control operation, including:若所述耳机盒确定所述操作信息满足第一操作条件,则向所述第一耳机发送第一控制指令;If the earphone box determines that the operation information satisfies a first operation condition, then send a first control instruction to the first earphone;所述第一耳机根据所述目标指令,控制所述第一耳机和/或所述第二耳机进入所述目标指令所指定的工作状态,包括:The first earphone controls the first earphone and/or the second earphone to enter the working state specified by the target instruction according to the target instruction, including:所述第一耳机根据所述第一控制指令,控制所述第一耳机和/或所述第二耳机进入配对状态。The first earphone controls the first earphone and/or the second earphone to enter a pairing state according to the first control instruction.
- 根据权利要求4所述的方法,其特征在于,所述工作状态还包括单独使用状态和/或共同使用状态,其中,所述单独使用状态指的是所述第一耳机及第二耳机被配置为不同的蓝牙地址的状态,所述共同使用状态指的是所述第一耳机及第二耳机共享同一蓝牙地址的状态;The method according to claim 4, wherein the working state further includes a single use state and/or a common use state, wherein the single use state means that the first earphone and the second earphone are configured It is a state of different bluetooth addresses, and the common use state refers to a state in which the first earphone and the second earphone share the same bluetooth address;所述耳机盒根据所述控制操作的操作信息,向所述第一耳机发送与所述操作信息对应的目标指令,包括:The earphone box sends a target instruction corresponding to the operation information to the first earphone according to the operation information of the control operation, including:若所述耳机盒确定所述操作信息满足第二操作条件,则向所述第一耳机发送第二控制指令,所述第二操作条件与所述第一操作条件不同;和/或,若所述耳机盒确定所述操作信息满足第三操作条件,则向所述第一耳机发送第三控制指令,所述第三操作条件与所述第一操作条件不同;If the earphone box determines that the operation information satisfies a second operation condition, then send a second control instruction to the first earphone, where the second operation condition is different from the first operation condition; and/or, if the The earphone box determines that the operation information satisfies a third operation condition, then sends a third control instruction to the first earphone, and the third operation condition is different from the first operation condition;所述第一耳机根据所述目标指令,控制所述第一耳机和/或所述第二耳机进入所述目标指令所指定的工作状态,包括:The first earphone controls the first earphone and/or the second earphone to enter the working state specified by the target instruction according to the target instruction, including:若所述第一耳机接收到所述第二控制指令,则控制所述第一耳机和/或所述第二耳机更改配置的蓝牙地址,以使所述第一耳机及所述第二耳机从所述共同使用状态切换为所述单独使用状态;和/或,若所述第一耳机接收到所述第三控制指令,则控制所述第一耳机和/或所述第二耳机更改配置的蓝牙地址,以使所述第一耳机及所述第二耳机从所述单独使用状态切换为所述共同使用状态。If the first earphone receives the second control instruction, control the first earphone and/or the second earphone to change the configured Bluetooth address, so that the first earphone and the second earphone The common use state is switched to the single use state; and/or, if the first earphone receives the third control instruction, control the first earphone and/or the second earphone to change the configuration Bluetooth address, so that the first earphone and the second earphone are switched from the independent use state to the common use state.
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, further comprising:在所述第一耳机和/或所述第二耳机处于所述配对状态时,由所述第一耳机和/或第二耳机接收第一电子设备发送的扫描请求,并根据所述扫描请求向所述第一电子设备发送扫描响应;When the first earphone and/or the second earphone are in the pairing state, the first earphone and/or the second earphone receive the scan request sent by the first electronic device, and send the request to The first electronic device sends a scan response;在所述耳机设备与N个第二电子设备建立蓝牙连接的情况下,由所述第一耳机和/或第二耳机接收所述第一电子设备发送的第一连接请求;其中,所述N为所述耳机设备支持同时保持蓝牙连接的最大数量,所述N为大于或等于1的整数;When the headset device establishes Bluetooth connections with N second electronic devices, the first connection request sent by the first electronic device is received by the first headset and/or the second headset; wherein, the N The headset device supports the maximum number of simultaneous Bluetooth connections, and the N is an integer greater than or equal to 1;通过所述第二耳机进行与所述N个第二电子设备中的目标电子设备对应的断连处理,并通过所述第一耳机对所述第一连接请求进行处理,与所述第一电子设备建立蓝牙连接;或,通过所述第一耳机进行与所述N个第二电子设备中的目标电子设备对应的断连处理,并通过所述第二耳机对所述第一连接请求进行处理,与所述第一电子设备建立蓝牙连接。Perform disconnection processing corresponding to the target electronic device among the N second electronic devices through the second earphone, and process the first connection request through the first earphone, and communicate with the first electronic device The device establishes a Bluetooth connection; or, through the first earphone, perform disconnection processing corresponding to the target electronic device among the N second electronic devices, and process the first connection request through the second earphone , establishing a Bluetooth connection with the first electronic device.
- 根据权利要求6所述的方法,其特征在于,在所述通过所述第二耳机进行与所述N个第二电子设备中的目标电子设备对应的断连处理之前,所述方法还包括:The method according to claim 6, wherein before performing the disconnection process corresponding to the target electronic device among the N second electronic devices through the second earphone, the method further comprises:由所述第一耳机或第二耳机根据各个所述第二电子设备的优先级,从所述N个第二电子设备中选择优先级满足优先级条件的第二电子设备作为目标电子设备。The first earphone or the second earphone selects a second electronic device whose priority satisfies a priority condition from the N second electronic devices as the target electronic device according to the priority of each second electronic device.
- 根据权利要求1所述的方法,其特征在于,所述耳机设备支持同时保持的蓝牙连接的最大数量N为大于或等于2的整数;所述方法还包括:The method according to claim 1, wherein the maximum number N of Bluetooth connections supported by the headset device is an integer greater than or equal to 2; the method also includes:在所述第一耳机和/或所述第二耳机处于所述配对状态时,由所述第一耳机和/或第二耳机接收第一电子设备发送的扫描请求,并根据所述扫描请求向所述第一电子设备发送扫描响应,以及由所述第一耳机和/或第二耳机接收第三电子设备发送的扫描请求,并根据所述扫描请求向所述第三电子设备发送扫描响应;When the first earphone and/or the second earphone are in the pairing state, the first earphone and/or the second earphone receive the scan request sent by the first electronic device, and send the request to The first electronic device sends a scan response, and the first earphone and/or the second earphone receives a scan request sent by a third electronic device, and sends a scan response to the third electronic device according to the scan request;若在第一时间段内接收到所述第一电子设备发送的第一连接请求及第三电子设备发送的第二连接请求,则通过所述第一耳机对所述第一连接请求进行处理,与所述第一电子设备建立蓝牙连接,以及通过所述第二耳机对所述第二连接请求进行处理,与所述第三电子设备建立蓝牙连接。If the first connection request sent by the first electronic device and the second connection request sent by the third electronic device are received within the first time period, the first connection request is processed through the first earphone, Establishing a Bluetooth connection with the first electronic device, processing the second connection request through the second earphone, and establishing a Bluetooth connection with the third electronic device.
- 根据权利要求6~8任一所述的方法,其特征在于,在所述通过所述第一耳机对所述第一连接请求进行处理,与所述第一电子设备建立蓝牙连接之后,所述方法还包括:The method according to any one of claims 6-8, characterized in that, after processing the first connection request through the first earphone and establishing a Bluetooth connection with the first electronic device, the Methods also include:通过所述第一耳机向所述第二耳机同步所述第一电子设备的连接信息,以使所述第一电子设备的蓝牙连接对象从所述第一耳机切换至所述第二耳机,且所述第一耳机对所述第二耳机与所述第一电子设备之间的蓝牙连接进行监听;或,synchronizing the connection information of the first electronic device to the second earphone through the first earphone, so that the Bluetooth connection object of the first electronic device is switched from the first earphone to the second earphone, and The first earphone monitors the Bluetooth connection between the second earphone and the first electronic device; or,通过所述第一耳机向所述第二耳机同步所述第一电子设备的连接信息,以使所述第一电子设备的蓝牙连接对象从所述第一耳机切换至所述第二耳机,且所述第二耳机将与所述第一电子设备之间传输的数据同步给所述第一耳机。synchronizing the connection information of the first electronic device to the second earphone through the first earphone, so that the Bluetooth connection object of the first electronic device is switched from the first earphone to the second earphone, and The second earphone synchronizes the data transmitted with the first electronic device to the first earphone.
- 根据权利要求1~3任一所述的方法,其特征在于,所述工作状态包括共同使用状态;控制所述第一耳机和第二耳机进入所述目标指令所指定的工作状态,包括:The method according to any one of claims 1-3, wherein the working state includes a common use state; controlling the first earphone and the second earphone to enter the working state specified by the target instruction includes:在所述第一耳机与所述第二耳机未建立蓝牙连接的情况下,由所述第一耳机发送广播信号,所述广播信号用于触发接收到所述广播信号的所述第二耳机与所述第一耳机建立蓝牙连接,并与所述第一耳机共享同一蓝牙地址。When no Bluetooth connection is established between the first earphone and the second earphone, the first earphone sends a broadcast signal, and the broadcast signal is used to trigger the second earphone receiving the broadcast signal to communicate with the second earphone. The first earphone establishes a bluetooth connection, and shares the same bluetooth address with the first earphone.
- 根据权利要求1~3任一所述的方法,其特征在于,所述工作状态包括共同使用蓝牙地址;所述控制所述第一耳机和/或第二耳机进入与所述目标指令对应的工作状态,包括:The method according to any one of claims 1 to 3, wherein the working state includes using a Bluetooth address together; the controlling the first earphone and/or the second earphone to enter a working state corresponding to the target status, including:在所述第一耳机与所述第二耳机未建立蓝牙连接的情况下,且所述第二耳机与第四电子设备建立蓝牙连接的情况下,由所述第一耳机发送广播信号,所述广播信号用于触发接收到所述广播信号的所述第四电子设备向所述第二耳机发送连接指令,以使所述第二耳机根据所述连接指令与所述第一耳机建立蓝牙连接,并与所述第一耳机共享同一蓝牙地址。In the case that the first earphone has not established a Bluetooth connection with the second earphone, and in the case that the second earphone has established a Bluetooth connection with the fourth electronic device, the broadcast signal is sent by the first earphone, and the The broadcast signal is used to trigger the fourth electronic device receiving the broadcast signal to send a connection instruction to the second earphone, so that the second earphone establishes a Bluetooth connection with the first earphone according to the connection instruction, And share the same bluetooth address with the first earphone.
- 根据权利要求11所述的方法,其特征在于,所述广播信号包括第一特定信息,所述广播信号还用于触发接收到所述广播信号的所述第四电子设备在确定所述第一特定信息与第二特定信息相同时,向所述第二耳机发送连接指令,以使所述第二耳机根据所述连接指令与所述第一耳机建立蓝牙连接,并共享同一蓝牙地址;其中,所述第二特定信息为所述第二耳机在与所述第四电子设备建立蓝牙连接后,向所述第四电子设备发送的;或,The method according to claim 11, wherein the broadcast signal includes first specific information, and the broadcast signal is also used to trigger the fourth electronic device receiving the broadcast signal to determine the first When the specific information is the same as the second specific information, send a connection instruction to the second earphone, so that the second earphone can establish a Bluetooth connection with the first earphone according to the connection instruction, and share the same Bluetooth address; wherein, The second specific information is sent by the second earphone to the fourth electronic device after establishing a Bluetooth connection with the fourth electronic device; or,所述广播信号还用于触发接收到所述广播信号的所述第四电子设备将所述第一特定信息及连接指令发送给所述第二耳机,以使所述第二耳机在确定所述第一特定信息与存储的第二特定信息相同时,根据所述连接指令与所述第一耳机建立蓝牙连接,并与所述第一耳机共享同一蓝牙地址。The broadcast signal is also used to trigger the fourth electronic device receiving the broadcast signal to send the first specific information and the connection instruction to the second earphone, so that the second earphone determines the When the first specific information is the same as the stored second specific information, establish a Bluetooth connection with the first earphone according to the connection instruction, and share the same Bluetooth address with the first earphone.
- 一种耳机设备的状态控制方法,其特征在于,所述耳机设备包括第一耳机、第二耳机及耳机盒,所述方法包括:A method for controlling the state of an earphone device, wherein the earphone device includes a first earphone, a second earphone, and an earphone box, and the method includes:在仅所述第一耳机被放置在耳机盒的情况下,由所述第一耳机接收所述耳机盒发送的目标指令;When only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box;所述第一耳机根据所述目标指令,控制所述第一耳机和所述第二耳机进入单独使用状态或共同使 用状态,其中,所述单独使用状态指的是所述第一耳机及第二耳机被配置为不同的蓝牙地址的状态,所述共同使用状态指的是所述第一耳机及第二耳机共享同一蓝牙地址的状态。According to the target instruction, the first earphone controls the first earphone and the second earphone to enter a single use state or a common use state, wherein the single use state refers to the first earphone and the second earphone The earphones are configured with different bluetooth addresses, and the common use state refers to a state in which the first earphone and the second earphone share the same bluetooth address.
- 根据权利要求13所述的方法,其特征在于,所述控制所述第一耳机和所述第二耳机进入单独使用状态,包括:The method according to claim 13, wherein the controlling the first earphone and the second earphone to enter a state of independent use comprises:控制所述第一耳机和/或第二耳机更改配置的蓝牙地址,以使所述第一耳机及第二耳机分别对应不同的蓝牙地址。Controlling the first earphone and/or the second earphone to change the configured bluetooth address, so that the first earphone and the second earphone respectively correspond to different bluetooth addresses.
- 根据权利要求14所述的方法,其特征在于,所述方法还包括:The method according to claim 14, characterized in that the method further comprises:断开所述第一耳机与所述第二耳机之间的蓝牙连接。Disconnect the Bluetooth connection between the first earphone and the second earphone.
- 根据权利要求13所述的方法,其特征在于,控制所述第一耳机和所述第二耳机进入共同使用状态,包括:The method according to claim 13, wherein controlling the first earphone and the second earphone to enter a common use state comprises:在所述第一耳机与所述第二耳机未建立蓝牙连接的情况下,由所述第一耳机发送广播信号,所述广播信号用于触发接收到所述广播信号的所述第二耳机与所述第一耳机建立蓝牙连接,并与所述第一耳机共享同一蓝牙地址。When no Bluetooth connection is established between the first earphone and the second earphone, the first earphone sends a broadcast signal, and the broadcast signal is used to trigger the second earphone receiving the broadcast signal to communicate with the second earphone. The first earphone establishes a bluetooth connection, and shares the same bluetooth address with the first earphone.
- 根据权利要求13所述的方法,其特征在于,控制所述第一耳机和所述第二耳机进入共同使用状态,包括:The method according to claim 13, wherein controlling the first earphone and the second earphone to enter a common use state comprises:在所述第一耳机与所述第二耳机未建立蓝牙连接,且所述第二耳机与第四电子设备建立蓝牙连接的情况下,由所述第一耳机发送广播信号,所述广播信号用于触发接收到所述广播信号的所述第四电子设备向所述第二耳机发送连接指令,以使所述第二耳机根据所述连接指令与所述第一耳机建立蓝牙连接,并与所述第一耳机共享同一蓝牙地址。When the first earphone has not established a Bluetooth connection with the second earphone, and the second earphone has established a Bluetooth connection with the fourth electronic device, the first earphone sends a broadcast signal, and the broadcast signal uses triggering the fourth electronic device receiving the broadcast signal to send a connection instruction to the second earphone, so that the second earphone establishes a bluetooth connection with the first earphone according to the connection instruction, and communicates with the second earphone The first earphones share the same bluetooth address.
- 根据权利要求13~17任一所述的方法,其特征在于,所述在仅所述第一耳机被放置在耳机盒的情况下,由所述第一耳机接收所述耳机盒发送的目标指令,包括:The method according to any one of claims 13 to 17, wherein when only the first earphone is placed in the earphone box, the first earphone receives the target instruction sent by the earphone box ,include:在仅所述第一耳机被放置在耳机盒的情况下,若所述耳机盒检测到控制操作,则所述耳机盒根据所述控制操作的操作信息,向所述第一耳机发送与所述操作信息对应的目标指令,以使所述第一耳机接收到所述目标指令。In the case where only the first earphone is placed in the earphone box, if the earphone box detects a control operation, the earphone box sends the first earphone to the first earphone according to the operation information of the control operation. Operating the target instruction corresponding to the information, so that the first earphone receives the target instruction.
- 根据权利要求18所述的方法,其特征在于,所述操作信息包括所述控制操作对应的操作时长、操作组件标识、操作方向及操作力度中的一种或多种。The method according to claim 18, wherein the operation information includes one or more of operation duration corresponding to the control operation, operation component identification, operation direction, and operation force.
- 根据权利要求18所述的方法,其特征在于,所述耳机盒根据所述控制操作的操作信息,向所述第一耳机发送与所述操作信息对应的目标指令,包括:The method according to claim 18, wherein the earphone box sends a target instruction corresponding to the operation information to the first earphone according to the operation information of the control operation, including:若所述耳机盒确定所述操作信息满足第二操作条件,则向所述第一耳机发送第二控制指令;If the earphone box determines that the operation information satisfies a second operation condition, then send a second control instruction to the first earphone;若所述耳机盒确定所述操作信息满足第三操作条件,则向所述第一耳机发送第三控制指令,所述第三操作条件与所述第二操作条件不同;If the earphone box determines that the operation information satisfies a third operation condition, then send a third control instruction to the first earphone, where the third operation condition is different from the second operation condition;所述第一耳机根据所述目标指令,控制所述第一耳机和/或所述第二耳机进入所述目标指令所指定的工作状态,包括:The first earphone controls the first earphone and/or the second earphone to enter the working state specified by the target instruction according to the target instruction, including:若所述第一耳机接收到所述第二控制指令,则控制所述第一耳机和/或所述第二耳机更改配置的蓝牙地址,以使所述第一耳机及所述第二耳机从所述共同使用状态切换为所述单独使用状态;If the first earphone receives the second control instruction, control the first earphone and/or the second earphone to change the configured Bluetooth address, so that the first earphone and the second earphone The common use state is switched to the single use state;若所述第一耳机接收到所述第三控制指令,则控制所述第一耳机和/或所述第二耳机更改配置的蓝牙地址,以使所述第一耳机及所述第二耳机从所述单独使用状态切换为所述共同使用状态。If the first earphone receives the third control instruction, control the first earphone and/or the second earphone to change the configured Bluetooth address, so that the first earphone and the second earphone The single use state is switched to the joint use state.
- 根据权利要求13~17任一所述的方法,其特征在于,所述第一耳机根据所述目标指令,控制所述第一耳机和所述第二耳机进入单独使用状态或共同使用状态,包括:The method according to any one of claims 13 to 17, wherein the first earphone controls the first earphone and the second earphone to enter a single use state or a joint use state according to the target instruction, including :若所述耳机设备当前处于共同使用状态,则所述第一耳机根据所述目标指令,控制所述第一耳机和所述第二耳机进入单独使用状态;If the earphone device is currently in a common use state, the first earphone controls the first earphone and the second earphone to enter a separate use state according to the target instruction;若所述耳机设备当前处于单独使用状态,则所述第一耳机根据所述目标指令,控制所述第一耳机和所述第二耳机进入共同使用状态。If the earphone device is currently in a single use state, the first earphone controls the first earphone and the second earphone to enter a common use state according to the target instruction.
- 一种耳机设备的状态控制装置,其特征在于,所述耳机设备包括第一耳机、第二耳机和耳机盒,所述装置包括:A state control device for an earphone device, characterized in that the earphone device includes a first earphone, a second earphone and an earphone box, and the device includes:指令接收模块,用于在仅所述第一耳机被放置在耳机盒的情况下,由所述第一耳机接收所述耳机盒发送的目标指令;An instruction receiving module, configured to receive, by the first earphone, the target instruction sent by the earphone box when only the first earphone is placed in the earphone box;状态控制模块,用于由所述第一耳机根据所述目标指令,控制所述第一耳机和/或第二耳机进入所述目标指令所指定的工作状态;A state control module, configured for the first earphone to control the first earphone and/or the second earphone to enter the working state specified by the target instruction according to the target instruction;其中,所述工作状态包括配对状态;所述配对状态指的是所述第一耳机和/或所述第二耳机能够被其它电子设备发现的状态。Wherein, the working state includes a pairing state; the pairing state refers to a state in which the first earphone and/or the second earphone can be discovered by other electronic devices.
- 一种耳机设备的状态控制装置,其特征在于,所述耳机设备包括第一耳机、第二耳机及耳机盒,所述装置包括:A state control device for an earphone device, characterized in that the earphone device includes a first earphone, a second earphone, and an earphone box, and the device includes:指令接收模块,用于在第一耳机被放置在耳机盒的情况下,由所述第一耳机接收所述耳机盒发送的目标指令;An instruction receiving module, configured to receive, by the first earphone, the target instruction sent by the earphone box when the first earphone is placed in the earphone box;状态控制模块,用于由所述第一耳机根据所述目标指令,控制所述第一耳机和所述第二耳机进入单独使用状态或共同使用状态,其中,所述单独使用状态指的是所述第一耳机及第二耳机被配置为不同的蓝牙地址的状态,所述共同使用状态指的是所述第一耳机及第二耳机共享同一蓝牙地址的状态。A state control module, used for the first earphone to control the first earphone and the second earphone to enter a single use state or a joint use state according to the target instruction, wherein the single use state refers to the The state in which the first earphone and the second earphone are configured with different bluetooth addresses, and the common use state refers to the state in which the first earphone and the second earphone share the same bluetooth address.
- 一种耳机设备,其特征在于,包括存储器及处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器实现如权利要求1至21任一所述的方法。An earphone device, characterized by comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor realizes any one of claims 1 to 21. the method described.
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至21任一所述的方法。A computer-readable storage medium on which a computer program is stored, wherein the computer program implements the method according to any one of claims 1 to 21 when executed by a processor.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111493252.9A CN116320859A (en) | 2021-12-08 | 2021-12-08 | State control method and device of earphone device, earphone device and storage medium |
CN202111493252.9 | 2021-12-08 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023103732A1 true WO2023103732A1 (en) | 2023-06-15 |
Family
ID=86729589
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/132512 WO2023103732A1 (en) | 2021-12-08 | 2022-11-17 | State control method and apparatus for earphone device, earphone device and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN116320859A (en) |
WO (1) | WO2023103732A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115776644A (en) * | 2021-09-06 | 2023-03-10 | Oppo广东移动通信有限公司 | Broadcast message transmitting method and device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101544181B1 (en) * | 2014-05-27 | 2015-08-12 | (주) 시지아이 | Direct box and direct box system supporting line out for in- ear earphone and bluetooth communication |
WO2020097916A1 (en) * | 2018-11-16 | 2020-05-22 | 深圳百灵声学有限公司 | Wireless bluetooth headphone smart charging and carrying case and bluetooth headphone |
CN111787158A (en) * | 2020-07-29 | 2020-10-16 | 歌尔科技有限公司 | Earphone device, message reminding method of mobile equipment and storage medium |
CN112913321A (en) * | 2018-12-07 | 2021-06-04 | 华为技术有限公司 | Method, equipment and system for carrying out call by using Bluetooth headset |
-
2021
- 2021-12-08 CN CN202111493252.9A patent/CN116320859A/en active Pending
-
2022
- 2022-11-17 WO PCT/CN2022/132512 patent/WO2023103732A1/en unknown
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101544181B1 (en) * | 2014-05-27 | 2015-08-12 | (주) 시지아이 | Direct box and direct box system supporting line out for in- ear earphone and bluetooth communication |
WO2020097916A1 (en) * | 2018-11-16 | 2020-05-22 | 深圳百灵声学有限公司 | Wireless bluetooth headphone smart charging and carrying case and bluetooth headphone |
CN112913321A (en) * | 2018-12-07 | 2021-06-04 | 华为技术有限公司 | Method, equipment and system for carrying out call by using Bluetooth headset |
CN111787158A (en) * | 2020-07-29 | 2020-10-16 | 歌尔科技有限公司 | Earphone device, message reminding method of mobile equipment and storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115776644A (en) * | 2021-09-06 | 2023-03-10 | Oppo广东移动通信有限公司 | Broadcast message transmitting method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN116320859A (en) | 2023-06-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113348675B (en) | Fast role switching between bluetooth Truly Wireless Stereo (TWS) earbud headphones | |
KR102362156B1 (en) | Earphone wireless communication method, master earphone, slave earphone and earphone system | |
EP3849223B1 (en) | Bluetooth headset device and communication method for the same | |
JP6656358B2 (en) | Role exchange between unconnected wireless connected devices | |
EP3893109B1 (en) | Method and device for connecting bluetooth devices | |
CN104335642A (en) | Smart battery wear leveling for audio devices | |
KR102652380B1 (en) | Electronic device for transmitting response message in bluetooth network environment and method thereof | |
WO2023036178A1 (en) | Bluetooth connection method and apparatus, earphone device, and computer-readable storage medium | |
CN104205998A (en) | Method and apparatus for relaying data communications in a bluetooth network | |
KR20200110086A (en) | Method for establishing wireless communication link and electronic device supporting the same | |
KR20210020542A (en) | Method for supporting multiple links in bluetooth network environment and electronic device thereof | |
WO2022068517A1 (en) | Bluetooth communication system, bluetooth connection method, electronic device, and storage medium | |
WO2023103732A1 (en) | State control method and apparatus for earphone device, earphone device and storage medium | |
WO2024016948A1 (en) | Information updating method and apparatus, audio sharing method and system, and electronic device | |
WO2021043277A1 (en) | Method for configuring bluetooth connection parameter, and electronic device | |
WO2021233398A1 (en) | Wireless audio system, wireless communication method, and device | |
KR20210020649A (en) | Electronic device for transmitting data packet in bluetooth network environment and method thereof | |
WO2024055738A1 (en) | Method and apparatus for audio data sharing, and electronic device and storage medium | |
CN115175149A (en) | Equipment adding method and device, bluetooth chip and equipment | |
US11818781B2 (en) | Communication method between multi devices in Bluetooth communication environment and electronic device therefor | |
WO2021239032A1 (en) | Bluetooth protocol connection method and apparatus, storage medium, and related device | |
WO2023035782A1 (en) | Bluetooth connection method and apparatus, earphone device and computer-readable storage medium | |
KR102639249B1 (en) | Method for sharing channel information and electronic device therefor | |
WO2023098423A1 (en) | Bluetooth connection method and apparatus, and bluetooth address configuration method and apparatus | |
WO2020038393A1 (en) | Data transmission method and terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22903155 Country of ref document: EP Kind code of ref document: A1 |