CN110944313A - Bluetooth connection method, device, storage medium and terminal - Google Patents

Bluetooth connection method, device, storage medium and terminal Download PDF

Info

Publication number
CN110944313A
CN110944313A CN201911230006.7A CN201911230006A CN110944313A CN 110944313 A CN110944313 A CN 110944313A CN 201911230006 A CN201911230006 A CN 201911230006A CN 110944313 A CN110944313 A CN 110944313A
Authority
CN
China
Prior art keywords
bluetooth
peripheral
service
equipment
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911230006.7A
Other languages
Chinese (zh)
Other versions
CN110944313B (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.)
Huizhou TCL Mobile Communication Co Ltd
Original Assignee
Huizhou TCL Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN201911230006.7A priority Critical patent/CN110944313B/en
Publication of CN110944313A publication Critical patent/CN110944313A/en
Application granted granted Critical
Publication of CN110944313B publication Critical patent/CN110944313B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/19Connection re-establishment
    • 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

Abstract

The embodiment of the application discloses a Bluetooth connection method, a Bluetooth connection device, a storage medium and a terminal. The method comprises the following steps: receiving a Bluetooth connection request sent by an external Bluetooth device, wherein the Bluetooth connection request carries first service information of a service currently provided by the external Bluetooth device; responding the Bluetooth connection request to connect with the peripheral Bluetooth equipment; matching second service information of the Bluetooth service required by the application in the current running of the first service information; if the matching fails, the connection with the peripheral Bluetooth equipment is disconnected, and a reconnection request is sent to the peripheral Bluetooth equipment, wherein the reconnection request carries the second service information, so that the Bluetooth connection efficiency of the terminal can be effectively improved.

Description

