CN115776661B - Bluetooth-based control method, device, electronic device, and storage medium - Google Patents

Bluetooth-based control method, device, electronic device, and storage medium

Info

Publication number
CN115776661B
CN115776661B CN202111050876.3A CN202111050876A CN115776661B CN 115776661 B CN115776661 B CN 115776661B CN 202111050876 A CN202111050876 A CN 202111050876A CN 115776661 B CN115776661 B CN 115776661B
Authority
CN
China
Prior art keywords
electronic device
bluetooth
pairing
connection
electronic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111050876.3A
Other languages
Chinese (zh)
Other versions
CN115776661A (en
Inventor
包建全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202111050876.3A priority Critical patent/CN115776661B/en
Publication of CN115776661A publication Critical patent/CN115776661A/en
Application granted granted Critical
Publication of CN115776661B publication Critical patent/CN115776661B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

本申请实施例公开了一种基于蓝牙的控制方法、装置、电子设备及存储介质。该方法应用于第一电子设备,该方法可包括:在所述第一电子设备与至少一个第二电子设备建立蓝牙连接的情况下,接收一个所述第二电子设备发送的第一配对指令;根据所述第一配对指令进入配对状态,以使其它电子设备能够扫描到所述第一电子设备,所述其它电子设备包括没有存储与所述第一电子设备对应的连接信息的电子设备。本申请实施例公开的一种基于蓝牙的控制方法、装置、电子设备及存储介质,能够简化使电子设备进入配对状态的方式,且让电子设备进入配对状态的方式更为丰富。

The embodiments of the present application disclose a control method, device, electronic device and storage medium based on Bluetooth. The method is applied to a first electronic device, and the method may include: when the first electronic device establishes a Bluetooth connection with at least one second electronic device, receiving a first pairing instruction sent by the second electronic device; entering a pairing state according to the first pairing instruction, so that other electronic devices can scan the first electronic device, and the other electronic devices include electronic devices that do not store connection information corresponding to the first electronic device. The control method, device, electronic device and storage medium based on Bluetooth disclosed in the embodiments of the present application can simplify the way of making an electronic device enter a pairing state, and make the way of making an electronic device enter a pairing state more diverse.

Description

Bluetooth-based control method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a control method and apparatus based on bluetooth, an electronic device, and a storage medium.
Background
Bluetooth is a radio technology supporting short-range communication of devices, and can realize wireless information exchange among a plurality of electronic devices supporting Bluetooth transmission, so that data transmission among the electronic devices is quicker and more efficient. In order to improve the security of bluetooth communication, if two electronic devices connected by bluetooth are not connected before, pairing is needed in the process of bluetooth connection. At present, the mode of enabling the electronic equipment to enter the pairing state is complicated and single.
Disclosure of Invention
The embodiment of the application discloses a control method, a control device, electronic equipment and a storage medium based on Bluetooth, which can simplify the mode of enabling the electronic equipment to enter a pairing state and enrich the mode of enabling the electronic equipment to enter the pairing state.
The embodiment of the application discloses a control method based on Bluetooth, which is applied to first electronic equipment and comprises the following steps:
Receiving a first pairing instruction sent by a second electronic device under the condition that the first electronic device establishes Bluetooth connection with at least one second electronic device;
And entering a pairing state according to the first pairing instruction so that other electronic equipment can scan the first electronic equipment, wherein the other electronic equipment comprises electronic equipment which does not store connection information corresponding to the first electronic equipment.
The embodiment of the application discloses a control method based on Bluetooth, which is applied to second electronic equipment and comprises the following steps:
And under the condition that Bluetooth connection is established between the second electronic equipment and the first electronic equipment, sending a first pairing instruction to the first electronic equipment, wherein the first pairing instruction is used for indicating the first electronic equipment to enter a pairing state so that other electronic equipment can scan the first electronic equipment, and the other electronic equipment comprises electronic equipment which does not store connection information corresponding to the first electronic equipment.
The embodiment of the application discloses a Bluetooth-based control device which is applied to first electronic equipment and comprises:
the instruction receiving module is used for receiving a first pairing instruction sent by one second electronic device under the condition that the first electronic device establishes Bluetooth connection with at least one second electronic device;
And the pairing module is used for entering a pairing state according to the first pairing instruction so that other electronic equipment can scan the first electronic equipment, wherein the other electronic equipment comprises electronic equipment which does not store connection information corresponding to the first electronic equipment.
The embodiment of the application discloses a Bluetooth-based control device which is applied to second electronic equipment, and comprises:
the electronic equipment comprises a first electronic equipment, a command sending module and a second electronic equipment, wherein the first electronic equipment is used for sending a first pairing command to the first electronic equipment under the condition that Bluetooth connection is established between the second electronic equipment and the first electronic equipment, the first pairing command is used for triggering the first electronic equipment to enter a pairing state so that other electronic equipment can scan the first electronic equipment, and the other electronic equipment comprises electronic equipment which does not store connection information corresponding to the first electronic equipment.
The embodiment of the application discloses an electronic device, which comprises a memory and a processor, wherein the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to realize the method applied to first electronic device.
The embodiment of the application discloses an electronic device, which comprises a memory and a processor, wherein the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to realize the method applied to second electronic device.
The embodiment of the application discloses a computer readable storage medium, on which a computer program is stored, which when being executed by a processor, implements a method as described above applied to a first electronic device.
The embodiment of the application discloses a computer readable storage medium, on which a computer program is stored, which when being executed by a processor, implements a method as described above for application to a second electronic device.
According to the Bluetooth-based control method, device, electronic equipment and storage medium disclosed by the embodiment of the application, under the condition that the first electronic equipment and at least one second electronic equipment are connected by Bluetooth, the second electronic equipment sends a first pairing instruction to the first electronic equipment, the first electronic equipment enters a pairing state according to the first pairing instruction, so that other electronic equipment can scan the first electronic equipment, the other electronic equipment comprises electronic equipment which does not store connection information corresponding to the first electronic equipment, the first electronic equipment enters the pairing state by sending the first pairing instruction to the first electronic equipment through the second electronic equipment connected with the first electronic equipment, normal Bluetooth communication between the second electronic equipment and the first electronic equipment is not influenced, and the way of enabling the electronic equipment to enter the pairing state is simplified, so that the way of enabling the electronic equipment to enter the pairing state is richer.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is an application scenario diagram of a Bluetooth-based control method in one embodiment;
FIG. 2 is a flow chart of a Bluetooth-based control method in one embodiment;
FIG. 3 is an interactive timing diagram of an electronic device entering a paired state in one embodiment;
FIG. 4 is a flow chart of a Bluetooth-based control method in another embodiment;
FIG. 5 is a schematic diagram of an interface of a second electronic device in one embodiment;
FIG. 6A is a timing diagram of interactions in an electronic device robbery scenario, under one embodiment;
FIG. 6B is a timing diagram of interactions in a handset device robbery scenario, under an embodiment;
FIG. 7A is an interactive timing diagram of a media player device connecting two electronic devices in one embodiment;
FIG. 7B is an interactive timing diagram of a headset device connecting two electronic devices in another embodiment;
FIG. 8 is a flow chart of a Bluetooth-based control method in yet another embodiment;
FIG. 9 is a block diagram of a Bluetooth-based control device in one embodiment;
FIG. 10 is a block diagram of a Bluetooth-based control device in another embodiment;
FIG. 11 is a block diagram of an electronic device in one embodiment.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that the terms "comprising" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
It will be understood that the terms first, second, etc. as used herein may be used to describe various elements, 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 earphone may be referred to as a second earphone, and similarly, a second earphone may be referred to as a first earphone, without departing from the scope of the application. Both the first earpiece and the second earpiece belong to the earpiece, but they are not the same earpiece. In addition, the term "plurality" or the like used in the embodiments of the present application means two or more.
In the related art, the manner of enabling the electronic device to enter the pairing state has the problems of complexity and singleness, taking the electronic device as a wireless earphone supporting Bluetooth to pass through as an example, when a user needs to enable the wireless earphone to enter the pairing state, the wireless earphone needs to be placed in a charging box, the wireless earphone enters the pairing state by pressing a pairing button on the charging box, the operation process is complex, the user can be influenced by normal use of the wireless earphone, and inconvenience is brought to the user.
The embodiment of the application provides a Bluetooth-based control method, a Bluetooth-based control device, electronic equipment and a storage medium, which can simplify the mode of enabling the electronic equipment to enter a pairing state and enrich the mode of enabling the electronic equipment to enter the pairing state.
Fig. 1 is an application scenario diagram of a bluetooth-based control method in one embodiment. As shown in fig. 1, a first electronic device 10 may establish a bluetooth connection with at least one second electronic device 20, based on which communication may take place.
The first electronic device 10 may include, but is not limited to, a headset device, a mobile phone, a wearable device (e.g., a bracelet, a smart watch, a smart glasses, etc.), a vehicle terminal, a tablet computer, etc., wherein the headset device may include, but is not limited to, a headset, an in-ear headset, an earplug headset, an ear-hanging headset, etc., and for example, the headset device may be a truly wireless stereo (True Wireless Stereo, TWS) bluetooth headset, etc. The second electronic device 20 may include, but is not limited to, a wearable device, a vehicle-mounted terminal, a cell phone, a tablet computer, a notebook computer, and the like.
A variety of bluetooth connections may be used between the first electronic device 10 and the second electronic device 20. Taking the first electronic device 10 as a TWS headset as an example, a first headset and a second headset may be included, and optionally, the first headset and the second headset may distinguish between a master headset and a slave headset. As a connection manner, the master earphone in the first earphone and the second earphone can establish bluetooth connection with the second electronic device 20, the slave earphone establishes bluetooth connection with the master earphone, and the slave earphone can acquire connection information and the like of the master earphone and the second electronic device 20 through bluetooth connection with the master earphone, so that communication between the master earphone and the second electronic device 20 can be monitored in a monitoring manner, and synchronization of the master earphone and the slave earphone is realized. As an implementation manner, the master earphone may establish a bluetooth connection with the second electronic device 20, and the master earphone may establish a bluetooth connection with the slave earphone, and the master earphone forwards the data sent by the second electronic device 20 to the slave earphone after receiving the data, so as to achieve synchronization of the master earphone and the slave earphone. It should be understood that other bluetooth connection manners may be adopted between the first electronic device 10 and the second electronic device 20, and the specific bluetooth connection manner is not limited in the embodiments of the present application.
In the embodiment of the present application, in the case that the first electronic device 10 establishes a bluetooth connection with at least one second electronic device 20, the second electronic device 20 may send a first pairing instruction to the first electronic device 10. The first electronic device 10 receives the first pairing instruction and enters a pairing state according to the first pairing instruction, so that other electronic devices can scan the first electronic device 10, and the other electronic devices can include electronic devices which do not store connection information corresponding to the first electronic device 10.
By sending the first pairing instruction to the first electronic device 10 by the second electronic device 20 connected to the first electronic device 10, the first electronic device 10 is put into a pairing state, so that normal data transmission between the second electronic device 20 and the first electronic device 10 is not affected, and a manner of putting the first electronic device 10 into the pairing state is simplified. Taking the first electronic device 10 as a wireless earphone as an example, the wireless earphone can be in a pairing state without putting the wireless earphone into a charging box, so that user operation is simplified, and the user can continue to use the wireless earphone, taking the first electronic device 10 as a wearable device as an example, a display screen of the wearable device is usually smaller, by adopting the scheme, the user does not need to click on a small display screen to enter a Bluetooth setting page, and then click on a pairing opening button in the Bluetooth setting page to enter the wearable device into the pairing state, so that the operation simplicity is improved. Meanwhile, the mode of enabling the electronic equipment to enter the pairing state is enriched, and the requirements of users in different scenes are met.
As shown in fig. 2, in one embodiment, a bluetooth-based control method is provided and may be applied to the first electronic device, where the method may include the following steps:
Step 210, receiving a first pairing instruction sent by a second electronic device under the condition that the first electronic device establishes bluetooth connection with at least one second electronic device.
The first electronic device may be an electronic device supporting bluetooth "one-to-one", or may be an electronic device capable of supporting bluetooth "one-to-many", such as "one-to-two", "one-to-three", "one-to-four", etc. supporting bluetooth. Where bluetooth "one-to-many" is supported, it means that the maximum number N of bluetooth connections that the first electronic device supports to be established may be an integer greater than or equal to 2, i.e. the first electronic device is able to maintain bluetooth connections with at least two devices simultaneously. Taking bluetooth enabled "one-to-two" as an example, the first electronic device can maintain bluetooth connectivity with both devices at the same time.
In the case that the first electronic device establishes a bluetooth connection with at least one second electronic device, the second electronic device may send a first pairing instruction to the first electronic device, where the first pairing instruction is used to instruct the first electronic device to enter a pairing state. Optionally, any second electronic device may send the first pairing instruction to the first electronic device, or a designated electronic device in the second electronic device may send the first pairing instruction to the first electronic device. For example, when a user needs to make a first electronic device enter a pairing state, any second electronic device can be controlled, so that the controlled second electronic device sends a first pairing instruction to the first electronic device, and the first electronic device enters the pairing state. For another example, the user may select a specific electronic device from the second electronic devices connected to the first electronic device, and set pairing setting information (for example, set a fixed time point for the first electronic device to enter a pairing state, or set a scenario for the first electronic device to enter the pairing state) in the specific electronic device, where the specific electronic device may send the first pairing instruction to the first electronic device according to the pairing setting information.
When the first electronic device and the plurality of second electronic devices establish bluetooth connection, the user may send the pairing instruction through a specific second electronic device, or may send the pairing instruction through any one of the second electronic devices, or may send the pairing instruction through the plurality of second electronic devices, which is not limited herein.
Step 220, entering a pairing state according to the first pairing instruction, so that other electronic devices can scan the first electronic device.
The first electronic device may enter a pairing state according to a first pairing instruction sent by the second electronic device, so that other electronic devices can scan the first electronic device, where the other electronic devices may include electronic devices that do not store connection information corresponding to the first electronic device. The connection information may include device information, and pairing information, where the device information may include, but is not limited to, a MAC (MEDIA ACCESS Control, media-intervening Control layer) address, a device name, and the like of the first electronic device, and the pairing information may include, but is not limited to, a pairing key, a pairing code, and the like. It will be appreciated that when the other electronic device has the connection information, even if the discoverable state (requirement scan mode) of the first electronic device is not started, the other electronic device may directly send a bluetooth connection request to the first electronic device according to the connection information, so as to establish a bluetooth connection, and the specific connection mode may refer to a related bluetooth protocol, for example, a bluetooth standard protocol, and may also be adjusted according to a change of the protocol. The bluetooth connection request may include a paging page.
The pairing state may refer to a mode that the first electronic device starts an information scan mode and a page scan mode, in which the first electronic device is allowed to be scanned and searched (i.e. can be found) by other electronic devices, and in which the first electronic device is allowed to be connected by other electronic devices, and in which the first electronic device can receive a bluetooth connection request sent by other electronic devices. That is, in the pairing state, the first electronic device is in a discoverable state and a connectable state at the same time, and other electronic devices can start the bluetooth scanning function to scan surrounding bluetooth devices, so that the first electronic device can be scanned and a bluetooth request can be sent to the first electronic device. The first electronic device may respond to bluetooth requests sent by other electronic devices and establish bluetooth connections with other electronic devices, and pairing may be performed during the process of establishing bluetooth connections between the first electronic device and other electronic devices (pairing) because other electronic devices do not store connection information corresponding to the first electronic device (e.g., have not been previously connected to the first electronic device, or have been connected but have been deleted, etc.). Optionally, the pairing may include a process of exchanging pairing codes with each other, agreeing on a key between the two, and the like, so as to ensure the security of transmission.
In some embodiments, the method may further include receiving a scan request sent by the third electronic device when the first electronic device is in the pairing state, sending a scan response to the third electronic device according to the scan request, receiving a first connection request sent by the third electronic device, and establishing a bluetooth connection with the third electronic device according to the first connection request.
Taking the third electronic device as an example, the third electronic device may be a device that is not connected to the first electronic device. When the first electronic device is in the pairing state, the third electronic device may start a scanning mode and scan surrounding bluetooth devices, and the third electronic device may send a scanning request (requirement request) to the first electronic device. The first electronic device receives a scan request sent by the third electronic device, and may send a scan response to the third electronic device according to the scan request (inquiry respond).
After the third electronic device receives the scanning response, the device information of the first electronic device can be obtained, and a first connection request is sent to the first electronic device according to the device information. The first connection request may be understood as a bluetooth connection request.
Optionally, after the third electronic device obtains the device information of the first electronic device, the device information may be displayed, and the user may perform a selection operation with respect to the device information, so as to trigger the third electronic device to perform bluetooth connection with the first electronic device. After the third electronic device receives the selection operation, a first connection request can be sent to the first electronic device according to the device information of the first electronic device so as to request the establishment of Bluetooth connection with the first electronic device. After receiving the first connection request, the first electronic device may respond to the first connection request and establish bluetooth connection with the third electronic device. Since the third electronic device is not connected to the first electronic device and is not paired with the first electronic device, pairing may be performed during the process of establishing the bluetooth connection.
Illustratively, FIG. 3 is an interactive timing diagram of an electronic device entering a paired state in one embodiment. As shown in fig. 3, a bluetooth connection is established between an electronic device a and an electronic device B, and the electronic device B may send a first pairing instruction to the electronic device a, where the electronic device a enters a pairing state (in both an query scan mode and a page scan mode) according to the first pairing instruction. The electronic device a may be a bluetooth "one-to-two" enabled device, and the electronic device C may be a device that does not store connection information corresponding to the electronic device a. When the electronic device a is in the pairing state, the electronic device C may send a scan request to the electronic device a, and after receiving the scan request, the electronic device a may send a scan response to the electronic device C. The electronic device C may send a bluetooth connection request to the electronic device a, and the electronic device a may process the bluetooth connection request, perform bluetooth connection with the electronic device C, and pair with the electronic device C in the process of performing bluetooth connection.
In some embodiments, the other electronic devices may also include an electronic device storing connection information corresponding to the first electronic device, that is, may be an electronic device successfully paired with the first electronic device. When the first electronic device is in the page scan mode (i.e. in a connectable state), or is in both the required scan mode and the page scan mode (i.e. in the pairing state), bluetooth connection requests sent by other electronic devices can be received. The paired other electronic devices can send a bluetooth connection request to the first electronic device according to the connection information to request to establish bluetooth connection with the first electronic device, and pairing is not needed because pairing information such as a pairing key is stored in the previous pairing.
As a specific embodiment, the bluetooth connection request may be a paging (page) packet, and the other electronic devices may send the paging packet in a frequency hopping manner to page the first electronic device. In the page scan mode, the first electronic device may scan (scan) the paging packets sent externally at regular intervals, and if the first electronic device scans the paging packets sent by other electronic devices, it may be considered that a bluetooth connection request is received. For the specific procedure of the bluetooth connection, reference may be made to the specification of the bluetooth standard protocol.
In some embodiments, establishing a bluetooth connection as referred to in the foregoing may include establishing a bluetooth physical link, such as an ACL (Asynchronous Connectionless ) physical link, or the like.
In some embodiments, the second electronic device connected to the first electronic device may also control the first electronic device to close the pairing state, the second electronic device may send a closing instruction to the first electronic device, and the first electronic device may close the pairing state (i.e. close the in scan mode) according to the closing instruction, where the first electronic device may be in a page scan mode (i.e. in a connection state) and may receive bluetooth connection requests sent by other electronic devices.
Optionally, the second electronic device that sends the close instruction to the first electronic device and the second electronic device that sends the first pairing instruction to the first electronic device may be the same device or different devices, which is not limited in the embodiment of the present application. The pairing state of the first electronic equipment can be flexibly opened/closed through the second electronic equipment, and convenience and flexibility are improved.
It can be appreciated that the first electronic device may also be in a self-closing pairing state, such as when entering a pairing state for a certain period of time (e.g. 2 minutes, 3 minutes, etc.), or when establishing a bluetooth connection with another electronic device.
In the embodiment of the application, under the condition that the first electronic equipment and at least one second electronic equipment are connected by Bluetooth, the second electronic equipment sends the first pairing instruction to the first electronic equipment, the first electronic equipment enters the pairing state according to the first pairing instruction, so that other electronic equipment can scan the first electronic equipment, the first electronic equipment enters the pairing state by sending the first pairing instruction to the first electronic equipment through the second electronic equipment connected with the first electronic equipment, normal Bluetooth communication between the second electronic equipment and the first electronic equipment is not influenced, the way of enabling the electronic equipment to enter the pairing state is simplified, and the way of enabling the electronic equipment to enter the pairing state is richer.
In some embodiments, if the first electronic device is not electrically connected to any of the second electronic devices, a second pairing instruction sent by the accessory device is received, and the accessory device enters a pairing state according to the second pairing instruction, where the second pairing instruction is generated by the accessory device according to the detected pairing trigger operation.
Under the condition that the first electronic device does not establish Bluetooth connection with any second electronic device, the user can enter the first electronic device into a pairing state in other modes. The first electronic device may correspond to an accessory device, and the accessory device may be used in cooperation with (or sold in cooperation with) the first electronic device, for example, the first electronic device may be a wireless earphone, the accessory device may be a charging box of the wireless earphone, the first electronic device may be a smart watch, the accessory device may be a watchband or a processing module disposed on the watchband, and the like, but is not limited thereto.
The first electronic device may be in signal communication with the accessory device when the first electronic device is electrically connected with the accessory device. The user may perform a pairing trigger operation on the accessory device, which may be a preset operation. For example, the first electronic device is a wireless earphone, the accessory device is a charging box of the wireless earphone, the pairing triggering operation can be that a user presses a pairing button on the charging box for more than 3 seconds, the first electronic device is a smart watch, the accessory device is a processing module arranged on a watch band, a touch sensor can be arranged on the processing module, and the pairing triggering operation can be that the user touches the surface of the processing module for more than 2 seconds. The pairing triggering operation can be set according to actual product requirements and user requirements, and the embodiment of the application does not limit the specific operation mode of the pairing triggering operation.
If the accessory equipment detects the pairing triggering operation, a second pairing instruction can be sent to the first electronic equipment, and the first electronic equipment can enter a pairing state according to the second pairing instruction.
It should be noted that, in the case that the first electronic device does not establish a bluetooth connection with any of the second electronic devices, other manners may be adopted to enable the first electronic device to enter the pairing state. For example, one or more different sensors, such as a distance sensor, a touch sensor, a pressure sensor, a temperature sensor, and the like, may be disposed in the first electronic device, and a pairing trigger operation (such as a pressing operation, a touch operation, a distance sensing operation, and the like) performed by the user may be detected by the one or more sensors, and a pairing state is entered when the pairing trigger operation is detected.
In the embodiment of the application, various different modes for enabling the electronic equipment to enter the pairing state can be provided, the modes for enabling the electronic equipment to enter the pairing state are more abundant, the requirements of users under different conditions can be met, and the product viscosity of the users is improved.
In another embodiment, as shown in fig. 4, a control method based on bluetooth is provided, which can be applied to the first electronic device, and the method may include the following steps:
Step 402, receiving a first pairing instruction sent by a second electronic device under the condition that the first electronic device establishes bluetooth connection with at least one second electronic device.
Step 404, entering a pairing state according to the first pairing instruction, so that other electronic devices can scan to the first electronic device.
The descriptions of steps 402 to 404 may refer to the related descriptions in the above embodiments, and the descriptions are not repeated here.
In some embodiments, the second electronic device sending pairing instructions to the first electronic device may include any one of the following:
In the first mode, the second electronic device starts operation according to the state of the first electronic device, and sends a first pairing instruction to the first electronic device. Under the condition that Bluetooth connection is established between the second electronic device and the first electronic device, a user can execute a state opening operation for the first electronic device on the second electronic device to enable the first electronic device to enter a pairing state, wherein the operation mode of the state opening operation can include, but is not limited to, touch operation, voice control operation, gesture operation, sight control operation and the like.
In one embodiment, the second electronic device may display a management interface of the bluetooth device, where the management interface may include device information of the first electronic device and a pairing control, and the user may enter the pairing state by touching the pairing control to perform a state opening operation. If the second electronic device detects a touch operation for the pairing control, that is, detects a state opening operation for the first electronic device, a first pairing instruction can be sent to the first electronic device, and the first electronic device can enter a pairing state according to the first pairing instruction.
Illustratively, FIG. 5 is an interface schematic of a second electronic device in one embodiment. As shown in fig. 5, the second electronic device 20 may display a device name (bluetooth headset) of the first electronic device 10, and the pairing control 202, the user may click on the pairing control 202, and the second electronic device 20 may send a first pairing instruction to the first electronic device 10 to cause the first electronic device 10 to enter a pairing state.
And in the second mode, the second electronic equipment sends a first pairing instruction to the first electronic equipment according to the set time information. The time information can be set by a user according to actual demands, or can be time information uniformly set before the first electronic equipment leaves the factory, and optionally, when the second electronic equipment first establishes Bluetooth connection with the first electronic equipment, the first electronic equipment can send the set time information to the second electronic equipment for storage.
In some embodiments, the time information may be a fixed point in time, e.g., 12 pm a day to bring the first electronic device into a pairing state, 8 am monday a week to bring the first electronic device into a pairing state, etc. The time information may be a time period, and after the second electronic device is connected to the first electronic device, the first pairing instruction may be sent to the first electronic device according to the time period, for example, may be sent once every 1 hour, or may be sent once every 2 hours, or the like, but is not limited thereto.
In a third mode, when the second electronic device detects that the first electronic device is in a set target scene, the second electronic device sends a first pairing instruction to the first electronic device. The target scene can be set by a user according to actual demands, or can be a scene uniformly set before the first electronic equipment leaves the factory, alternatively, when the second electronic equipment first establishes Bluetooth connection with the first electronic equipment, the first electronic equipment can send the scene information of the set target scene to the second electronic equipment for storage, and the scene information can be used for describing the target scene.
In some embodiments, the target scenario may include a connection scenario of the first electronic device, for example, the target scenario may be that the number of devices currently connected by the first electronic device does not reach the maximum number N, or may be that a duration in which the first electronic device does not receive service data reaches a target duration (i.e., no second electronic device connected with the first electronic device sends service data to the first electronic device in the target duration), where the service data may include, but is not limited to, audio data, call voice data, a file, and the like.
When the second electronic device detects that the first electronic device is in the set target scene, the first electronic device can be considered to be highly likely to need to establish Bluetooth connection with other electronic devices, and then a first pairing instruction can be sent to the first electronic device. Taking the second electronic device as a support of bluetooth one-to-many, and taking the target scenario as an example that the number of devices currently connected by the first electronic device does not reach the maximum number N, the second electronic device may acquire the number of devices currently connected by the first electronic device in real time or according to a time interval (e.g. 2 minutes and 3 minutes), and determine whether the number of devices reaches the maximum number N that the first device supports establishing bluetooth connection, so as to determine whether the first electronic device is in the target scenario.
It should be noted that, other ways may be adopted to trigger the second electronic device to send the first pairing instruction to the first electronic device, and the method is not limited to the above-mentioned ways, for example, the second electronic device may send the first pairing instruction to the first electronic device when the remaining power is lower than the power threshold, and the second electronic device may be in a power-off state to disconnect the bluetooth connection with the first electronic device at any time when the remaining power of the second electronic device is lower than the power threshold.
Step 406, receiving a first connection request sent by a third electronic device when the first electronic device establishes bluetooth connection with N second electronic devices.
It is understood that the first electronic device establishes bluetooth connections with the N second electronic devices, which may mean that the first electronic device maintains bluetooth connections with the N second electronic devices. When the first electronic equipment is in a pairing state, if the first electronic equipment has established Bluetooth connection with N second electronic equipment, bluetooth connection supported by the first electronic equipment reaches the maximum number, and if a first connection request sent by the third electronic equipment is received, bluetooth connection with one of the second electronic equipment needs to be disconnected, the first electronic equipment can successfully establish Bluetooth connection with the third electronic equipment, and the first electronic equipment is equivalent to the third electronic equipment preempting the Bluetooth connection between the one of the second electronic equipment and the first electronic equipment. That is, under the condition that the first electronic device and the N second electronic devices respectively establish bluetooth connection, if the first electronic device receives a bluetooth connection request sent by the third electronic device, the first electronic device is in a robbery connection scenario.
And 408, performing disconnection processing corresponding to the target electronic device in the N second electronic devices, and establishing Bluetooth connection with the third electronic device according to the first connection request.
Under the condition that the first electronic device and the N second electronic devices respectively establish Bluetooth connection, if the first electronic device enters a pairing state, in the related technology, the first electronic device can directly disconnect Bluetooth connection with at least part of the second electronic devices, even if no third electronic device requests to connect with the first electronic device, the first electronic device and the at least part of the second electronic devices are in a disconnected state, and a user is required to manually restore Bluetooth connection again.
In the embodiment of the application, when the first electronic equipment enters a pairing state according to the first pairing instruction, bluetooth connection with N second electronic equipment can be maintained. When the first electronic device is in a first connection scene (i.e. receives a first connection request sent by the third electronic device), the first electronic device can perform disconnection processing corresponding to a target electronic device in the N second electronic devices, and establish Bluetooth connection with the third electronic device according to the first connection request. Wherein the disconnection process may be used to disconnect the bluetooth connection between the first electronic device and the target electronic device. The first electronic equipment does not need to disconnect Bluetooth connection between the first electronic equipment and at least part of the second electronic equipment after entering the pairing state, so that the situation that no third electronic equipment requests to be connected with the first electronic equipment and Bluetooth connection is manually restored by a user is avoided, and the user requirements are met.
In some embodiments, the first electronic device may determine a target electronic device of the N second electronic devices before performing the disconnection process corresponding to the target electronic device of the N second electronic devices. In some embodiments, if N is 1, that is, the first electronic device establishes a bluetooth connection with only one second electronic device, the second electronic device is the target electronic device. If N is an integer greater than or equal to 2, that is, the first electronic device establishes bluetooth connection with the plurality of second electronic devices, the first electronic device may select one of the plurality of second electronic devices as the target electronic device.
Alternatively, the target electronic device may be any one of the N second electronic devices, and the first electronic device may randomly select the target electronic device from the N second electronic devices. As another embodiment, the first electronic device may select the target electronic device from the N second electronic devices according to a preset selection rule, for example, may select, as the target electronic device, the second electronic device with the lowest priority from among the N second electronic devices according to the priorities of the respective second electronic devices, may select, as the target electronic device, the second electronic device with the lowest activity (i.e., the least amount of data to be transmitted), or select, as the target electronic device, the second electronic device with the earliest bluetooth connection establishment, or the like, but is not limited thereto.
In one embodiment, the first electronic device may select, as the target electronic device, a second electronic device whose priority satisfies the priority condition from the N second electronic devices according to the priorities of the respective second electronic devices.
The first electronic device may acquire priorities corresponding to the second electronic devices that establish the bluetooth connection, and optionally, the priorities of the second electronic devices may be determined according to device state parameters of the second electronic devices. The device status parameters may include, but are not limited to, one or more of a traffic data output parameter, a sequence parameter for characterizing a sequence of establishing a bluetooth connection with the first electronic device, a device type parameter, a device remaining power parameter, a historical connection frequency.
The service data output parameter may be used to characterize whether the second electronic device is currently outputting service data to the first electronic device via a bluetooth connection. The priority of the second electronic device that is currently outputting the service data to the first electronic device may be higher than the priority of the second electronic device that is not currently outputting the service data to the first electronic device.
The order parameter may be used to characterize an order in which the bluetooth connection is established with the first electronic device. As an implementation manner, the first electronic device may store a connection time when each second electronic device recently establishes bluetooth connection with the first electronic device, and determine a connection duration of the connection of each second electronic device according to the connection time corresponding to each second electronic device, where the connection duration is a duration from the connection time to the current time. The sequence parameter of each second electronic device can be determined according to the connection duration of each second electronic device, and the longer the connection duration is, the earlier the sequence indicated by the sequence parameter is, that is, the earlier the second electronic device establishes bluetooth connection with the first electronic device.
As another embodiment, the first electronic device may also establish a connection queue, and the device information of each second electronic device may be sequentially stored in the connection queue according to the order in which each second electronic device establishes a bluetooth connection with the first electronic device, where the second electronic device that is arranged earlier in the connection queue indicates that the second electronic device establishes a bluetooth connection with the first electronic device earlier. Alternatively, the earlier the priority of the second electronic device establishing a bluetooth connection with the first electronic device may be lower.
The device type parameter may be used to characterize a device type of the second electronic device, which may include, but is not limited to, a cell phone, a smart watch, a bracelet, a smart home, and the like. The priority corresponding to each equipment type can be preset, the first electronic equipment can determine the equipment type of each first electronic equipment according to the equipment type parameter of each second electronic equipment, and the priority corresponding to the equipment type of each first electronic equipment is obtained.
The device remaining power parameter may be used to characterize a current remaining power of the second electronic device, and a priority of the second electronic device with a large device remaining power may be higher than a priority of the second electronic device with a small device remaining power.
The historical connection frequency may be used to characterize the historical connection of the second electronic device to the first electronic device, which may be a connection frequency over a period of time in the past (e.g., over the past 1 week, over the past 1 month), etc. The first electronic device may store connection condition data of each connected electronic device, where the connection condition data may include device information, connection time, connection duration, and the like of each connected electronic device. According to the stored connection condition data, the first electronic device can count historical connection frequencies of N second electronic devices connected with the first electronic device in the past period of time. The priority of the second electronic device with the higher history connection frequency may be higher than the priority of the second electronic device with the lower history connection frequency.
The first electronic device may determine a priority corresponding to each second electronic device according to one or more device state parameters of each second electronic device. If the priority corresponding to each second electronic device is determined according to the multiple device state parameters, weights can be respectively assigned to each device state parameter. Taking the 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 according to each device state parameter of the device a, for example, the service data output parameter of the device a is 1, which indicates that the service data is currently being output to the first electronic device, the reference priority corresponding to the service data output parameter may be 4, the device remaining power parameter of the device a indicates that the current remaining power of the device a is greater than 50%, and the reference priority corresponding to the remaining power of the device may be 2. And then according to the reference priority corresponding to each equipment state parameter of the equipment A and the distribution weight of each equipment state parameter, weighting and calculation or weighted average calculation can be carried out so as to obtain the priority corresponding to the equipment A.
The method of determining the priority of each second electronic device is not limited to the above-described methods, and for example, a priority rule may be directly set, and the priority of each second electronic device may be determined based on the priority rule and the device state parameter of each second electronic device, for example, the priority of the second electronic device currently outputting the service data to the first electronic device is highest, the priority of the second electronic device currently not outputting the service data to the first electronic device is lowest, and the priority of the second electronic device currently having the lowest remaining power is lowest.
The first electronic device selects, as the target electronic device, a second electronic device whose priority satisfies a priority condition from the N second electronic devices, and the priority condition may alternatively include any one of a priority lower than a priority threshold, a priority lowest, and the like. Further, the first electronic device may directly select the second electronic device with the lowest priority as the target electronic device, or may first select the second electronic device with the priority lower than the priority threshold, and if there are a plurality of second electronic devices with the priority lower than the priority threshold, one of the second electronic devices may be selected as the target electronic device at random, or the second electronic device with the lowest priority may be selected as the target electronic device from the second electronic devices. And determining the target electronic equipment based on the priority of each second electronic equipment, so that the target electronic equipment disconnected with the Bluetooth can be more fit with the requirements of users, and adverse effects on normal use of the users caused by disconnection of the Bluetooth can be reduced.
It should be noted that the priority of each second electronic device may be changed continuously according to the specific situation, and is not necessarily fixed. It may be appreciated that, before the first electronic device does not receive the bluetooth connection request, if the priority of a certain second electronic device changes, the target electronic device is selected according to the latest priority of each second electronic device when the bluetooth connection request is received.
For example, if the first electronic device enters a pairing state, when the first electronic device receives a first connection request sent by the third electronic device, if no service data is transmitted to the first electronic device by each second electronic device, the first connected second electronic device a may be preferentially disconnected according to the bluetooth connection sequence of each second electronic device. If the first electronic device enters a 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 electronic device receives a first connection request sent by the third electronic device, the priority of the second electronic device a changes, and if the first electronic device receives the first connection request, the bluetooth connection with the second electronic device a will not be disconnected, and at this time, which second electronic device is specifically disconnected is determined according to the set priority rule. It can be seen that the first electronic device is disconnected without entering the pairing state, but is disconnected after receiving the bluetooth connection request, so that the use of the first electronic device by the user is ensured to a greater extent.
After determining the target electronic device, the first electronic device may send a disconnection instruction to the target electronic device to disconnect the bluetooth connection with the target electronic device.
Illustratively, fig. 6A is a timing diagram of interactions in an electronic device robbery scenario in one embodiment. As shown in fig. 6A, the electronic device a may be a bluetooth "one-to-two" supporting device, and the electronic device a may establish bluetooth connection with the electronic device B and the electronic device D, respectively. The electronic device B may send a first pairing instruction to the electronic device a, where the electronic device a enters a pairing state (in both the query scan mode and the page scan mode) according to the first pairing instruction, and maintains bluetooth connection with the electronic device B and the electronic device D before entering the pairing state. The electronic device C may be a device that does not store connection information corresponding to the electronic device a, and when the electronic device a is in the pairing state, the electronic device C may send a scan request to the electronic device a, and after receiving the scan request, the electronic device a may send a scan response to the electronic device C. The electronic device C may send a bluetooth connection request to the electronic device a, and after receiving the bluetooth connection request, the electronic device a may perform disconnection processing corresponding to the target electronic device (e.g., the electronic device B in fig. 6A), disconnect the bluetooth connection with the target electronic device, and perform bluetooth connection with the electronic device C, and pair with the electronic device C in the process of performing bluetooth connection.
In the embodiment of the application, under the condition that the first electronic equipment and N second electronic equipment are connected in Bluetooth, when the first electronic equipment enters a pairing state, bluetooth connection with at least part of the second electronic equipment is not disconnected, and when a first connection request sent by the third electronic equipment is received, namely, the first electronic equipment is in a first-class connection scene, disconnection operation is performed, so that the situation that no third electronic equipment requests to be connected with the first electronic equipment, and Bluetooth connection is required to be restored manually by a user is avoided, and the user requirement is met.
In some embodiments, the first electronic device may include a headset device, and the headset device may include a first headset and a second headset. Step 408 may include performing, by the first headset, disconnection processing corresponding to a target electronic device of the N second electronic devices, and establishing, by the second headset, bluetooth connection with the third electronic device according to the first connection request.
When the earphone device is in a robbery connection scene, the Bluetooth connection with one second electronic device needs to be disconnected, and in the embodiment of the application, disconnection processing can be performed through the first earphone of the earphone device, and the first connection request sent by the third electronic device is processed through the second earphone of the earphone device so as to establish Bluetooth connection with the third electronic device. The first earphone and the second earphone can be connected and disconnected in parallel, the earphone device does not need to respond to the first connection request sent by the third electronic device after the disconnection processing is completed, the connection speed of the third electronic device to the earphone device can be improved, and the connection efficiency is improved.
Alternatively, the first earpiece may be a master earpiece of the earpiece device and the second earpiece may be a slave earpiece of the earpiece device. The first earphone can be connected with N second electronic devices in a Bluetooth mode, and Bluetooth connection is established between the first earphone and the second earphone. In one embodiment, if the first earphone receives data sent by any second electronic device, the first earphone sends the data to the second earphone through bluetooth connection with the second earphone, so as to realize master-slave synchronization. As another embodiment, the first earphone may synchronize connection information of each second electronic device to the second earphone through bluetooth connection with the second earphone, so that the second earphone monitors bluetooth connections between the first earphone and the N second electronic devices according to the connection information, and master-slave synchronization is implemented.
When the earphone device is in the first-class connection scene, the first earphone can directly disconnect Bluetooth connection with the target electronic device and send a disconnection instruction to the target electronic device. The second earphone can establish Bluetooth connection with the third electronic device according to the first connection request sent by the third electronic device.
In some embodiments, after the second headset establishes a bluetooth connection with the third electronic device, connection information of the third electronic device may be synchronized to the first headset through the second headset, which may include, but is not limited to, frequency hopping information, channel information, clock information, and the like. After the second earphone synchronizes the connection information of the third electronic device to the first earphone, the Bluetooth connection object of the third electronic device is switched from the second earphone to the first earphone, and the second earphone monitors Bluetooth connection between the first earphone and the third electronic device; after the second earphone synchronizes the connection information of the third electronic device to the first earphone, or the Bluetooth connection object of the third electronic device is switched from the second earphone to the first earphone, and the first earphone synchronizes the data transmitted between the first earphone and the third electronic device to the second earphone.
After the first earphone acquires the connection information, data transmission can be directly carried out with the third electronic device based on the connection information, the physical link between the second earphone and the third electronic device is transitionally switched to the physical link between the first earphone and the third electronic device, and the Bluetooth connection object of the third electronic device is switched from the second earphone to the first earphone. The second earphone can monitor the physical link between the first earphone and the third electronic device, or the first earphone forwards the data transmitted between the second earphone and the third electronic device to the second earphone, so that master-slave synchronization is realized. Through the information synchronization between the earphones, all the electronic devices which are connected with the earphone device in a Bluetooth mode are connected by adopting the first earphone (namely the main earphone) and the second earphone (namely the slave earphone) to monitor or receive the data forwarded by the first earphone, so that the connected electronic devices are more convenient to manage and transmit data.
In some embodiments, after the first earphone completes the disconnection process, the first earphone may synchronize disconnection information to the second earphone, where the disconnection information may at least include device information of the target electronic device that disconnects the bluetooth connection, and the second earphone may not monitor the bluetooth connection between the target electronic device and the first earphone.
Illustratively, FIG. 6B is an interactive timing diagram in a handset device robbery scenario, under an embodiment. As shown in fig. 6B, the earphone device may be a device supporting bluetooth "one-to-two", and the earphone device may establish bluetooth connection with the electronic device B and the electronic device D, respectively. The electronic device C may be a device that does not store connection information corresponding to the earphone device, and the earphone device may enter a pairing state and maintain bluetooth connection with the electronic device B and the electronic device D before entering the pairing state. The electronic device C may send a scan request to the headset device, and after receiving the scan request, the headset device may send a scan response to the electronic device C through the first headset and/or the second headset. The earphone device is in the pairing state and is in the required scan mode and the page scan mode, and when the electronic device C determines that Bluetooth connection with the earphone device is needed, a Bluetooth connection request can be sent to the earphone device. After receiving the bluetooth connection request sent by the electronic device C, the first headset may perform disconnection processing corresponding to the target electronic device (e.g., the electronic device D in fig. 6B), and the second headset may process the bluetooth connection request, perform bluetooth connection with the electronic device C, and pair with the electronic device C in the process of performing bluetooth connection. After the first earphone is disconnected with the Bluetooth connection between the target electronic equipment, the first earphone can synchronously disconnect information to the second earphone, and after the second earphone successfully establishes Bluetooth connection with the electronic equipment C, the second earphone can synchronously connect information to the first earphone, so that information synchronization is realized, and a Bluetooth connection object of the electronic equipment C is switched from the second earphone to the first earphone.
In some embodiments, after the bluetooth connection object of the third electronic device is switched from the second headset to the first headset, a bluetooth physical link is established between the first headset and the third electronic device, and further, the first headset may further establish a service connection such as A2DP (Advanced Audio Distribution Profile, bluetooth audio transmission model protocol), HFP (Hands-free Profile) and the like with the third electronic device on the basis of the bluetooth physical link, so that the third electronic device may transmit service data such as audio data, voice data and the like to the first headset.
Alternatively, the first earphone may be a slave earphone of the earphone device, and the second earphone may be a master earphone of the earphone device. When the earphone device is in the first-class connection scene, the first earphone can monitor Bluetooth connection between the second earphone and the target electronic device, and send a disconnection request to the target electronic device on a transmission channel between the second earphone and the target electronic device, wherein the disconnection request can be used for triggering Bluetooth connection disconnection between the target electronic device and the second earphone. The second earpiece may process the bluetooth request sent by the third electronic device and establish a bluetooth connection with the third electronic device.
In the embodiment of the application, when the third electronic equipment seizes Bluetooth connection, the disconnection operation and the connection operation are respectively carried out in parallel through the first earphone and the second earphone, so that the seizing speed of the third electronic equipment to the earphone equipment can be improved, and the seizing efficiency is improved. And after the disconnection operation and the connection operation are completed, the first earphone and the second earphone are in information synchronization, so that the Bluetooth connection object of the third electronic device is switched from the second earphone to the first earphone, management of all Bluetooth connection establishment can be more convenient, and data transmission efficiency is ensured.
In some embodiments, after the first electronic device enters the pairing state according to the first pairing instruction, the method may further include establishing a bluetooth connection with the third electronic device according to the first connection request and establishing a bluetooth connection with the fourth electronic device according to the second connection request if the first connection request sent by the third electronic device and the second connection request sent by the fourth electronic device are received within the first period of time.
It is understood that the first connection request and the second connection request may be bluetooth connection requests.
The first electronic device may be a bluetooth enabled "one-to-many" enabled device. After the first electronic device enters the pairing state, if the first connection request sent by the third electronic device and the second connection request sent by the fourth electronic device are received in the first period of time, it may be indicated that the first electronic device needs to establish bluetooth connection with the third electronic device and the fourth electronic device simultaneously or in a connection manner. Wherein the first time period can be set according to actual requirements, for example, the first time period can be 1 second, 2 seconds, etc.,
When the first electronic device is connected with the M second electronic devices through bluetooth, if the first connection request sent by the third electronic device and the second connection request sent by the fourth electronic device are received in the first period of time, bluetooth connection can be respectively established with the third electronic device and the fourth electronic device. Wherein M may be an integer greater than or equal to 0 and less than or equal to N-2, the first electronic device establishes bluetooth connections with M second electronic devices, which may include a case where the first electronic device does not establish bluetooth connections with any of the second electronic devices (i.e., m=0), and may also include a case where the number of second electronic devices that establish bluetooth connections with the first electronic device is less than or equal to N-2, e.g., N is 3, and the first electronic device establishes bluetooth connections with only 1 second electronic device.
Under the condition that the first electronic device establishes Bluetooth connection with the M second electronic devices, the first electronic device can also establish Bluetooth connection with N-M electronic devices, and N-M is greater than or equal to 2, so that the first electronic device can establish Bluetooth connection with the third electronic device and the fourth electronic device respectively.
In some embodiments, when the number of second electronic devices establishing bluetooth connection with the first electronic device reaches N-1, if the first connection request sent by the third electronic device and the second connection request sent by the fourth electronic device are received in the first period of time, the disconnection process may be performed on the target electronic device in the second electronic device, and then bluetooth connection is established with the third electronic device and the fourth electronic device respectively. As another embodiment, the bluetooth connection may be established with an electronic device (such as a third electronic device) that receives the bluetooth connection request, and then the disconnection process is performed on the target electronic device in the second electronic device, and bluetooth connection is performed with another electronic device (such as a fourth electronic device). The specific disconnection processing manner and bluetooth connection process may refer to the related description and bluetooth standard protocol in the above embodiments, and will not be described herein.
In some embodiments, the first electronic device may include a headset device, which may include a first headset and a second headset. The method comprises the steps of establishing Bluetooth connection with third electronic equipment according to a first connection request and establishing Bluetooth connection with fourth electronic equipment according to a second connection request, wherein the method comprises the steps of processing the first connection request through a first earphone, establishing Bluetooth connection with the third electronic equipment, processing the second connection request through a second earphone, and establishing Bluetooth connection with the fourth electronic equipment.
If the earphone device receives the first connection request sent by the third electronic device and the second connection request sent by the fourth electronic device in the first period of time, it is indicated that the earphone device needs to establish bluetooth connection with the third electronic device and the fourth electronic device simultaneously or continuously, and it is highly likely that the earphone device receives one bluetooth connection request when the other bluetooth connection request is not processed. Therefore, the first earphone and the third electronic device can be connected in parallel through the first earphone and the fourth electronic device, and the first earphone and the second earphone can be connected in parallel to establish Bluetooth connection with the third electronic device and the fourth electronic device respectively. The serial connection establishment process is changed into the parallel connection establishment process, so that the connection waiting time is reduced.
Optionally, the first period of time may be set according to actual requirements, for example, the first period of time may be 1 second, 2 seconds, and the first period of time may also be set according to a speed of establishing bluetooth connection by the earphone device, where the faster the earphone device establishes bluetooth connection, the shorter the first period of time, and the slower the earphone device establishes bluetooth connection, the longer the first period of time. Further, the first period of time may be a period of time during which the headset device normally establishes a bluetooth connection with the other electronic device.
In some embodiments, when the earphone device is in the pairing state, the device scan mode and the page scan mode are turned on, so that the earphone device can be scanned by other electronic devices. Under the condition that the third electronic device and the fourth electronic device do not store the connection information corresponding to the earphone device, the third electronic device and the fourth electronic device can send a scanning request to the earphone device, and the earphone device can send scanning responses to the third electronic device and the fourth electronic device respectively according to the scanning request. Optionally, the first earphone may send a scan response to the third electronic device and the fourth electronic device, or the second earphone may send a scan response to the third electronic device and the fourth electronic device, or the first earphone may send a scan response to the third electronic device and the second earphone may send a scan response to the fourth electronic device.
After receiving the scanning response, the third electronic device can send a first connection request to the earphone device, the first earphone can be connected with the third electronic device in a Bluetooth mode according to the first connection request, similarly, the fourth electronic device can also send a second connection request to the earphone device, and the second earphone can be connected with the fourth electronic device in a Bluetooth mode according to the second connection request.
In some embodiments, a bluetooth connection may be established between the first earpiece and the second earpiece, connection information of the third electronic device may be synchronized to the second earpiece through the first earpiece after the bluetooth connection is established between the first earpiece and the third electronic device, and connection information of the fourth electronic device may be synchronized to the first earpiece through the second earpiece after the bluetooth connection is established between the second earpiece and the fourth electronic device. And information synchronization between the first earphone and the second earphone is realized.
In some embodiments, the first earpiece may be a master earpiece in the earpiece device and the second earpiece may be a slave earpiece in the earpiece device. After the second earphone synchronizes the connection information of the fourth electronic device to the first earphone, the Bluetooth connection object of the fourth electronic device can be switched from the second earphone to the first earphone, and the second earphone monitors the Bluetooth connection between the first earphone and the fourth electronic device, or after the second earphone synchronizes the connection information of the fourth electronic device to the first earphone, the Bluetooth connection object of the fourth electronic device can be switched from the second earphone to the first earphone, and the first earphone synchronizes the data transmitted between the first earphone and the fourth electronic device to the second earphone.
After the first earphone acquires the synchronous connection information of the second earphone, data transmission can be directly carried out with the fourth electronic equipment based on the connection information, the physical link between the second earphone and the fourth electronic equipment is transitionally switched into the physical link between the first earphone and the fourth electronic equipment, and the Bluetooth connection object of the fourth electronic equipment is switched from the second earphone to the first earphone. The second earphone can monitor the Bluetooth physical link between the first earphone and the fourth electronic device, or the first earphone forwards the data transmitted between the second earphone and the fourth electronic device to the second earphone, so that master-slave synchronization is realized.
After the first earphone and the third electronic device establish Bluetooth connection, the first earphone can synchronize connection information of the third electronic device to the second earphone, and the second earphone can monitor the established Bluetooth connection between the first earphone and the third electronic device based on the connection information. Through the information synchronization between the earphones, all the electronic devices which are connected with the earphone device in a Bluetooth mode are connected by adopting the first earphone (namely the main earphone) and the second earphone (namely the slave earphone) to monitor or receive the data forwarded by the first earphone, so that the connected electronic devices are more convenient to manage and transmit data.
Illustratively, FIG. 7A is an interactive timing diagram of a tympanic device connecting two electronic devices, in one embodiment. As shown in fig. 7A, the headset device may be a bluetooth "one-to-two" enabled device that enters a pairing state without being connected to any electronic device. Neither the electronic device E nor the electronic device F stores connection information corresponding to the headphone device. The earphone device is in the pairing state and is in the requirement scan mode and the page scan mode, and the electronic device E and the electronic device F can scan the earphone device and send a Bluetooth connection request to the earphone device. The earphone equipment receives a Bluetooth connection request sent by the electronic equipment E and the electronic equipment F in a first time period, and the first earphone can process the Bluetooth connection request sent by the electronic equipment E, carry out Bluetooth connection with the electronic equipment E and pair with the electronic equipment E in the Bluetooth connection process. The second earphone can process the Bluetooth connection request sent by the electronic equipment F, and is connected with the electronic equipment F in a Bluetooth connection mode, and is paired with the electronic equipment F in the Bluetooth connection process. After the first earphone successfully establishes Bluetooth connection with the electronic equipment E, the connection information of the electronic equipment E can be synchronized with the second earphone, and after the second earphone successfully establishes Bluetooth connection with the electronic equipment F, the connection information of the electronic equipment F can be synchronized with the second earphone, so that information synchronization is realized, and a Bluetooth connection object of the electronic equipment F is switched from the second earphone to the first earphone.
Illustratively, fig. 7B is an interactive timing diagram of a connection of a headset device to two electronic devices in another embodiment. As shown in fig. 7B, the headset device may be a bluetooth "one-to-three" enabled device, and the headset device establishes a bluetooth connection with the electronic device B. The electronic device B may send a first pairing instruction to the earphone device, and the earphone device may enter a pairing state according to the first pairing instruction. The subsequent process of establishing bluetooth connection between the earphone device and the electronic device E and the electronic device F may be the same as that described in fig. 7A, and the detailed description is not repeated here.
In some embodiments, if the headset device first receives the first connection request sent by the third electronic device, the first headset (the first headset may be a master headset) may process the first connection request. When the first earphone finishes processing the first connection request and successfully establishes Bluetooth connection with the third electronic equipment, the second earphone can be sent with second information, the second information is used for informing the second earphone, and the first earphone finishes processing the Bluetooth connection request. If the second earphone receives the first information but does not receive the second information, the first earphone is still in the process of processing the first connection request of the third electronic device, and if the second connection request sent by the fourth electronic device is received in the process, the second earphone can process the second connection request sent by the fourth electronic device and establish Bluetooth connection with the fourth electronic device. The connection speed of the earphone device and the two electronic devices can be improved.
In the embodiment of the application, the Bluetooth connection can be established between the first earphone and the second earphone of the earphone device and the third electronic device and between the first earphone and the second earphone of the earphone device and the fourth electronic device respectively, the first earphone and the second earphone are connected in parallel, the Bluetooth connection can be established between the earphone device and one electronic device without waiting for the earphone device to complete the Bluetooth connection process with the other electronic device, the Bluetooth connection speed between the earphone device and the two electronic devices can be improved, and the connection efficiency is improved. And the first earphone and the second earphone carry out information synchronization for the bluetooth connection object of fourth electronic equipment switches to first earphone from the second earphone, can be more convenient to all establish bluetooth connection's management, guarantees data transmission efficiency.
The third electronic device, the fourth electronic device, and the like may be electronic devices paired with the first electronic device (i.e., the connection information is stored), and may establish bluetooth connection with the first electronic device by using the method for establishing bluetooth connection described in each of the above embodiments without collision.
Alternatively, the bluetooth connection in embodiments of the present application may include any of a classical bluetooth connection and a bluetooth low energy (Bluetooth Low Energy, BLE) connection. In a BLE connection scenario, a first electronic device may send a BLE broadcast, and other electronic devices may scan for the BLE broadcast and establish a BLE bluetooth connection with the first electronic device.
As shown in fig. 8, in one embodiment, another bluetooth-based control method is provided and may be applied to the second electronic device described above, where the method may include:
Step 810, under the condition that the bluetooth connection is established between the second electronic device and the first electronic device, sending a first pairing instruction to the first electronic device, where the first pairing instruction is used to instruct the first electronic device to enter a pairing state, so that other electronic devices can scan the first electronic device. Wherein the other electronic device includes an electronic device that does not store the connection information corresponding to the first electronic device.
In one embodiment, the step of sending a first pairing instruction to the first electronic device includes:
In response to a status-on operation for the first electronic device, a first pairing instruction is sent to the first electronic device, or,
The first pairing instruction is sent to the first electronic equipment according to the set time information, or,
And when the first electronic equipment is detected to be in the set target scene, sending a first pairing instruction to the first electronic equipment.
It should be noted that, description of the bluetooth-based control method applied to the second electronic device provided in the embodiment of the present application may refer to the description related to the bluetooth-based control method applied to the first electronic device described in each embodiment, and the detailed description is not repeated here.
In the embodiment of the application, the first electronic equipment is enabled to enter the pairing state by sending the first pairing instruction to the first electronic equipment through the second electronic equipment connected with the first electronic equipment, so that normal Bluetooth communication between the second electronic equipment and the first electronic equipment is not affected, the mode of enabling the electronic equipment to enter the pairing state can be simplified, and the mode of enabling the electronic equipment to enter the pairing state is richer.
As shown in fig. 9, in one embodiment, a bluetooth-based control apparatus 900 is provided and can be applied to the first electronic device, where the bluetooth-based control apparatus 900 may include an instruction receiving module 910 and a pairing module 920.
The instruction receiving module 910 is configured to receive a first pairing instruction sent by one second electronic device when the first electronic device establishes a bluetooth connection with at least one second electronic device.
The pairing module 920 is configured to enter a pairing state according to the first pairing instruction, so that other electronic devices can scan the first electronic device, where the other electronic devices include electronic devices that do not store connection information corresponding to the first electronic device.
In one embodiment, the bluetooth-based control device 900 includes a connection module in addition to the instruction receiving module 910 and the pairing module 920.
The Bluetooth connection module is used for receiving a scanning request sent by the third electronic equipment when the first electronic equipment is in a pairing state, sending a scanning response to the third electronic equipment according to the scanning request, receiving a first connection request sent by the third electronic equipment, and establishing Bluetooth connection with the third electronic equipment according to the first connection request.
In the embodiment of the application, the first electronic equipment is enabled to enter the pairing state by sending the first pairing instruction to the first electronic equipment through the second electronic equipment connected with the first electronic equipment, so that normal Bluetooth communication between the second electronic equipment and the first electronic equipment is not affected, the mode of enabling the electronic equipment to enter the pairing state can be simplified, and the mode of enabling the electronic equipment to enter the pairing state is richer.
In one embodiment, the pairing module 920 is further configured to, if the first electronic device is not connected to any second electronic device, receive a second pairing instruction sent by the accessory device and enter a pairing state according to the second pairing instruction, where the second pairing instruction is generated by the accessory device according to the detected pairing triggering operation.
In the embodiment of the application, various different modes for enabling the electronic equipment to enter the pairing state can be provided, the modes for enabling the electronic equipment to enter the pairing state are more abundant, the requirements of users under different conditions can be met, and the product viscosity of the users is improved.
In one embodiment, the connection module includes a receiving unit, a disconnecting unit, and a connecting unit.
The receiving unit is used for receiving a first connection request sent by the third electronic device under the condition that the first electronic device establishes Bluetooth connection with the N second electronic devices.
And the disconnection unit is used for performing disconnection processing corresponding to the target electronic equipment in the N second electronic equipment.
And the connection unit is used for establishing Bluetooth connection with the third electronic equipment according to the first connection request.
The disconnection process is used for disconnecting Bluetooth connection between the first electronic equipment and the target electronic equipment, N is the maximum number of Bluetooth connection which the first electronic equipment supports to be established, and N is an integer which is greater than or equal to 1.
In one embodiment, the disconnection unit is further configured to determine a target electronic device of the N second electronic devices, and perform a disconnection process corresponding to the target electronic device.
In one embodiment, N is an integer greater than or equal to 2, and the disconnection unit is further configured to select, from the N second electronic devices, a second electronic device whose priority satisfies a priority condition as a target electronic device according to the priorities of the respective second electronic devices.
In one embodiment, the first electronic device comprises a headset device comprising a first headset and a second headset. The disconnection unit is used for performing disconnection processing corresponding to the target electronic equipment in the N second electronic equipment through the first earphone; and the connection unit is used for establishing Bluetooth connection with the third electronic equipment through the second earphone according to the first connection request.
In one embodiment, the bluetooth-based control apparatus 900 further includes a synchronization module. The synchronization module is used for synchronizing connection information of the third electronic device to the first earphone through the second earphone after the second earphone establishes Bluetooth connection with the third electronic device according to the first connection request.
In one embodiment, the synchronization module is further configured to switch the bluetooth connection object of the third electronic device from the second earpiece to the first earpiece after the second earpiece synchronizes the connection information of the third electronic device with the first earpiece, and monitor the bluetooth connection between the first earpiece and the third electronic device through the second earpiece, or switch the bluetooth connection object of the third electronic device from the second earpiece to the first earpiece after the second earpiece synchronizes the connection information of the third electronic device with the first earpiece, and synchronize data transmitted with the third electronic device to the second earpiece by the first earpiece.
In the embodiment of the application, when the third electronic equipment seizes Bluetooth connection, the disconnection operation and the connection operation are respectively carried out in parallel through the first earphone and the second earphone, so that the seizing speed of the third electronic equipment to the earphone equipment can be improved, and the seizing efficiency is improved. And after the disconnection operation and the connection operation are completed, the first earphone and the second earphone are in information synchronization, so that the Bluetooth connection object of the third electronic device is switched from the second earphone to the first earphone, management of all Bluetooth connection establishment can be more convenient, and data transmission efficiency is ensured.
In one embodiment, the connection module is further configured to, if the first connection request sent by the third electronic device and the second connection request sent by the fourth electronic device are received within the first period of time, establish a bluetooth connection with the third electronic device according to the first connection request, and establish a bluetooth connection with the fourth electronic device according to the second connection request.
In one embodiment, the first electronic device comprises a headset device comprising a first headset and a second headset. The connection module is further used for processing the first connection request through the first earphone, establishing Bluetooth connection with the third electronic device, processing the second connection request through the second earphone and establishing Bluetooth connection with the fourth electronic device.
In one embodiment, the synchronization module is further configured to synchronize connection information corresponding to the third electronic device with the first earphone after the first earphone establishes a bluetooth connection with the third electronic device, and synchronize connection information corresponding to the fourth electronic device with the second earphone after the second earphone establishes a bluetooth connection with the fourth electronic device.
In one embodiment, the bluetooth connection includes any of a classical bluetooth connection and a bluetooth low energy BLE connection.
In the embodiment of the application, the Bluetooth connection can be established between the first earphone and the second earphone of the earphone device and the third electronic device and between the first earphone and the second earphone of the earphone device and the fourth electronic device respectively, the first earphone and the second earphone are connected in parallel, the Bluetooth connection can be established between the earphone device and one electronic device without waiting for the earphone device to complete the Bluetooth connection process with the other electronic device, the Bluetooth connection speed between the earphone device and the two electronic devices can be improved, and the connection efficiency is improved. And the first earphone and the second earphone carry out information synchronization for the bluetooth connection object of fourth electronic equipment switches to first earphone from the second earphone, can be more convenient to all establish bluetooth connection's management, guarantees data transmission efficiency.
As shown in fig. 10, in one embodiment, a bluetooth-based control apparatus 1000 is provided and may be applied to the second electronic device described above, where the bluetooth-based control apparatus 1000 includes an instruction sending module 1010.
The instruction sending module 1010 is configured to send a first pairing instruction to the first electronic device when the bluetooth connection is established between the second electronic device and the first electronic device, where the first pairing instruction is used to trigger the first electronic device to enter a pairing state, so that other electronic devices can scan the first electronic device, and the other electronic devices include electronic devices that do not store connection information corresponding to the first electronic device.
The instruction sending module 1010 is further configured to send a first pairing instruction to the first electronic device in response to a status opening operation for the first electronic device, or send the first pairing instruction to the first electronic device according to the set time information, or send the first pairing instruction to the first electronic device when detecting that the first electronic device is in the set target scene.
In the embodiment of the application, the first electronic equipment is enabled to enter the pairing state by sending the first pairing instruction to the first electronic equipment through the second electronic equipment connected with the first electronic equipment, so that normal Bluetooth communication between the second electronic equipment and the first electronic equipment is not affected, the mode of enabling the electronic equipment to enter the pairing state can be simplified, and the mode of enabling the electronic equipment to enter the pairing state is richer.
FIG. 11 is a block diagram of an electronic device in one embodiment. As shown in fig. 11, the electronic device 1100 may include one or more processors 1110, a memory 1120 coupled to the processor 1110, wherein the memory 1120 may store one or more computer programs that, when executed by the one or more processors 1110, may be configured to implement a bluetooth-based control method as described in the above embodiments as applied to the first electronic device.
Processor 1110 may include one or more processing cores. The processor 1110 utilizes various interfaces and lines to connect various portions of the overall electronic device 1100, perform various functions of the electronic device 1100, and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 1120, and invoking data stored in the memory 1120. Alternatively, the processor 1110 may be implemented in at least one hardware form of digital signal Processing (DIGITAL SIGNAL Processing, DSP), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 1110 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like, the GPU is used for rendering and drawing display contents, and the modem is used for processing wireless communication. It will be appreciated that the modem may not be integrated into the processor 1110 and may be implemented solely by a single communication chip.
The Memory 1120 may include random access Memory (Random Access Memory, RAM) or Read-Only Memory (ROM). Memory 1120 may be used to store instructions, programs, code, sets of codes, or instruction sets. The memory 1120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (e.g., a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like. The storage data area may also store data created by the electronic device 1100 in use, and the like.
The electronic device 1100 may also include a bluetooth module that may be used to provide bluetooth communication functionality, establish bluetooth connections with other electronic devices, and perform bluetooth data transmissions. The bluetooth module may support one or more bluetooth protocols such as classical bluetooth, BLE, etc.), but is not limited thereto and may vary with the development of the bluetooth protocol.
In some embodiments, the processor 1110 is configured to, in a case where the electronic device 1100 establishes a bluetooth connection with at least one second electronic device, receive, by using the bluetooth module, a first pairing instruction sent by the one second electronic device, and control the bluetooth module to enter a pairing state according to the first pairing instruction, so that other electronic devices can scan the electronic device 1100.
It is to be appreciated that the electronic device 1100 may include more or fewer structural elements than those described in the above-described structural block diagrams, including, for example, power modules, physical keys, sensors, etc., and may not be limited herein.
The embodiments of the present application disclose a computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the bluetooth-based control method applied to a first electronic device as described in the above embodiments.
Embodiments of the present application disclose a computer program product comprising a non-transitory computer readable storage medium storing a computer program which, when executed by a processor, implements a bluetooth-based control method as described in the above embodiments as applied to a first electronic device.
In one embodiment, there is also provided an electronic device including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to implement the bluetooth-based control method applied to a second electronic device as described in the embodiments above.
The embodiments of the present application disclose a computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the bluetooth-based control method applied to a second electronic device as described in the above embodiments.
Embodiments of the present application disclose a computer program product comprising a non-transitory computer readable storage medium storing a computer program which, when executed by a processor, implements a bluetooth-based control method as described in the above embodiments for a second electronic device.
Those skilled in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a non-volatile computer readable storage medium, and where the program, when executed, may include processes in the embodiments of the methods described above. Wherein the storage medium may be a magnetic disk, an optical disk, a ROM, etc.
Any reference to memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Suitable nonvolatile memory can include ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (ELECTRICALLY ERASABLE PROM, EEPROM), or flash memory. Volatile memory can include random access memory (random access memory, RAM), which acts as external cache memory. By way of illustration and not limitation, RAM may take many forms, such as static RAM (STATIC RAM, SRAM), dynamic RAM (Dynamic Random Access Memory, DRAM), synchronous DRAM (SDRAM), double-data-rate SDRAM (Double DATA RATE SDRAM, DDR SDRAM), enhanced SDRAM (Enhanced Synchronous DRAM, ESDRAM), synchronous link DRAM (SYNCHLINK DRAM, SLDRAM), memory bus Direct RAM (Rambus DRAM), and Direct memory bus dynamic RAM (DRDRAM).
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all 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 will also appreciate that the embodiments described in the specification are alternative embodiments and that the acts and modules referred to are not necessarily required for the present application. The term "plurality" in the present application includes "two or more".
In various embodiments of the present application, it should be understood that the sequence numbers of the foregoing processes do not imply that the execution sequences of the processes should be determined by the functions and internal logic of the processes, and should not be construed as limiting the implementation of the embodiments of the present application.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The control method, the device, the electronic equipment and the storage medium based on bluetooth disclosed in the embodiments of the present application are described in detail, and specific examples are applied to illustrate the principles and the implementation of the present application, and the description of the above embodiments is only used to help understand the method and the core idea of the present application. Meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (18)

1.一种基于蓝牙的控制方法,其特征在于,应用于第一电子设备,所述第一电子设备包括耳机设备;所述方法包括:1. A Bluetooth-based control method, characterized in that it is applied to a first electronic device, wherein the first electronic device includes a headphone device; the method comprises: 在所述第一电子设备与至少一个第二电子设备建立蓝牙连接的情况下,接收一个所述第二电子设备发送的第一配对指令;When the first electronic device establishes a Bluetooth connection with at least one second electronic device, receiving a first pairing instruction sent by the second electronic device; 根据所述第一配对指令进入配对状态,以使其它电子设备能够扫描到所述第一电子设备,所述其它电子设备包括没有存储与所述第一电子设备对应的连接信息的电子设备;在所述配对状态下,所述第一电子设备允许被其它电子设备扫描搜索到,且能够接收到其它电子设备发送的蓝牙连接请求;Entering a pairing state according to the first pairing instruction, so that another electronic device can scan the first electronic device, the other electronic device including an electronic device that does not store connection information corresponding to the first electronic device; in the pairing state, the first electronic device allows being scanned and searched by the other electronic device and can receive a Bluetooth connection request sent by the other electronic device; 在所述第一电子设备未与任一第二电子设备建立蓝牙连接的情况下,若所述第一电子设备与配件设备电连接,则接收所述配件设备发送的第二配对指令,并根据所述第二配对指令进入配对状态,其中,所述第二配对指令为所述配件设备根据检测到的配对触发操作生成,所述配件设备包括耳机的充电盒。When the first electronic device has not established a Bluetooth connection with any second electronic device, if the first electronic device is electrically connected to an accessory device, it receives a second pairing instruction sent by the accessory device and enters a pairing state according to the second pairing instruction, wherein the second pairing instruction is generated by the accessory device according to a detected pairing trigger operation, and the accessory device includes a charging box for the earphones. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, further comprising: 在所述第一电子设备处于所述配对状态时,接收第三电子设备发送的扫描请求;When the first electronic device is in the pairing state, receiving a scanning request sent by a third electronic device; 根据所述扫描请求向所述第三电子设备发送扫描响应;sending a scan response to the third electronic device according to the scan request; 接收所述第三电子设备发送的第一连接请求,根据所述第一连接请求与所述第三电子设备建立蓝牙连接。A first connection request sent by the third electronic device is received, and a Bluetooth connection is established with the third electronic device according to the first connection request. 3.根据权利要求2所述的方法,其特征在于,所述接收所述第三电子设备发送的第一连接请求,根据所述第一连接请求与所述第三电子设备建立蓝牙连接,包括:3. The method according to claim 2, wherein receiving the first connection request sent by the third electronic device and establishing a Bluetooth connection with the third electronic device according to the first connection request comprises: 在所述第一电子设备与N个第二电子设备建立蓝牙连接的情况下,接收所述第三电子设备发送的第一连接请求;When the first electronic device establishes Bluetooth connections with N second electronic devices, receiving a first connection request sent by the third electronic device; 进行与所述N个第二电子设备中的目标电子设备对应的断连处理,并根据所述第一连接请求与所述第三电子设备建立蓝牙连接;performing a disconnection process corresponding to a target electronic device among the N second electronic devices, and establishing a Bluetooth connection with the third electronic device according to the first connection request; 其中,所述断连处理用于断开所述第一电子设备与所述目标电子设备之间的蓝牙连接;所述N为所述第一电子设备支持建立的蓝牙连接的最大数量,所述N为大于或等于1的整数。The disconnection process is used to disconnect the Bluetooth connection between the first electronic device and the target electronic device; N is the maximum number of Bluetooth connections supported by the first electronic device, and N is an integer greater than or equal to 1. 4.根据权利要求3所述的方法,其特征在于,所述进行与所述N个第二电子设备中的目标电子设备对应的断连处理,包括:4. The method according to claim 3, wherein the performing of the disconnection process corresponding to the target electronic device among the N second electronic devices comprises: 确定所述N个第二电子设备中的目标电子设备,并进行与所述目标电子设备对应的断连处理。A target electronic device among the N second electronic devices is determined, and a disconnection process corresponding to the target electronic device is performed. 5.根据权利要求4所述的方法,其特征在于,所述N为大于或等于2的整数;所述确定所述N个第二电子设备中的目标电子设备,包括:5. The method according to claim 4, wherein N is an integer greater than or equal to 2; and determining a target electronic device among the N second electronic devices comprises: 根据各个所述第二电子设备的优先级,从所述N个第二电子设备中选择优先级满足优先级条件的第二电子设备作为目标电子设备。According to the priorities of the respective second electronic devices, a second electronic device whose priority satisfies a priority condition is selected from the N second electronic devices as a target electronic device. 6.根据权利要求3~5任一所述的方法,其特征在于,所述耳机设备包括第一耳机及第二耳机;所述进行与所述N个第二电子设备中的目标电子设备对应的断连处理,并根据所述第一连接请求与所述第三电子设备建立蓝牙连接,包括:6. The method according to any one of claims 3 to 5, wherein the headphone device includes a first headphone and a second headphone; and the disconnecting process corresponding to the target electronic device among the N second electronic devices and establishing a Bluetooth connection with the third electronic device according to the first connection request comprises: 通过所述第一耳机进行与所述N个第二电子设备中的目标电子设备对应的断连处理,并通过所述第二耳机根据所述第一连接请求与所述第三电子设备建立蓝牙连接。The first headset performs a disconnection process corresponding to a target electronic device among the N second electronic devices, and the second headset establishes a Bluetooth connection with the third electronic device according to the first connection request. 7.根据权利要求6所述的方法,其特征在于,在所述通过所述第二耳机根据所述第一连接请求与所述第三电子设备建立蓝牙连接之后,所述方法还包括:7. The method according to claim 6, characterized in that after establishing a Bluetooth connection with the third electronic device through the second headset according to the first connection request, the method further comprises: 通过所述第二耳机向所述第一耳机同步所述第三电子设备的连接信息。The connection information of the third electronic device is synchronized to the first headset through the second headset. 8.根据权利要求7所述的方法,其特征在于,在所述第二耳机向所述第一耳机同步所述第三电子设备的连接信息之后,所述第三电子设备的蓝牙连接对象从所述第二耳机切换至所述第一耳机,且所述第二耳机对所述第一耳机与所述第三电子设备之间的蓝牙连接进行监听;或,8. The method according to claim 7, wherein after the second headset synchronizes the connection information of the third electronic device to the first headset, the Bluetooth connection target of the third electronic device is switched from the second headset to the first headset, and the second headset monitors the Bluetooth connection between the first headset and the third electronic device; or 所述第三电子设备的蓝牙连接对象从所述第二耳机切换至所述第一耳机,且所述第一耳机将与所述第三电子设备之间传输的数据同步给所述第二耳机。The Bluetooth connection object of the third electronic device is switched from the second earphone to the first earphone, and the first earphone synchronizes the data transmitted between the first earphone and the third electronic device to the second earphone. 9.根据权利要求2所述的方法,其特征在于,所述第一电子设备支持建立的蓝牙连接的最大数量N为大于或等于2的整数;所述接收所述第三电子设备发送的第一连接请求,根据所述第一连接请求与所述第三电子设备建立蓝牙连接,包括:9. The method according to claim 2, wherein a maximum number N of Bluetooth connections supported by the first electronic device is an integer greater than or equal to 2; and receiving a first connection request sent by the third electronic device and establishing a Bluetooth connection with the third electronic device according to the first connection request comprises: 若在第一时间段内接收到所述第三电子设备发送的第一连接请求,以及第四电子设备发送的第二连接请求,则根据所述第一连接请求与所述第三电子设备建立蓝牙连接,以及根据所述第二连接请求与所述第四电子设备建立蓝牙连接。If a first connection request sent by the third electronic device and a second connection request sent by the fourth electronic device are received within the first time period, a Bluetooth connection is established with the third electronic device according to the first connection request, and a Bluetooth connection is established with the fourth electronic device according to the second connection request. 10.根据权利要求9所述的方法,其特征在于,所述耳机设备包括第一耳机及第二耳机;所述根据所述第一连接请求与所述第三电子设备建立蓝牙连接,以及根据所述第二连接请求与所述第四电子设备建立蓝牙连接,包括:10. The method according to claim 9, wherein the earphone device comprises a first earphone and a second earphone; and establishing a Bluetooth connection with the third electronic device according to the first connection request, and establishing a Bluetooth connection with the fourth electronic device according to the second connection request, comprises: 通过所述第一耳机对所述第一连接请求进行处理,并与所述第三电子设备建立蓝牙连接,以及通过所述第二耳机对所述第二连接请求进行处理,与所述第四电子设备建立蓝牙连接。The first connection request is processed by the first headset, and a Bluetooth connection is established with the third electronic device; and the second connection request is processed by the second headset, and a Bluetooth connection is established with the fourth electronic device. 11.根据权利要求10所述的方法,其特征在于,在所述第一耳机对所述第一连接请求进行处理,并与所述第三电子设备建立蓝牙连接之后,所述方法还包括:通过所述第一耳机向所述第二耳机同步所述第三电子设备对应的连接信息;11. The method according to claim 10, wherein after the first headset processes the first connection request and establishes a Bluetooth connection with the third electronic device, the method further comprises: synchronizing connection information corresponding to the third electronic device to the second headset via the first headset; 在所述第二耳机对所述第二连接请求进行处理,与所述第四电子设备建立蓝牙连接之后,所述方法还包括:通过所述第二耳机向所述第一耳机同步所述第四电子设备对应的连接信息。After the second headset processes the second connection request and establishes a Bluetooth connection with the fourth electronic device, the method further includes: synchronizing connection information corresponding to the fourth electronic device to the first headset via the second headset. 12.根据权利要求2~5、9~11任一所述的方法,其特征在于,所述蓝牙连接包括经典蓝牙连接及蓝牙低能耗BLE连接中的任一种。12. The method according to any one of claims 2 to 5, 9 to 11, wherein the Bluetooth connection comprises any one of a classic Bluetooth connection and a Bluetooth Low Energy (BLE) connection. 13.一种基于蓝牙的控制方法,其特征在于,应用于第二电子设备,所述方法包括:13. A Bluetooth-based control method, characterized in that it is applied to a second electronic device, the method comprising: 在所述第二电子设备与第一电子设备之间建立蓝牙连接的情况下,向所述第一电子设备发送第一配对指令,所述第一配对指令用于指示所述第一电子设备进入配对状态,以使其它电子设备能够扫描到所述第一电子设备;其中,所述其它电子设备包括没有存储与所述第一电子设备对应的连接信息的电子设备;When a Bluetooth connection is established between the second electronic device and the first electronic device, sending a first pairing instruction to the first electronic device, wherein the first pairing instruction is used to instruct the first electronic device to enter a pairing state so that another electronic device can scan the first electronic device; wherein the other electronic device includes an electronic device that does not store connection information corresponding to the first electronic device; 其中,所述第一电子设备包括耳机设备;在所述配对状态下,所述第一电子设备允许被其它电子设备扫描搜索到,且能够接收到其它电子设备发送的蓝牙连接请求;在所述第一电子设备未与任一第二电子设备建立蓝牙连接的情况下,若所述第一电子设备与配件设备电连接,所述第一电子设备用于根据所述配件设备发送的第二配对指令进入配对状态;所述第二配对指令为所述配件设备根据检测到的配对触发操作生成,所述配件设备包括耳机的充电盒。In which, the first electronic device includes a headphone device; in the pairing state, the first electronic device allows being scanned and searched by other electronic devices, and can receive Bluetooth connection requests sent by other electronic devices; when the first electronic device has not established a Bluetooth connection with any second electronic device, if the first electronic device is electrically connected to an accessory device, the first electronic device is used to enter the pairing state according to a second pairing instruction sent by the accessory device; the second pairing instruction is generated by the accessory device according to a detected pairing trigger operation, and the accessory device includes a charging box for the headphones. 14.根据权利要求13所述的方法,其特征在于,所述向所述第一电子设备发送第一配对指令,包括:14. The method according to claim 13, wherein sending the first pairing instruction to the first electronic device comprises: 响应针对所述第一电子设备的状态开启操作,向所述第一电子设备发送第一配对指令;或,In response to a status opening operation on the first electronic device, sending a first pairing instruction to the first electronic device; or, 按照设定的时间信息向所述第一电子设备发送第一配对指令;或,Sending a first pairing instruction to the first electronic device according to the set time information; or, 在检测到所述第一电子设备处于设定的目标场景时,向所述第一电子设备发送第一配对指令。When it is detected that the first electronic device is in a set target scene, a first pairing instruction is sent to the first electronic device. 15.一种基于蓝牙的控制装置,其特征在于,应用于第一电子设备,所述第一电子设备包括耳机设备;所述装置包括:15. A Bluetooth-based control device, characterized in that it is applied to a first electronic device, wherein the first electronic device includes a headphone device; the device comprises: 指令接收模块,用于在所述第一电子设备与至少一个第二电子设备建立蓝牙连接的情况下,接收一个所述第二电子设备发送的第一配对指令;an instruction receiving module, configured to receive a first pairing instruction sent by at least one second electronic device when the first electronic device establishes a Bluetooth connection with the second electronic device; 配对模块,用于根据所述第一配对指令进入配对状态,以使其它电子设备能够扫描到所述第一电子设备,所述其它电子设备包括没有存储与所述第一电子设备对应的连接信息的电子设备;在所述配对状态下,所述第一电子设备允许被其它电子设备扫描搜索到,且能够接收到其它电子设备发送的蓝牙连接请求;a pairing module, configured to enter a pairing state according to the first pairing instruction, so that another electronic device can scan the first electronic device, wherein the other electronic device includes an electronic device that does not store connection information corresponding to the first electronic device; in the pairing state, the first electronic device allows being scanned and searched by the other electronic device and can receive a Bluetooth connection request sent by the other electronic device; 所述配对模块,还用于在所述第一电子设备未与任一第二电子设备建立蓝牙连接的情况下,若所述第一电子设备与配件设备电连接,则接收所述配件设备发送的第二配对指令,并根据所述第二配对指令进入配对状态,其中,所述第二配对指令为所述配件设备根据检测到的配对触发操作生成,所述配件设备包括耳机的充电盒。The pairing module is further configured to receive a second pairing instruction sent by the accessory device and enter a pairing state according to the second pairing instruction if the first electronic device is electrically connected to an accessory device when the first electronic device has not established a Bluetooth connection with any second electronic device, wherein the second pairing instruction is generated by the accessory device according to a detected pairing trigger operation, and the accessory device includes a charging box for the earphones. 16.一种基于蓝牙的控制装置,其特征在于,应用于第二电子设备,所述装置包括:16. A Bluetooth-based control device, characterized in that it is applied to a second electronic device, the device comprising: 指令发送模块,用于在所述第二电子设备与第一电子设备之间建立蓝牙连接的情况下,向所述第一电子设备发送第一配对指令,所述第一配对指令用于触发所述第一电子设备进入配对状态,以使其它电子设备能够扫描到所述第一电子设备;其中,所述其它电子设备包括没有存储与所述第一电子设备对应的连接信息的电子设备;an instruction sending module, configured to send a first pairing instruction to the first electronic device when a Bluetooth connection is established between the second electronic device and the first electronic device, wherein the first pairing instruction is configured to trigger the first electronic device to enter a pairing state so that another electronic device can scan the first electronic device; wherein the other electronic device includes an electronic device that does not store connection information corresponding to the first electronic device; 其中,所述第一电子设备包括耳机设备;在所述配对状态下,所述第一电子设备允许被其它电子设备扫描搜索到,且能够接收到其它电子设备发送的蓝牙连接请求;在所述第一电子设备未与任一第二电子设备建立蓝牙连接的情况下,若所述第一电子设备与配件设备电连接,所述第一电子设备用于根据所述配件设备发送的第二配对指令进入配对状态;所述第二配对指令为所述配件设备根据检测到的配对触发操作生成,所述配件设备包括耳机的充电盒。In which, the first electronic device includes a headphone device; in the pairing state, the first electronic device allows being scanned and searched by other electronic devices, and can receive Bluetooth connection requests sent by other electronic devices; when the first electronic device has not established a Bluetooth connection with any second electronic device, if the first electronic device is electrically connected to an accessory device, the first electronic device is used to enter the pairing state according to a second pairing instruction sent by the accessory device; the second pairing instruction is generated by the accessory device according to a detected pairing trigger operation, and the accessory device includes a charging box for the headphones. 17.一种电子设备,其特征在于,包括存储器及处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器实现如权利要求1~12或13~14任一所述的方法。17. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 12 or 13 to 14. 18.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1~12或13~14任一所述的方法。18. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 12 or 13 to 14 is implemented.
CN202111050876.3A 2021-09-08 2021-09-08 Bluetooth-based control method, device, electronic device, and storage medium Active CN115776661B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111050876.3A CN115776661B (en) 2021-09-08 2021-09-08 Bluetooth-based control method, device, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111050876.3A CN115776661B (en) 2021-09-08 2021-09-08 Bluetooth-based control method, device, electronic device, and storage medium

Publications (2)

Publication Number Publication Date
CN115776661A CN115776661A (en) 2023-03-10
CN115776661B true CN115776661B (en) 2025-08-05

Family

ID=85388138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111050876.3A Active CN115776661B (en) 2021-09-08 2021-09-08 Bluetooth-based control method, device, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN115776661B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115866569A (en) * 2021-09-23 2023-03-28 Oppo广东移动通信有限公司 Device control method, device, electronic device and storage medium
WO2025165898A1 (en) * 2024-02-01 2025-08-07 Apple Inc. Electronic devices with vision-assisted radio control

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110191442A (en) * 2019-04-18 2019-08-30 华为技术有限公司 Bluetooth connection method, equipment and system
CN112654030A (en) * 2020-12-16 2021-04-13 深圳市爱都科技有限公司 Bluetooth pairing method and device, electronic equipment and computer-readable storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102295516B1 (en) * 2014-09-15 2021-08-31 후아웨이 테크놀러지 컴퍼니 리미티드 Communication method, communication system and relevant device of wearable device
WO2021037208A1 (en) * 2019-08-30 2021-03-04 华为技术有限公司 Bluetooth connection method and electronic apparatus
CN112449332B (en) * 2019-08-30 2022-04-12 华为技术有限公司 A Bluetooth connection method and electronic device
CN111629370B (en) * 2020-05-27 2022-11-04 歌尔科技有限公司 Bluetooth headset, pairing connection method and device thereof, and TWS headset
CN112004173B (en) * 2020-08-27 2023-06-27 努比亚技术有限公司 Bluetooth headset switching method, mobile terminal and computer readable storage medium
CN113194450B (en) * 2021-05-06 2023-08-04 维沃移动通信有限公司 Bluetooth equipment management method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110191442A (en) * 2019-04-18 2019-08-30 华为技术有限公司 Bluetooth connection method, equipment and system
CN112654030A (en) * 2020-12-16 2021-04-13 深圳市爱都科技有限公司 Bluetooth pairing method and device, electronic equipment and computer-readable storage medium

Also Published As

Publication number Publication date
CN115776661A (en) 2023-03-10

Similar Documents

Publication Publication Date Title
KR102713645B1 (en) Method, device and storage medium for selecting destination address in sidelink
US10911930B2 (en) Wireless system, wireless device, non-transitory computer-readable storage medium having stored therein communication program, and communication method
EP4199558A1 (en) Audio control system
CN111447602B (en) Bluetooth device, Bluetooth preemption method and device thereof, and computer-readable storage medium
CN109417758B (en) Bluetooth connection method and terminal
CN115776662B (en) Bluetooth connection method, bluetooth connection device, earphone device and computer readable storage medium
CN108391205B (en) Left and right channel switching method and device, readable storage medium, and terminal
US20190327675A1 (en) Wireless system, wireless device, non-transitory computer-readable storage medium having stored therein communication program, and communication method
CN104335642A (en) Smart battery wear leveling for audio devices
CN117119614B (en) A Bluetooth connection method, device and system
CN115776661B (en) Bluetooth-based control method, device, electronic device, and storage medium
EP3008923B1 (en) A method of operating a binaural hearing aid system and a binaural hearing aid system
CN103701000B (en) Smart Hub with Bluetooth pairing function and Bluetooth pairing method thereof
CN114040373A (en) Audio service processing method, device, electronic device and storage medium
JP2022554365A (en) Relay connection establishment method and device
JP7453385B2 (en) Resource scheduling method, communication equipment, network equipment and storage medium
CN116320859B (en) Methods and devices for controlling the status of headphone devices, headphone devices and storage media
JP7252259B2 (en) Access control method, message broadcasting method and related device
WO2023035782A1 (en) Bluetooth connection method and apparatus, earphone device and computer-readable storage medium
CN117751593A (en) Context-based wireless protocol connection
CN110798896A (en) A transmission method, terminal device and network side device
CN105163391A (en) Data transmission method, terminal and wireless access point
CN115915037B (en) Call control method, device, electronic device and computer-readable storage medium
CN119767279A (en) Information updating method and device, audio sharing method and system, and electronic device
EP1753254B1 (en) System and method of automatically turning a wireless radio station ON or OFF

Legal Events

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