CN114158025A - Device reconnection method and related device - Google Patents

Device reconnection method and related device Download PDF

Info

Publication number
CN114158025A
CN114158025A CN202210119639.6A CN202210119639A CN114158025A CN 114158025 A CN114158025 A CN 114158025A CN 202210119639 A CN202210119639 A CN 202210119639A CN 114158025 A CN114158025 A CN 114158025A
Authority
CN
China
Prior art keywords
equipment
external
bluetooth
electronic device
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.)
Granted
Application number
CN202210119639.6A
Other languages
Chinese (zh)
Other versions
CN114158025B (en
Inventor
张瑞芳
黄鹏飞
宋业全
牛永民
张雅姝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210119639.6A priority Critical patent/CN114158025B/en
Publication of CN114158025A publication Critical patent/CN114158025A/en
Application granted granted Critical
Publication of CN114158025B publication Critical patent/CN114158025B/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
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/30Connection release

Abstract

The embodiment of the application provides a device reconnection method and a related device. The method comprises the following steps: the electronic equipment cancels the pairing with the external equipment; when the Bluetooth protocol stack of the electronic equipment does not have a background reconnection mark corresponding to the external equipment, the electronic equipment deletes the equipment information of the external equipment stored in the electronic equipment, wherein the background reconnection mark is used for marking the scanning connection of the electronic equipment with the external equipment; when the Bluetooth function of the external equipment is started, the electronic equipment and the external equipment are connected in a Bluetooth mode. Therefore, when the electronic equipment cancels the pairing of the external equipment, the equipment information of the external equipment is deleted from the white list of the controller, so that the electronic equipment can scan the external equipment after the pairing is cancelled, the Bluetooth connection can be reestablished, the condition that the electronic equipment cannot be connected back after the pairing with the external equipment is cancelled is reduced, and the user experience is increased.

Description

Device reconnection method and related device
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a device reconnection method and a related apparatus.
Background
Bluetooth (bluetooth) is a radio technology supporting short-distance communication between devices, operates in a globally available 2.4GHz wireless band, and enables data transmission between devices such as mobile phones, notebook computers, wireless headsets, and vehicle tools.
At present, it is common to use an external device with bluetooth function in combination with an electronic device such as a tablet computer or a mobile phone, for example, a bluetooth keyboard is used in combination with a tablet computer for inputting characters, and a bluetooth headset is used in combination with a mobile phone for listening to music.
However, after the electronic device and the external device with the bluetooth function are undone from the pairing connection, the electronic device may not scan the external device.
Disclosure of Invention
The embodiment of the application provides a device reconnection method and a related device, when the electronic device cancels the pairing of the external device, the device information of the external device is deleted from the white list of the controller, so that the electronic device can establish Bluetooth connection with the external device after the pairing is cancelled, the situation that the reconnection cannot be performed after the pairing with the external device is cancelled is reduced, and the user experience is increased.
In a first aspect, an embodiment of the present application provides an apparatus loopback method, including: the electronic equipment cancels the pairing with the external equipment; when the Bluetooth protocol stack of the electronic equipment does not have a background reconnection mark corresponding to the external equipment, the electronic equipment deletes the equipment information of the external equipment stored in the electronic equipment, wherein the background reconnection mark is used for marking the scanning connection of the electronic equipment with the external equipment; when the Bluetooth function of the external equipment is started, the electronic equipment and the external equipment are connected in a Bluetooth mode.
Therefore, when the electronic equipment cancels the pairing of the external equipment, the electronic equipment can delete the equipment information of the external equipment from the white list of the controller, so that the electronic equipment can reestablish Bluetooth connection with the external equipment, the situation that the Bluetooth connection cannot be established due to the fact that the equipment information of the external equipment is not deleted is reduced, and the user experience is improved.
Optionally, when the background reconnection flag corresponding to the external device does not exist in the bluetooth protocol stack of the electronic device, the electronic device deletes the device information of the external device stored in the electronic device, where the deleting includes: when the background loopback mark corresponding to the external device does not exist in the Bluetooth protocol stack of the electronic device, the electronic device deletes the device information of the external device stored in the Bluetooth protocol stack and deletes the device information of the external device stored in the controller of the electronic device.
Therefore, when the electronic equipment cancels the pairing of the external equipment, the electronic equipment removes the equipment information of the external equipment in the Bluetooth protocol stack and the controller, the condition that Bluetooth connection cannot be established due to the fact that the equipment information of the external equipment is not deleted is reduced, and user experience is improved.
Optionally, when the background loopback flag corresponding to the external device does not exist in the bluetooth protocol stack of the electronic device, the electronic device deletes the device information of the external device stored in the bluetooth protocol stack, and deletes the device information of the external device stored in the controller of the electronic device, including: when the background reconnection mark corresponding to the external equipment does not exist in the Bluetooth protocol stack of the electronic equipment, the electronic equipment removes the equipment information of the external equipment from a background reconnection list of the Bluetooth protocol stack, and the background reconnection list is used for storing the equipment information of the equipment which is connected back by the electronic equipment; after the device information of the external device is removed from the background back-connection list, the electronic device removes the device information of the external device from a white list of the controller, and the white list is used for storing the device information of the device to which the electronic device is back-connected.
Therefore, when the electronic equipment cancels the pairing of the external equipment, the electronic equipment removes the equipment information of the external equipment of the Bluetooth protocol stack background back connection list and the equipment information of the external equipment of the white list in the controller, the condition that the Bluetooth connection cannot be established due to the fact that the equipment information of the external equipment is not deleted is reduced, and the user experience is improved.
Optionally, when the background loopback mark corresponding to the external device does not exist in the bluetooth protocol stack of the electronic device, the electronic device removes the device information of the external device from the background loopback list, including: when the electronic equipment cancels the pairing with the external equipment, the Bluetooth application of the electronic equipment sends a first message to a Bluetooth protocol stack of the electronic equipment, wherein the first message is used for indicating the removal of equipment information of the external equipment; the Bluetooth protocol stack inquires the number of the devices in the white list based on the first message; when the number of the devices is not zero, the Bluetooth protocol stack inquires a background loop connection mark corresponding to the external device in a tracking record in the Bluetooth protocol stack, and the tracking record is used for recording the operation related to the external device in the electronic device; when the Bluetooth protocol stack does not inquire the background loopback mark in the trace record, the Bluetooth protocol stack removes the device information of the external device from the background loopback list.
Therefore, when the number of the white list devices is not zero, the electronic device removes the device information of the external device of the Bluetooth protocol stack background back connection list and the device information of the external device of the white list in the controller, the situation that Bluetooth connection cannot be established due to the fact that the device information of the external device is not deleted is reduced, and user experience is improved.
Optionally, after removing the device information of the external device from the background back connection list, the electronic device removes the device information of the external device from the white list of the controller, including: the Bluetooth protocol stack sends a second message to the controller after removing the equipment information of the external equipment from the background back-connection list, wherein the second message is used for indicating that the equipment information of the external equipment is removed from the white list of the controller; the controller removes the device information of the external device from the white list based on the second message.
Therefore, the device information of the external device in the background back-connection list is deleted, the device information of the external device in the white list is deleted, the condition that the device information of the external device is added to the white list when the device information of the external device is not deleted in the background back-connection list is reduced, signaling overhead is reduced, and resources are saved.
Optionally, the device information of the external device includes: the media access control MAC address of the external device.
Optionally, the electronic device cancels the pairing with the external device, including: the method comprises the steps that when the electronic equipment receives an operation for indicating to cancel the pairing with the external equipment, the pairing with the external equipment is cancelled; or when the electronic equipment is not connected to the external equipment within the preset time, the electronic equipment cancels the pairing with the external equipment.
Therefore, the electronic equipment can be triggered to cancel the pairing with the external equipment in various ways, and the user experience is improved.
Optionally, when external device bluetooth function opens, electronic equipment and external device establish bluetooth and connect, include: when the Bluetooth function of the external equipment is started, the electronic equipment scans the external equipment; after the electronic equipment scans the external equipment, the electronic equipment establishes Bluetooth connection with the external equipment.
Optionally, before the electronic device cancels the pairing with the external device, the method further includes: and upgrading and restarting the electronic equipment.
Therefore, the situation that the Bluetooth connection cannot be established with the external equipment after the electronic equipment is upgraded and restarted and the pairing with the external equipment is cancelled can be reduced, and the user experience is increased.
Optionally, the electronic device is a tablet computer, and the external device is a wireless keyboard.
In a second aspect, an embodiment of the present application provides an electronic device. The electronic device includes a terminal device, which may be a tablet computer (PAD), a Personal Digital Assistant (PDA), a handheld device with a wireless communication function, a computing device, a vehicle-mounted device, or a wearable device, a Virtual Reality (VR) terminal device, an Augmented Reality (AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in self driving (self driving), a wireless terminal in remote medical (remote medical), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety, a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), or a fixed terminal.
The electronic device includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes computer-executable instructions stored by the memory to cause the processor to perform the method of the first aspect described above.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program or instructions are stored, and when the computer program or instructions are executed, the method of the first aspect is implemented.
In a fourth aspect, embodiments of the present application provide a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the method of the first aspect is implemented.
For the beneficial effects of the possible implementation manners of the second aspect to the fourth aspect, reference may be made to the beneficial effects brought by the possible implementation manners of the first aspect and the first aspect, which are not repeated herein.
Drawings
Fig. 1 is a schematic diagram of a software architecture of a bluetooth device according to an embodiment of the present application;
FIG. 2 is a schematic diagram illustrating a process of canceling pairing of an external device by an electronic device in a possible design;
fig. 3 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 4A is a schematic interface diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4B is an interface schematic diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4C is a schematic interface diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4D is an interface schematic diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4E is a schematic interface diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4F is a schematic interface diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4G is a schematic interface diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4H is a schematic interface diagram of an electronic device according to an embodiment of the present disclosure;
fig. 5 is a schematic flowchart of a device loopback method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
In the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same or similar items having substantially the same function and action. For example, the first device and the second device are only used for distinguishing different devices, and the sequence order thereof is not limited. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
It is noted that, in the present application, words such as "exemplary" or "for example" are used to mean exemplary, illustrative, or descriptive. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
It should be noted that the network architecture and the service scenario described in the embodiment of the present application are for more clearly illustrating the technical solution of the embodiment of the present application, and do not constitute a limitation to the technical solution provided in the embodiment of the present application, and it is known by a person skilled in the art that the technical solution provided in the embodiment of the present application is also applicable to similar technical problems along with the evolution of the network architecture and the appearance of a new service scenario.
The method provided by the embodiment of the application is applied to an electronic device with a bluetooth function, the electronic device includes a terminal device, the terminal device can be a tablet computer (PAD), a Personal Digital Assistant (PDA), a handheld device with a wireless communication function, a computing device, a vehicle-mounted device or a wearable device, a mobile terminal or a fixed terminal having a bluetooth function, such as a Virtual Reality (VR) terminal device, an Augmented Reality (AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in self driving (self driving), a wireless terminal in remote medical (remote medical), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), and the like. The form of the terminal device is not particularly limited in the embodiment of the present application.
Fig. 1 is a schematic diagram of a framework of an electronic device according to an embodiment of the present disclosure. Wherein, the layered architecture divides the software into a plurality of layers, and each layer has clear roles and division of labor. The layers communicate with each other through a software interface. In some embodiments, an android system may be divided into four layers, from top to bottom, an application layer Hardware Abstraction Layer (HAL), a kernel layer (kernel), and a hardware layer (hardware).
The application layer may include a series of application packages. As shown in fig. 1, the application package may include applications such as bluetooth applications. The Bluetooth application is used for interacting with a user, converting instructions and data input by the user into application layer logic, calling corresponding Bluetooth services, and realizing data communication and control operation between the electronic equipment and the external equipment.
As shown in fig. 3, the bluetooth application may include a bluetooth process. The Bluetooth process comprises the following steps: bluetooth services (bluetooth service) and bluetooth profiles (bluetooth profiles). The bluetooth service may be a variety of interactive services including, but not limited to: audio service, short message service, telephone service, or input service.
The bluetooth process may invoke the HAL layer via a Java Native Interface (JNI) and receive callbacks from the HAL layer via the JNI to provide access to various bluetooth profiles. Illustratively, when a particular bluetooth operation occurs, the bluetooth process may call the HAL layer through the JNI and receive a callback from the HAL layer through the JNI. Specific bluetooth operations include, but are not limited to: discovering the external device, and canceling the matching of the external device,
the purpose of the HAL layer is to abstract hardware, which can provide a uniform interface for querying hardware devices for upper applications, or can also provide data storage services for upper applications. As shown in fig. 1, the HAL layer may comprise a bluetooth protocol stack. The bluetooth protocol stack is used to implement a conventional bluetooth HAL and is customized by extending programs and changing configurations. The Bluetooth protocol stack is used for analyzing, subpackaging, packaging and the like of the message.
The bluetooth protocol stack defines a protocol (profile) and a core protocol (protocol) of a plurality of applications in the bluetooth framework, each profile defines a respective corresponding message format and application rule, such as an advanced audio distribution profile (A2 DP), a hands-free protocol (HFP), and the like, so as to achieve interconnection and interworking of different devices under different platforms and meet various possible application scenarios with general meaning.
The core protocols include a Service Discovery Protocol (SDP), a logical channel control and adaptation protocol (L2 CAP), a Radio Frequency Communication (RFCOMM) protocol, and the like.
SDP is a crucial layer in the bluetooth framework, which is the basis for all application models, any implementation of which is a result of the utilization of certain services. In a bluetooth wireless communication system, any two or more devices that are set up on a bluetooth link may begin communicating at any time, and merely a static setting is not sufficient, the SDP determines the dynamic manner in which these services are located, and may dynamically query device information and service types to establish a communication channel corresponding to the desired service.
The L2CAP is an adaptation protocol for shielding a baseband protocol for a higher layer protocol, is located above the baseband protocol, belongs to a data link layer, provides connection-oriented and connectionless-oriented data services for the higher layer, and completes functions such as protocol multiplexing, segmentation and reassembly, quality of service (QoS) transmission, group abstraction, and the like.
The RFCOMM provides a serial emulation interfacing (serial emulation) interface including emulation of data signal lines and non-data signal lines. The method can simulate a plurality of serial ports between two devices, can support multi-serial port simulation among a plurality of devices, and simultaneously provides simulation of a modem in the RFCOMM.
The generic attribute protocol (GATT) is a generic specification for sending and receiving very short data segments over a bluetooth connection, providing generic, information storage and sharing functions.
Modules in the HAL layer may conform to a hardware abstraction layer interface description language (HIDL). The bluetooth protocol stack interacts with the bluetooth controller through the HIDL.
The kernel layer is a layer between hardware and software. As shown in fig. 1, a bluetooth controller may be included in the core layer.
The bluetooth controller defines the underlying hardware components for controlling the underlying hardware to connect. The bluetooth controller includes: a Link Manager (LM), a baseband or Link Controller (LC), and a radio unit (radio).
The link management unit is responsible for managing communication between the Bluetooth devices and realizing operations of link establishment, verification, removal, link configuration and the like. A Link Manager Protocol (LMP) is a link management layer protocol of a bluetooth protocol stack, and is responsible for translating commands transmitted by a HIDL interface into operations that a baseband can receive, establishing an asynchronous link-oriented link (ACL), a synchronous connection-oriented (SCO) link, and enabling a bluetooth device to enter an energy-saving mode.
And the baseband or link control unit is used for performing mutual conversion of the radio frequency signal and the digital or voice signal and realizing a baseband protocol and other bottom layer connection procedures.
The radio frequency unit is Bluetooth radio frequency, is responsible for sending and receiving data and voice, and is characterized by short distance and low power consumption.
For ease of understanding, the examples are given in part for illustration of concepts related to embodiments of the present application.
1. Bluetooth connection: a data transmission connection mode between devices. The bluetooth connection includes, but is not limited to, the following procedures: pairing connections and SDP service queries, etc.
The pairing connection procedure between the bluetooth devices is explained below.
Taking a tablet computer and a wireless keyboard as an example, the pairing connection process between the tablet computer and the wireless keyboard may be as follows: the tablet personal computer and the wireless keyboard both start the Bluetooth function, when the tablet personal computer receives the operation that the user triggers the adding device control, the tablet personal computer inquires the peripheral Bluetooth devices with the started Bluetooth function, and the names of the Bluetooth devices with the started Bluetooth function are displayed on the interface of the tablet personal computer. When the tablet computer receives an operation that a user triggers the wireless keyboard name control, the tablet computer initiates paging (page) for a Media Access Control (MAC) address of the wireless keyboard. When the wireless keyboard receives a page (page) sent by the tablet computer, the wireless keyboard responds to the page, the tablet computer and the wireless keyboard establish connection of an ACL link, and pairing connection of the tablet computer and the wireless keyboard is completed.
In a possible implementation manner, after the ACL link connection is established, the tablet computer may initiate a connection request of a channel (channel), that is, a connection of L2CAP, and after the connection of L2CAP is established, the tablet computer queries a service supported by the wireless keyboard by using an SDP to obtain a channel number of a corresponding service, and then the tablet computer may initiate a connection request of the corresponding service to establish a connection of the bluetooth application.
2. And (3) connecting back: and after the two Bluetooth devices are disconnected from the Bluetooth connection, when the two Bluetooth devices are within a certain range, establishing the Bluetooth connection again.
For example, after the tablet computer and the wireless keyboard are connected in a pairing mode, the tablet computer and the wireless keyboard can be automatically connected within a certain range. In a possible implementation, when the wireless keyboard is attached to the tablet computer, the tablet computer and the wireless keyboard can automatically establish pairing connection. Therefore, user operation can be reduced, and user experience is improved.
The process of the loopback between bluetooth devices is explained below.
Taking the tablet pc and the wireless keyboard as an example, the back connection process between the tablet pc and the wireless keyboard may be as follows: when the tablet personal computer is disconnected from the Bluetooth connection of the wireless keyboard, the device information of the wireless keyboard is added to a Bluetooth protocol stack background back connection list. The Bluetooth protocol stack adds the device information in the background back-connected list to the white list of the controller.
When the tablet computer scans that the equipment information is consistent with the equipment information of the wireless keyboard in the white list of the controller of the tablet computer, the connection of the ACL link is established between the tablet computer and the wireless keyboard. And after the ACL link connection is established, the tablet computer and the wireless keyboard perform SDP service inquiry and the like to establish Bluetooth connection.
In a possible implementation, the tablet initiates paging (page) for the MAC address of the wireless keyboard in the white list of the controller. When the wireless keyboard receives a page (page) sent by the tablet computer, the wireless keyboard responds to the page, the tablet computer and the wireless keyboard establish connection of an ACL link, and pairing connection of the tablet computer and the wireless keyboard is completed; after the ACL link connection is established, the tablet computer initiates a channel (channel) connection request, that is, the L2CAP connection, and after the L2CAP connection is established, the tablet computer queries the service supported by the wireless keyboard by using the SDP to obtain a channel number of the corresponding service, and then the tablet computer initiates a connection request of the corresponding service to establish the connection of the bluetooth application.
3. White list: is a security mechanism. Through the white list, the bluetooth device may only allow a specific bluetooth device (listed in the white list) to scan (scan), connect (connect), or scan, connect only a specific bluetooth device (listed in the white list).
4. And (3) unpairing: and a process of deleting the device information of another bluetooth device stored in the bluetooth device.
The following describes a procedure of unpairing between two bluetooth devices. The two bluetooth devices may be referred to as an electronic device and an external device, respectively, or may also be referred to as a master device and a slave device, respectively.
Fig. 2 is a schematic flow chart illustrating a method for canceling a pairing connection between an electronic device and an external device in a possible design. Taking the electronic device as a tablet computer and the external device as a wireless keyboard as an example, as shown in fig. 2,
s201, the tablet computer receives a trigger operation for indicating to cancel the pairing of the wireless keyboard.
S202, the Bluetooth application of the tablet computer sends a first message to a Bluetooth protocol stack, wherein the first message is used for indicating the removal of the equipment information of the wireless keyboard.
In a possible implementation manner, a bluetooth application of the tablet computer starts a bluetooth process and sends a first message to a bluetooth protocol stack through the JNI.
S203, after receiving the first message, the Bluetooth protocol stack inquires the number of the devices in the white list in the controller.
It can be understood that when the number of devices in the white list in the controller is zero, it indicates that there is no connected external device, and the electronic device does not have an external device that needs to be connected back, and confirms that there is no device information of the external device in the white list.
S204, when the number of the devices in the white list is not zero, inquiring whether a background loopback mark corresponding to the wireless keyboard exists in a tracking record (bg track).
In the embodiment of the present application, the trace record is used for recording operations related to the external device in the electronic device. The background reconnection mark is used for marking and recording that the electronic equipment is in scanning reconnection with the external equipment, and after the electronic equipment scans the external equipment, Bluetooth connection can be established with the external equipment.
It can be understood that when the tracking record (bg track) has a background backhaul mark corresponding to the wireless keyboard, it indicates that the electronic device is in the backhaul wireless keyboard; when the tracking record (bg track) has no background loopback mark corresponding to the wireless keyboard, it indicates that the electronic device is not in the loopback wireless keyboard.
Illustratively, when the first mark corresponding to the wireless keyboard in the trace record (bg track) is true, the background loopback mark corresponding to the wireless keyboard is in the trace record (bg track), and the electronic device is in loopback connection with the wireless keyboard; when the first mark corresponding to the wireless keyboard in the trace record (bg track) is false, the background loop connection mark corresponding to the wireless keyboard is not in the trace record (bg track), and the electronic device is not in the loop connection wireless keyboard.
S205, when the background loopback mark corresponding to the wireless keyboard exists in the tracking record (bg track), the Bluetooth protocol stack removes the equipment information of the wireless keyboard from the background loopback list; accordingly, the electronic device may also remove the device from the white list of the controller.
It should be noted that, when the device information of the external device is removed from the background loopback list, the electronic device also removes the device information of the external device from the white list of the controller.
S206, when the background loopback mark corresponding to the external device does not exist in the tracking record (bg track), the Bluetooth protocol stack confirms that the white list does not have the device information of the external device.
It can be understood that the bluetooth protocol stack confirms that the white list has no device information of the external device, and the white list removal process is terminated.
It should be noted that, the electronic device cancels the pairing connection with the external device, and further includes: clearing the state value and the like. The embodiment of the present application is not described in detail herein.
An application scenario to which the present application is applied will be described below.
Fig. 3 is a schematic view of an application scenario provided in an embodiment of the present application. As shown in fig. 3, the application scenario includes: included in this scenario is an electronic device 200 and a wireless keyboard 300. Fig. 3 illustrates the electronic device 200 as a tablet computer (tablet).
The electronic device 200 and the wireless keyboard 300 can be interconnected through bluetooth, so as to realize wireless signal interaction.
After the wireless keyboard 300 is bluetooth connected to the electronic device 200, the wireless keyboard 300 may provide an input to the electronic device 200, and the electronic device 200 performs an operation in response to the input based on the input of the wireless keyboard 300.
The wireless keyboard 300 may include: keyboard main part and keyboard cover. The keypad cover is used to place the electronic device 200, and the keypad body may be provided with keys, a touch pad, etc. for receiving user operations.
It should be understood that the electronic device 200 in the embodiment of the present application may be referred to as a User Equipment (UE), a terminal (terminal), and the like, for example, the electronic device 200 may be a tablet computer (PAD), a mobile phone, and the like. The form of the terminal device is not particularly limited in the embodiment of the present application.
It is understood that in the application scenario shown in fig. 3, the wireless keyboard 300 is one of the external devices, and the electronic device 200 may also establish a bluetooth connection with other external devices. Other external devices include, but are not limited to, a bluetooth headset, a stylus pen, or a bracelet, etc. The electronic device 200 may establish a bluetooth connection with one or more external devices, and the embodiment of the present application is not limited to the specific form and number of the external devices.
It is to be understood that the application scenario shown in fig. 3 is by way of example only. The embodiment of the application is suitable for a scene that the electronic equipment is connected with other external equipment through Bluetooth. Other external devices can be a Bluetooth headset, a bracelet and a handwriting pen, and the like, and have terminal devices with Bluetooth functions.
In the scenario illustrated in fig. 3, during the process of connecting back the wireless keyboard, the electronic device may receive and cancel the connection with the wireless keyboard in response to an operation of canceling the pairing with the wireless keyboard. However, after the electronic device cancels the pairing with the wireless keyboard, the bluetooth application of the electronic device may not be able to detect the wireless keyboard, and then cannot establish a bluetooth connection with the wireless keyboard again.
Taking an electronic device as an example of a tablet computer, in a possible scenario, when the tablet computer is upgraded and restarted, the bluetooth connection between the tablet computer and the wireless keyboard is disconnected. And after the tablet computer is upgraded and restarted, the tablet computer is connected back to the wireless keyboard.
However, the tablet computer fails to connect back to the wireless keyboard. It is understood that the wireless keyboard may be dormant and bluetooth is not available when it is disconnected for a long period of time (e.g., 1 minute); when the wireless keyboard is in a dormant state, the tablet computer cannot detect the external device, so that the electronic device fails to connect back the wireless keyboard.
Before the wireless keyboard is awakened, the tablet computer removes the device information of the wireless keyboard in response to an operation for instructing to cancel pairing with the wireless keyboard. However, after the tablet computer cancels the pairing with the wireless keyboard, the bluetooth application of the tablet computer cannot scan the wireless keyboard.
4A-4E are schematic diagrams of interfaces of an electronic device in possible scenarios.
As shown in fig. 4A, when the tablet computer receives an operation for triggering the upgrade and restarting the control 401 in the interface shown in fig. 4A, the tablet computer performs the upgrade and restarts after the upgrade is completed. It will be appreciated that when the tablet upgrade is restarted, the bluetooth connection between the tablet and the wireless keyboard is broken.
When the tablet computer is restarted, the tablet computer starts to scan back to the wireless keyboard. The tablet computer fails to connect back to the wireless keyboard.
Illustratively, the user may check whether the wireless keyboard establishes a bluetooth connection with the tablet computer through the setup-bluetooth interface. As shown in fig. 4B, the bluetooth interface includes a paired device list and an available device list. The paired device list includes device identifiers of external devices that have established a bluetooth connection with the tablet computer, such as the wireless keyboard 402 and the stylus pen. The available device list includes device identifiers of external devices that the tablet computer scans but has not performed pairing connection, for example, device a.
In the bluetooth interface shown in fig. 4B, the stylus corresponds to the connected identifier 403, and the wireless keyboard 402 does not correspond to the connected identifier 403, which indicates that the tablet computer is connected back to the wireless keyboard, but does not establish a bluetooth connection with the wireless keyboard.
The tablet computer may receive an instruction from the user to cancel the pairing with the wireless keyboard in the interface shown in fig. 4B. The tablet computer may not be able to scan the wireless keyboard after the pairing operation with the wireless keyboard is cancelled.
When the tablet computer receives a trigger operation for the identifier 404 of the next step on the interface shown in fig. 4B, the terminal device enters the interface shown in fig. 4C, and as shown in fig. 4C, the interface includes a unpairing control 405.
When the tablet computer receives a trigger operation for the unpairing control 405 on the interface shown in fig. 4C, the terminal device enters the bluetooth interface shown in fig. 4D, and as shown in fig. 4D, the paired device list and the available device list in the interface have no identifier of the wireless keyboard.
For example, when the tablet computer detects that the wireless keyboard is re-attached to the tablet computer, the tablet computer enters the interface shown in fig. 4E from the interface shown in fig. 4D. The interface shown in FIG. 4E includes: a pop-up window 406 for prompting discovery of the wireless keyboard. The pop-up window 406 includes an identification 407 of the wireless keyboard. In the interface shown in FIG. 4E, there is no identification of the wireless keyboard in both the paired device list and the available devices. The tablet personal computer can detect the adsorption operation of the wireless keyboard, but cannot scan the wireless keyboard through the Bluetooth, and further cannot establish Bluetooth connection with the wireless keyboard.
It should be noted that the wireless keyboard can be attached to the tablet computer through a magnet; when the tablet personal computer detects a magnet induction event through the Hall sensor, the tablet personal computer detects the adsorption operation of the wireless keyboard.
When the tablet receives an operation for the control 408 at the interface shown in fig. 4E, the tablet enters the bluetooth interface shown in fig. 4F. The bluetooth function is turned off in the bluetooth interface shown in fig. 4F.
When the tablet computer receives an operation for the control 409 on the interface shown in fig. 4F, the bluetooth function of the tablet computer is turned on, and the tablet computer enters the bluetooth interface shown in fig. 4G. The bluetooth interface includes a paired device list and an available device list. The paired device list includes device identifiers of external devices that have established a bluetooth connection with the tablet computer, for example, a stylus pen. The list of available devices includes device identifications of external devices that were scanned by the tablet computer but not paired, e.g., device a and wireless keyboard 410.
When the tablet receives an operation directed to the wireless keyboard 410 at the interface shown in fig. 4G, the tablet establishes a bluetooth connection with the wireless keyboard, and the tablet enters the bluetooth interface shown in fig. 4H. The bluetooth interface includes a paired device list and an available device list. The paired device list includes device identifiers of external devices that have established a bluetooth connection with the tablet computer, such as the wireless keyboard 411 and the stylus pen. The wireless keyboard 411 corresponds to the connected identification 412. The available device list includes device identifiers of external devices that the tablet computer scans but has not performed pairing connection, for example, device a.
In the process, after the pairing is cancelled, the tablet computer cannot scan the wireless keyboard through the Bluetooth; the tablet personal computer needs to restart the Bluetooth and establish the Bluetooth connection with the wireless keyboard, and the operation is complex.
Based on this, further analysis in the embodiment of the present application finds that the reason why the wireless keyboard cannot be scanned by the tablet computer after the pairing is cancelled is that: upon unpairing, the tablet computer does not remove the wireless keyboard from the white list of the controller. Therefore, after the electronic equipment is unpaired, when the wireless keyboard is awakened and the Bluetooth is started, the controller of the tablet computer initiates the return connection according to the white list, the tablet computer is connected with the bottom link of the wireless keyboard, the Bluetooth protocol stack of the tablet computer does not have the matching record indicated by the Bluetooth application, the Bluetooth protocol stack cannot feed back the ACL link to the Bluetooth application, the upper link is not connected, and the terminal equipment cannot be connected with the wireless keyboard. Due to the establishment of the bottom link, the wireless keyboard does not send the broadcast, and the terminal equipment cannot sense the wireless keyboard.
In the following, a detailed description is given of a process of reconnecting the wireless keyboard after the tablet pc is restarted in one possible scenario.
When the tablet computer is upgraded, the Bluetooth connection between the tablet computer and the wireless keyboard is interrupted. After the tablet computer is restarted, the Bluetooth application adds the wireless keyboard device information to a background reconnection list, and adds a background reconnection mark corresponding to the wireless keyboard in the tracking record. The bluetooth application starts to loop back to the wireless keyboard. The bluetooth application sends a message to the bluetooth protocol stack indicating the reconnected device. After receiving the message, the Bluetooth protocol stack sends the device information of the wireless keyboard in the background back-connected list in the Bluetooth protocol stack to the controller, and the controller adds the device information of the wireless keyboard to the white list.
It will be appreciated that the wireless keyboard may go to sleep due to a long time (e.g., 1 minute) of disconnection. When the tablet computer is connected with the wireless keyboard after upgrading and restarting, the wireless keyboard may be in a dormant state, bluetooth is unavailable, and a controller of the tablet computer cannot scan the equipment information of the wireless keyboard, so that failure to return is caused.
When the Bluetooth application receives an operation for indicating the cancel of the pairing with the wireless keyboard, the Bluetooth application sends a message for indicating the cancel of the pairing with the wireless keyboard to a Bluetooth protocol stack, after the Bluetooth protocol stack receives the message, the Bluetooth protocol stack inquires the number of devices in a white list in a controller, and when the number of the devices is larger than zero, the Bluetooth protocol stack inquires whether a background reconnection mark corresponding to the wireless keyboard exists in a tracking record (bg track).
It should be noted that after the upgrade and restart, the trace record may be abnormal due to various reasons, when the trace record is abnormal, there may be no background reconnection flag corresponding to the wireless keyboard, the bluetooth protocol stack confirms that the white list has no device information of the external device, and the white list removal process is terminated.
Illustratively, a number of reasons include: when the tablet computer adds the equipment information of the wireless keyboard into the background reconnection list, the background reconnection mark corresponding to the wireless keyboard is not added into the tracking record; and when the tablet personal computer clears other records, clearing the background reconnection mark corresponding to the wireless keyboard.
In the above process, when the tablet computer cancels the connection with the wireless keyboard, since the background callback mark of the wireless keyboard is not present in the tracking record (bg track) in the bluetooth protocol stack, the device information of the wireless keyboard in the background callback list is not removed, and the device information of the white-list wireless keyboard of the controller is not removed.
When the wireless keyboard is adsorbed on the tablet computer again, an ACL link is established between the controller of the tablet computer and the wireless keyboard, the bottom link is connected, and the controller feeds back the ACL link to the Bluetooth protocol stack; because the Bluetooth protocol stack does not have the record of the back connection equipment indicated by the Bluetooth application, the Bluetooth protocol stack cannot feed back an ACL link to the Bluetooth application, so that an upper link is not connected, and the terminal equipment cannot be connected with the wireless keyboard.
Due to the establishment of the bottom link, the wireless keyboard cannot send the broadcast, and the terminal equipment cannot scan and sense the wireless keyboard.
When the Bluetooth application of the tablet computer is closed, the Bluetooth process is finished, and both the background back connection list of the Bluetooth protocol stack and the white list of the controller are reset. When the bluetooth application of the tablet computer is reopened, the tablet computer adds the device information in the paired device list to the background callback list. At this time, the paired device list has no wireless keyboard, and the background linked list and the white list have no device information of the wireless keyboard, so that the tablet computer can scan the wireless keyboard. When the tablet computer receives an operation for indicating the pairing with the wireless keyboard, the tablet computer establishes Bluetooth connection with the wireless keyboard.
In view of this, an embodiment of the present application provides a device connection method, where when an electronic device cancels pairing of an external device, device information of the external device is deleted from a white list of a controller, so that the electronic device may scan the external device after canceling the pairing, and further may perform bluetooth connection again.
The device loopback method provided by the embodiment of the application is described below with reference to fig. 5.
S501, the electronic equipment cancels the pairing with the external equipment and removes the equipment information of the external equipment from the electronic equipment.
In the embodiment of the application, the electronic device can cancel the pairing with the external device when receiving the operation that the user triggers the pairing cancellation control. The electronic device may also cancel the pairing with the external device when the external device is not connected back within the preset time.
In the embodiment of the application, the removal of the device information of the external device from the electronic device may be understood as deleting the device information of the external device stored in the electronic device. In a possible implementation manner, removing the device information of the external device from the electronic device includes: and removing the device information of the external device from the Bluetooth protocol stack and the controller. Specifically, the device information of the external device is removed from the background loopback list of the bluetooth protocol stack, and is removed from the white list of the controller.
The device information of the external device includes but is not limited to: the MAC address of the external device, the name of the external device, etc.
In a possible implementation manner, in the embodiment of the present application, the S501 may specifically include S5011 to S5015.
S5011, the electronic device receives an operation for instructing to cancel pairing of the external device.
S5012, the Bluetooth application of the electronic device sends a first message to the Bluetooth protocol stack, wherein the first message is used for indicating that the device information of the external device is removed.
Illustratively, the bluetooth application of the electronic device sends the first message to the bluetooth protocol stack through bta _ dm _ process _ remove _ device interface, bta _ gattc _ process _ api _ open _ cancel interface, and bta _ gattc _ cancel _ bk _ conn interface.
S5013, after receiving the first message, the Bluetooth protocol stack inquires the number of the devices in the white list of the controller. It can be understood that when the number of devices in the white list in the controller is zero, it indicates that there is no connected external device, and the electronic device does not have an external device that needs to be connected back, and confirms that there is no device information of the external device in the white list.
In a possible implementation, after receiving the first message, the bluetooth protocol stack calls bta _ gattc _ mark _ bg _ conn to query the number of devices in the white list of the controller, and traverse the query trace record according to the white list of the controller.
S5014, when the number of the devices in the white list is not zero, the Bluetooth protocol stack inquires whether a background reconnection mark corresponding to the external device exists in a tracking record (bg track).
In the embodiment of the present application, the tracking record and the background linking mark may refer to the description of the related contents, and are not described herein again.
S5015, the Bluetooth protocol stack removes the device information of the external device from the background back-connection list.
In a possible implementation manner, the bluetooth protocol stack calls an automatic connection device removal (gatt _ auto _ connection _ dev _ remove) interface and a background connection removal (background connection removal) interface to remove the device information of the external device from the background connection list.
S5016, the bluetooth protocol stack sends a second message to the controller, where the second message is used to instruct to remove the device information of the external device from the white list of the controller.
It should be noted that, when the device information of the external device is removed from the background loopback list, the electronic device also removes the device information of the external device from the white list of the controller.
In a possible implementation manner, a background back-connected list in the bluetooth protocol stack triggers a white list removal (BTM _ whitelist remove) interface to remove the device information of the external device from the white list of the controller.
Therefore, after the electronic equipment cancels the pairing with the external equipment, the background back connection list of the Bluetooth protocol stack and the white list of the controller have no equipment record of the external equipment. The ACL link cannot be automatically established between the electronic equipment and the external equipment, and the electronic equipment can scan the external equipment. Therefore, the situation that the external equipment cannot be scanned after the pairing is cancelled can be reduced, and the user experience is increased.
S502, the electronic equipment scans the external equipment.
Illustratively, the electronic device discovers the external device by broadcasting. Specifically, the electronic device sends out a broadcast; and after receiving the broadcast, the external equipment replies a message to the electronic equipment.
S503, the electronic equipment and the external equipment establish Bluetooth connection.
In a possible implementation manner, the electronic device establishes a bluetooth connection with the external device in response to an operation of adding the external device control.
The process of establishing the bluetooth connection between the electronic device and the external device may refer to the related concept description above, and is not described herein again.
In sum, when the electronic device cancels the pairing of the external device, the device information of the external device is deleted from the white list of the controller, so that the electronic device can scan the external device after canceling the pairing, and then can reestablish the bluetooth connection, thereby reducing the situation that the external device cannot be connected back after canceling the pairing, and increasing the user experience.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Referring to fig. 6, an electronic device may include multiple subsystems that cooperate to perform, coordinate, or monitor one or more operations or functions of the electronic device. The electronic device may include: a Radio Frequency (RF) circuit 110, a memory 120, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a wireless fidelity (WiFi) module 170, a processor 180, a power supply 190, and a bluetooth module 1100.
Those skilled in the art will appreciate that the electronic device configuration shown in fig. 6 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the electronic device in detail with reference to fig. 6:
the RF circuit 110 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information of a base station and then processes the received downlink information to the processor 180; in addition, the data for designing uplink is transmitted to the base station. Typically, the RF circuitry includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuitry 110 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to global system for mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, and Short Message Service (SMS).
The memory 120 may be used to store software programs and modules, and the processor 180 executes various functional applications and data processing of the electronic device by operating the software programs and modules stored in the memory 120. The memory 120 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, a boot loader (boot loader), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the electronic device, and the like. Further, the memory 120 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. It is understood that, in the embodiment of the present application, the memory 120 stores a program for the bluetooth device to connect back.
The input unit 130 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the input unit 130 may include a touch panel 131 and other input devices 132. The touch panel 131, also referred to as a touch screen, may collect touch operations of a user on or near the touch panel 131 (e.g., operations of the user on or near the touch panel 131 using any suitable object or accessory such as a finger or a stylus pen), and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 131 may include two parts, i.e., a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 180, and can receive and execute commands sent by the processor 180. In addition, the touch panel 131 may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 130 may include other input devices 132 in addition to the touch panel 131. In particular, other input devices 132 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 140 may be used to display information input by a user or information provided to the user and various menus of the electronic device. The display unit 140 may include a display panel 141, and optionally, the display panel 141 may be configured in the form of a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), or the like. Further, the touch panel 131 can cover the display panel 141, and when the touch panel 131 detects a touch operation on or near the touch panel 131, the touch operation is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of the touch event. Although in fig. 1, the touch panel 131 and the display panel 141 are two independent components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 131 and the display panel 141 may be integrated to implement the input and output functions of the electronic device.
The electronic device may also include at least one sensor 150, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that adjusts the brightness of the display panel 141 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 141 or the backlight when the electronic device is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration) for recognizing the attitude of the electronic device, vibration recognition related functions (such as pedometer, tapping) and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which may be further configured to the electronic device, detailed descriptions thereof are omitted.
Audio circuitry 160, speaker 161, microphone 162 may provide an audio interface between a user and the electronic device. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electric signal, which is received by the audio circuit 160 and converted into audio data, which is then processed by the audio data output processor 180, and then transmitted to, for example, another electronic device via the RF circuit 110, or output to the memory 120 for further processing.
WiFi belongs to a short-distance wireless transmission technology, and the electronic device can help a user send and receive e-mails, browse webpages, access streaming media and the like through the WiFi module 170, and provides wireless broadband internet access for the user. Although fig. 6 shows the WiFi module 170, it is understood that it does not belong to the essential constitution of the electronic device, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 180 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by operating or executing software programs or modules stored in the memory 120 and calling data stored in the memory 120, thereby integrally monitoring the electronic device. Alternatively, processor 180 may include one or more processing units; preferably, the processor 180 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 180. It is understood that in the embodiment of the present application, the memory 120 stores a program for bluetooth device loopback, and the processor 180 may be configured to call and execute the program for bluetooth device loopback stored in the memory 120, so as to implement the method for bluetooth device loopback in the embodiment of the present application.
The electronic device also includes a power supply 190 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 180 via a power management system to manage charging, discharging, and power consumption via the power management system.
The bluetooth technology belongs to short distance wireless transmission technology, and electronic equipment can establish bluetooth with other electronic equipment that possess bluetooth module through bluetooth module 1100 and be connected to carry out data transmission based on bluetooth communication link. The bluetooth module 1100 may be Bluetooth Low Energy (BLE) or a module according to actual needs.
Although not shown, the electronic device may also include a camera. Optionally, the position of the camera on the electronic device may be front-located, rear-located, or built-in (the camera body may be extended when in use), which is not limited in this application.
It will be apparent to one skilled in the art that some of the specific details presented above with respect to electronic devices may not be required to practice a particular embodiment or its equivalents. Similarly, other electronic devices may include a greater number of subsystems, modules, components, etc. Some sub-modules may be implemented as software or hardware, where appropriate. Accordingly, it should be understood that the above description is not intended to be exhaustive or to limit the disclosure to the precise form herein. On the contrary, many modifications and variations are possible in light of the above teaching, as would be apparent to those of ordinary skill in the art.
The device reconnection method according to the embodiment of the present application has been described above, and the following describes a related apparatus for performing the device reconnection method according to the embodiment of the present application. Those skilled in the art will appreciate that the method and apparatus can be combined and referred to, and the electronic device provided in the embodiments of the present application can perform the steps of the above-described device loopback method.
Fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application. Referring to fig. 7, the apparatus includes: memory 1001, processor 1002, and interface circuit 1003. The device may also include a display 1004, wherein the memory 1001, processor 1002, interface circuit 1003, and display 1004 may be in communication; illustratively, the memory 1001, the processor 1002, the interface circuit 1003 and the display screen 1004 may communicate via a communication bus, the memory 1001 is used for storing computer executable instructions, the processor 1002 controls the execution, and the interface circuit 1003 executes the communication, thereby implementing the methods provided by the embodiments described below in the present application.
In a possible implementation manner, the computer execution instructions in the embodiment of the present application may also be referred to as application program codes, which is not specifically limited in the embodiment of the present application.
Optionally, the interface circuit 1003 may further include a transmitter and/or a receiver. Optionally, the processor 1002 may include one or more CPUs, and may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present application may be embodied directly in a hardware processor, or in a combination of the hardware and software modules in the processor.
The embodiment of the application also provides the electronic equipment. The electronic device includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored by the memory, causing the processor to perform the above-described method.
The embodiment of the application also provides a computer readable storage medium. The methods described in the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media may include computer storage media and communication media, and may include any medium that can communicate a computer program from one place to another. A storage medium may be any target medium that can be accessed by a computer.
In one possible implementation, the computer-readable medium may include RAM, ROM, a compact disk read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and Disc, as used herein, includes Disc, laser Disc, optical Disc, Digital Versatile Disc (DVD), floppy disk and blu-ray Disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above embodiments are only for illustrating the embodiments of the present invention and are not to be construed as limiting the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made on the basis of the embodiments of the present invention shall be included in the scope of the present invention.