Bluetooth connection method, device, storage medium and terminal
Technical Field
The application relates to the field of mobile terminal application, in particular to a Bluetooth connection method, a Bluetooth connection device, a Bluetooth connection storage medium and a Bluetooth connection terminal.
Background
At present, when a mobile terminal is connected with a bluetooth peripheral, automatic connection operation under certain conditions is set for improving the use experience of a user, so that the step of manual connection operation of the user is omitted. For example, after the mobile terminal starts the bluetooth, the mobile terminal automatically tries to connect to the bluetooth peripheral once, and if the connected device is in a normal state, the mobile terminal user can directly use the bluetooth function after the connection is successful, and no additional manual operation is needed.
In the related technology, two modes exist for automatically reconnecting the mobile terminal and the Bluetooth peripheral equipment, namely, the mobile terminal is actively reconnected; secondly, Bluetooth peripheral equipment is actively reconnected. When the bluetooth peripheral is used as a reconnection initiator, the mobile terminal as a passive connection party cannot control connected services, for example, the bluetooth headset or the vehicle-mounted device usually supports both call services and media audio services, but if the bluetooth peripheral actively connects to initiate connection of only one of the services, the other service cannot work. At this time, the mobile terminal user must manually disconnect, and then perform a connection operation, which is cumbersome in operation steps and affects user experience.
Disclosure of Invention
The embodiment of the application provides a Bluetooth connection method, a Bluetooth connection device, a storage medium and a terminal, which can effectively improve the Bluetooth connection efficiency of the terminal.
The embodiment of the application provides a Bluetooth connection method, which comprises the following steps:
receiving a Bluetooth connection request sent by an external Bluetooth device, wherein the Bluetooth connection request carries first service information of a service currently provided by the external Bluetooth device;
responding the Bluetooth connection request to connect with the peripheral Bluetooth equipment;
matching second service information of the Bluetooth service required by the application in the current running of the first service information;
and if the matching fails, disconnecting the connection with the peripheral Bluetooth equipment, and sending a reconnection request to the peripheral Bluetooth equipment, wherein the reconnection request carries the second service information.
Correspondingly, this application embodiment still provides a bluetooth connecting device, includes:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a Bluetooth connection request sent by peripheral Bluetooth equipment, and the Bluetooth connection request carries first service information of a service currently provided by the peripheral Bluetooth equipment;
the connection unit is used for responding the Bluetooth connection request and connecting the peripheral Bluetooth equipment;
the first matching unit is used for matching second service information of the Bluetooth service required by the application in the current running of the first service information;
and the sending unit is used for disconnecting the connection with the peripheral Bluetooth equipment and sending a reconnection request to the peripheral Bluetooth equipment if the matching fails, wherein the reconnection request carries the second service information.
Correspondingly, the embodiment of the present application further provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to perform the steps in the bluetooth connection method.
Correspondingly, the embodiment of the present application further provides a terminal, which includes a processor and a memory, where the memory stores a plurality of instructions, and the processor loads the instructions to execute the steps in the bluetooth connection method.
The embodiment of the application discloses a Bluetooth connection method, a Bluetooth connection device, a Bluetooth connection storage medium and a Bluetooth connection terminal. The method comprises the following steps: receiving a Bluetooth connection request sent by an external Bluetooth device, wherein the Bluetooth connection request carries a service protocol initiated by the external Bluetooth device; connecting with the peripheral Bluetooth equipment according to the Bluetooth connection request; acquiring a service set of the peripheral Bluetooth equipment based on a service protocol initiated by the peripheral Bluetooth equipment; matching the service set with a target service set, wherein the target service set comprises a to-be-performed Bluetooth service which needs to be executed by a currently running application; if the matching fails, the connection with the peripheral Bluetooth equipment is disconnected, and a reconnection request is sent to the peripheral Bluetooth equipment, wherein the reconnection request carries the service protocol of the Bluetooth service to be performed, so that the Bluetooth connection efficiency of the terminal can be effectively improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a first bluetooth connection method according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating a second bluetooth connection method according to an embodiment of the present application.
Fig. 3 is a block diagram of a first bluetooth connection apparatus according to an embodiment of the present disclosure.
Fig. 4 is a block diagram of a second bluetooth connection apparatus according to an embodiment of the present disclosure.
Fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Based on the above problems, embodiments of the present application provide a bluetooth connection method, apparatus, storage medium, and terminal, which can improve the efficiency of bluetooth connection of the terminal. The following are detailed below. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
Referring to fig. 1, fig. 1 is a flowchart illustrating a bluetooth connection method according to an embodiment of the present disclosure. The bluetooth connection method may be applied to mobile terminals such as mobile phones, tablet computers, notebook computers, palmtop computers, Portable Media Players (PMPs), and fixed terminals such as desktop computers. The specific process of the bluetooth connection method may be as follows:
101. receiving a Bluetooth connection request sent by an external Bluetooth device, wherein the Bluetooth connection request carries first service information of a service currently provided by the external Bluetooth device.
Specifically, the peripheral bluetooth device may include multiple types, such as: bluetooth headset, bluetooth speaker or bluetooth car, etc.
When the Bluetooth function is used for communication, two devices, namely a master device and a slave device, are included. The bluetooth technology stipulates that when each pair of equipment carries out bluetooth communication, one of the equipment is required to be a master role, and the other equipment is required to be a slave role, so that the communication can be carried out. Theoretically, one bluetooth master device can communicate with 7 bluetooth slave devices simultaneously. A device with Bluetooth communication function can be switched between two roles, normally works in a slave mode, waits for other master devices to connect, and is switched into the master mode to initiate a call to other devices when needed. When one bluetooth device initiates a call in a master mode, the bluetooth device needs to know the information of the other party such as the bluetooth address, the pairing password and the like, and can directly initiate the call after the pairing is completed.
Before receiving the bluetooth connection request sent by the peripheral bluetooth device, the bluetooth function needs to be turned on, so in some embodiments, before the step "receiving the bluetooth connection request sent by the peripheral bluetooth device", the following steps may be further included:
detecting whether the running application needs to execute a Bluetooth function;
and if so, receiving a Bluetooth starting instruction, and starting the Bluetooth function according to the starting instruction.
Specifically, detecting whether the running application needs to execute the bluetooth function may first acquire the running application. The acquiring of the running application program may be through viewing the background running program, for example, by opening a system task manager to view the running application program, so that the currently running application may be determined.
The application software may include various types, such as a telephony application, an entertainment application, and the like. The currently running application may be a call application, and the user may determine whether the bluetooth function needs to be started according to an actual situation. For example, the user may be performing a call application while driving, and the bluetooth function needs to be turned on at this time.
When detecting that the running application needs to execute the Bluetooth function, the running application can trigger a Bluetooth starting instruction, and the Bluetooth function is started according to the Bluetooth starting instruction. After the bluetooth function is turned on, a connection request sent by the peripheral bluetooth device may be received, where the bluetooth connection request carries a service protocol initiated by the peripheral bluetooth device, and the service protocol may include a service type initiated by the peripheral device, and the service type may include multiple types, such as: a call service, which may perform a call function after performing a bluetooth connection, or a media audio service, which may perform a media entertainment function after performing a bluetooth connection, etc.
102. And responding the Bluetooth connection request to connect with the peripheral Bluetooth equipment.
Specifically, after receiving a connection request sent by an external bluetooth device, the peripheral bluetooth device may perform bluetooth connection with the external bluetooth device.
In some embodiments, before the step "connect with the peripheral bluetooth device according to the bluetooth connection request", the following steps may be further included:
acquiring a Bluetooth device list, wherein the Bluetooth device list comprises a plurality of historical connection Bluetooth devices;
matching the historical connection Bluetooth equipment with the peripheral Bluetooth equipment;
and if the matching is successful, the execution step responds to the Bluetooth connection request to connect with the peripheral Bluetooth equipment.
After the bluetooth function is opened, the bluetooth device list can be acquired by opening the bluetooth setting interface. The bluetooth device list may include a plurality of bluetooth device identifiers, each bluetooth device identifier may correspond to one bluetooth device, and the bluetooth device may be a bluetooth device that has been historically connected to the terminal, that is, a historically connected bluetooth device. For example, a historically connected bluetooth device may be: device a, device B, device C, etc.
Furthermore, the historical connection Bluetooth equipment is matched with the peripheral equipment Bluetooth connection equipment, the equipment identification of the historical connection Bluetooth equipment and the equipment identification of the peripheral equipment Bluetooth equipment can be obtained, and then the equipment identification of the historical connection Bluetooth equipment is matched with the equipment identification of the peripheral equipment Bluetooth equipment.
For example, the history connection bluetooth device may be device a, device B, and device C, the identifier of device a may be AAA, the identifier of device B may be BBB, the identifier of device C may be CCC, and the identifier of the peripheral bluetooth device may be AAA, it may be determined that the peripheral bluetooth device is the history connection bluetooth device of the terminal, that is, the terminal stores the connection information of the peripheral bluetooth device.
After determining that the peripheral Bluetooth device is a history connection Bluetooth device, performing Bluetooth connection with the peripheral Bluetooth device according to a Bluetooth connection request sent by the peripheral Bluetooth device.
When the matching of the peripheral Bluetooth equipment and the equipment identification of the historical connection Bluetooth equipment fails, the peripheral Bluetooth equipment needs to be subjected to Bluetooth matching, and after the Bluetooth matching is successful, the Bluetooth connection can be carried out. For example, in some embodiments, after the step of "matching the history connection bluetooth device with the peripheral bluetooth device", the following steps may be further included:
if the matching fails, acquiring equipment information of the peripheral Bluetooth equipment;
and sending a Bluetooth pairing request to the peripheral Bluetooth equipment based on the equipment information.
Specifically, after the matching fails, the peripheral bluetooth device needs to be paired. Bluetooth pairing can be an authentication process, and when a user listens to music, shares files or carries out a call by using Bluetooth equipment, the user has a pairing-connection-data transmission process.
In order to ensure the security of bluetooth communication, bluetooth SIG (bluetooth technical association) performs data interaction in an authentication manner. Meanwhile, in order to ensure the convenience of use, the first communication authentication between the two Bluetooth devices is completed in a pairing mode, and after pairing, the subsequent communication connection does not need to be confirmed every time. Therefore, the generation of the authentication code is started from pairing, and after pairing, a link key agreed between the devices is established by a Personal Identification Number (PIN) code for generating an initial authentication code for a later established connection. Therefore, the two devices cannot establish an authentication relationship without pairing, and cannot be connected and operated afterwards, so that the Bluetooth communication safety is ensured to a certain extent by pairing.
Specifically, match with peripheral equipment bluetooth device, can be through the equipment information who acquires peripheral equipment bluetooth device, equipment information can include peripheral equipment bluetooth device's equipment identification, and the equipment identification of oweing through peripheral equipment bluetooth device sends the bluetooth to establishing bluetooth device and pairs the request. A bluetooth connection may be made with the peripheral bluetooth device based on a response of the peripheral bluetooth device to the bluetooth pairing request.
103. And matching second service information of the Bluetooth service required by the application in the current running of the first service information.
Specifically, the first service information may be a service protocol carried in a bluetooth connection request sent by the peripheral bluetooth device, and the service set of the peripheral bluetooth device is acquired, and may be acquired from the service protocol carried in the bluetooth connection request sent by the peripheral bluetooth device, where the service protocol may represent a bluetooth service executed for the bluetooth connection initiated by the peripheral bluetooth device.
Wherein the service set may comprise at least one bluetooth service, for example, the service set may comprise a media audio service. The service set of the peripheral Bluetooth equipment is acquired, so that the peripheral Bluetooth equipment can be conveniently matched with the Bluetooth service required to be executed by the terminal, and the Bluetooth connection operation is completed according to the matching result.
Specifically, the second service information of the bluetooth service required by the application in the current running of the first service information is matched. The second service information may be a service protocol of a bluetooth service required by the currently running application, and the target service set may refer to a to-be-executed bluetooth service that the currently running application of the terminal needs to execute, that is, a bluetooth function that the terminal needs to execute when performing the bluetooth connection.
For example, the service set may include a media audio service, the target service set may include a call service, and matching the service set with the target service set may determine that matching between the service set and the target service set fails, that is, a service protocol initiated by the peripheral bluetooth device is not a to-be-performed bluetooth service of the current terminal.
For example, the service set may include a call service, the target service set may include a call service, and matching the service set with the target service set may determine that the matching between the service set and the target service set is successful. Then in some embodiments, the following steps may also be included:
and if the first service information is successfully matched with the second service information of the Bluetooth service required by the currently running application, executing the Bluetooth service required by the currently running application based on the peripheral Bluetooth equipment.
After the service set is successfully matched with the target service set, the Bluetooth connection with the peripheral Bluetooth device can be continuously carried out, and the Bluetooth function to be executed by the application in the current operation is completed based on the peripheral Bluetooth device. For example, the currently running application may be a call application, the peripheral bluetooth device may be a bluetooth headset, and the user may perform a call operation using the bluetooth headset.
104. And if the matching fails, disconnecting the connection with the peripheral Bluetooth equipment, and sending a reconnection request to the peripheral Bluetooth equipment, wherein the reconnection request carries the second service information.
After the service set fails to match the target service set, in order to avoid the user reconnection failure, the connection with the peripheral bluetooth device may be disconnected, and then a reconnection request may be sent to the peripheral bluetooth device.
In some embodiments, the step "sending a reconnect request to a peripheral bluetooth device" may include the following process:
acquiring a target service protocol of a Bluetooth service required by an application in current operation;
and sending a reconnection request to the peripheral Bluetooth equipment based on the target service protocol.
Specifically, the target service protocol of the to-be-performed bluetooth service is obtained, and the to-be-performed bluetooth service may include multiple services, for example, the to-be-performed bluetooth service may be a call service, and the call service may be used as the target service protocol. After the target service protocol is determined, the target service protocol can be sent to the peripheral Bluetooth device, that is, the target service protocol can be used as a Bluetooth reconnection request, so that the peripheral Bluetooth device can execute corresponding Bluetooth service according to the requirement of an application in the running of the terminal, and the problem of abnormity in the Bluetooth connection process can be solved.
The embodiment of the application discloses a Bluetooth connection method, which comprises the following steps: receiving a Bluetooth connection request sent by an external Bluetooth device, wherein the Bluetooth connection request carries first service information of a service currently provided by the external Bluetooth device; responding the Bluetooth connection request to connect with the peripheral Bluetooth equipment; matching second service information of the Bluetooth service required by the application in the current running of the first service information; and if the matching fails, disconnecting the connection with the peripheral Bluetooth equipment, and sending a reconnection request to the peripheral Bluetooth equipment, wherein the reconnection request carries the second service information. This embodiment matches the bluetooth clothes agreement at peripheral hardware bluetooth equipment and terminal through acquireing bluetooth service agreement, carries out the bluetooth according to the matching result and connects, can effectively improve terminal bluetooth connection efficiency.
Referring to fig. 2, fig. 2 is a flowchart illustrating a second bluetooth connection method according to an embodiment of the present disclosure. In this embodiment, taking a terminal as an example, the specific application of the bluetooth connection method may be as follows:
201. the terminal starts the Bluetooth function.
Specifically, the terminal starts the bluetooth function, and the bluetooth function can be opened according to the application requirement in the current operation, for example, the user can be in a driving state at present, and when the terminal is used for answering a call, the bluetooth device needs to be used, and then the bluetooth function needs to be started at this moment.
202. And the terminal receives a Bluetooth connection request sent by the Bluetooth equipment.
After the terminal starts the bluetooth function, the user can start the bluetooth device, wherein the bluetooth device can be a bluetooth headset, or vehicle bluetooth, etc. After the user starts the bluetooth device, the bluetooth device may send a bluetooth connection request to the terminal, and the bluetooth device may be a bluetooth device that has been historically connected to the terminal, or may be a bluetooth device that has been connected for the first time.
For example, when the bluetooth device is a history connected bluetooth device, the terminal already stores the device information of the bluetooth device, and may directly receive the bluetooth connection request sent by the bluetooth device. For another example, when the bluetooth device is a bluetooth device that is connected for the first time, the terminal does not store the device information of the bluetooth device, the terminal may obtain the device information of the bluetooth device, the device information may include a device identifier and the like, a bluetooth pairing request is sent to the bluetooth device according to the device identifier of the bluetooth device, and after pairing with the bluetooth device is completed, the terminal may be connected to the bluetooth device.
203. And the terminal acquires the service protocol sent by the Bluetooth equipment according to the Bluetooth connection request.
Specifically, after receiving a bluetooth connection request sent by a bluetooth device, the terminal may obtain a service protocol sent by the bluetooth device according to the bluetooth connection request, where the service protocol sent by the bluetooth device may be a bluetooth service sent by a current bluetooth device, for example, the bluetooth service may be a call service, an entertainment service, and the like.
For example, the service sent by the bluetooth device acquired by the terminal according to the service protocol may be an entertainment service.
204. The terminal judges whether the service agreement meets the Bluetooth service to be carried out.
Specifically, the to-be-performed bluetooth service that needs to be completed by the application currently running in the terminal may be a call service, the bluetooth service included in the service agreement sent by the bluetooth device may be an entertainment service, and it may be determined that the bluetooth service carried by the service agreement sent by the bluetooth device does not satisfy the to-be-performed bluetooth service of the terminal, so step 206 may be executed.
For another example, the to-be-performed bluetooth service that needs to be completed by the application currently running in the terminal may be an entertainment service, and the bluetooth service included in the service protocol sent by the bluetooth device may be an entertainment service, and then it may be determined that the bluetooth service carried by the service protocol sent by the bluetooth device satisfies the to-be-performed bluetooth service of the terminal, so step 205 may be executed.
205. And the terminal responds to the connection request and performs Bluetooth connection with the Bluetooth equipment.
When the terminal detects that the Bluetooth service included in the service protocol sent by the Bluetooth equipment meets the requirement of the terminal for the Bluetooth service, the terminal can respond to the Bluetooth connection request sent by the Bluetooth equipment and complete Bluetooth connection with the Bluetooth equipment based on the Bluetooth connection request. After the Bluetooth connection is completed, the terminal can execute the function corresponding to the Bluetooth service to be performed.
206. The terminal refuses the Bluetooth connection request sent by the Bluetooth equipment.
When the terminal detects that the Bluetooth service included in the service protocol sent by the Bluetooth equipment does not satisfy the Bluetooth service to be performed by the terminal, the terminal can refuse to respond to the Bluetooth connection request sent by the Bluetooth equipment, and can indicate that the Bluetooth connection initiated by the Bluetooth equipment does not satisfy the connection condition and the connection fails.
207. And the terminal sends a reconnection request to the Bluetooth equipment based on the Bluetooth service to be performed.
Specifically, after the terminal rejects the bluetooth connection initiated by the bluetooth device, the terminal may be used as the bluetooth connection initiator to send a reconnection request to the bluetooth device. In order to ensure that the terminal and the bluetooth device successfully complete the bluetooth connection, the reconnection request may include a bluetooth protocol corresponding to the bluetooth connection to be performed by the terminal, so that the bluetooth device may complete the bluetooth connection according to the bluetooth service protocol sent by the terminal. The operation step of manual reconnection of a user can be omitted, and the user experience is improved.
The embodiment of the application discloses a Bluetooth connection method, which comprises the following steps: receiving a Bluetooth connection request sent by an external Bluetooth device, wherein the Bluetooth connection request carries first service information of a service currently provided by the external Bluetooth device; responding the Bluetooth connection request to connect with the peripheral Bluetooth equipment; matching second service information of the Bluetooth service required by the application in the current running of the first service information; and if the matching fails, disconnecting the connection with the peripheral Bluetooth equipment, and sending a reconnection request to the peripheral Bluetooth equipment, wherein the reconnection request carries the second service information. This embodiment matches the bluetooth clothes agreement at peripheral hardware bluetooth equipment and terminal through acquireing bluetooth service agreement, carries out the bluetooth according to the matching result and connects, can effectively improve terminal bluetooth connection efficiency.
In order to better implement the bluetooth connection method provided in the embodiments of the present application, an apparatus based on the bluetooth connection method is also provided in the embodiments of the present application. The terms are the same as those in the bluetooth connection method, and details of implementation may refer to the description in the method embodiment.
Referring to fig. 3, fig. 3 is a block diagram of a first bluetooth connection apparatus according to an embodiment of the present application, including:
a receiving unit 301, configured to receive a bluetooth connection request sent by an external bluetooth device, where the bluetooth connection request carries first service information of a service currently provided by the external bluetooth device;
a connection unit 302, configured to connect to the peripheral bluetooth device in response to the bluetooth connection request;
a first matching unit 303, configured to match second service information of a bluetooth service required by an application in current running of the first service information;
a sending unit 304, configured to disconnect the connection with the peripheral bluetooth device if the matching fails, and send a reconnection request to the peripheral bluetooth device, where the reconnection request carries the second service information.
Referring to fig. 4, fig. 4 is a block diagram of a second bluetooth connection device according to an embodiment of the present disclosure. In some embodiments, the bluetooth connection apparatus may further include:
a first acquisition unit 305 configured to acquire a bluetooth device list including a plurality of historically connected bluetooth devices;
a second matching unit 306, configured to match the history connection bluetooth device with the peripheral bluetooth device;
an executing unit 307, configured to execute the step of connecting with the peripheral bluetooth device in response to the bluetooth connection request.
In some embodiments, the bluetooth connection apparatus may further include:
the second acquisition unit is used for acquiring the equipment information of the peripheral Bluetooth equipment;
a first operation unit, configured to send a bluetooth pairing request to the peripheral bluetooth device based on the device information.
In some embodiments, the bluetooth connection apparatus may further include:
the detection unit is used for detecting whether the running application needs to execute the Bluetooth function or not;
and the starting unit is used for receiving the Bluetooth starting instruction and starting the Bluetooth function according to the starting instruction.
In some embodiments, the sending unit 304 may include:
the acquisition subunit is used for acquiring a target service protocol of the Bluetooth service required by the application in the current operation;
and the sending subunit is used for sending a reconnection request to the peripheral Bluetooth equipment based on the target service protocol.
In some embodiments, the bluetooth connection apparatus may further include:
and the second operation unit is used for executing the Bluetooth service required by the currently running application based on the peripheral Bluetooth equipment if the first service information is successfully matched with the second service information of the Bluetooth service required by the currently running application.
The embodiment of the application discloses bluetooth connecting device includes: receiving a Bluetooth connection request sent by an external Bluetooth device, wherein the Bluetooth connection request carries first service information of a service currently provided by the external Bluetooth device; responding the Bluetooth connection request to connect with the peripheral Bluetooth equipment; matching second service information of the Bluetooth service required by the application in the current running of the first service information; and if the matching fails, disconnecting the connection with the peripheral Bluetooth equipment, and sending a reconnection request to the peripheral Bluetooth equipment, wherein the reconnection request carries the second service information. This embodiment matches the bluetooth clothes agreement at peripheral hardware bluetooth equipment and terminal through acquireing bluetooth service agreement, carries out the bluetooth according to the matching result and connects, can effectively improve terminal bluetooth connection efficiency.
The embodiment of the application also provides a terminal. As shown in fig. 5, the terminal may include a Radio Frequency (RF) circuit 601, a memory 602 including one or more storage media, an input unit 603, a display unit 604, a sensor 605, an audio circuit 606, a Wireless Fidelity (WiFi) module 607, a processor 608 including one or more processing cores, and a power supply 609. Those skilled in the art will appreciate that the terminal structure shown in fig. 5 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the RF circuit 601 may be used for receiving and transmitting signals during the process of transmitting and receiving information, and in particular, for processing the received downlink information of the base station by one or more processors 608; in addition, data relating to uplink is transmitted to the base station. In general, the RF circuit 601 includes, but is not limited to, an antenna, at least one Amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuit 601 may also communicate with networks and other devices via wireless communications.
The memory 602 may be used to store software programs and modules, and the processor 608 executes various functional applications and data processing by operating the software programs and modules stored in the memory 602. The memory 602 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like. Further, the memory 602 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 608 and the input unit 603 access to the memory 602.
The input unit 603 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in one particular embodiment, input unit 603 may include a touch-sensitive surface as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations by a user (e.g., operations by a user on or near the touch-sensitive surface using a finger, a stylus, or any other suitable object or attachment) thereon or nearby, and drive the corresponding connection device according to a predetermined program. The input unit 603 may include other input devices in addition to the touch-sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 604 may be used to display information input by or provided to the user and various graphical user interfaces of the server, which may be made up of graphics, text, icons, video, and any combination thereof. The display unit 604 may include a display panel, and optionally, the display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay the display panel, and when a touch operation is detected on or near the touch-sensitive surface, the touch operation is transmitted to the processor 608 to determine the type of touch event, and the processor 608 then provides a corresponding visual output on the display panel according to the type of touch event. Although in FIG. 5 the touch-sensitive surface and the display panel are two separate components to implement input and output functions, in some embodiments the touch-sensitive surface may be integrated with the display panel to implement input and output functions.
The terminal may also include at least one sensor 605, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that turns off the display panel and the backlight when the server moves to the ear.
Audio circuitry 606, speakers, and microphones may provide an audio interface between the user and the server. The audio circuit 606 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 606 and converted into audio data, which is then processed by the audio data output processor 608, and then passed through the RF circuit 601 to be sent to, for example, a terminal, or the audio data is output to the memory 602 for further processing. The audio circuitry 606 may also include an ear-bud jack to provide communication of peripheral headphones with the server.
WiFi belongs to short-distance wireless transmission technology, and the terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 607, and provides wireless broadband internet access for the user. Although fig. 5 shows the WiFi module 607, it is understood that it does not belong to the essential constitution of the terminal, and may be omitted entirely as needed within the scope of not changing the essence of the application.
The processor 608 is a control center of the terminal, connects various parts of the entire handset using various interfaces and lines, and performs various functions of the server and processes data by operating or executing software programs and modules stored in the memory 602 and calling data stored in the memory 602, thereby performing overall monitoring of the handset. Optionally, processor 608 may include one or more processing cores; preferably, the processor 608 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 608.
The terminal also includes a power supply 609 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 608 via a power management system that may be used to manage charging, discharging, and power consumption. The power supply 609 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Specifically, in this embodiment, the processor 608 in the terminal loads the executable file corresponding to the process of one or more application programs into the memory 602 according to the following instructions, and the processor 608 runs the application programs stored in the memory 602, thereby implementing various functions:
receiving a Bluetooth connection request sent by an external Bluetooth device, wherein the Bluetooth connection request carries first service information of a service currently provided by the external Bluetooth device;
responding the Bluetooth connection request to connect with the peripheral Bluetooth equipment;
matching second service information of the Bluetooth service required by the application in the current running of the first service information;
and if the matching fails, disconnecting the connection with the peripheral Bluetooth equipment, and sending a reconnection request to the peripheral Bluetooth equipment, wherein the reconnection request carries the second service information.
The embodiment of the application discloses a Bluetooth connection method, which comprises the following steps: receiving a Bluetooth connection request sent by an external Bluetooth device, wherein the Bluetooth connection request carries first service information of a service currently provided by the external Bluetooth device; responding the Bluetooth connection request to connect with the peripheral Bluetooth equipment; matching second service information of the Bluetooth service required by the application in the current running of the first service information; and if the matching fails, disconnecting the connection with the peripheral Bluetooth equipment, and sending a reconnection request to the peripheral Bluetooth equipment, wherein the reconnection request carries the second service information. This embodiment matches the bluetooth clothes agreement at peripheral hardware bluetooth equipment and terminal through acquireing bluetooth service agreement, carries out the bluetooth according to the matching result and connects, can effectively improve terminal bluetooth connection efficiency.
It will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by instructions or by instructions controlling associated hardware, which may be stored in a storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute the steps in any of the bluetooth connection methods provided in the embodiments of the present application. For example, the instructions may perform the steps of:
receiving a Bluetooth connection request sent by an external Bluetooth device, wherein the Bluetooth connection request carries first service information of a service currently provided by the external Bluetooth device; responding the Bluetooth connection request to connect with the peripheral Bluetooth equipment; matching second service information of the Bluetooth service required by the application in the current running of the first service information; if the matching fails, the connection with the peripheral Bluetooth equipment is disconnected, and a reconnection request is sent to the peripheral Bluetooth equipment, wherein the reconnection request carries the second service information
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in any of the bluetooth connection methods provided in the embodiments of the present application, beneficial effects that can be achieved by any of the bluetooth connection methods provided in the embodiments of the present application can be achieved, which are detailed in the foregoing embodiments and will not be described again here.
The bluetooth connection method, apparatus, storage medium, and terminal provided in the embodiments of the present application are described in detail above, and a specific example is applied in the description to explain the principle 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, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A Bluetooth connection method is applied to a terminal and is characterized by comprising the following steps:
receiving a Bluetooth connection request sent by an external Bluetooth device, wherein the Bluetooth connection request carries first service information of a service currently provided by the external Bluetooth device;
responding the Bluetooth connection request to connect with the peripheral Bluetooth equipment;
matching second service information of the Bluetooth service required by the application in the current running of the first service information;
and if the matching fails, disconnecting the connection with the peripheral Bluetooth equipment, and sending a reconnection request to the peripheral Bluetooth equipment, wherein the reconnection request carries the second service information.
2. The method of claim 1, further comprising, prior to connecting with the peripheral Bluetooth device in response to the Bluetooth connection request:
acquiring a Bluetooth device list, wherein the Bluetooth device list comprises a plurality of historical connection Bluetooth devices;
matching the historical connection Bluetooth equipment with the peripheral Bluetooth equipment;
and if the matching is successful, the execution step responds to the Bluetooth connection request to connect with the peripheral Bluetooth equipment.
3. The method of claim 2, after matching the historical connected bluetooth device with the peripheral bluetooth device, further comprising:
if the matching fails, acquiring equipment information of the peripheral Bluetooth equipment;
and sending a Bluetooth pairing request to the peripheral Bluetooth equipment based on the equipment information.
4. The method of claim 1, prior to receiving the bluetooth connection request sent by the peripheral bluetooth device, further comprising:
detecting whether the running application needs to execute a Bluetooth function;
and if so, receiving a Bluetooth starting instruction, and starting the Bluetooth function according to the starting instruction.
5. The method of claim 1, wherein sending the reconnect request to the peripheral Bluetooth device comprises:
acquiring a target service protocol of a Bluetooth service required by an application in current operation;
and sending a reconnection request to the peripheral Bluetooth equipment based on the target service protocol.
6. The method of claim 1, further comprising:
and if the first service information is successfully matched with the second service information of the Bluetooth service required by the currently running application, executing the Bluetooth service required by the currently running application based on the peripheral Bluetooth equipment.
7. A bluetooth connection device, comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a Bluetooth connection request sent by peripheral Bluetooth equipment, and the Bluetooth connection request carries first service information of a service currently provided by the peripheral Bluetooth equipment;
the connection unit is used for responding the Bluetooth connection request and connecting the peripheral Bluetooth equipment;
the first matching unit is used for matching second service information of the Bluetooth service required by the application in the current running of the first service information;
and the sending unit is used for disconnecting the connection with the peripheral Bluetooth equipment and sending a reconnection request to the peripheral Bluetooth equipment if the matching fails, wherein the reconnection request carries the second service information.
8. The apparatus of claim 7, further comprising:
the device comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring a Bluetooth device list, and the Bluetooth device list comprises a plurality of historical connection Bluetooth devices;
the second matching unit is used for matching the historical connection Bluetooth equipment with the peripheral Bluetooth equipment;
and the execution unit is used for executing the step to respond the Bluetooth connection request to be connected with the peripheral Bluetooth equipment.
9. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the bluetooth connection method according to any one of claims 1 to 6.
10. A terminal comprising a processor and a memory, the memory storing a plurality of instructions, the processor loading the instructions to perform the steps in the bluetooth connection method of any one of claims 1 to 6.
CN201911230006.7A 2019-12-04 2019-12-04 Bluetooth connection method, device, storage medium and terminal Active CN110944313B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911230006.7A CN110944313B (en) 2019-12-04 2019-12-04 Bluetooth connection method, device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911230006.7A CN110944313B (en) 2019-12-04 2019-12-04 Bluetooth connection method, device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN110944313A true CN110944313A (en) 2020-03-31
CN110944313B CN110944313B (en) 2023-03-24

