CN113660650A - Method and related device for device reconnection - Google Patents

Method and related device for device reconnection Download PDF

Info

Publication number
CN113660650A
CN113660650A CN202110955892.0A CN202110955892A CN113660650A CN 113660650 A CN113660650 A CN 113660650A CN 202110955892 A CN202110955892 A CN 202110955892A CN 113660650 A CN113660650 A CN 113660650A
Authority
CN
China
Prior art keywords
electronic device
bluetooth
threshold
mobile phone
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
CN202110955892.0A
Other languages
Chinese (zh)
Other versions
CN113660650B (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 CN202110955892.0A priority Critical patent/CN113660650B/en
Publication of CN113660650A publication Critical patent/CN113660650A/en
Application granted granted Critical
Publication of CN113660650B publication Critical patent/CN113660650B/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/10Connection setup
    • H04W76/19Connection re-establishment

Abstract

The embodiment of the application provides a device reconnection method and a related device, and relates to the technical field of communication. The method comprises the following steps: the first electronic equipment and the second electronic equipment establish Bluetooth connection; when the first electronic equipment meets the preset condition, the first electronic equipment is disconnected from the second electronic equipment by Bluetooth; in response to the first electronic device being disconnected from the bluetooth connection of the second electronic device, the first electronic device records a first association relationship, the first association relationship including: the association relationship between the disconnection position S and the disconnection time T1 when the first electronic device and the second electronic device are disconnected; when the first electronic device determines that the first electronic device is located at the disconnection position S at time T2, and the type of the second electronic device is an audio device, a vehicle-mounted device, or other devices, the first electronic device initiates a bluetooth connection to the second electronic device. Therefore, the first electronic device can actively initiate Bluetooth connection to the second electronic device, and quick reconnection is achieved.

Description

Method and related device for device reconnection
The application is a divisional application, the application number of the original application is 202110385894.0, the application date is 2021, 04 and 12 days, and the invention name is as follows: a method and related apparatus for device loopback.
Technical Field
The present application relates to the field of communications technologies, and in particular, to a device reconnection method and a related apparatus.
Background
With the development of terminal technology, more and more terminals are developed and applied. Some kinds of terminals need to be connected with devices such as mobile phones and the like, and then realize corresponding functions of the terminals. For example, a terminal such as a bluetooth headset or a car audio device needs to establish a connection with a mobile phone to realize functions such as music playing.
In the prior art, after the bluetooth headset or the vehicle-mounted audio device is successfully connected with the mobile phone, if a user leaves for a period of time with the mobile phone, the user returns with the mobile phone, the bluetooth headset or the vehicle-mounted audio device cannot be connected to the mobile phone, the user needs to use the mobile phone to search for the device again, and establish pairing connection with the bluetooth headset or the vehicle-mounted audio device again, so that the operation is complicated.
Disclosure of Invention
The embodiment of the application provides a device reconnection method and a related device, which can actively initiate reconnection through electronic equipment and save time.
In a first aspect, an embodiment of the present application provides an apparatus loopback method, including: the first electronic equipment and the second electronic equipment establish Bluetooth connection; when the first electronic equipment meets the preset condition, the first electronic equipment is disconnected from the second electronic equipment by Bluetooth; in response to the first electronic device being disconnected from the bluetooth connection of the second electronic device, the first electronic device records a first association relationship, the first association relationship including: the association relationship between the disconnection position S and the disconnection time T1 when the first electronic device and the second electronic device are disconnected; when the first electronic device determines that the first electronic device is located at the off position S at time T2: when the type of the second electronic device is an audio device and the time difference between the T2 and the T1 is greater than a first threshold, the first electronic device initiates a Bluetooth connection to the audio device; or, when the type of the second electronic device is a vehicle-mounted device and the time difference between T2 and T1 is greater than a second threshold, the first electronic device initiates a bluetooth connection to the vehicle-mounted device; wherein the first threshold is greater than the second threshold; or, when the type of the second electronic device is other types of devices and the time difference between T2 and T1 is greater than a third threshold, the first electronic device initiates a bluetooth connection to the other types of devices; wherein the second threshold is greater than the third threshold.
The audio-frequency device may be a certain specific COD type device, or may be several specific COD types of devices, which is not specifically limited in the embodiment of the present application, and similarly, the vehicle-mounted device or other devices may also be a certain specific COD type device, or may also be several specific COD types of devices, which is not specifically limited in the embodiment of the present application.
Based on this, when the first electronic device and the second electronic device are disconnected from the bluetooth connection, the first electronic device may record the location and the disconnection time when the disconnection occurs, and when the first electronic device returns to the location when the disconnection occurs again, the first electronic device may actively initiate the bluetooth connection to the second electronic device, so as to implement the fast reconnection with the second electronic device.
It can be understood that, in the embodiment of the present application, the disconnection position S when the first electronic device is disconnected from the second electronic device may be the same position information when the first electronic device is disconnected from the second electronic device, or may be position information near when the first electronic device is disconnected from the second electronic device, where a difference between the position information and the position information in the association relationship may be within a certain error range, and the embodiment of the present application is not particularly limited.
It is understood that the first electronic device and the second electronic device may be disconnected from each other by bluetooth at time T1, and the first electronic device returns to the position S where the first electronic device is disconnected from the second electronic device at time T2.
In one possible implementation manner, before the first electronic device initiates a bluetooth connection to the audio-type device or the vehicle-mounted device or other devices, the first electronic device and the audio-type device or the vehicle-mounted device or other devices are in an unconnected state. In this way, the first electronic device may initiate a bluetooth connection to an audio device or a vehicle device or other devices.
In one possible implementation manner, when the number of other electronic devices connected through bluetooth in the first electronic device is less than a fourth threshold, the first electronic device initiates a bluetooth connection to the second electronic device. Thus, the operation of the connected Bluetooth device is not affected in the first electronic device.
In one possible implementation, the determining, by the first electronic device, that the first electronic device is located at the disconnected location S at time T2 includes: the method comprises the steps that the first electronic equipment obtains position information of the first electronic equipment; the first electronic equipment matches the position information with the first incidence relation; when the distance between the position information and the disconnection position in the first association relation is smaller than or equal to a fifth threshold, the first electronic equipment determines that the first electronic equipment is located at the disconnection position S; the first electronic device records time T2. In this way, the first electronic device may determine that the first electronic device has returned to the location information when the first electronic device is disconnected from the second electronic device, and may actively initiate a reconnection to the second electronic device.
In one possible implementation, in response to the bluetooth connection of the first electronic device with the second electronic device being disconnected, the method further includes: the first electronic equipment acquires the position information of the first electronic equipment according to a positioning algorithm to obtain a disconnection position S; wherein, the distance between the disconnection position S and the position information of the first electronic device is smaller than a sixth threshold, and the positioning algorithm includes one or more of the following: GPS positioning, Beidou positioning, geomagnetic positioning, WiFi fingerprint positioning, cell positioning or ultra-wideband positioning. In this way, under different environments, the first electronic device can calculate the position of the first electronic device when the first electronic device is disconnected from the second electronic device by adopting a corresponding positioning algorithm.
In one possible implementation manner, when the first electronic device satisfies a preset condition, the first electronic device disconnects bluetooth from the second electronic device, including: and when the distance between the first electronic device and the second electronic device exceeds a seventh threshold, or the received signal strength RRSI of the first electronic device and the second electronic device is lower than an eighth threshold, or the first electronic device receives a Connection Timeout command, the first electronic device and the second electronic device are disconnected from the Bluetooth Connection. Thus, there may be a number of different reasons that may cause the first electronic device to disconnect from the second electronic device.
In one possible implementation, the first threshold is 32 seconds, the second threshold is 6 seconds, and the third threshold is 2 seconds. Thus, the first electronic device can determine the type of the second electronic device by determining a specific threshold value.
It should be understood that, in the embodiments of the present application, specific values of the first threshold, the second threshold, the third threshold, the fourth threshold, the fifth threshold, the sixth threshold, the seventh threshold, and the eighth threshold are not limited in this application.
In a second aspect, an embodiment of the present application further provides an apparatus loopback method, including: the second electronic equipment establishes Bluetooth connection with the first electronic equipment; when the second electronic equipment meets the preset condition, the second electronic equipment is disconnected with the first electronic equipment through Bluetooth; responding to the disconnection of the Bluetooth connection between the second electronic equipment and the first electronic equipment, and sending a data packet by the second electronic equipment according to a preset rule; and the first electronic equipment records a first association relation, wherein the first association relation comprises: the association relationship between the disconnection position S and the disconnection time T1 when the first electronic device and the second electronic device are disconnected; when the first electronic device determines that the first electronic device is located at the disconnection position S at the time T2, when the type of the second electronic device is an audio device and the time difference between T2 and T1 is greater than a first threshold, the first electronic device initiates Bluetooth connection to the audio device; or, when the type of the second electronic device is a vehicle-mounted device and the time difference between T2 and T1 is greater than a second threshold, the first electronic device initiates a bluetooth connection to the vehicle-mounted device; wherein the first threshold is greater than the second threshold; or, when the type of the second electronic device is other types of devices and the time difference between T2 and T1 is greater than a third threshold, the first electronic device initiates a bluetooth connection to the other types of devices; wherein the second threshold is greater than the third threshold.
Wherein, predetermine the law and include: the data packets are sent periodically, or the data packets are sent according to exponentially increasing time intervals, or the data packets are sent according to the exponentially increasing time intervals first, and then the data packets are sent at fixed periods.
Based on this, when the first electronic device and the second electronic device are disconnected from the bluetooth connection, the second electronic device may send a data packet to reconnect the first electronic device according to a preset rule, the first electronic device may record a position when the first electronic device is disconnected and a disconnection time, when the first electronic device returns to the position when the first electronic device is disconnected again, the second electronic device may reconnect the first electronic device, and if the reconnection success does not exist, the first electronic device may also initiate the bluetooth connection to the second electronic device, so as to implement the fast reconnection with the second electronic device.
In a third aspect, an embodiment of the present application further provides an apparatus loopback method, including: the first electronic equipment and the second electronic equipment establish Bluetooth connection; when the first electronic equipment meets the preset condition, the first electronic equipment is disconnected from the second electronic equipment by Bluetooth; responding to the disconnection of the Bluetooth connection between the first electronic device and the second electronic device, and recording a disconnection position S when the first electronic device is disconnected from the second electronic device by the first electronic device; when the first electronic device determines that the first electronic device is located at the disconnection position S, the first electronic device initiates Bluetooth connection to the second electronic device.
Based on this, when first electronic equipment and second electronic equipment disconnect the bluetooth and connect, first electronic equipment can record the position when disconnection, and when first electronic equipment returned the position when disconnection again, first electronic equipment can initiatively initiate the bluetooth to second electronic equipment and connect, realizes the quick reconnection with second electronic equipment, saves the consumption.
In a fourth aspect, an embodiment of the present application provides an apparatus loopback method, including: the first electronic equipment and the second electronic equipment establish Bluetooth connection; when the first electronic equipment meets the preset condition, the first electronic equipment is disconnected from the second electronic equipment by Bluetooth; in response to the first electronic device being disconnected from the bluetooth connection of the second electronic device, the first electronic device records a first association relationship, the first association relationship including: the association relationship between the disconnection position S and the disconnection time T1 when the first electronic device and the second electronic device are disconnected; when the first electronic device determines that the first electronic device is located at the disconnection position S at the time of T2, and when the type of the second electronic device is an audio device, the first electronic device initiates Bluetooth connection to the audio device; or when the type of the second electronic equipment is vehicle-mounted equipment, the first electronic equipment initiates Bluetooth connection to the vehicle-mounted equipment; or, when the type of the second electronic device is other types of devices, the first electronic device initiates bluetooth connection to other types of devices.
Based on this, when the first electronic device and the second electronic device are disconnected from the bluetooth connection, the first electronic device may record the location and the disconnection time when the disconnection occurs, and when the first electronic device returns to the location when the disconnection occurs again, the first electronic device may actively initiate the bluetooth connection to the second electronic device according to the device type of the second electronic device, so as to implement the fast reconnection with the second electronic device.
In a fifth aspect, an embodiment of the present application provides an apparatus reconnection device, including: a processor, a memory, and a communication unit. A memory to store instructions; the communication unit is used for establishing Bluetooth connection with second electronic equipment; the communication unit is also used for disconnecting the Bluetooth connection with the second electronic equipment when the first electronic equipment meets the preset condition; a processor, configured to record a first association relationship in response to a bluetooth disconnection between a first electronic device and a second electronic device, where the first association relationship includes: the association relationship between the disconnection position S and the disconnection time T1 when the first electronic device and the second electronic device are disconnected; when the first electronic device is located at the off position S at time T2: the communication unit is further used for initiating Bluetooth connection to the audio equipment when the type of the second electronic equipment is audio equipment and the time difference between T2 and T1 is greater than a first threshold value; or, the communication unit is further configured to initiate a bluetooth connection to the vehicle-mounted device when the type of the second electronic device is the vehicle-mounted device and the time difference between T2 and T1 is greater than a second threshold; wherein the first threshold is greater than the second threshold; or, the communication unit is further configured to initiate a bluetooth connection to the other class of devices when the type of the second electronic device is the other class of devices and the time difference between T2 and T1 is greater than a third threshold; wherein the second threshold is greater than the third threshold.
In a possible implementation manner, before the first electronic device initiates a bluetooth connection to the audio device, the vehicle-mounted device, or other devices, the first electronic device and the audio device, the vehicle-mounted device, or other devices are in an unconnected state.
In a possible implementation manner, the communication unit is specifically configured to initiate bluetooth connection to the second electronic device when the number of other electronic devices connected through bluetooth in the first electronic device is less than a fourth threshold.
In a possible implementation manner, the processor is specifically configured to acquire location information of the first electronic device; the processor is specifically further configured to match the location information with the first association; the processor is specifically further configured to determine that the first electronic device is located at the disconnection position S when the distance between the position information and the disconnection position in the first association relationship is less than or equal to a fifth threshold; and the processor is specifically used for recording the T2 time.
In a possible implementation manner, the processor is specifically configured to obtain position information of the first electronic device according to a positioning algorithm to obtain a disconnection position S; wherein, the distance between the disconnection position S and the position information of the first electronic device is smaller than a sixth threshold, and the positioning algorithm includes one or more of the following: GPS positioning, Beidou positioning, geomagnetic positioning, WiFi fingerprint positioning, cell positioning or ultra-wideband positioning.
In a possible implementation manner, the communication unit is specifically configured to disconnect the bluetooth Connection from the second electronic device when a distance between the first electronic device and the second electronic device exceeds a seventh threshold, or a received signal strength RRSI of the first electronic device and the second electronic device is lower than an eighth threshold, or the first electronic device receives a Connection Timeout command.
In one possible implementation, the first threshold is 32 seconds, the second threshold is 6 seconds, and the third threshold is 2 seconds.
In a sixth aspect, an embodiment of the present application provides an electronic device, including: one or more processors, transceivers, memories, and interface circuits; the one or more processors, transceivers, memories, and interface circuits communicate over one or more communication buses; the interface circuit is for communicating with other apparatus, the one or more computer programs being stored in the memory and configured for execution by the one or more processors or transceivers to cause the electronic device to perform the method as set forth in the first aspect or any one of the possible designs of the first aspect.
In a seventh aspect, an embodiment of the present application provides a chip, where the chip is coupled to a memory in an electronic device, and is configured to call a computer program stored in the memory and execute a technical solution of any one of the first aspect and the possible design of the first aspect of the embodiment of the present application; "coupled" in the context of this application means that two elements are joined to each other either directly or indirectly.
In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium includes a computer program, and when the computer program runs on an electronic device, the electronic device is caused to perform any one of the technical solutions as set forth in the first aspect and any one of the possible designs of the first aspect.
A ninth aspect is a computer program product according to an embodiment of the present application, where the computer program product includes instructions that, when executed on a computer, cause the computer to perform any one of the technical solutions as described in the first aspect and any possible design thereof.
For the beneficial effects of the fifth aspect to the ninth aspect, please refer to the beneficial effects of the first aspect, which is not repeated herein.
Drawings
Fig. 1 is a schematic view of an application scenario of device interconnection provided in an embodiment of the present application;
fig. 2 is a schematic diagram of a hardware system architecture of a terminal device according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating an interaction process between a bluetooth peripheral and a mobile phone according to an embodiment of the present application;
FIG. 4 is a schematic interface diagram of a mobile phone connecting back to a Bluetooth peripheral device according to an embodiment of the present disclosure;
fig. 5 is a schematic flowchart of a method for device loopback according to an embodiment of the present application;
FIG. 6 is a diagram of a Bluetooth service class field provided by an embodiment of the present application;
fig. 7 is a timing diagram illustrating a mobile phone and bluetooth peripheral device according to an embodiment of the present disclosure;
FIG. 8 is a timing diagram illustrating another exemplary embodiment of the present invention for a mobile phone to interface with a Bluetooth peripheral device;
FIG. 9 is a schematic diagram of an interface of a mobile phone after being connected back according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an apparatus reconnection device provided in an embodiment of the present application;
fig. 11 is a schematic hardware structure diagram of an apparatus loopback apparatus according to an embodiment of the present application.
Detailed Description
The technical solution in the present application will be described below with reference to the accompanying drawings. In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two.
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 "at … …" in the embodiment of the present application may be at the instant of a certain condition, or may be within a certain period of time after a certain condition occurs, and the embodiment of the present application is not particularly limited to this.
The device connection method and the device provided by the embodiment of the application can be applied to electronic devices with a device interconnection function.
Specifically, the electronic device having the device interconnection function may include two types of devices. For example, the electronic devices may include a first electronic device having a relatively strong computing power and a second electronic device that needs to be connected to the first electronic device to implement a function.
For example, the first electronic device includes: a mobile phone (mobile phone), a tablet computer (Pad), a computer with a wireless transceiving function, a wireless terminal in industrial control (industrial control), a wireless terminal in self-driving (self-driving), a wireless terminal in remote medical supply (remote surgery), 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. For example, the second electronic device includes: bluetooth headset, on-vehicle audio equipment, wearable equipment etc.. The embodiments of the present application do not limit the specific technologies and the specific device forms adopted by the first electronic device and the second electronic device.
For example, taking a first electronic device as a mobile phone and a second electronic device as a bluetooth headset or a car audio device as an example, fig. 1 shows an application scenario diagram of device interconnection provided in an embodiment of the present application.
As shown in fig. 1, the bluetooth headset 101 or the car audio device 102 may send a page packet via bluetooth or the like, and the cell phone 103 may also discover and connect with the bluetooth headset 101 or the car audio device 102 via bluetooth or the like.
After the bluetooth headset 101 or the vehicle audio device 102 is connected to the mobile phone 103, the bluetooth headset 101 or the vehicle audio device 102 may implement functions such as music playing and call making.
In order to better understand the embodiments of the present application, the following describes the structures of the first electronic device and the second electronic device in the embodiments of the present application:
exemplarily, taking the first electronic device as a terminal device as an example, fig. 2 shows a hardware system architecture diagram of the terminal device. The terminal device may include: a Radio Frequency (RF) circuit 210, a memory 220, an input unit 230, a display unit 240, a sensor 250, an audio circuit 260, a wireless fidelity (WiFi) module 270, a processor 280, a power supply 290, and a bluetooth module 2100. Those skilled in the art will appreciate that the terminal device configuration shown in fig. 2 is not intended to be limiting of terminal devices and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following specifically describes each constituent component of the terminal device with reference to fig. 2:
the RF circuit 210 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 280; 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 210 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 220 may be used to store software programs and modules, and the processor 280 executes various functional applications and data processing of the terminal device by operating the software programs and modules stored in the memory 220. The memory 220 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 terminal device, and the like. Further, the memory 220 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 220 stores a program for the bluetooth device to connect back.
The input unit 230 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device. Specifically, the input unit 230 may include a touch panel 231 and other input devices 232. The touch panel 231, also referred to as a touch screen, may collect touch operations of a user (e.g., operations of the user on or near the touch panel 231 using any suitable object or accessory such as a finger, a stylus, etc.) thereon or nearby, and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 231 may include two parts of 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 it to touch point coordinates, and then provides the touch point coordinates to the processor 280, and can receive and execute commands from the processor 280. In addition, the touch panel 231 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 230 may include other input devices 232 in addition to the touch panel 231. In particular, other input devices 232 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 240 may be used to display information input by a user or information provided to the user and various menus of the terminal device. The display unit 240 may include a display panel 241, and optionally, the display panel 241 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 231 may cover the display panel 241, and when the touch panel 231 detects a touch operation thereon or nearby, the touch panel is transmitted to the processor 280 to determine the type of the touch event, and then the processor 280 provides a corresponding visual output on the display panel 241 according to the type of the touch event. Although in fig. 2, the touch panel 231 and the display panel 241 are implemented as two separate components to implement the input and output functions of the terminal device, in some embodiments, the touch panel 231 and the display panel 241 may be integrated to implement the input and output functions of the terminal device.
The terminal device may also include at least one sensor 250, 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 241 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 241 or the backlight when the terminal 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 terminal device, and related functions (such as pedometer and tapping) for vibration recognition; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal device, detailed description is omitted here.
Audio circuitry 260, speaker 261, and microphone 262 may provide an audio interface between the user and the terminal device. The audio circuit 260 may transmit the electrical signal converted from the received audio data to the speaker 261, and convert the electrical signal into a sound signal by the speaker 261 and output the sound signal; on the other hand, the microphone 262 converts the collected sound signal into an electric signal, which is received by the audio circuit 260 and converted into audio data, which is then processed by the audio data output processor 280, and then transmitted to, for example, another terminal device via the RF circuit 210, or output to the memory 220 for further processing.
WiFi belongs to a short-distance wireless transmission technology, and the terminal device can help a user send and receive e-mails, browse webpages, access streaming media and the like through the WiFi module 270, and provides wireless broadband internet access for the user. Although fig. 2 shows the WiFi module 270, it is understood that it does not belong to the essential constitution of the terminal device, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 280 is a control center of the terminal device, connects various parts of the entire terminal device using various interfaces and lines, and performs various functions of the terminal device and processes data by operating or executing software programs or modules stored in the memory 220 and calling data stored in the memory 220, thereby integrally monitoring the terminal device. Alternatively, processor 280 may include one or more processing units; preferably, the processor 280 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 processor 280. It is understood that in the embodiment of the present application, the memory 220 stores a program for bluetooth device loopback, and the processor 280 may be configured to call and execute the program for bluetooth device loopback stored in the memory 220 to implement the method for bluetooth device loopback in the embodiment of the present application.
The terminal device also includes a power supply 290 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 280 via a power management system to manage charging, discharging, and power consumption management functions via the power management system.
The bluetooth technology belongs to a short-distance wireless transmission technology, and the terminal device can establish bluetooth connection with other terminal devices having a bluetooth module through the bluetooth module 2100, so as to perform data transmission based on a bluetooth communication link. Bluetooth module 2100 may be Bluetooth Low Energy (BLE), or a module, according to actual needs. It can be understood that, in the case that the terminal device in the embodiment of the present application is a user terminal and a service tool, the terminal device includes a bluetooth module. It is to be understood that the bluetooth module does not belong to the essential constitution of the terminal device and may be omitted entirely as needed within the scope not changing the essence of the invention, for example, the bluetooth module may not be included in the server.
Although not shown, the terminal device may further include a camera. Optionally, the position of the camera on the terminal 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 embodiment of the present application.
Optionally, the terminal device may include a single camera, a dual camera, or a triple camera, and the like, which is not limited in this embodiment. Cameras include, but are not limited to, wide angle cameras, tele cameras, or depth cameras, among others.
For example, the terminal device may include three cameras, one being a main camera, one being a wide camera, and one being a tele camera.
Optionally, when the terminal device includes a plurality of cameras, the plurality of cameras may be all front-mounted, all rear-mounted, all built-in, at least partially front-mounted, at least partially rear-mounted, or at least partially built-in, and the like, which is not limited in this embodiment of the application.
Illustratively, taking the second electronic device as a bluetooth peripheral (or referred to as a bluetooth device), the bluetooth peripheral may include at least one processor, at least one memory, a wireless communication module, an audio module, a power module, an input/output interface, a sensor, and the like. The processor may include one or more interfaces for connecting with other components of the bluetooth peripheral.
The memory may be used to store program code such as applications for proximity discovery, pairing and connection between a bluetooth peripheral and an electronic device, handling audio traffic (e.g., music playing, making/receiving calls) of the electronic device, and the like. The memory may also be used to store other information, such as the priority of the electronic device.
The processor may be configured to execute the application program code and call the relevant modules to implement the functions of the bluetooth peripheral in the embodiment of the present application. For example, the functions of proximity discovery, pairing, connection, audio playing, call receiving/making and the like between the Bluetooth peripheral and the electronic equipment are realized. For example, when the bluetooth module is a bluetooth headset, and the wireless communication module is a bluetooth module, the processor may instruct the bluetooth module to send a discovery message such as a page data packet, so that the electronic device may calculate a signal strength indicator (RRSI) according to the received discovery message, and determine whether to discover the bluetooth headset according to the RSSI. It will be appreciated that the distance r between the bluetooth peripheral and the electronic device is inversely proportional to RSSI. The greater the RSSI is, the smaller the distance between the Bluetooth peripheral and the electronic equipment can be shown; the smaller the RSSI, the greater the distance between the bluetooth peripheral and the electronic device may be indicated. For example, the correspondence between r and RSSI may be:
Figure BDA0003220256750000081
wherein, A is the signal intensity when the distance between the preset transmitting end and the receiving end is 1m, and n is the preset environment attenuation factor.
The processor may include one or more processing units, and the different processing units may be separate devices or may be integrated in one or more processors. The processor may specifically be an integrated control chip, or may be composed of a circuit including various active and/or passive components, and the circuit is configured to perform the functions attributed to the processor described in the embodiments of the present application.
The wireless communication module may be configured to support data exchange between the bluetooth peripheral and other electronic devices using wireless technologies such as Bluetooth (BT), wireless local area network (WiFi), wireless technology (zigbee, ZB), Frequency Modulation (FM), Near Field Communication (NFC), infrared (infrared, IR), or universal 2.4G/5G wireless communication.
In some embodiments, the wireless communication module may be a bluetooth module, for example, specifically, a bluetooth chip, and the bluetooth-free peripheral is a bluetooth device. The Bluetooth peripheral can be matched and connected with a Bluetooth chip of the electronic equipment through the Bluetooth chip, so that wireless communication and service processing between the Bluetooth peripheral and the electronic equipment are realized through Bluetooth connection. In general, a bluetooth chip may support Basic Rate (BR)/Enhanced Data Rate (EDR) bluetooth and Bluetooth Low Energy (BLE), for example, may receive/transmit paging (page) information, receive/transmit BLE broadcast, and the like.
In addition, the wireless communication module may further include an antenna, and receive the electromagnetic wave via the antenna, frequency-modulate and filter the electromagnetic wave signal, and transmit the processed signal to the processor. The wireless communication module can also receive a signal to be sent from the processor, frequency-modulate and amplify the signal, and convert the signal into electromagnetic waves through the antenna to radiate the electromagnetic waves.
For example, when the wireless communication module is a bluetooth module, the bluetooth module may receive a signal to be transmitted from a processor, perform frequency modulation, amplify the signal, and radiate the amplified signal via an electromagnetic wave converted from a bluetooth antenna.
For example, the signal sent by the bluetooth module via the bluetooth antenna may be a discovery message such as a page packet, which may be used by the electronic device to calculate RSSI and perform proximity discovery according to the RSSI.
The audio module can be used for managing audio data and realizing the input and output of audio signals by the Bluetooth peripheral. For example, the audio module may obtain an audio signal from the wireless communication module or transmit the audio signal to the wireless communication module, so as to implement functions of making and receiving calls, playing music, activating/deactivating a voice assistant of an electronic device connected to the headset, receiving/transmitting voice data of a user, and the like through the bluetooth headset. The audio module may include a speaker (or called an earphone or a receiver) component for outputting an audio signal, a microphone (or called a microphone or a microphone), a microphone receiving circuit matched with the microphone, and the like. The speaker may be used to convert the electrical audio signal into an acoustic signal and play it. The microphone may be used to convert sound signals into electrical audio signals.
The power supply module can be used for providing a system power supply of the Bluetooth peripheral and supplying power to each module of the Bluetooth peripheral; and the Bluetooth peripheral is supported to receive charging input and the like. The power module may include a Power Management Unit (PMU) and a battery. The power supply management unit can receive external charging input; the electric signal input by the charging circuit is provided for the battery to charge after being transformed, and the electric signal provided by the battery can be provided for other modules such as an audio module, a wireless communication module and the like after being transformed; and to prevent overcharging, overdischarging, short-circuiting, overcurrent, etc. of the battery. In some embodiments, the power module may further comprise a wireless charging coil for wirelessly charging the bluetooth peripheral. In addition, the power management unit can also be used for monitoring parameters such as battery capacity, battery cycle number, battery health state (electric leakage and impedance) and the like.
A plurality of input/output interfaces that may be used to provide wired connections for charging or communication of the bluetooth peripheral. For example, the input/output interface may be a USB interface, a charging interface, or the like.
Additionally, the bluetooth peripheral may also include a sensor. For example, the sensor may be a distance sensor or a proximity light sensor, which may be used to determine whether the bluetooth peripheral is being used by the user. For example, the bluetooth peripheral may utilize a distance sensor to detect whether an object is in the vicinity of the bluetooth peripheral to determine whether the bluetooth peripheral is being used by the user. Upon determining that the bluetooth peripheral is in use, the bluetooth peripheral may turn on the speaker.
As another example, the sensor may also include a bone conduction sensor, incorporated into a bone conduction headset. By utilizing the bone conduction sensor, the Bluetooth peripheral can acquire the vibration signal of the human body sound part vibration bone block, analyze out the voice signal, realize the voice function and further receive the voice instruction of the user. The Bluetooth peripheral can also perform voice authentication according to the user voice signal acquired by the bone conduction headset so as to authenticate the user identity in service scenes such as payment transaction and the like.
For another example, the sensor may further include: the touch sensor is used for detecting touch operation of a user so as to respond to the touch operation to release pairing (namely release Bluetooth pairing with other equipment, which can also be called pairing reset), put through a phone call, switch music and other functions; the fingerprint sensor is used for detecting the fingerprint of the user, identifying the identity of the user and the like; the ambient light sensor can adaptively adjust some parameters (such as volume) according to the perceived brightness of the ambient light; and other sensors.
In some embodiments, the touch sensor may detect a single click, a double click, a multiple click, a long press, a heavy press, and other touch operations of the user, and may also perform user fingerprint recognition to authenticate the user identity in a service scenario such as a payment transaction.
It is to be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation to the bluetooth peripheral. It may have more or fewer components, may combine two or more components, or may have a different configuration of components. For example, the external surface of the bluetooth peripheral device may further include a key, an indicator light (which may indicate the status of power, incoming/outgoing call, pairing mode, etc.), a display screen (which may prompt the user for relevant information), a dust screen (which may be used with an earphone), and the like. The key may be a physical key or a touch key (used in cooperation with the touch sensor), and is used for triggering operations such as startup, shutdown, pause, play, recording, pairing start, and reset. The following explains a method for device loopback in a possible design by taking an electronic device as a mobile phone and a bluetooth headset or a car machine (or called as a car-mounted device) as an example.
In some embodiments, as shown in fig. 3, in the case that the bluetooth peripheral is successfully paired and connected with the mobile phone, when the distance between the bluetooth peripheral and the mobile phone exceeds a threshold, for example, if the user wears the bluetooth peripheral to gradually leave the range covered by the bluetooth information of the mobile phone, or the distance between the user and the bluetooth peripheral exceeds the threshold, the distance between the mobile phone and the bluetooth peripheral may be increased or the signal quality may be degraded, which may result in disconnection between the mobile phone and the bluetooth peripheral, and after the disconnection, the bluetooth peripheral may initiate a loopback to the mobile phone according to a preset scheme, for example, the bluetooth peripheral may periodically initiate a loopback operation.
The link back can be understood as a process in which after the bluetooth peripheral has established a connection with the mobile phone, the bluetooth peripheral is disconnected from the mobile phone for various reasons, and then the bluetooth peripheral tries to reconnect to the mobile phone, or the mobile phone tries to connect to the bluetooth peripheral.
It should be noted that, the embodiment of the present application is not limited to determine the disconnection between the bluetooth peripheral and the mobile phone.
For example, in a first implementation manner of the preset scheme, when the bluetooth peripheral determines that the RRSI with the mobile phone is lower than the threshold, the bluetooth peripheral may determine to disconnect with the mobile phone. The threshold may be flexibly set according to actual conditions, for example, the threshold may be-80 dBm, -90dBm, and the like, and the embodiment of the present application is not particularly limited.
In a second implementation manner of the preset scheme, the bluetooth peripheral device may send a pull data packet to the mobile phone according to a certain rule, and if the bluetooth peripheral device does not receive information that the mobile phone responds to the pull data packet within a period of time, the bluetooth peripheral device may determine to disconnect from the mobile phone.
It can be understood that, when the bluetooth peripheral is disconnected from the mobile phone, the air interface between the bluetooth peripheral and the mobile phone may be disconnected, and communication between the bluetooth peripheral and the mobile phone may not be possible. A Host Controller Interface (HCI) between a Host (Host) and a controller (controller) inside the bluetooth peripheral may transmit an HCI command, for example, the HCI command may include a Complete Reason "Connection Timeout" for Disconnection, for example, HCI Disconnection Complete, and response Timeout.
In some embodiments, when the bluetooth peripheral is disconnected from the handset, the handset or the bluetooth peripheral may receive a Connection Timeout command, for example, a "Connection Timeout" command due to a distance pull specified in the protocol, i.e., a Connection Timeout.
In a possible implementation, after the bluetooth peripheral device is disconnected from the mobile phone, a page data packet may be sent to the paired mobile phone to recover the connection, and this process may be referred to as the bluetooth peripheral device initiating a connection back to the mobile phone. In some embodiments, the page data packet may include an identity representation of the mobile phone, such as a Mac address, which is not specifically limited in this embodiment. Certainly, after the connection between the bluetooth peripheral and the mobile phone is disconnected, the bluetooth peripheral may not initiate a connection back to the mobile phone.
For example, when the bluetooth peripheral initiates a loopback to the mobile phone, the bluetooth peripheral may initiate a loopback to the mobile phone according to a certain rule. The rule may be to send data packets periodically; may be sending packets at exponentially increasing intervals; or the data packets are sent according to the exponentially increased time interval, and then the data packets are sent in a fixed period; and the like. The embodiment of the present application is not particularly limited to this.
For example, taking bluetooth as an example of a headset, the headset may include a first headset supporting a Basic Rate (BR) protocol and/or an Enhanced Data Rate (EDR) protocol, a second headset supporting a low power (BLE) protocol, and the like, and in some embodiments, some bluetooth devices may support both the BR/EDR protocol and the BLE protocol.
The first headset may initiate a loopback to the handset in the following three cases.
The first condition is as follows: after the first headset is disconnected from the handset, the first headset may initiate a reconnection of the handset at a fixed period (e.g., 2 seconds, 4 seconds, 8 seconds, 32 seconds, 64 seconds, 128 seconds, etc.).
Case two: after the first earphone is disconnected from the mobile phone, the mobile phone may be reconnected at 2n exponentially increasing time intervals such as 2 seconds, 4 seconds, 8 seconds, etc., or may be reconnected at 3n exponentially increasing time intervals such as 3 seconds, 9 seconds, 27 seconds, etc., and the embodiment of the present application is not limited in particular.
Case three: after the first earphone is disconnected from the mobile phone, the first earphone can firstly initiate reconnection of the mobile phone according to the exponentially increased time intervals of 2 seconds, 4 seconds and 8 seconds, and after 8 seconds, the first earphone can fixedly initiate reconnection of the mobile phone by taking 8 seconds as the time interval.
It is understood that after the first earphone is disconnected from the mobile phone, the first earphone may also be connected back to the mobile phone in the form of 2 seconds, 4 seconds, and 8 seconds, and the form of the given time period value is not particularly limited in this embodiment of the application.
If the first earphone does not successfully reconnect the mobile phone within a certain time, the mobile phone enters a page scan mode, and in the page scan mode, the mobile phone can receive a reconnection request of a previously connected Bluetooth peripheral. After a while, if the Bluetooth peripheral device does not successfully connect back to the mobile phone, the Bluetooth peripheral device is powered off, and the connection back to the mobile phone cannot be realized.
For example, after the first headset is disconnected from the mobile phone, the first headset is not reconnected to the mobile phone within 10 minutes, the mobile phone enters a page scan mode, and the first headset can be reconnected to the mobile phone. If the first earphone is not reconnected to the mobile phone after 20 minutes, the first earphone is powered off and cannot be connected back to the mobile phone.
Taking the second headset as a True Wireless Stereo (TWS) headset as an example, after the TWS headset is disconnected from the mobile phone, the BLE broadcast signal may be transmitted periodically, where the period may be a fixed period, for example, 2 seconds, and the period may also be an increasing period, which may be 2 seconds, 4 seconds, and the like. The handset may initiate a backhaul connection to the TWS headset after scanning for the BLE broadcast signal. However, for non-TWS type headsets, such as the first headset described above, it is often not possible to continuously transmit broadcast signals, and the handset may not be able to make a connection to the first headset.
It will be appreciated that the manner in which different bluetooth peripherals are looped back with the handset, or the cycle of the looping back, may vary.
In a possible implementation manner, taking the bluetooth external as the car machine as an example, after the car machine is disconnected from the mobile phone, some car machines do not initiate a loopback, wait for the mobile phone to initiate a loopback, and when the mobile phone initiates a loopback, re-perform the steps of device discovery, device connection and the like.
It is understood that the bluetooth peripheral may be an audio device or a vehicle-mounted device or other devices, where the audio device is mainly a generic term for audio input and output devices, and may include: power amplifier, audio amplifier, multimedia console, digital sound console, audio frequency sampling card, synthesizer, well high frequency audio amplifier, microphone, earphone etc. on-vehicle class equipment mainly is the on-vehicle information equipment who installs inside the car, can include: the vehicle-mounted computer, the vehicle-mounted sound equipment, the vehicle-mounted television and the like, other equipment can be wearable equipment, can also be peripheral equipment, and the like, and the embodiment of the application does not limit the equipment.
It should be noted that, in the embodiments of the present application, an audio device is taken as an earphone, and a vehicle-mounted device is taken as a vehicle-mounted device.
Illustratively, fig. 4 shows an interface diagram of a mobile phone connecting back to a bluetooth peripheral.
Fig. 4 a is a schematic diagram of a shortcut operation menu displayed on a mobile phone interface according to an embodiment of the present application. As shown in fig. 4 a, the shortcut operation menu 411 may be a pull-down menu, and optionally, the shortcut operation menu may also be a pull-up menu, a side pull menu, a floating menu, or the like, which is not specifically limited in the embodiment of the present application.
Specifically, if it is detected that the user operates the bluetooth control 410 by the user, for example, the mobile phone receives a click operation of the user on the bluetooth control 410, the display state of the bluetooth control 410 in the shortcut menu 411 is highlighted, which indicates that the current bluetooth of the mobile phone is in an open state. Further, the mobile phone interface may enter the mobile phone interface shown as B in fig. 4, as shown as B in fig. 4, in the mobile phone interface, a user may receive a selection operation of a bluetooth peripheral device that needs to be reconnected in the paired device list, and if the bluetooth peripheral device that needs to be reconnected is set as honor-1, the mobile phone may initiate a reconnection to the honor-1, and the operation of implementing the reconnection in this manner is cumbersome.
In another possible implementation manner, after the bluetooth peripheral is disconnected from the mobile phone, if some type of application program, such as an exercise health application program, is installed on the mobile phone, the application program may actively initiate a bluetooth connection with the bluetooth peripheral, so that the mobile phone and the bluetooth peripheral reestablish the bluetooth connection, the method of returning the bluetooth peripheral through the mobile phone as shown in fig. 4 may not be needed. However, in this method, a dedicated application program needs to be downloaded from the mobile phone, and the space occupied by the application program on the mobile phone is large.
In summary, in the above possible design, for the first headset or the car machine, after the first headset or the car machine is disconnected from the mobile phone, the first headset or the car machine actively initiates a loop back connection to the mobile phone, if a period of initiating the loop back connection of the first headset or the car machine is long, there may be a lag in the loop back connection with the mobile phone, and after the user leaves the first headset or the car machine for a period of time with the mobile phone, if the user returns, the connection between the first headset or the car machine and the mobile phone may not be realized in time, which affects the use of the user. If the mobile phone is actively connected with the first earphone or the vehicle, a more complicated equipment re-discovery and connection process is adopted, or a special application program needs to be installed in the mobile phone, and the application program occupies the space of the mobile phone.
Based on this, the method for device reconnection provided in the embodiments of the present application, when the mobile phone and the bluetooth peripheral device are disconnected, the mobile phone may record the position when the connection is disconnected and the time when the connection is disconnected, and when the mobile phone returns to the position when the connection is disconnected again, the mobile phone may actively initiate reconnection to the bluetooth peripheral device, thereby implementing fast reconnection to the bluetooth peripheral device. In addition, in the embodiment of the application, the mobile phone can initiate the process of the connection back without installing a specific application program, so that the user can not perceive the process and does not need to perform complicated operation.
Specifically, the device loop connection method in the embodiment of the present application may be specifically used in the following two scenarios.
Scene one: after the distance between the mobile phone and the Bluetooth peripheral exceeds a certain value (or called a pull distance), the mobile phone returns to the position of the Bluetooth peripheral again, at the moment, the Bluetooth peripheral is not powered off, and the Bluetooth peripheral tries to be connected back with the mobile phone, so that the Bluetooth peripheral can receive a connection back request of the mobile phone when the mobile phone initiates the connection back to the Bluetooth peripheral.
Scene two: after the distance between the mobile phone and the Bluetooth peripheral exceeds a certain value, the mobile phone returns to the position of the Bluetooth peripheral again, the Bluetooth peripheral is not powered off at the moment, the Bluetooth peripheral is in a page mode, and when the mobile phone initiates a reconnection to the Bluetooth peripheral, the Bluetooth peripheral can receive a reconnection request of the mobile phone.
Exemplarily, fig. 5 shows a flowchart of a method for providing device loopback according to an embodiment of the present application, where the method includes:
s501, the mobile phone is successfully connected with the Bluetooth peripheral in a matching mode.
And S502, when the mobile phone or the Bluetooth peripheral meets the preset condition, the Bluetooth peripheral is disconnected with the mobile phone.
The embodiment of the application does not limit the matching connection mode of the mobile phone and the Bluetooth peripheral.
For example, the bluetooth peripheral may enter a pairable mode based on key triggering, and after the bluetooth is turned on, the bluetooth peripheral may be found in the device list, and a pairing connection between the mobile phone and the bluetooth peripheral may be established.
After the mobile phone and the Bluetooth peripheral are successfully matched and connected, the Bluetooth peripheral can realize the functions of playing music, making a call and the like.
During the connection between the mobile phone and the bluetooth peripheral, the bluetooth peripheral may send a data packet to the mobile phone, where the data packet may include a device name, a device type, a bluetooth media access control (Mac) address, manufacturer information, power information, or connection status, and other information related to the bluetooth peripheral.
If the distance between the mobile phone and the Bluetooth peripheral is larger than a certain value, or the RSSI between the mobile phone and the Bluetooth peripheral is smaller than or equal to a preset threshold value, or the mobile phone or the Bluetooth peripheral receives a command of 'connection overtime', or the mobile phone does not receive a data packet from the Bluetooth peripheral within a period of time, or the Bluetooth peripheral does not receive a response from the mobile phone within a period of time, and the like, the Bluetooth peripheral and the mobile phone can be determined to be disconnected.
After the bluetooth peripheral is disconnected from the mobile phone, the bluetooth peripheral may initiate a reconnection to the mobile phone according to a certain rule, which is specifically referred to the above description of the bluetooth peripheral reconnection and will not be described herein again. The Bluetooth peripheral equipment can also enter a page scan state, in the page scan state, the power consumption of the Bluetooth peripheral equipment can be saved, and the Bluetooth peripheral equipment can also receive messages of other equipment.
S503, recording the association relation among the Bluetooth Mac of the peripheral equipment, the disconnected position S and the disconnected time T1 by the local database of the mobile phone.
In the embodiment of the present application, the local database refers to a database provided by a mobile phone system, and may be used to store files in a mobile phone, where the files may include texts, audio, video, images, and the like.
In the embodiment of the present application, the bluetooth Mac may also be referred to as a bluetooth physical address, and is composed of a number with a 16-system length of 48 bits (6 bytes), and can be used to identify a bluetooth peripheral type. It is understood that the bluetooth Mac may be replaced with any possible content for identifying the bluetooth device, such as replacing the name or serial number of the bluetooth device, and the embodiment of the present application is not particularly limited.
In a possible implementation manner, after the mobile phone and the bluetooth peripheral device are successfully paired, the mobile phone local database stores the Mac address of the bluetooth peripheral device, and when the mobile phone and the bluetooth peripheral device are disconnected, the mobile phone may record a position S and/or a time T1 of the disconnection of the bluetooth peripheral device, where the position S and/or the time T1 are associated with the Mac address of the bluetooth peripheral device.
For example, the mobile phone may calculate the position of the mobile phone disconnected from the bluetooth peripheral device according to a positioning algorithm, and record the position of the mobile phone as the position S of the bluetooth peripheral device disconnected. It can be understood that the position S may be the same as the position where the mobile phone is located when the mobile phone is disconnected from the bluetooth peripheral, and the position S may also have a certain error with the position where the mobile phone is located when the mobile phone is disconnected from the bluetooth peripheral, for example, the distance between the position S and the position where the mobile phone is located when the mobile phone is disconnected from the bluetooth peripheral is smaller than or equal to a certain threshold, which is not limited in the embodiment of the present application.
Wherein, the positioning algorithm may comprise: a GPS positioning method, a Beidou positioning method, a geomagnetic positioning method, a WiFi fingerprint positioning method, a cell positioning method, an Ultra Wide Band (UWB) positioning method and the like.
The GPS positioning method and the beidou positioning method may refer to a method for realizing positioning by using a satellite, and are not described herein again.
The geomagnetic positioning method may refer to: and recording the incidence relation between the current position and the geomagnetic intensity by using the terminal, and then matching the current geomagnetic intensity of the mobile phone with the incidence relation to obtain a positioning result.
For example, when the mobile phone is at the location B, the mobile phone measures that the surrounding geomagnetic intensity is 2 oersted, and the mobile phone may compare and match the geomagnetic intensity value 2 oersted with the geomagnetic intensity value of the association relationship, to find the location information where the geomagnetic intensity value is 2 oersted, and obtain the location result of the location B.
The WiFi fingerprint positioning method refers to the steps that a terminal detects Mac information of peripheral routers (WiFi), and the position of a mobile phone is obtained according to the position information of the WiFi.
For example, when the handset is at the location C, the handset detects Mac information of 3 surrounding WiFi, and obtains an RRSI and a Service Set Identifier (SSID) of the 3 WiFi, respectively, where the RRSI may be-80 dBm, -100dBm, -110dBm, the SSID is a name of a local area network and may be used to distinguish different networks, and the handset may compare and match the RRSI of the location being-80 dBm, -100dBm, -110dBm, and the SSID with the RRSI and the SSID in the fingerprint library, find the RRSI being-80 dBm, -100dBm, -110dBm, and the location information of the SSID, further determine the location of the location C, and obtain a location result of the location C, where the RRSI and the SSID are fixed at a certain location. Wherein the fingerprint repository may include WiFi association with location.
The cell positioning method may refer to: and obtaining the position of the mobile phone according to the cell position information of the mobile phone.
For example, when the mobile phone is at the location D, the mobile phone is located in the area of the cell a, and the mobile phone may translate the location information of the cell a into longitude and latitude coordinates (116 ° E, 40 ° N), and resolve the coordinates to obtain the location result of the mobile phone as the location D.
The UWB positioning method includes a time of flight (TOF) method, a time difference of arrival (TDOA) method, an angle of arrival positioning method (AOA) method, and the like.
For example, taking TOF positioning as an example, when the mobile phone is at the position E, the mobile phone performs position calculation by measuring the distance between the mobile phone and the surrounding positioning base station, and obtains a positioning result. For example, the mobile phone may obtain the positioning result of the position E by measuring the distance between the mobile phone and the base station 1 to be 800 meters, or the mobile phone may obtain the positioning result of the position E by measuring the distance between the mobile phone and the base station 2 to be 300 meters and the distance between the mobile phone and the base station 3 to be 500 meters.
It can be understood that, if the bluetooth peripheral has a positioning function, the bluetooth peripheral may also send its own location information to the mobile phone, and the mobile phone may obtain the location S from the bluetooth peripheral.
The embodiment of the present application is also not limited to the manner in which the mobile phone obtains the time T1 of disconnection, and for example, the mobile phone may record the time of the clock when disconnection according to the clock inside the mobile phone to obtain T1. The handset may also obtain the T1 from a bluetooth peripheral.
In some embodiments, the mobile phone may further record the position in a corresponding manner according to the current environment, for example, when the mobile phone is located outdoors, a GPS positioning method or a beidou positioning method may be used, and when the mobile phone is located indoors, a geomagnetic positioning method, a WiFi fingerprint positioning method, a cell positioning method or an ultra-wideband positioning method may be used, which is not specifically limited in the embodiments of the present application.
In some embodiments, the mobile phone may associate the current location S1 according to the time point T1 when the bluetooth peripheral is disconnected, as shown in table 1 below, the table 1 may include the identification of the bluetooth peripheral, the disconnected location S1 of the bluetooth peripheral to the mobile phone, and the association of the bluetooth peripheral to the disconnected time T1 of the mobile phone.
TABLE 1
Bluetooth Mac (Key) COD type Open position Off time
Device A Earphone set S1 T1
Optionally, the association relationship in table 1 may further include a class of device (COD) of the bluetooth peripheral. The COD type is used for identifying the type of the Bluetooth peripheral equipment, different types of Bluetooth equipment can support different protocols, and different connection modes are realized. For example, from the perspective of the urgency degree of the loop back requirement, the bluetooth peripheral may include two types, one type is a device with a relatively urgent loop back time requirement, and the other type is a device with a relatively less urgent loop back time requirement, for example, the requirement of the headset for the loop back time may be a period of 32 seconds, the requirement of the vehicle machine for the loop back time may be a period of 6 seconds, then the headset is a device with a relatively less urgent loop back time requirement, and the vehicle machine is a device with a relatively urgent loop back time requirement. Therefore, the subsequent mobile phone can select an adaptive period based on the COD type of the bluetooth peripheral device to initiate a backhaul to the bluetooth peripheral device, which is not described herein.
In some embodiments, this step may also record only the location when bluetooth is off and an identity representation (e.g., Mac address) of the bluetooth peripheral, which may optionally be time.
And S504, determining that the mobile phone returns to the position S disconnected with the Bluetooth peripheral.
The mobile phone may determine the location information of the mobile phone in any manner as described in S503, which is not described herein again.
The mobile phone may match the acquired location information with the association relationship recorded in the local database of the mobile phone, and when the location information acquired by the mobile phone has matching information in the association relationship, it may be determined that the mobile phone returns to the location disconnected from the bluetooth peripheral, for example, the mobile phone returns to the location S, and the mobile phone may perform the processes as in S505-S508.
It should be noted that, the fact that the location information acquired by the mobile phone has matching information in the association relationship may mean that the location information acquired by the mobile phone is the same as some location information in the association relationship, or that a difference between the location information acquired by the mobile phone and some location information in the association relationship is smaller than a certain threshold, which is not limited in the embodiment of the present application.
Optionally, the handset may also record the time T2 when it returns to position S. It is understood that the time T2 when the mobile phone returns to the position S may not be recorded, and the embodiment of the present application is not particularly limited.
In some embodiments, the handset may not initiate a loopback operation when it is determined that the handset is in a location different from the location S where the bluetooth peripheral is disconnected.
And S505, the mobile phone judges the connection state with the Bluetooth peripheral.
In the embodiment of the application, the connection state between the mobile phone and the bluetooth peripheral device may be a connected state or an unconnected state.
For example, when the mobile phone returns to the position S, if the bluetooth peripheral has initiated a loopback with the mobile phone and the bluetooth peripheral successfully establishes a loopback with the mobile phone, the connection state of the mobile phone and the bluetooth peripheral may be a connected state.
In other cases, the connection state of the mobile phone and the bluetooth peripheral device may be an unconnected state.
If the mobile phone and the Bluetooth peripheral are in a connected state, the mobile phone does not need to carry out the step of back connection with the Bluetooth peripheral. If the mobile phone and the Bluetooth peripheral are in an unconnected state, S506 is performed.
It should be noted that, in this embodiment of the application, the mobile phone may also be connected to other bluetooth peripherals, and the bluetooth peripherals may also be connected to other mobile phones, which is not specifically limited in this embodiment of the application.
In a possible implementation manner, before S505, the mobile phone may further determine whether a condition for connecting the bluetooth device is currently met. For example, the mobile phone supports connection of at most 5 bluetooth peripherals, when the mobile phone returns to the position where the bluetooth peripherals are disconnected, the mobile phone may first determine that the mobile phone has currently connected several bluetooth peripherals, if the mobile phone has connected 5 bluetooth peripherals, the mobile phone will not initiate reconnection, and if the number of the bluetooth peripherals connected to the mobile phone is less than 5, S505 may be executed. The mobile phone can support at most several bluetooth peripheral connections, and the embodiment of the present application is not particularly limited.
In some embodiments, the bluetooth peripheral may not initiate a loopback operation if the current mobile phone is already in a connected state with other peripheral devices, and further, the bluetooth peripheral may initiate a loopback if the current mobile phone is already in a connected state with other peripheral devices and the current mobile phone does not perform bluetooth service or performs low priority service with other peripheral devices.
And S506, the mobile phone judges the type of the Bluetooth peripheral, if the type is an earphone, the step S507 is carried out, and if the type is a vehicle machine, the step S508 is carried out.
In a possible implementation manner, the mobile phone may determine the type of the bluetooth peripheral according to the content including the bluetooth service class field sent by the bluetooth peripheral to the mobile phone.
For example, fig. 6 is a schematic diagram of a bluetooth service class field provided in an embodiment of the present application, and as shown in fig. 6, the bluetooth service class field includes: field 1, field 2, and field 3, field 1 may be used to distinguish primary service classes, occupying the fields of sections 13-23, field 2 may be used to distinguish primary device classes, occupying the fields of sections 8-12, and field 3 may be used to distinguish secondary device classes, occupying the fields of sections 2-7.
Wherein, by distinguishing each byte in the field 1, the main service classes can be divided into classes such as limited discoverable mode, location, network, rendering, capturing, object transmission, audio, telephone, information, etc.; by distinguishing each byte in the field 2, the main device categories can be classified into computer, telephone, LAN/network access point, audio/video, accessory, imaging, wearable, toy, health, other categories, and by distinguishing each byte in the field 3, the secondary device categories can be classified, specifically, the type of the bluetooth peripheral device can be judged.
Illustratively, taking the audio/video main category as an example, the audio/video main category can be classified into wearable headset device, hands-free device, microphone, speaker, earphone, portable audio, car audio, set-top box, HiFi audio device, VCR, video camera, camcorder, video monitor, video display and speaker, video conference, game/toy, and others, and the handset can determine the type of bluetooth peripheral from the headset, portable audio, car audio, and so on according to the bytes in field 3.
In another possible implementation manner, the COD type of the bluetooth peripheral may also be recorded in the local database of the mobile phone, for example, the Mac address, COD type, disconnection position, disconnection time and return position time of the bluetooth peripheral may be recorded in the local database of the mobile phone, as shown in table 2, device a is an earphone, disconnection position is S1, disconnection time is T1, and return time to this position S1 is T2; the device a is a car machine, the off position is S2, the off time is T1, and the time for returning to the position S2 is T2.
TABLE 2
Bluetooth Mac (Key) COD type Open position Off time Time of return position
Device A Earphone set S1 T1 T2
Device B Vehicle machine S2 T1 T2
Further, in order to avoid the loss of the loopback of the mobile phone to the bluetooth headset due to the fact that the mobile phone and the bluetooth peripheral initiate the loopback simultaneously, the mobile phone may determine whether to connect the bluetooth peripheral according to the interval between T2 and T1. Illustratively, S507, S508 and S509 respectively show steps when the handset initiates a loop back with the headset or the car or other device.
And S507, the mobile phone judges whether T2-T1 is larger than a1, if so, the mobile phone initiates reconnection of the Bluetooth peripheral equipment, and if not, the operation returns to S505.
However, a1 may be replaced by any value, for example, a1 may be 32 seconds, which is not specifically limited in this embodiment of the present application.
S508, the mobile phone judges whether T2-T1 is larger than a2, if yes, the mobile phone initiates reconnection of the Bluetooth peripheral equipment, and if not, the operation returns to S505.
However, a2 may be replaced by any value, for example, a2 may be 6 seconds, which is not specifically limited in this embodiment of the present application.
And S509, judging whether T2-T1 is larger than a3 by the mobile phone, if so, initiating reconnection of the Bluetooth peripheral by the mobile phone, and if not, returning to S505.
However, a3 may be replaced by any value, for example, a3 may be 2 seconds, which is not specifically limited in this embodiment of the present application.
It will be appreciated that the principle of initiating a loopback connection is similar when the bluetooth device is a headset or a car or other type of device. Next, take the example of the handset determining whether T2-T1 is greater than a, describe S507, S508 and S509.
For example, fig. 7 is a timing diagram of a mobile phone and a bluetooth peripheral device that are provided in this embodiment of the present application, as shown in fig. 7, the mobile phone and the bluetooth peripheral device are disconnected at a time T1, the mobile phone records a disconnection position of the bluetooth peripheral device at the time T1, when the mobile phone returns to the disconnection position of the bluetooth peripheral device at the time T2, the mobile phone determines whether T2-T1 is greater than a value a, and if so, the mobile phone initiates a reconnection to the bluetooth peripheral device at a time T2.
For example, fig. 8 is a timing diagram of another mobile phone and bluetooth peripheral device reconnection provided in this embodiment of the application, as shown in fig. 8, the mobile phone and the bluetooth peripheral device are disconnected at time T1, the mobile phone records the disconnected position of the bluetooth peripheral device at the time T1, when the mobile phone returns to the disconnected position of the bluetooth peripheral device at time T2, the mobile phone determines whether T2-T1 is greater than a value a, if not, the mobile phone continues to wait for a period of time Δ T, and determines whether T2+ Δ T-T1 is greater than a at time T2+ Δ T, and if so, the mobile phone initiates a reconnection to the bluetooth peripheral device.
It should be noted that the value a may be determined according to the related art, or may be set by the user, and the embodiment of the present application is not particularly limited.
For example, since the period of reconnecting the headset to the mobile phone may be 32 seconds, when it is determined that the bluetooth peripheral is the headset, a may take a value of 32 seconds. Of course, the 32 seconds may be replaced by any value, and this is not particularly limited in the embodiment of the present application.
Because the period of reconnection initiated by the vehicle-mounted device to the mobile phone can be 6 seconds, when the Bluetooth peripheral is judged to be the vehicle-mounted device, a can take 6 seconds. Of course, the 6 seconds may be replaced by any value, and this is not particularly limited in the embodiment of the present application.
It can be understood that the above-mentioned process of disconnecting the mobile phone from the bluetooth peripheral and initiating the loopback may not have a user interface, and the user may not perceive the process.
The mobile phone can also prompt the user that the Bluetooth peripheral is successfully connected back through modes of displaying information, vibrating or voice and the like. Fig. 9 is a schematic interface diagram of a mobile phone after being connected back according to an embodiment of the present application.
As shown in fig. 9, the mobile phone may display a prompt box to prompt the user to find the bluetooth peripheral and automatically pair and connect with the bluetooth peripheral, the bluetooth peripheral may be a bluetooth headset or a car machine, and the user may confirm that the mobile phone is connected to the bluetooth peripheral by selecting "know" in the trigger prompt box, or disconnect the connection between the mobile phone and the bluetooth peripheral by selecting "disconnect" in the trigger prompt box.
In the solutions shown in fig. 5 and steps S501 to S509 in the embodiment of the present application, some steps may not be necessary, and each step may also be combined at will, for example, in combination with S501 to S504, the embodiment of the present application provides a method for actively triggering a bluetooth connection back when a bluetooth peripheral is located at a last disconnected position again based on recording a last disconnected position of the bluetooth, so as to save power consumption; for another example, according to S505, it may be determined whether to connect back according to the device type of the bluetooth peripheral; for another example, S501-S506, when the bluetooth peripheral is located at the last disconnected position again, the bluetooth connection may be actively triggered by recording the last disconnected position of the bluetooth and the device type of the bluetooth peripheral; as another example, S501-S509, record the position of last bluetooth disconnection and determine different connection back periods in conjunction with the device of the bluetooth peripheral, and actively trigger bluetooth connection back when the bluetooth peripheral is in the position of last disconnection again.
The device reconnection method according to the embodiment of the present application has been described above, and the following describes an 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 device loopback apparatus provided in the embodiments of the present application can perform the steps of the device loopback method described above.
As shown in fig. 10, fig. 10 is a schematic structural diagram of an apparatus loopback apparatus provided in the embodiment of the present application, where the apparatus loopback apparatus may be a terminal device in the embodiment of the present application, or may be a chip or a chip system in the terminal device. The device reconnection device comprises: a communication unit 1001 and a processing unit 1002.
The communication unit 1001 is used for establishing bluetooth connection with a second electronic device; the communication unit 1001 is further configured to disconnect a bluetooth connection with the second electronic device when the first electronic device meets a preset condition; the processing unit 1002, configured to record a first association relationship in response to a bluetooth disconnection between the first electronic device and the second electronic device, where the first association relationship includes: the association relationship between the disconnection position S and the disconnection time T1 when the first electronic device and the second electronic device are disconnected; when the first electronic device is located at the off position S at time T2: the communication unit 1001 is further configured to initiate a bluetooth connection to the audio device when the type of the second electronic device is an audio device and the time difference between T2 and T1 is greater than a first threshold; or, the communication unit 1001 is further configured to initiate a bluetooth connection to the vehicle-mounted device when the type of the second electronic device is the vehicle-mounted device and the time difference between T2 and T1 is greater than a second threshold; wherein the first threshold is greater than the second threshold; or, the communication unit 1001 is further configured to initiate a bluetooth connection to another type of device when the type of the second electronic device is another type of device and the time difference between T2 and T1 is greater than a third threshold; wherein the second threshold is greater than the third threshold.
Exemplarily, taking the device connection apparatus as a terminal device or a chip system applied in the terminal device as an example, the communication unit 1001 is configured to support the device connection apparatus to perform the communication steps in the foregoing embodiments, and the processing unit 1002 is configured to support the device connection apparatus to perform the processing steps in the foregoing embodiments.
Illustratively, when the device loopback apparatus is a terminal device, the communication unit 1001 may be a communication interface or an interface circuit. When the device loopback apparatus is a chip or a system of chips within a terminal device, the communication unit 1001 may be a communication interface. For example, the communication interface may be an input/output interface, a pin or a circuit, etc.
In a possible implementation manner, the device reconnection apparatus may further include: a storage unit 1003. The storage unit 1003 may include one or more memories, which may be devices in one or more devices or circuits for storing programs or data.
The storage unit 1003 may be independent and connected to the processing unit 1002 through a communication bus. The memory unit 1003 may also be integrated with the processing unit 1002.
Taking the device loopback apparatus as an example of a chip or a chip system of the terminal device in the embodiment of the present application, the storage unit 1003 may store a computer-executable instruction of the method of the terminal device, so that the processing unit 1002 executes the method of the terminal device in the above embodiment. The storage unit 1003 may be a register, a cache, a Random Access Memory (RAM), or the like, and the storage unit 1003 may be integrated with the processing unit 1002. The storage unit 1003 may be a read-only memory (ROM) or other type of static storage device that may store static information and instructions, and the storage unit 1003 may be separate from the processing unit 1002.
In a possible implementation manner, before the first electronic device initiates a bluetooth connection to the audio device, the vehicle-mounted device, or other devices, the first electronic device and the audio device, the vehicle-mounted device, or other devices are in an unconnected state.
In a possible implementation manner, the communication unit 1001 is specifically configured to initiate bluetooth connection to the second electronic device when the number of other electronic devices connected through bluetooth in the first electronic device is less than a fourth threshold.
In a possible implementation manner, the processing unit 1002 is specifically configured to obtain location information of the first electronic device; the processing unit 1002 is further configured to match the position information with the first association relationship; the processing unit 1002 is further specifically configured to determine that the first electronic device is located at the disconnection position S when a distance between the position information and the disconnection position in the first association relationship is smaller than or equal to a fifth threshold; the processing unit 1002 is further configured to record a time T2.
In a possible implementation manner, the processing unit 1002 is specifically configured to obtain position information of the first electronic device according to a positioning algorithm, so as to obtain a disconnection position S; wherein, the distance between the disconnection position S and the position information of the first electronic device is smaller than a sixth threshold, and the positioning algorithm includes one or more of the following: GPS positioning, Beidou positioning, geomagnetic positioning, WiFi fingerprint positioning, cell positioning or ultra-wideband positioning.
In a possible implementation manner, the communication unit 1001 is specifically configured to disconnect the bluetooth Connection from the second electronic device when the distance between the first electronic device and the second electronic device exceeds a seventh threshold, or the received signal strength RRSI between the first electronic device and the second electronic device is lower than an eighth threshold, or the first electronic device receives a Connection Timeout command.
In one possible implementation, the first threshold is 32 seconds, the second threshold is 6 seconds, and the third threshold is 2 seconds.
For example, taking the device reconnection apparatus as a chip or a chip system of a terminal system as an example, the communication unit 1001 is configured to support the device reconnection apparatus to perform S501, S502, S507, S508, or S509 in the foregoing embodiment. The processing unit 1002 is configured to support the device reconnection apparatus to execute S503, S504, S505, S506, S507, S508, or S509 in the foregoing embodiment.
In one possible implementation manner, the device reconnection apparatus may further include: a display unit 1004. The display unit 1004 is used for supporting the device reconnection apparatus to display an interface. The processing unit 1002 may be integrated with the display unit 1004, and the processing unit 1002 and the display unit 1004 may be in communication.
The apparatus of this embodiment may be correspondingly used to perform the steps performed in the above method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 11 is a schematic hardware structure diagram of an apparatus loopback apparatus according to an embodiment of the present application. Referring to fig. 11, the apparatus includes: a memory 1101, a processor 1102, and an interface circuit 1103. The apparatus may further include a display 1104, wherein the memory 1101, the processor 1102, the interface circuit 1103, and the display 1104 may be in communication; illustratively, the memory 1101, the processor 1102, the interface circuit 1103 and the display 1104 can communicate through a communication bus, and the memory 1101 is used for storing computer execution instructions, and is controlled by the processor 1102 and the interface circuit 1103 to execute communication, so as to implement the device loopback method provided by the following embodiments of 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 1103 may also include a transmitter and/or a receiver. Optionally, the processor 1102 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 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 (19)

1. A method of device loopback, the method comprising:
the first electronic equipment and the second electronic equipment establish Bluetooth connection;
when the first electronic equipment meets a preset condition, the first electronic equipment and the second electronic equipment are disconnected by Bluetooth;
in response to the disconnection of the Bluetooth connection between the first electronic device and the second electronic device, the first electronic device records a disconnection position S when the first electronic device is disconnected from the second electronic device;
when the first electronic device determines that the first electronic device is located at the disconnection position S, the first electronic device initiates Bluetooth connection to the second electronic device.
2. The method of claim 1, wherein the disconnection location S is recorded in a first association comprising: the association relationship between the disconnection position S and a disconnection time T1 when the first electronic device and the second electronic device are disconnected; when the first electronic device determines that the first electronic device is located at the disconnection position S, the first electronic device initiates a bluetooth connection to the second electronic device, including:
when the first electronic device determines that the first electronic device is located at the disconnected position S at time T2, and the T2 is greater than the T1 by a preset value, the first electronic device initiates a Bluetooth connection to the second electronic device.
3. The method of claim 2, wherein when the first electronic device determines that the first electronic device is in the disconnected position S at time T2, and the T2 is greater than the T1 by a preset value, the first electronic device initiates a Bluetooth connection to the second electronic device, comprising:
when the first electronic device determines that the first electronic device is located at the off position S at time T2:
when the type of the second electronic device is an audio device and the time difference between the T2 and the T1 is greater than a first threshold, the first electronic device initiates a Bluetooth connection to the audio device;
or, when the type of the second electronic device is a vehicle-mounted device and the time difference between the T2 and the T1 is greater than a second threshold, the first electronic device initiates a Bluetooth connection to the vehicle-mounted device; wherein the first threshold is greater than the second threshold;
or, when the type of the second electronic device is other type devices and the time difference between the T2 and the T1 is greater than a third threshold, the first electronic device initiates a bluetooth connection to the other type devices; wherein the second threshold is greater than the third threshold.
4. The method according to claim 3, wherein before the first electronic device initiates a Bluetooth connection to the audio class device or the vehicle class device or the other class device, the first electronic device is in an unconnected state with the audio class device or the vehicle class device or the other class device.
5. The method of claim 3 or 4, wherein the first threshold is 32 seconds, the second threshold is 6 seconds, and the third threshold is 2 seconds.
6. The method according to any one of claims 1-5, wherein when the number of other electronic devices connected through Bluetooth in the first electronic device is less than a fourth threshold, the first electronic device initiates a Bluetooth connection to the second electronic device.
7. The method of any of claims 2-5, wherein the first electronic device determining that the first electronic device is located in the disconnected location S comprises:
the first electronic equipment acquires position information of the first electronic equipment;
the first electronic equipment matches the position information with the first incidence relation;
when the distance between the position information and the disconnection position in the first association relation is smaller than or equal to a fifth threshold, the first electronic device determines that the first electronic device is located at the disconnection position S.
8. The method of any of claims 1-7, wherein in response to the first electronic device disconnecting from the Bluetooth connection of the second electronic device, the method further comprises:
the first electronic equipment acquires the position information of the first electronic equipment according to a positioning algorithm to obtain the disconnection position S; wherein the distance between the disconnection position S and the position information of the first electronic device is less than a sixth threshold, and the positioning algorithm includes one or more of the following: GPS positioning, Beidou positioning, geomagnetic positioning, WiFi fingerprint positioning, cell positioning or ultra-wideband positioning.
9. The method according to any one of claims 1-8, wherein the disconnecting, by the first electronic device and the second electronic device, the Bluetooth connection when the first electronic device satisfies a preset condition comprises:
when the distance between the first electronic device and the second electronic device exceeds a seventh threshold, or when the received signal strength RRSI of the first electronic device and the second electronic device is lower than an eighth threshold, or when the first electronic device receives a Connection Timeout command, the first electronic device and the second electronic device are disconnected from each other by Bluetooth.
10. An apparatus of device loopback, comprising a memory, a processor, and a communication unit, the memory to store instructions;
the communication unit is used for establishing Bluetooth connection with second electronic equipment;
the communication unit is further used for disconnecting the Bluetooth connection with the second electronic equipment when the device connected back to the equipment meets a preset condition;
the processor is used for responding to the disconnection of the Bluetooth connection between the device connected back and the second electronic equipment and recording a disconnection position S when the first electronic equipment is disconnected from the second electronic equipment;
the communication unit is further configured to initiate a bluetooth connection to the second electronic device when the device to which the device is connected back is located at the disconnection location S.
11. The apparatus of claim 10, wherein the disconnection location S is recorded in a first association comprising: the association relationship between the disconnection position S and a disconnection time T1 when the first electronic device and the second electronic device are disconnected;
the communication unit is specifically configured to initiate a bluetooth connection to the second electronic device when the device that is connected back to the device is located at the disconnection position S at time T2, and the T2 is greater than the T1 by a preset value.
12. The apparatus of claim 11, wherein when the device being connected back is in the disconnect position S at time T2:
the communication unit is further used for initiating a Bluetooth connection to the audio equipment when the type of the second electronic equipment is audio equipment and the time difference between the T2 and the T1 is greater than a first threshold;
or, the communication unit is further configured to initiate a bluetooth connection to the vehicle-mounted device when the type of the second electronic device is a vehicle-mounted device and the time difference between the T2 and the T1 is greater than a second threshold; wherein the first threshold is greater than the second threshold;
or, the communication unit is further configured to initiate a bluetooth connection to another class of device when the type of the second electronic device is another class of device and the time difference between the T2 and the T1 is greater than a third threshold; wherein the second threshold is greater than the third threshold.
13. The apparatus according to claim 12, wherein the apparatus for device loopback is in an unconnected state with the audio class device or the vehicle class device or the other class device before the apparatus for device loopback initiates a bluetooth connection with the audio class device or the vehicle class device or the other class device.
14. The apparatus of claim 12 or 13, wherein the first threshold is 32 seconds, the second threshold is 6 seconds, and the third threshold is 2 seconds.
15. The apparatus according to any of claims 10 to 14, wherein the communication unit is specifically configured to initiate a bluetooth connection to the second electronic device when the number of devices of other electronic devices that have been connected via bluetooth in the apparatus for device loopback is less than a fourth threshold.
16. The apparatus according to any of claims 11-14, wherein the processor is specifically configured to obtain location information of the apparatus to which the device is connected back;
the processor is specifically further configured to match the location information with the first association;
the processor is specifically further configured to determine that the device for device reconnection is located at the disconnection position S when the distance between the position information and the disconnection position in the first association relationship is smaller than or equal to a fifth threshold.
17. The apparatus according to any one of claims 10 to 16, wherein the processor is specifically configured to obtain location information of the apparatus to which the device is connected back according to a positioning algorithm, to obtain the disconnection location S; wherein the distance between the disconnection location S and the location information of the device to which the apparatus is connected back is less than a sixth threshold, and the positioning algorithm comprises one or more of the following: GPS positioning, Beidou positioning, geomagnetic positioning, WiFi fingerprint positioning, cell positioning or ultra-wideband positioning.
18. The apparatus of any one of claims 10-17,
the communication unit is specifically configured to disconnect the bluetooth Connection with the second electronic device when a distance between the device reconnecting apparatus and the second electronic device exceeds a seventh threshold, or when a received signal strength RRSI between the device reconnecting apparatus and the second electronic device is lower than an eighth threshold, or when the device reconnecting apparatus receives a Connection Timeout command.
19. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 9.
CN202110955892.0A 2021-04-12 2021-04-12 Method and related device for device reconnection Active CN113660650B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110955892.0A CN113660650B (en) 2021-04-12 2021-04-12 Method and related device for device reconnection

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110385894.0A CN112839303B (en) 2021-04-12 2021-04-12 Method and related device for device reconnection
CN202110955892.0A CN113660650B (en) 2021-04-12 2021-04-12 Method and related device for device reconnection

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202110385894.0A Division CN112839303B (en) 2021-04-12 2021-04-12 Method and related device for device reconnection

Publications (2)

Publication Number Publication Date
CN113660650A true CN113660650A (en) 2021-11-16
CN113660650B CN113660650B (en) 2023-01-10

Family

ID=75929799

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202110955892.0A Active CN113660650B (en) 2021-04-12 2021-04-12 Method and related device for device reconnection
CN202110385894.0A Active CN112839303B (en) 2021-04-12 2021-04-12 Method and related device for device reconnection

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202110385894.0A Active CN112839303B (en) 2021-04-12 2021-04-12 Method and related device for device reconnection

Country Status (1)

Country Link
CN (2) CN113660650B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024012408A1 (en) * 2022-07-12 2024-01-18 华为技术有限公司 Method for implementing low-power-consumption operation of bluetooth device, and related apparatus

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114153770A (en) * 2021-11-30 2022-03-08 联想(北京)有限公司 Control method and electronic equipment
CN114173285B (en) * 2022-02-11 2022-07-22 荣耀终端有限公司 Bluetooth back connection method, system, electronic equipment, server and storage medium
CN114173315B (en) * 2022-02-14 2022-06-14 荣耀终端有限公司 Bluetooth reconnection method and terminal equipment
CN116233760B (en) * 2023-05-10 2023-08-08 深圳市雅乐电子有限公司 Bluetooth headset retrieval method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160127559A1 (en) * 2014-10-30 2016-05-05 Samsung Electronics Co., Ltd. Communication Service Operating Method and Electronic Device Supporting the Same
CN105897314A (en) * 2016-06-24 2016-08-24 维沃移动通信有限公司 Bluetooth connection control method and terminal
CN108419226A (en) * 2012-09-27 2018-08-17 华为终端(东莞)有限公司 A kind of method and bluetooth equipment connected between bluetooth equipment
CN109417758A (en) * 2016-06-27 2019-03-01 华为技术有限公司 A kind of method and terminal of bluetooth connection
CN110191442A (en) * 2019-04-18 2019-08-30 华为技术有限公司 A kind of Bluetooth connecting method, equipment and system
CN110602672A (en) * 2019-07-29 2019-12-20 深圳市万普拉斯科技有限公司 Bluetooth device reconnection method, device, terminal and computer readable storage medium
CN111436039A (en) * 2019-10-23 2020-07-21 珠海市杰理科技股份有限公司 Bluetooth reconnection method and system, Bluetooth master and slave device reconnection method and Bluetooth master and slave devices
US20200375457A1 (en) * 2019-05-29 2020-12-03 Dexcom, Inc. System and method for wireless communication of analyte data
CN112399390A (en) * 2019-08-14 2021-02-23 华为技术有限公司 Bluetooth connection method and related device

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103686595B (en) * 2012-09-26 2018-10-12 联想(北京)有限公司 State switching method and electronic equipment
US9565514B2 (en) * 2015-06-12 2017-02-07 Qualcomm Incorporated Systems and methods for disabling page scans
CN105554861A (en) * 2015-12-02 2016-05-04 广东小天才科技有限公司 Method and system of automatic networking on the basis of position and time
CN105392115A (en) * 2015-12-03 2016-03-09 上海卓易科技股份有限公司 Automatic Bluetooth reconnection method
CN105636004A (en) * 2015-12-25 2016-06-01 惠州Tcl移动通信有限公司 Bluetooth automatic reconnection method and system based on low power consumption Bluetooth
CN105636238B (en) * 2016-02-26 2019-02-22 北京小米移动软件有限公司 Wireless Fidelity WiFi connection control method and device
US20180115858A1 (en) * 2016-10-21 2018-04-26 Qualcomm Incorporated Systems and methods for connecting wireless communication devices
CN107770758A (en) * 2017-09-21 2018-03-06 深圳市汉普电子技术开发有限公司 The bluetooth of Baffle Box of Bluetooth returns even method, Baffle Box of Bluetooth and storage medium
CN108541080B (en) * 2018-04-23 2020-09-22 Oppo广东移动通信有限公司 Method for realizing loop connection between first electronic equipment and second electronic equipment and related product
CN112203179B (en) * 2020-09-22 2022-10-18 歌尔科技有限公司 TWS earphone, automatic reconnection method and device thereof, and computer storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108419226A (en) * 2012-09-27 2018-08-17 华为终端(东莞)有限公司 A kind of method and bluetooth equipment connected between bluetooth equipment
US20160127559A1 (en) * 2014-10-30 2016-05-05 Samsung Electronics Co., Ltd. Communication Service Operating Method and Electronic Device Supporting the Same
CN105897314A (en) * 2016-06-24 2016-08-24 维沃移动通信有限公司 Bluetooth connection control method and terminal
CN109417758A (en) * 2016-06-27 2019-03-01 华为技术有限公司 A kind of method and terminal of bluetooth connection
CN110191442A (en) * 2019-04-18 2019-08-30 华为技术有限公司 A kind of Bluetooth connecting method, equipment and system
US20200375457A1 (en) * 2019-05-29 2020-12-03 Dexcom, Inc. System and method for wireless communication of analyte data
CN110602672A (en) * 2019-07-29 2019-12-20 深圳市万普拉斯科技有限公司 Bluetooth device reconnection method, device, terminal and computer readable storage medium
CN112399390A (en) * 2019-08-14 2021-02-23 华为技术有限公司 Bluetooth connection method and related device
CN111436039A (en) * 2019-10-23 2020-07-21 珠海市杰理科技股份有限公司 Bluetooth reconnection method and system, Bluetooth master and slave device reconnection method and Bluetooth master and slave devices

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024012408A1 (en) * 2022-07-12 2024-01-18 华为技术有限公司 Method for implementing low-power-consumption operation of bluetooth device, and related apparatus

Also Published As

Publication number Publication date
CN112839303A (en) 2021-05-25
CN113660650B (en) 2023-01-10
CN112839303B (en) 2021-08-31

Similar Documents

Publication Publication Date Title
CN112839303B (en) Method and related device for device reconnection
US20230362028A1 (en) Home device control method and device
CN107852762B (en) Method for managing Bluetooth connection, Bluetooth master device and device
CN113395685B (en) Bluetooth communication system and wireless communication system
US20230130963A1 (en) Method for processing relax measurement parameter update, and terminal device
CN114499587B (en) Audio synchronization communication method, system, wireless earphone, terminal and storage medium
CN110536193B (en) Audio signal processing method and device
US20220141745A1 (en) Network switching method and terminal
CN112789934B (en) Bluetooth service query method and electronic equipment
CN108600539B (en) Mobile terminal, position detection method and related product
EP3843459A1 (en) Communication system switching method and terminal device
CN109495769B (en) Video communication method, terminal, smart television, server and storage medium
CN105530684B (en) Network access method, device and system
CN112040475A (en) Communication connection method, system, terminal equipment and network equipment
US11006475B2 (en) Direct mode operation communication method and terminal
CN108540659B (en) Method, terminal and computer readable storage medium for reducing TDD noise influence
CN110087223B (en) Communication connection method, communication device, and storage medium
CN108683800B (en) Mobile terminal, position detection method and related product
CN110636530A (en) Method for processing adjacent channel interference and terminal equipment
US20220053585A1 (en) Method for pc5 link establishment, device, and system
CN111818594A (en) Network switching method, network equipment and terminal
CN115396408A (en) Wireless audio/video device and wireless communication method
CN109618062B (en) Voice interaction method, device, equipment and computer readable storage medium
CN107204882B (en) Method and equipment for filtering data packet and mobile terminal
CN112469014A (en) Method and electronic equipment for configuring Bluetooth connection parameters

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