Claims (12)

1. A device reconnection method, characterized in that the method comprises:
the electronic equipment cancels the pairing with the external equipment;
when a background reconnection mark corresponding to the external device does not exist in a Bluetooth protocol stack of the electronic device, deleting device information of the external device stored in the electronic device by the electronic device, wherein the background reconnection mark is used for marking that the electronic device is connected with the external device in a scanning manner;
and when the Bluetooth function of the external equipment is started, the electronic equipment and the external equipment are connected in a Bluetooth mode.
2. The method according to claim 1, wherein when the background loopback flag corresponding to the external device does not exist in a bluetooth protocol stack of the electronic device, the electronic device deletes the device information of the external device stored in the electronic device, including:
when the background reconnection mark corresponding to the external device does not exist in the Bluetooth protocol stack of the electronic device, the electronic device deletes the device information of the external device stored in the Bluetooth protocol stack and deletes the device information of the external device stored in the controller of the electronic device.
3. The method according to claim 2, wherein when the background loopback flag corresponding to the external device does not exist in a bluetooth protocol stack of the electronic device, the electronic device deletes the device information of the external device stored in the bluetooth protocol stack and deletes the device information of the external device stored in a controller of the electronic device, including:
when the background reconnection mark corresponding to the external device does not exist in the Bluetooth protocol stack of the electronic device, the electronic device removes the device information of the external device from a background reconnection list of the Bluetooth protocol stack, wherein the background reconnection list is used for storing the device information of the device which is connected back by the electronic device;
and after removing the equipment information of the external equipment from a background back-connection list, the electronic equipment removes the equipment information of the external equipment from a white list of the controller, wherein the white list is used for storing the equipment information of the equipment back-connected with the electronic equipment.
4. The method according to claim 3, wherein when the background callback mark corresponding to the external device does not exist in the bluetooth protocol stack of the electronic device, the removing, by the electronic device, the device information of the external device from a background callback list includes:
when the electronic equipment cancels the pairing with the external equipment, the Bluetooth application of the electronic equipment sends a first message to a Bluetooth protocol stack of the electronic equipment, wherein the first message is used for indicating the removal of equipment information of the external equipment;
the Bluetooth protocol stack inquires the number of the devices in the white list based on the first message;
when the number of the devices is not zero, the Bluetooth protocol stack inquires a background loopback mark corresponding to the external device in a tracking record in the Bluetooth protocol stack, wherein the tracking record is used for recording the operation related to the external device in the electronic device;
and when the Bluetooth protocol stack does not inquire the background loopback mark in the tracking record, the Bluetooth protocol stack removes the equipment information of the external equipment from the background loopback list.
5. The method of claim 3, wherein the electronic device removing the device information of the external device from the white list of the controller after removing the device information of the external device from the background back list comprises:
the Bluetooth protocol stack sends a second message to the controller after removing the device information of the external device from a background back-connected list, wherein the second message is used for indicating that the device information of the external device is removed from a white list of the controller;
the controller removes the device information of the external device from the white list based on the second message.
6. The method according to any one of claims 1 to 5, wherein the device information of the external device includes: and the Media Access Control (MAC) address of the external equipment.
7. The method of any one of claims 1-5, wherein the electronic device unpairing with the external device comprises:
the electronic equipment cancels the pairing with the external equipment when receiving an operation for indicating the cancellation of the pairing with the external equipment;
or when the electronic equipment is not connected to the external equipment within preset time, cancelling pairing with the external equipment.
8. The method according to any one of claims 1-5, wherein when the external device Bluetooth function is turned on, the electronic device establishes a Bluetooth connection with the external device, including:
when the Bluetooth function of the external equipment is started, the electronic equipment scans the external equipment;
and after the electronic equipment scans the external equipment, establishing Bluetooth connection with the external equipment.
9. The method of any one of claims 1-5, wherein before the electronic device cancels pairing with an external device, the method further comprises:
and upgrading and restarting the electronic equipment.
10. The method of any one of claims 1-5, wherein the electronic device is a tablet computer and the external device is a wireless keyboard.
11. An electronic device, comprising: a processor and a memory;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory, causing the processor to perform the method of any of claims 1-10.
12. A computer-readable storage medium, in which a computer program or instructions are stored which, when executed, implement the method of any one of claims 1-10.
CN202210119639.6A 2022-02-09 2022-02-09 Device reconnection method and related device Active CN114158025B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210119639.6A CN114158025B (en) 2022-02-09 2022-02-09 Device reconnection method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210119639.6A CN114158025B (en) 2022-02-09 2022-02-09 Device reconnection method and related device