Family

ID=69909128

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911230006.7A Active CN110944313B (en) 2019-12-04 2019-12-04 Bluetooth connection method, device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN110944313B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112351414A (en) * 2020-10-26 2021-02-09 北京达佳互联信息技术有限公司 Equipment control method, device, system and storage medium
WO2022237704A1 (en) * 2021-05-08 2022-11-17 广州视源电子科技股份有限公司 Device connection method and apparatus, and device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075828A (en) * 2007-07-20 2007-11-21 中兴通讯股份有限公司 Method for establishing connection between terminal and audio-frequency apparatus
CN105025431A (en) * 2014-05-30 2015-11-04 络达科技股份有限公司 Multi-role Bluetooth device and Bluetooth connection method thereof
CN106209176A (en) * 2015-05-05 2016-12-07 深圳市金溢科技股份有限公司 Bluetooth adapter, board units and bluetooth adaptation method thereof
CN107006049A (en) * 2015-11-03 2017-08-01 国民技术股份有限公司 A kind of smart machine and its set up the method for equipment room bluetooth connection, device
CN109495871A (en) * 2018-12-20 2019-03-19 Oppo广东移动通信有限公司 Bluetooth connection control method, electronic device and computer readable storage medium
CN110234099A (en) * 2019-04-30 2019-09-13 努比亚技术有限公司 Communication connecting method, communication equipment and storage medium
WO2019199049A1 (en) * 2018-04-10 2019-10-17 엘지전자 주식회사 Method for controlling device in wireless communication system and device therefor

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075828A (en) * 2007-07-20 2007-11-21 中兴通讯股份有限公司 Method for establishing connection between terminal and audio-frequency apparatus
CN105025431A (en) * 2014-05-30 2015-11-04 络达科技股份有限公司 Multi-role Bluetooth device and Bluetooth connection method thereof
CN106209176A (en) * 2015-05-05 2016-12-07 深圳市金溢科技股份有限公司 Bluetooth adapter, board units and bluetooth adaptation method thereof
CN107006049A (en) * 2015-11-03 2017-08-01 国民技术股份有限公司 A kind of smart machine and its set up the method for equipment room bluetooth connection, device
WO2019199049A1 (en) * 2018-04-10 2019-10-17 엘지전자 주식회사 Method for controlling device in wireless communication system and device therefor
CN109495871A (en) * 2018-12-20 2019-03-19 Oppo广东移动通信有限公司 Bluetooth connection control method, electronic device and computer readable storage medium
CN110234099A (en) * 2019-04-30 2019-09-13 努比亚技术有限公司 Communication connecting method, communication equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112351414A (en) * 2020-10-26 2021-02-09 北京达佳互联信息技术有限公司 Equipment control method, device, system and storage medium
CN112351414B (en) * 2020-10-26 2021-11-02 北京达佳互联信息技术有限公司 Equipment control method, device, system and storage medium
WO2022237704A1 (en) * 2021-05-08 2022-11-17 广州视源电子科技股份有限公司 Device connection method and apparatus, and device and storage medium