Publications (2)

Publication Number Publication Date
CN114158025A true CN114158025A (en) 2022-03-08
CN114158025B CN114158025B (en) 2022-06-14

Family

ID=80450346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210119639.6A Active CN114158025B (en) 2022-02-09 2022-02-09 Device reconnection method and related device

Country Status (1)

Country Link
CN (1) CN114158025B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116527974A (en) * 2023-07-03 2023-08-01 深圳市华曦达科技股份有限公司 Bluetooth remote controller connection method, device and system

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1596538A1 (en) * 2004-05-10 2005-11-16 Sony Ericsson Mobile Communications AB Method and device for bluetooth pairing
CN101202769A (en) * 2006-12-14 2008-06-18 华为技术有限公司 Method and system for node identifying in wireless Mesh network
CN103561478A (en) * 2013-10-10 2014-02-05 华为终端有限公司 Method and device for automatically achieving wireless connection between devices
CN103597800A (en) * 2011-05-23 2014-02-19 微软公司 Automating cloud service reconnections
WO2015152614A1 (en) * 2014-04-02 2015-10-08 Samsung Electronics Co., Ltd. Method of reconnecting master device and slave device
CN106162936A (en) * 2014-11-26 2016-11-23 现代自动车株式会社 The method and apparatus of Bluetooth pairing in vehicle is provided
CN106851530A (en) * 2016-12-14 2017-06-13 青岛海信电器股份有限公司 The method and bluetooth equipment of a kind of automatic Hui Lian of bluetooth equipment
CN106998496A (en) * 2017-04-06 2017-08-01 深圳创维数字技术有限公司 The method and system that a kind of set top box bluetooth is de-coordinated automatically
US20180345077A1 (en) * 2017-06-02 2018-12-06 Apple Inc. Wearable computer with fitness machine connectivity for improved activity monitoring
CN109906561A (en) * 2017-08-31 2019-06-18 华为技术有限公司 A kind of matching method cancels matching method, terminal device and external equipment
CN113395687A (en) * 2021-05-19 2021-09-14 深圳Tcl新技术有限公司 Reconnection method, reconnection device, electronic equipment and storage medium
CN113453381A (en) * 2021-07-08 2021-09-28 Oppo广东移动通信有限公司 Device pairing method and related product
CN113613346A (en) * 2021-07-12 2021-11-05 深圳Tcl新技术有限公司 Network connection method, device, storage medium and electronic equipment

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1596538A1 (en) * 2004-05-10 2005-11-16 Sony Ericsson Mobile Communications AB Method and device for bluetooth pairing
CN101202769A (en) * 2006-12-14 2008-06-18 华为技术有限公司 Method and system for node identifying in wireless Mesh network
CN103597800A (en) * 2011-05-23 2014-02-19 微软公司 Automating cloud service reconnections
CN103561478A (en) * 2013-10-10 2014-02-05 华为终端有限公司 Method and device for automatically achieving wireless connection between devices
WO2015152614A1 (en) * 2014-04-02 2015-10-08 Samsung Electronics Co., Ltd. Method of reconnecting master device and slave device
CN106162936A (en) * 2014-11-26 2016-11-23 现代自动车株式会社 The method and apparatus of Bluetooth pairing in vehicle is provided
CN106851530A (en) * 2016-12-14 2017-06-13 青岛海信电器股份有限公司 The method and bluetooth equipment of a kind of automatic Hui Lian of bluetooth equipment
CN106998496A (en) * 2017-04-06 2017-08-01 深圳创维数字技术有限公司 The method and system that a kind of set top box bluetooth is de-coordinated automatically
US20180345077A1 (en) * 2017-06-02 2018-12-06 Apple Inc. Wearable computer with fitness machine connectivity for improved activity monitoring
CN109906561A (en) * 2017-08-31 2019-06-18 华为技术有限公司 A kind of matching method cancels matching method, terminal device and external equipment
CN113395687A (en) * 2021-05-19 2021-09-14 深圳Tcl新技术有限公司 Reconnection method, reconnection device, electronic equipment and storage medium
CN113453381A (en) * 2021-07-08 2021-09-28 Oppo广东移动通信有限公司 Device pairing method and related product
CN113613346A (en) * 2021-07-12 2021-11-05 深圳Tcl新技术有限公司 Network connection method, device, storage medium and electronic equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
SHAWN BRINK: "How to unpair a bluetooth Device on Windows 10PC", 《GOOGLE学术》 *
张鹏: "基于蓝牙的多生理参数采集传输系统的设计与实现", 《中国优秀硕士学位论文全文数据库》 *
百度: "蓝牙测试方案8.30", 《百度文库》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116527974A (en) * 2023-07-03 2023-08-01 深圳市华曦达科技股份有限公司 Bluetooth remote controller connection method, device and system