Also Published As

Publication number Publication date
CN110944313B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
EP3468068B1 (en) Method for establishing classic bluetooth connection between dual-mode bluetooth devices, and dual-mode bluetooth device
US11310848B2 (en) Pairing method, unpairing method, terminal device, and externally-connected device
US10069818B2 (en) Method, system, device, and terminal for network initialization of multimedia playback device
CN108419226B (en) Method for connecting Bluetooth devices and Bluetooth devices
US20190159271A1 (en) Bluetooth connection management method, master bluetooth device, and apparatus
CN107786424B (en) Audio and video communication method, terminal and server
WO2019029618A1 (en) Ims voice call network switching method, storage device and mobile terminal
CN110944313B (en) Bluetooth connection method, device, storage medium and terminal
CN115190197B (en) Bluetooth headset-based communication method and device and storage medium
WO2023236972A1 (en) Communication environment security warning method and apparatus, terminal device, and storage medium
CN109788114B (en) Call processing method and terminal
CN112691363A (en) Cross-terminal switching method and related device for cloud games
CN110572508A (en) Address book synchronization method and device, storage medium and electronic equipment
CN107872791B (en) Access point connection method and device
CN109992430B (en) Data transmission method, first terminal and second terminal
CN108777627B (en) Power supply method and device
WO2019237954A1 (en) Network connection method and device, readable storage medium and intelligent terminal
CN110891262A (en) Bluetooth pairing method, system and terminal equipment
CN110582079B (en) Bluetooth connection setting method and device, computer readable storage medium and terminal
CN114531741A (en) Method, device, equipment and storage medium for connecting external equipment and terminal
CN111132275A (en) Method and device for establishing data connection, storage medium and electronic equipment
CN114158025A (en) Device reconnection method and related device
CN112286849A (en) Wireless charging base data switching method and system, storage medium and terminal equipment
CN110913022A (en) Method, device and system for downloading network file of mobile terminal and storage medium
CN111225374B (en) Network sharing setting method, device, storage medium and terminal

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