Also Published As

Publication number Publication date
CN114158025B (en) 2022-06-14

Similar Documents

Publication Publication Date Title
US11023296B2 (en) Method for managing multiple operating systems in a terminal
WO2016127795A1 (en) Service processing method, server, and terminal
CN109219021B (en) Operator configuration file switching method, mobile terminal and readable storage medium
CN109379735B (en) eSIM card operation method, mobile terminal and eSIM card device
KR102441850B1 (en) Service processing method and mobile communication terminal
WO2019011324A1 (en) Method for determining access method of mobile terminal, storage medium, and mobile terminal
CN111182563B (en) Wireless capability identifier transmission method, terminal equipment and network node
CN114158025B (en) Device reconnection method and related device
WO2017000495A1 (en) Method and device for adding contacts
WO2016119233A1 (en) Method for processing call collision of terminal apparatus and terminal apparatus
CN109219039B (en) eSIM card operation method, mobile terminal and eSIM card device
CN109947617B (en) Method, terminal and readable storage medium for monitoring display content of application interface
CN109257739B (en) eSIM card operation method, mobile terminal and eSIM card device
CN109089258B (en) eSIM card operation method, mobile terminal and eSIM card device
CN109068314B (en) Operator configuration file switching method, intelligent device and readable storage medium
CN109743469B (en) VOLTE-based communication method and mobile terminal
WO2017000496A1 (en) Method and device for adding contact
CN110891262A (en) Bluetooth pairing method, system and terminal equipment
US20220053585A1 (en) Method for pc5 link establishment, device, and system
CN106817370B (en) Method and device for transmitting network data
CN111565388B (en) Network registration method and electronic equipment
CN111314900B (en) Wireless connection method, wireless connection device and mobile terminal
CN111615158B (en) Updating method, reconstruction request processing method, terminal and network equipment
JP2023509407A (en) Multicast service processing method, multicast service configuration method, terminal and network equipment
CN108307531B (en) Call control method, device, user terminal and computer readable storage medium

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