Earphone back connection method and device, storage medium and electronic equipment

By detecting disconnection triggers within a preset time period during the Bluetooth headset reconnection process, the problem of excessively long reconnection times and low accuracy caused by user-intentioned triggers is solved, resulting in faster and more accurate headset reconnection.

CN116390067BActive Publication Date: 2026-01-16GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202111607084.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2026-01-16
Estimated Expiration
2041-12-23

AI Technical Summary

Technical Problem

Existing Bluetooth headsets are prone to excessively long reconnection times and reduced accuracy due to user-intentioned jitter during the reconnection process.

Method used

By detecting whether a disconnection trigger operation occurs within a preset time period during the headphone reconnection process, the reconnection operation is terminated if such an operation is detected, thus shortening the reconnection time and improving accuracy.

Benefits of technology

It effectively shortens the headphone reconnection time, avoids reconnection caused by user accidental touch, and improves the accuracy of headphone reconnection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116390067B_ABST
    Figure CN116390067B_ABST
Patent Text Reader

Abstract

The application discloses an earphone reconnection method and device, a storage medium and an electronic device. The method comprises the following steps: if a reconnection trigger operation on an earphone is detected, starting a reconnection operation process on the earphone; detecting whether there is a disconnection trigger operation on the earphone within a preset time period between the starting of the reconnection operation process on the earphone and the success of the reconnection of the earphone; and if the disconnection trigger operation on the earphone is detected within the preset time period between the starting of the reconnection operation process on the earphone and the success of the reconnection of the earphone, terminating the reconnection operation process. The application shortens the earphone reconnection time, avoids the reconnection caused by the user's misoperation, and improves the accuracy of the earphone reconnection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to an earphone reconnection method and device, a storage medium and an electronic device. BACKGROUND

[0002] In the current life, in order to avoid the disturbance of the external sound when using the smart device in public places, the use of earphones is convenient for oneself and does not disturb others. With the development of wireless communication technology, Bluetooth technology is widely used to realize the wireless connection between two devices within a certain distance range. Therefore, Bluetooth earphones are widely used in daily life and work because they can be carried easily without the constraint of wires. SUMMARY

[0003] The earphone reconnection method and device, the storage medium and the electronic device provided by the embodiments of the present application shorten the earphone reconnection time, avoid the reconnection caused by the user's mistake, and improve the accuracy of earphone reconnection.

[0004] In a first aspect, the embodiments of the present application provide an earphone reconnection method, which comprises the following steps:

[0005] If a reconnection trigger operation on the earphone is detected, the earphone reconnection operation processing is started;

[0006] In a preset time period between the start of the earphone reconnection operation processing and the success of the earphone reconnection, it is detected whether there is a disconnection trigger operation on the earphone;

[0007] In the preset time period between the start of the earphone reconnection operation processing and the success of the earphone reconnection, if it is detected that there is a disconnection trigger operation on the earphone, the reconnection operation processing is terminated.

[0008] In a second aspect, the embodiments of the present application provide an earphone reconnection device, which comprises the following modules:

[0009] A reconnection module is configured to start the earphone reconnection operation processing if a reconnection trigger operation on the earphone is detected;

[0010] A first detection module is configured to detect whether there is a disconnection trigger operation on the earphone in a preset time period between the start of the earphone reconnection operation processing and the success of the earphone reconnection;

[0011] A disconnection module is configured to terminate the reconnection operation processing if it is detected that there is a disconnection trigger operation on the earphone in the preset time period between the start of the earphone reconnection operation processing and the success of the earphone reconnection.

[0012] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and performing the method steps of the first aspect.

[0013] In a fourth aspect, an embodiment of the present application provides an electronic device, which can include a processor and a memory, wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and performing the method steps of the first aspect.

[0014] The technical solutions provided by some embodiments of the present application have at least the following beneficial effects:

[0015] In the embodiments of the present application, by detecting the state of the earphone, if the reconnection triggering operation on the earphone is detected, the reconnection operation processing on the earphone is started, and within a certain preset time period between the start of the reconnection operation processing on the earphone and the success of the reconnection of the earphone, it is detected whether there is a disconnection triggering operation on the earphone, and if the disconnection triggering operation on the earphone is detected, the reconnection operation processing on the earphone is terminated. By detecting whether the disconnection triggering operation occurs within the preset time period during the reconnection operation processing on the earphone, the reconnection operation processing and the disconnection detection processing within the preset time period are executed in parallel, the reconnection time of the earphone is shortened, the reconnection caused by user's mis-touch is avoided, and the accuracy of the earphone reconnection is improved. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0017] Figure 1 A system architecture diagram of an earphone reconnection method provided by an embodiment of the present application;

[0018] Figure 2 A flowchart of an earphone reconnection method provided by an embodiment of the present application;

[0019] Figure 3 An example diagram of state change of a neck-hanging Bluetooth earphone provided by an embodiment of the present application;

[0020] Figure 4 An example diagram of state change of a wireless Bluetooth earphone provided by an embodiment of the present application;

[0021] Figure 5 A flowchart of an earphone reconnection method provided by an embodiment of the present application;

[0022] Figure 6 An example schematic diagram of an earphone back connection operation processing logic provided for an embodiment of the present application is shown in FIG. 1.

[0023] Figure 7 An example structural diagram of an earphone back connection device provided for an embodiment of the present application is shown in FIG. 2.

[0024] Figure 8 An example structural diagram of an electronic device provided for an embodiment of the present application is shown in FIG. 3. DETAILED DESCRIPTION

[0025] The technical solutions in the embodiments of the present application will be clearly and completely described in combination with the drawings in the embodiments of the present application.

[0026] In the following description, the terms "first" and "second" are only for the purpose of description, and cannot be understood as indicating or implying relative importance. The following description provides a plurality of embodiments of the present application, and different embodiments can be replaced or combined, so the present application can also be considered to include all possible combinations of the same and / or different embodiments described. Thus, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, the present application should also be considered to include an embodiment including one or more of all other possible combinations of A, B, C, and D, even if the embodiment is not explicitly described in the following content.

[0027] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes can be made in the function and arrangement of described elements without departing from the scope of the present application. Various examples can appropriately omit, replace, or add various processes or components. For example, the described methods can be executed in a different order from the described order, and various steps can be added, omitted, or combined. In addition, features described with respect to some examples can be combined into other examples.

[0028] With the development of wireless communication technology, Bluetooth technology is also widely used to realize wireless connection between two devices within a certain distance range, therefore, Bluetooth earphones are widely used in daily life and work because they can be carried easily without being bound by wires. Currently, for wireless earphones, a Hall sensor and a magnet are usually used to detect whether the user needs to perform a back connection operation of the earphone, such as a neck-mounted earphone, according to the pulled-apart or closed state of the earphone, back connection or disconnection operations can be performed respectively; for example, a Bluetooth earphone can be placed in a charging box, the charging box is provided with a Hall sensor, and when the user opens the cover of the charging box, the Bluetooth earphone will trigger the back connection with a terminal that has been connected. However, in the actual operation process of the user, there may be a mis-triggering situation, for example, the user likes to play with the earphone and unintentionally pulls the earphone apart, which will cause the back connection, but does not meet the user's intention.

[0029] Therefore, in actual use, anti-shake processing needs to be added in the Hall sensor processing, that is, whether there is a disconnection triggering operation on the earphone is detected within a preset time period, to avoid some false triggering problems caused by shaking.

[0030] The inventor has found through analysis that the current reconnection scheme needs to initiate a reconnection process after the anti-shake processing period ends, which results in a long time from when the user starts to pull apart to when the reconnection is completed. Shortening the anti-shake time will result in incomplete anti-shake and increase the probability of false triggering.

[0031] Based on this, the embodiment of the present application provides an earphone reconnection method. The state of the earphone is detected. If a reconnection triggering operation on the earphone is detected, the earphone is started to be processed for reconnection. Within a preset time period between when the earphone starts to be processed for reconnection and when the earphone is successfully reconnected, whether there is a disconnection triggering operation on the earphone is detected. If a disconnection triggering operation on the earphone is detected, the earphone is terminated to be processed for reconnection. By detecting whether a disconnection triggering operation occurs within a preset time period during the processing of the reconnection operation on the earphone, if a disconnection triggering operation on the earphone is detected, the processing of the reconnection operation on the earphone is stopped. The reconnection time of the earphone is shortened, and the reconnection caused by user false touch is avoided, thereby improving the accuracy of the earphone reconnection.

[0032] See Figure 1 A system architecture diagram of an earphone reconnection method provided by the embodiment of the present application is provided. The system includes a terminal device and an earphone. The terminal device has a Bluetooth thread. The terminal device can include but is not limited to a smart phone, a smart interactive tablet, a personal computer, a desktop computer, a tablet computer, a palm computer, a laptop computer, an all-in-one computer, a vehicle-mounted multimedia, etc. The earphone can include but is not limited to a neck-hung Bluetooth earphone, a wireless Bluetooth earphone, etc. Further, the earphone is internally structured by a Bluetooth module, a Hall sensor, a master control chip, a battery, a loudspeaker, a resistor, a capacitor, etc.

[0033] The user controls the state of the earphone. When the earphone receives a reconnection triggering operation on the earphone from the user, the earphone starts to search for a terminal device with an opened Bluetooth in the vicinity through Bluetooth. The terminal device that has established a connection is filtered from the searched terminal devices, and a communication connection is established with the filtered terminal device. While the earphone searches for the terminal device in the vicinity through Bluetooth, the terminal device also searches for the earphone in the vicinity through Bluetooth. A wireless communication channel between the earphone and the terminal device is established through Bluetooth. The connection between the earphone and the terminal device can be a Bluetooth connection or other wireless connection, which is not specifically limited here.

[0034] The back connection refers to that the first electronic device is trying to back connect with the second electronic device which has been paired and connected before through the paging mode. In the embodiments of the present application, the first electronic device is the earphone, and the second electronic device is the terminal device.

[0035] That is, the back connection refers to that the first electronic device sends a page packet to the second electronic device to request to establish a communication connection with the second electronic device, the page is usually referred to as connection (paging), and the operation of connecting / activating the second electronic device is referred to as page. The page refers to that the first electronic device (the master device) initiating the connection has the address of the second electronic device to be connected, and then the connection can be directly performed. For example, when the first electronic device receives the back connection instruction, it can be determined that the first electronic device needs to perform the back connection, and then the Bluetooth connection record can be acquired. According to various conditions, the address of the second electronic device to be back connected with the first electronic device can be determined in the Bluetooth connection record, and a communication connection with the second electronic device is established to realize the back connection of the first electronic device with the second electronic device. The second electronic device to be back connected in the Bluetooth connection record of the first electronic device can be determined according to the connection time, the connection times, the total connection time, etc., which are not limited herein. The back connection instruction received by the first electronic device can be through voice control, through touching the control button of the first electronic device, etc. For example, when the first electronic device is controlled by the key to turn on / off the first electronic device, the triggering operation of the key of the first electronic device is detected, that is, the back connection of the first electronic device is triggered. When the first electronic device is controlled by the Hall sensor, etc. to turn on / off the first electronic device, the change of the electromagnetic field in the first electronic device is detected, that is, the back connection of the first electronic device is triggered. When the first electronic device is controlled by voice recognition to turn on / off the first electronic device, the voice instruction to turn on the first electronic device is detected, that is, the back connection of the first electronic device is triggered. The back connection instruction of the first electronic device is not limited herein.

[0036] The Hall switch is used to control the switch of the earphone in the earphone, and the switch of the earphone can be controlled by changing the magnetic flux of the Hall switch. When the Hall switch is pulled apart, the magnetic flux of the Hall switch decreases, the earphone is turned on, the connection with the terminal device can be performed, and the interaction with the terminal device can be realized after the connection. When the Hall switch is closed, the magnetic flux of the Hall switch increases, the earphone is turned off, and the communication between the earphone and the terminal device is blocked. Therefore, the Hall switch is used to control the switch of the earphone, which breaks through the traditional key switch mode, provides better service for the user, and improves the sound quality of the earphone.

[0037] On the basis of the system architecture shown in Figure 1 , the earphone back connection method provided by the embodiments of the present application will be described in detail in combination with Figures 2-6 .

[0038] Referring to Figure 2 A flowchart of an earphone reconnection method is provided for an embodiment of the present application. As shown in FIG. 2, the earphone reconnection method can include the following steps:

[0039] S101, if a reconnection trigger operation on the earphone is detected, start reconnection operation processing on the earphone.

[0040] In one embodiment, the state of the earphone is detected, and when a reconnection trigger operation on the earphone is detected, the master control chip immediately starts reconnection operation processing on the earphone upon receiving the reconnection trigger operation on the earphone.

[0041] The method of determining whether the earphone is in a reconnection trigger state can include, but is not limited to, detecting whether the earphone is in an open state through a Hall sensor in the earphone, detecting whether the earphone is in a high-power consumption state, and the like.

[0042] The reconnection operation processing can include, but is not limited to, searching for the pairing time of each paired device in the paired list, establishing a connection according to the pairing time, and the like. For example, when a user's reconnection trigger operation is detected, nearby devices are immediately searched for, paired devices are searched for in the list of nearby devices searched for, and a connection is established with the terminal device having the most recent connection time among the paired devices.

[0043] As Figure 3 shown, for a wireless Bluetooth earphone changing from a closed state to an open state, when it is detected that the user opens the cover of the wireless Bluetooth earphone, a reconnection operation on the wireless Bluetooth earphone is triggered, and at this time the wireless Bluetooth earphone is in a reconnection trigger state.

[0044] As Figure 4 shown, for an adsorbed neck-hanging Bluetooth earphone changing from a closed state to a pulled-apart state, when it is detected that the user pulls apart the earphone head of the adsorbed neck-hanging Bluetooth earphone, a reconnection operation on the adsorbed neck-hanging Bluetooth earphone is triggered, and at this time the adsorbed neck-hanging Bluetooth earphone is in a reconnection trigger state.

[0045] S102, within a preset time period between the start of the reconnection operation processing of the earphone and the success of the reconnection of the earphone, detect whether there is a disconnection trigger operation on the earphone.

[0046] In one embodiment, upon detecting a reconnection trigger operation on the earphone, the earphone is immediately subjected to reconnection operation processing, a preset time period is set between the start of the reconnection operation processing and the success of the reconnection of the earphone, and the state of the earphone is detected within the preset time period to determine whether there is a disconnection trigger operation.

[0047] The preset time period can be set at any time between the start of the earphone reconnection operation processing and the success of the reconnection, and the duration of the preset time period can be any duration between the start of the earphone reconnection operation and the success of the earphone reconnection, for example, the preset time period can be the shortest time interval between the user's reconnection trigger operation and the disconnection trigger operation on the earphone, and the specific time is not limited in the present application; and the start time of the preset time period is any time point between the start of the earphone reconnection operation processing and the success of the earphone reconnection. It can be understood that, in order to save the reconnection time and improve the reconnection accuracy, the start point of the preset time period can be preferably set as the time point of the start of the reconnection operation processing, that is, the time point of detecting the reconnection trigger operation.

[0048] Optionally, when the master control chip receives the reconnection trigger operation on the earphone, the Bluetooth thread controls the creation of a timer and immediately starts timing.

[0049] It can be understood that if the timer is created, the start point of the preset time period is the time point of the start of the timer timing, and when the timer timing ends, it means that the preset time period ends. According to experience statistics, the experience duration of the preset time period is about 20-30 milliseconds, and within this time, the detection of whether the disconnection trigger operation occurs on the earphone can be completed. For example, the timing duration of the timer can include but is not limited to 20 milliseconds, 25 milliseconds, 30 milliseconds, etc.

[0050] S103, within the preset time period between the start of the earphone reconnection operation processing and the success of the earphone reconnection, if it is detected that there is a disconnection trigger operation on the earphone, the reconnection operation processing is terminated.

[0051] In one embodiment, a preset time period is set between the start of the earphone reconnection operation processing and the success of the reconnection, and whether the disconnection trigger operation occurs is detected within the preset time period, and if there is a disconnection trigger operation on the earphone, the reconnection trigger operation on the earphone is terminated.

[0052] It can be understood that the Bluetooth earphone can send a reconnection request to the terminal device based on the Bluetooth protocol to reconnect with the terminal device, and if it is detected that the Bluetooth protocol is connected, it is determined that the reconnection is successful. The above connection can be implemented based on the classic Bluetooth protocol (for example, the Bluetooth 4.0 protocol and the like formulated by the Bluetooth Special Interest Group (SIG)), or can be implemented based on the Bluetooth Low Energy (BLE) protocol (for example, the Bluetooth 5.0 protocol and the like), or can be implemented based on the LE Audio related Bluetooth protocol. Herein, no limitation is made, and it can be changed with the development of the Bluetooth protocol; or an asynchronous connection oriented link (ACL) connection is established between the terminal device and the earphone, and it is determined that the reconnection is successful. The method for determining the success of the reconnection is not limited by the present application.

[0053] The method for determining that the earphone receives the disconnection trigger operation can correspond to the method for determining the reconnection trigger operation, such as but not limited to detecting whether the earphone head is in a fitting state by a Hall sensor, detecting whether the earphone box is in a closed state, and the like.

[0054] The disconnection trigger operation can include but is not limited to shaking of the user when triggering the reconnection. Shaking refers to a situation in which at least one disconnection trigger operation and at least one reconnection trigger operation occur within a preset time period. For example, the reconnection trigger operation of the earphone is triggered by a button on the earphone, and the preset time period is 1 second. When the reconnection trigger operation of the earphone is detected, and within 1 second, the earphone receives two trigger operations of the user, then in the detected trigger operations, in addition to the first operation being the reconnection trigger operation of the earphone, the remaining operations are all shaking operations occurring within the preset time period. For example, the reconnection trigger operation of the earphone is triggered by pulling apart the neck-hanging earphone, and the disconnection trigger operation of the earphone is triggered by closing the neck-hanging earphone. The user pulls apart the earphone and closes the earphone within 1 second, which is determined as a false trigger, i.e., a shaking operation, and the reconnection operation needs to be terminated at this time. Detecting whether the reconnection trigger operation shakes is to avoid multiple reconnection trigger operations of the earphone within a short period of time, and to perform subsequent corresponding actions after receiving each reconnection trigger operation, thereby increasing the power consumption of the earphone.

[0055] In the embodiment of the present application, the state of the earphone is detected, if the reconnection triggering operation on the earphone is detected, the reconnection operation processing on the earphone is started, and in the preset time period between the start of the reconnection operation processing on the earphone and the successful reconnection of the earphone, it is detected whether there is a disconnection triggering operation on the earphone, if it is detected that there is a disconnection triggering operation on the earphone, the reconnection operation processing on the earphone is terminated. By detecting whether the disconnection triggering operation occurs in the preset time period during the reconnection operation processing on the earphone, if the disconnection triggering operation on the earphone is detected, the reconnection operation processing on the earphone is stopped, the reconnection time of the earphone is shortened, the reconnection caused by user's misoperation is avoided, and the accuracy of the earphone reconnection is improved.

[0056] Please refer to Figure 5 A flowchart of an earphone reconnection method is provided for the embodiment of the present application. As shown in FIG. 5, the earphone reconnection method can include the following steps:

[0057] S201, if the reconnection triggering operation on the earphone is detected, a Bluetooth thread is controlled to create a state flag bit, the state flag bit is used to indicate the reconnection processing state of the earphone.

[0058] Among them, the terminal device for reconnection with the earphone can include but is not limited to the terminal device which has connected with the earphone before the reconnection and has the most recent time; the connection priority can also be set for the terminal device which has connected, and the terminal device with higher priority is preferred to perform the reconnection operation.

[0059] In one embodiment, the state of the earphone is detected, if the user performs the reconnection triggering operation on the earphone, the master control chip receives the reconnection triggering operation on the earphone, and controls the Bluetooth thread to create a state flag bit for indicating the reconnection processing state of the earphone, so as to control the reconnection state of the earphone by changing the state of the state flag bit. The state flag bit can be represented as CONNECT_STATUS for example. The representation of the state flag bit in the embodiment of the present application is not a limitation on the representation method of the state flag bit, and other representation methods can also be used. The method for judging whether the reconnection triggering operation on the earphone is generated can include but is not limited to detecting whether the earphone is opened by a Hall sensor, detecting whether the earphone is in a high power consumption state, etc.

[0060] As shown in Figure 3 The earphone box of the wireless Bluetooth earphone changes from the closed state to the open state, when it is detected that the user opens the earphone box of the wireless Bluetooth earphone, the reconnection operation on the wireless Bluetooth earphone is triggered, at this time the wireless Bluetooth earphone is in the reconnection triggering state.

[0061] As shown in Figure 4As shown, the adsorbed neck Bluetooth earphone changes from a closed state to a pulled-apart state. When it is detected that the user pulls apart the earphone head of the adsorbed neck Bluetooth earphone, the reconnection operation of the adsorbed neck Bluetooth earphone is triggered, and the adsorbed neck Bluetooth earphone is in a reconnection triggering state.

[0062] It can be understood that, as shown in Figure 4 The initial state of the adsorbed neck Bluetooth earphone is an unconnected state, and the earphone head is closed. When it is detected that the user pulls apart the earphone head of the adsorbed neck Bluetooth earphone, the reconnection triggering operation of the adsorbed neck Bluetooth earphone is generated, and the main control chip of the adsorbed neck Bluetooth earphone receives the reconnection triggering operation of the earphone, sends the message to the Bluetooth thread, and creates a state flag bit after the Bluetooth thread receives the message.

[0063] Optionally, the Bluetooth thread can also create an initialization flag bit after receiving the reconnection triggering message. The initialization flag bit is used to indicate the state of the Hall sensor in the earphone. The state of the Hall sensor includes the open state and the closed state of the switch. Taking a TWS (True Wireless Bluetooth) earphone as an example, the TWS earphone is configured with a rechargeable charging box, a magnet or other elements that can generate a magnetic field is arranged on the edge of the cover of the earphone box, and a Hall switch is arranged on the edge of the body of the earphone box. The position of the Hall switch is opposite to the position of the magnet on the cover in the closed state of the earphone box. When the earphone box is in the closed state, the magnet is close to the Hall switch, and the Hall switch can output a low voltage (low level) or a closed signal. When the earphone box is in the open state, the magnet is away from the Hall switch, and the Hall switch outputs a high voltage (high level) or an open signal. When the main control chip inside the earphone detects the changed voltage value and determines that the charging box is opened, the earphone circuit is started, and the Bluetooth connection with the electronic device is established. The Hall switch outputs a high voltage (high level) or an open signal when the charging box is working normally, and the earphone box state information is determined to be in the open state, a reconnection command is generated, and the reconnection command can control the Bluetooth earphone to reconnect the terminal device originally connected through Bluetooth.

[0064] At the beginning of creating the initialization flag, the initialization flag is set to a first value. The first value of the initialization flag is used to indicate that the Hall sensor in the earphone is in an open state, at which time the Hall sensor switch outputs a high potential voltage (high level) or an open signal, and then it is determined that the earphone box state information is an open box state, and the Bluetooth thread can be prompted to enter a reconnection state and send a reconnection request / instruction to the terminal device. At this time, the initialization flag can be represented as OPEN_INIT_STATUS. The representation of the initialization flag in the embodiments of the present application is not a limitation on the representation method of the initialization flag, and other representation methods can also be used. When the initialization flag is created, it is assigned a value of open, represented as OPEN_INIT_STATUS=open, or the first value of the initialization flag is set to another value indicating that the Hall sensor is in an open state, for example, the first value of the initialization flag can be set to 1, represented as OPEN_INIT_STATUS=1.

[0065] S202, during a preset time period between the beginning of the reconnection operation processing of the earphone and the success of the reconnection of the earphone, detecting whether there is a disconnection triggering operation on the earphone.

[0066] In one embodiment, when the reconnection triggering operation on the earphone is detected, the reconnection operation processing of the earphone is immediately started, and a time period is preset between the beginning of the reconnection operation processing and the success of the reconnection of the earphone. During the preset time period, the state of the earphone is detected to determine whether there is a disconnection triggering operation.

[0067] It can be understood that during the preset time period, the value of the state flag is changed by detecting whether the disconnection triggering operation occurs, and whether the reconnection operation processing of the earphone is continued is controlled according to the value of the state flag.

[0068] S203, during the preset time period, if it is detected that there is a disconnection triggering operation on the earphone, the state flag is set to a first state to interrupt the reconnection operation processing and control the Bluetooth thread to return to a state before the reconnection, and the first state is that the earphone is in a reconnection termination state.

[0069] In one embodiment, when the reconnection triggering operation on the earphone is detected, the reconnection operation processing of the earphone is immediately started, and during the preset time period, if it is detected that there is a disconnection triggering operation on the earphone, the state flag is set to a first state in which the earphone is in a reconnection termination state to interrupt the reconnection operation processing of the earphone and control the Bluetooth thread to return to a state before the reconnection, thereby reducing the power consumption of the earphone, and at this time, the earphone is in a standby state and waits for a reconnection triggering operation again.

[0070] Before the disconnection triggering operation is detected, the earphone has already been processed with the reconnection operation, thus when the disconnection triggering operation is detected, the reconnection operation of the earphone needs to be interrupted to reduce the power consumption of the earphone.

[0071] It can be understood that the state flag bit is not assigned a value when it is created. Setting the state flag bit to the first state of the earphone in the reconnection termination state can mean that the value of the state flag bit is set to a preset value. For example, in step S201, the state flag bit is denoted as CONNECT_STATUS, and setting the state flag bit to the first state can mean that the state flag bit is assigned a value of 0, denoted as CONNECT_STATUS = 0, or denoted as CONNECT_STATUS = undo, and the like.

[0072] The disconnection triggering operation of the wireless Bluetooth earphone is the reverse process as shown in Figure 3 When it is detected that the user closes the earphone box of the wireless Bluetooth earphone, the reconnection termination operation of the wireless Bluetooth earphone is triggered, and at this time, the wireless Bluetooth earphone is in the reconnection termination state.

[0073] The disconnection triggering operation of the adsorptive neck-hung Bluetooth earphone is the reverse process as shown in Figure 4 When it is detected that the user closes the earphone box of the wireless Bluetooth earphone, the reconnection termination operation of the wireless Bluetooth earphone is triggered, and at this time, the wireless Bluetooth earphone is in the reconnection termination state.

[0074] It can be understood that between the start of the reconnection operation of the earphone and the success of the reconnection of the earphone, if it is detected that there is a disconnection triggering operation of the earphone before the end of the preset time period, the Bluetooth thread is controlled to return to the state before the reconnection to reduce the power consumption of the earphone.

[0075] S204, within the preset time period, if it is detected that there is no disconnection triggering operation of the earphone, the state flag bit is set to a second state, and the reconnection operation of the earphone is continued, and the second state is that the earphone is in the reconnection state.

[0076] In one embodiment, the state of the earphone is detected continuously from the start of the reconnection operation process of the earphone. If no disconnection triggering operation of the earphone is detected within a preset time period, it is determined that the current reconnection triggering operation of the earphone is a triggering operation generated by the real intention of the user, and the state flag bit is set to the second state that the earphone is in a reconnection state. The reconnection operation of the earphone is continued until the earphone is successfully reconnected. The second state of the state flag bit can be represented as CONNECT_STATUS = 1, or the second state of the state flag bit can be represented as any value of the state flag bit in a high level, for example, doing, represented as CONNECT_STATUS = doing.

[0077] At this time, because no disconnection triggering operation of the earphone is detected within the preset time period, it is indicated that the reconnection triggering operation is the real intention of the user, and the reconnection of the earphone and the terminal device needs to be performed. The second state indicates that the earphone is in a reconnection state, and the reconnection operation can be continued until the reconnection is successful. The terminal device for reconnection with the earphone can include but is not limited to a terminal device that has been connected with the earphone before the reconnection and has the most recent time. The reconnection state of the earphone can include but is not limited to searching for a paired device in the searched nearby device category, screening a device to establish a connection with the device, and the like.

[0078] S205, after the end of the preset time period and before the earphone is successfully reconnected, if it is detected that there is a disconnection triggering operation of the earphone, the state flag bit is set to the first state bit, and the Bluetooth thread is controlled to return to the state before the reconnection. The first state bit is the reconnection termination state of the earphone.

[0079] In one embodiment, the state of the earphone is detected continuously from the start of the reconnection operation process of the earphone. If no disconnection triggering operation of the earphone is detected within a preset time period, it is determined that the current reconnection triggering operation of the earphone is a triggering operation generated by the real intention of the user, and the state flag bit is set to the second state that the earphone is in a reconnection state. The reconnection operation of the earphone is continued until the earphone is successfully reconnected. The second state of the state flag bit can be represented as CONNECT_STATUS = 1, or the second state of the state flag bit can be represented as any value of the state flag bit in a high level, for example, doing, represented as CONNECT_STATUS = doing.

[0080] The first state of the state flag can be a level indicating a pulled-down state flag, or a value clearing the state flag, or a value modifying the state flag, and the like. For example, the pulled-down state flag can be a value of 0, denoted as CONNECT_STATUS = 0, or a value clearing the state flag, denoted as Clear CONNECT_STATUS, or a value modifying the state flag, such as CONNECT_STATUS = undo.

[0081] It can be understood that the value of the flag generated due to the disconnection triggering operation after the preset time period ends and before the earphone reconnection succeeds can be different from the value of the flag generated due to the disconnection triggering operation within the preset time period, although both values represent the reconnection termination state. For example, the former can be CONNECT_STATUS = 2, and the latter can be CONNECT_STATUS = 0. Of course, for the convenience of checking the state bit, the values can be the same when the states represented by the values are the same, and the embodiments of the present application do not limit this.

[0082] Optionally, in another embodiment of the present application, after the preset time period ends between the start of the earphone reconnection operation processing and the success of the earphone reconnection, if there is a disconnection triggering operation on the earphone, the value of the initialization flag is set to a second value, and the second value of the initialization flag indicates that the Hall sensor switch can output a low voltage (low level) or a closed signal. It can be understood that the initialization flag can be assigned a value of close, denoted as OPEN_INIT_STATUS = close, or a value of 0, denoted as OPEN_INIT_STATUS = 0.

[0083] It can be understood that the value of the initialization flag indicates the state of the Hall sensor, and the threshold information of the initialization flag can reflect the change of the state of the Hall sensor. For example, the state of the Hall sensor includes the open state and the closed state of the switch, and the Hall switch outputs a high voltage (high level) or an open signal, indicating that the earphone case state information is in the open state, and the earphone generates a reconnection command to control the Bluetooth earphone to reconnect to the terminal device originally connected through Bluetooth, thereby realizing the judgment of starting and terminating the earphone reconnection. After the preset time period ends between the start of the earphone reconnection operation processing and the success of the earphone reconnection, when a disconnection triggering operation on the earphone is detected, the value of the initialization flag is set to a second value, at which time it can be determined that the Hall switch outputs a low voltage (low level) or a closed signal, and the reconnection processing operation can be terminated.

[0084] If the disconnection triggering operation for the earphone is detected before the earphone is in the reconnection state, the state flag bit is adjusted from the state bit indicating that the earphone is in the reconnection state to the state bit indicating that the earphone is in the reconnection state, so as to terminate the reconnection operation of the earphone and make the earphone return to the unconnected state, thereby reducing the power consumption of the earphone.

[0085] Before the disconnection triggering operation for the earphone is detected, the earphone is in the reconnection state, which is equivalent to high power consumption. Therefore, when the disconnection triggering operation for the earphone is detected, the reconnection state of the earphone needs to be terminated by adjusting the state of the flag bit, so as to reduce the power consumption of the earphone.

[0086] It can be understood that in another embodiment of the present application, if no disconnection triggering operation for the earphone is detected before the earphone is in the reconnection state and the earphone is successfully reconnected, the reconnection operation of the earphone is continued until the earphone is successfully reconnected.

[0087] Optionally, in another embodiment of the present application, if the disconnection triggering operation for the earphone is detected after the preset time period ends and before the earphone is successfully reconnected, the reconnection operation is continued until the earphone is successfully reconnected; and after the earphone is successfully reconnected, the disconnection operation is performed on the earphone.

[0088] It can be understood that when the reconnection triggering operation for the earphone is detected and no disconnection triggering operation for the earphone is detected within the preset time period, it is indicated that the current reconnection triggering operation for the earphone is the real intention of the user. After the preset time period ends, the reconnection operation of the earphone is continued regardless of whether the disconnection triggering operation for the earphone exists or not, until the earphone is successfully reconnected. If the disconnection triggering operation for the earphone exists after the preset time period ends and before the earphone is successfully reconnected, the earphone needs to be disconnected after the earphone is successfully reconnected, so as to return to the standby state before the reconnection, thereby reducing the power consumption of the earphone and waiting for the reconnection triggering operation again. In this process, after the preset time period ends and before the earphone is successfully reconnected, even if the disconnection triggering operation is received, in order to respond to the reconnection triggering operation, the reconnection needs to be continued until the reconnection is successful. After the reconnection is successful, the disconnection is performed in order to respond to the disconnection triggering operation, so as to match the triggering operation of the user.

[0089] S206, after the earphone is in the reconnection operation and is successfully reconnected, if the disconnection triggering operation for the earphone is detected, the disconnection operation is performed on the earphone.

[0090] In one embodiment, no disconnect trigger operation is detected during the reconnection operation process of the earphone, i.e. the earphone is successfully connected with the terminal device, and the state of the earphone is continuously detected after the successful connection. If the disconnect trigger operation is detected, the connection between the earphone and the terminal device is disconnected, so that the earphone returns to the unconnected state, the power consumption of the earphone is reduced, and the reconnection trigger operation is waited again.

[0091] The user can be prompted when the earphone is successfully connected. For example, the user can be prompted by a prompt sound such as "ding-dong", or the user can be prompted by the flashing of a prompt light, and the like, and the prompt manner is not limited here.

[0092] It can be understood that in the case of creating a timer, as shown in Figure 6 When the reconnection trigger operation of the earphone is detected, the timer is created and immediately starts timing, and whether the disconnect trigger operation of the earphone occurs during the reconnection operation process of the earphone is detected within the timing duration of the timer. If the disconnect trigger operation of the earphone is detected within the timing duration of the timer, i.e. the state of the earphone changes, the state flag bit is set to the first state that the earphone is in the reconnection termination state, so as to interrupt the reconnection operation process of the earphone. If the disconnect trigger operation of the earphone is not detected within the timing duration of the timer, i.e. the state of the earphone does not change, the state flag bit is set to the second state that the earphone is in the reconnection state, so as to continue the reconnection operation process of the earphone. When the earphone enters the reconnection state, the state of the earphone is continuously detected before the successful reconnection. If the disconnect trigger operation of the earphone is detected before the successful reconnection, i.e. the state of the earphone changes, the reconnection operation process of the earphone is terminated by setting the state flag bit to the first state that the earphone is in the reconnection state. Or, when the earphone enters the connection state, the state of the earphone is detected before the reconnection. If the disconnect trigger operation of the earphone is detected, the earphone is still reconnected, and after the earphone is successfully connected, the connection between the terminal device and the earphone is disconnected. If the disconnect trigger operation of the earphone is not detected before the successful reconnection, i.e. the state of the earphone does not change, the reconnection operation process of the earphone is continuously performed until the successful reconnection. After the successful reconnection, the state of the earphone is continuously detected. When the disconnect trigger operation of the earphone is detected, i.e. the state of the earphone changes, the earphone is disconnected, so that the earphone returns to the unconnected state, enters the low power consumption, and waits for the reconnection trigger operation again.

[0093] In the embodiment of the present application, the state of the earphone is detected during the process of the earphone reconnection operation, if the earphone disconnection trigger operation is detected within the preset time period, the initialization process of the earphone is terminated, if the earphone disconnection trigger operation is not detected within the preset time period, the earphone reconnection operation is continued after the initialization until the reconnection is successful, if the earphone disconnection trigger operation is detected after the preset time period ends and before the reconnection is successful, the earphone reconnection operation is terminated, if the earphone disconnection trigger operation is detected after the reconnection is successful, the earphone reconnection operation is terminated, the state of the earphone is detected in real time during the earphone reconnection, when the earphone disconnection trigger operation is detected, the reconnection of the earphone is immediately terminated by controlling the state of the flag, the earphone reconnection time is shortened, the reconnection caused by user's mistake is avoided, and the accuracy of the earphone reconnection is improved.

[0094] The earphone reconnection device provided by the embodiment of the present application will be described in detail below. Figure 7 It should be noted that. Figure 7 The earphone reconnection device in the embodiment of the present application is used to execute the method of the embodiment of the present application. Figures 2-6 For the convenience of description, only the relevant part of the embodiment of the present application is shown, and the specific technical details are disclosed in the method embodiment of the present application. Figures 2-6 For the convenience of description, only the relevant part of the embodiment of the present application is shown, and the specific technical details are disclosed in the method embodiment of the present application.

[0095] Please refer to Figure 7 The structure diagram of the earphone reconnection device provided by the present application is shown. As shown in the figure, Figure 7 The earphone reconnection device 1 of the embodiment of the present application includes a reconnection module 11, a first detection module 12, and a disconnection module 13.

[0096] The reconnection module 11 is used to start the reconnection operation of the earphone if the earphone reconnection trigger operation is detected.

[0097] The first detection module 12 is used to detect whether the earphone disconnection trigger operation exists within the preset time period between the start of the earphone reconnection operation and the success of the earphone reconnection.

[0098] The disconnection module 13 is used to terminate the reconnection operation if the earphone disconnection trigger operation is detected within the preset time period between the start of the earphone reconnection operation and the success of the earphone reconnection.

[0099] Optionally, the reconnection module 11 is specifically used to:

[0100] If the earphone reconnection trigger operation is detected, the state flag of the Bluetooth thread creation is controlled, and the state flag is used to indicate the reconnection processing state of the earphone.

[0101] Optionally, as shown in Figure 7 the earphone reconnection device 1 further comprises:

[0102] a timer creating module 14, configured to create a timer and start timing if the reconnection trigger operation on the earphone is detected;

[0103] a judging module 15, configured to determine that the preset time period ends if the timer timing ends.

[0104] Optionally, the disconnection module 13 is specifically configured to:

[0105] if the disconnection trigger operation on the earphone is detected within the preset time period, set the state flag bit to a first state to control the Bluetooth thread to return to the state before the reconnection, the first state being that the earphone is in a reconnection termination state.

[0106] Optionally, the disconnection module 13 is specifically configured to:

[0107] if the disconnection trigger operation on the earphone is not detected within the preset time period, set the state flag bit to a second state to continue the reconnection operation processing on the earphone, the second state being that the earphone is in a reconnection state.

[0108] Optionally, the disconnection module 13 is specifically configured to:

[0109] if the disconnection trigger operation on the earphone is detected after the preset time period ends and before the earphone reconnection succeeds, control the Bluetooth thread to return to the state before the reconnection.

[0110] the control of the Bluetooth thread to return to the state before the reconnection is specifically configured to:

[0111] set the state flag bit to the first state to control the Bluetooth thread to return to the state before the reconnection, the first state being that the earphone is in the reconnection termination state.

[0112] Optionally, as shown in Figure 7 the earphone has a Hall sensor, and the earphone reconnection device 1 further comprises:

[0113] a first setting module 16, configured to control a Bluetooth thread to create an initialization flag bit and set the initialization flag bit to a first value if the reconnection trigger operation on the earphone is detected, the initialization flag bit being used to indicate the state of the Hall sensor;

[0114] The second setting module 17 is configured to, after the preset time period ends and before the earphone reconnection succeeds, set the initialization flag bit to a second value if a disconnect trigger operation on the earphone is detected.

[0115] Optionally, as shown in Figure 7 The earphone reconnection device 1 further includes:

[0116] The second detection module 18 is configured to, after the preset time period ends and before the earphone reconnection succeeds, continue to perform the reconnection operation processing if a disconnect trigger operation on the earphone is detected, until the earphone reconnection succeeds.

[0117] The Bluetooth control module 19 is configured to, after the earphone reconnection succeeds, perform a disconnect operation processing on the earphone.

[0118] Optionally, the disconnect module 13 is specifically configured to:

[0119] In a preset time period between the start of the reconnection operation processing on the earphone and the earphone reconnection succeeds, if a disconnect trigger operation on the earphone is detected, the disconnect module 13 sends reconnection termination information to the Bluetooth thread, so that the Bluetooth thread returns to a state before the reconnection.

[0120] Optionally, the disconnect module 13 is specifically configured to:

[0121] After the reconnection operation processing on the earphone and the earphone reconnection succeeds, if a disconnect trigger operation on the earphone is detected, the disconnect module 13 performs a disconnect operation processing on the earphone.

[0122] In the embodiments of the present application, the state of the earphone is detected during the reconnection operation processing on the earphone. If a disconnect trigger operation on the earphone is detected within a preset time period, the initialization processing on the earphone is terminated. If a disconnect trigger operation on the earphone is not detected within the preset time period, the reconnection operation processing on the earphone after the initialization is continued until the reconnection succeeds. If a disconnect trigger operation on the earphone is detected after the preset time period ends and before the reconnection succeeds, the reconnection operation processing on the earphone is terminated. If a disconnect trigger operation on the earphone is detected after the reconnection succeeds, the reconnection operation processing on the earphone is terminated. During the earphone reconnection, the state of the earphone is detected in real time. When a disconnect trigger operation on the earphone is detected, the reconnection of the earphone is immediately terminated by controlling the state of the flag bit. The earphone reconnection time is shortened. The reconnection caused by user's mistake is avoided. The accuracy of the earphone reconnection is improved.

[0123] The embodiments of the present application further provide a computer storage medium, which can store a plurality of instructions. The instructions are suitable for being loaded and executed by a processor to implement the above-mentioned earphone reconnection device. Figures 2-6The earphone back connection method of the embodiment shown, the specific implementation process can be seen from Figures 2-6 The specific description of the embodiment shown, will not be repeated here.

[0124] Please see Figure 8 A structural schematic diagram of an electronic device is provided for the embodiment of the present application. As shown in Figure 8 The terminal device 1000 can include at least one processor 1001, at least one network interface 1002, at least one input / output interface 1003, at least one display unit 1004, at least one memory 1005, and at least one communication bus 1006. The processor 1001 can include one or more processing cores. The processor 1001 connects various parts of the entire electronic device 1000 through various interfaces and lines, and performs various functions and processes data of the terminal 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. The memory 1005 can be a high-speed RAM memory, or a non-volatile memory such as at least one disk memory. The memory 1005 can also be at least one storage device located away from the aforementioned processor 1001. The network interface 1002 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface, a Bluetooth interface). The communication bus 1006 is used to realize the connection communication between the components. The display unit 1004 can be a touch panel. As shown in Figure 8 The memory 1005 as a storage medium can include an operating system, a network communication module, an input / output interface module, and an earphone back connection program.

[0125] In Figure 8 In the electronic device 1000 shown, the input / output interface 1003 is mainly used to provide an interface for the user and the access device, and to obtain data input by the user and the access device.

[0126] In one embodiment, the processor 1001 can be used to call the earphone back connection program stored in the memory 1005, and specifically perform the following operations:

[0127] If the back connection trigger operation on the earphone is detected, the earphone back connection operation processing is started;

[0128] During the preset time period between the start of the earphone back connection operation processing and the success of the earphone back connection, it is detected whether there is a disconnection trigger operation on the earphone;

[0129] If a disconnection trigger operation is detected during the preset time period between the start of the headphone reconnection operation and the successful reconnection of the headphone, the reconnection operation process is terminated.

[0130] In one embodiment, when the processor 1001 executes the "If a reconnection trigger operation is detected, start reconnection operation processing for the headphones" command, it specifically performs the following operations:

[0131] If a reconnection trigger operation to the headphones is detected, the Bluetooth thread is controlled to create a status flag bit, which is used to indicate the reconnection processing status of the headphones.

[0132] In one embodiment, the processor 1001 can be used to call the headphone reconnection program stored in the memory 1005, and specifically perform the following operations:

[0133] If a reconnection trigger operation to the headphones is detected, a timer is created and the timer starts counting down.

[0134] If the timer finishes counting down, then the preset time period is determined to have ended.

[0135] In one embodiment, if the processor 1001 detects a disconnection trigger operation on the headphones during a preset time period between the start of the headphones reconnection operation and the successful reconnection of the headphones, and terminates the reconnection operation, it specifically performs the following operations:

[0136] If a disconnection trigger operation is detected during the preset time period, the status flag is set to the first state to interrupt the reconnection operation and control the Bluetooth thread to return to the state before reconnection. The first state is when the earphone is in the reconnection terminated state.

[0137] In one embodiment, if the processor 1001 detects a disconnection trigger operation on the headphones during a preset time period between the start of the headphones reconnection operation and the successful reconnection of the headphones, and terminates the reconnection operation, it specifically performs the following operations:

[0138] If no disconnection trigger operation is detected for the earphone within the preset time period, the status flag is set to the second state, and the earphone continues to be reconnected. The second state indicates that the earphone is in the reconnection state.

[0139] In one embodiment, if the processor 1001 detects a disconnection trigger operation on the headphones during a preset time period between the start of the headphones reconnection operation and the successful reconnection of the headphones, and terminates the reconnection operation, it specifically performs the following operations:

[0140] If it is detected that there is a disconnection triggering operation on the earphone after the preset time period ends and before the earphone successfully reconnects, the Bluetooth thread is controlled to return to a state before reconnection.

[0141] In one embodiment, the processor 1001, when performing the controlling of the Bluetooth thread to return to the state before reconnection, specifically performs:

[0142] setting the state flag to a first state, controlling the Bluetooth thread to return to the state before reconnection, and the first state being that the earphone is in a reconnection termination state.

[0143] In one embodiment, the earphone has a Hall sensor, and the processor 1001 can be configured to invoke an earphone reconnection program stored in the memory 1005 and specifically perform the following operations:

[0144] If a reconnection triggering operation on the earphone is detected, the Bluetooth thread is controlled to create an initialization flag, and the initialization flag is set to a first value, the initialization flag being used to indicate the state of the Hall sensor.

[0145] If it is detected that there is a disconnection triggering operation on the earphone after the preset time period ends and before the earphone successfully reconnects, the initialization flag is set to a second value.

[0146] In one embodiment, the processor 1001 can be configured to invoke an earphone reconnection program stored in the memory 1005 and specifically perform the following operations:

[0147] If there is a disconnection triggering operation on the earphone after the preset time period ends and before the earphone successfully reconnects, the reconnection operation processing is continued until the earphone successfully reconnects.

[0148] After the earphone successfully reconnects, the earphone is subjected to disconnection operation processing.

[0149] In one embodiment, the processor 1001, when performing the terminating of the reconnection operation processing if it is detected that there is a disconnection triggering operation on the earphone during a preset time period between the start of the earphone reconnection operation processing and the earphone successfully reconnecting, specifically performs the following operations:

[0150] If it is detected that there is a disconnection triggering operation on the earphone during a preset time period between the start of the earphone reconnection operation processing and the earphone successfully reconnecting, reconnection termination information is sent to the Bluetooth thread to make the Bluetooth thread return to a state before reconnection.

[0151] In one embodiment, the processor 1001 can be configured to invoke the earphone back connection program stored in the memory 1005, and specifically perform the following operations:

[0152] After the earphone performs the back connection operation processing and the back connection succeeds, if there is a disconnection triggering operation on the earphone, the earphone performs the disconnection operation processing.

[0153] In the embodiments of the present application, the state of the earphone is detected during the back connection operation processing of the earphone. If the disconnection triggering operation on the earphone is detected within a preset time period, the initialization processing of the earphone is terminated. If the disconnection triggering operation on the earphone is not detected within the preset time period, the back connection operation processing of the earphone after initialization continues until the back connection succeeds. If the disconnection triggering operation on the earphone is detected after the preset time period ends and before the back connection succeeds, the back connection operation processing of the earphone is terminated. If the disconnection triggering operation on the earphone is detected after the back connection succeeds, the back connection operation processing of the earphone is terminated. During the back connection of the earphone, the state of the earphone is detected in real time. When the disconnection triggering operation on the earphone is detected, the back connection of the earphone is immediately terminated by controlling the state of the flag bit. The back connection time of the earphone is shortened, the back connection caused by user's mistake is avoided, and the accuracy of the back connection of the earphone is improved.

[0154] Those skilled in the art can clearly understand that the technical solutions of the present application can be implemented by means of software and / or hardware. The "unit" and "module" in the specification refer to software and / or hardware that can independently complete or cooperate with other components to complete a specific function, and the hardware can be, for example, a field programmable gate array (FPGA), an integrated circuit (IC), etc.

[0155] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action order described, because according to the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0156] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0157] In several embodiments provided in the present application, it should be understood that the disclosed apparatus can be implemented in other manners. For example, the division of the apparatus embodiments described above is merely illustrative, and the division of the units can be changed according to actual needs. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0158] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.

[0159] In addition, each functional unit in the various embodiments of the present application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0160] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that makes a contribution to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing an electronic device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.

[0161] A person of ordinary skill in the art can understand that all or part of the steps of the various methods in the above embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer readable storage medium, which can include a flash disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, etc.

[0162] The above descriptions are merely some example embodiments of the present disclosure, and cannot limit the scope of the present disclosure. That is, equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. Other embodiments of the present disclosure will be readily apparent to those skilled in the art upon considering the description and practicing the present disclosure. The present application is intended to cover any variations, uses, or adaptive changes of the present disclosure that follow the general principles of the present disclosure and include common knowledge or conventional technical means in the art that are not described in the present disclosure. The scope of the present disclosure is defined by the claims, and the spirit and principles of the present disclosure are not limited by the descriptions and examples.

Claims

1. A method of earpiece return chaining, the method comprising: The method comprises: If a reconnection trigger operation of the earphone is detected, a reconnection operation process of the earphone is started; wherein the reconnection operation process is for a terminal device with a higher priority that has been connected to the earphone; In a preset time period between the start of the reconnection operation process of the earphone and the success of the reconnection of the earphone, whether there is a disconnection trigger operation of the earphone is detected; the detection of whether there is a disconnection trigger operation of the earphone comprises: detecting whether the earphone head is in a fitting state by a Hall sensor, or detecting whether the earphone box is in a closed state; In the preset time period between the start of the reconnection operation process of the earphone and the success of the reconnection of the earphone, if it is detected that there is a disconnection trigger operation of the earphone, the reconnection operation process is terminated; After the end of the preset time period and before the success of the reconnection of the earphone, if there is a disconnection trigger operation of the earphone, the reconnection operation process is continued until the success of the reconnection of the earphone; after the success of the reconnection of the earphone, a disconnection operation process of the earphone is performed.

2. The method of claim 1, wherein, The method comprises: If a reconnection trigger operation of the earphone is detected, a reconnection operation process of the earphone is started; wherein the reconnection operation process is for a terminal device with a higher priority that has been connected to the earphone; 3. The method of claim 1, wherein, If a reconnection trigger operation of the earphone is detected, a Bluetooth thread creation state flag is controlled, and the state flag is used to indicate the reconnection processing state of the earphone. The method further comprises: If a reconnection trigger operation of the earphone is detected, a timer is created and starts timing; 4. The method according to claim 2 or 3, characterized in that, If the timing of the timer ends, it is determined that the preset time period ends. The method further comprises:

5. The method according to any of claims 1 to 3, characterized in that In the preset time period, if it is detected that there is a disconnection trigger operation of the earphone, the state flag is set to a first state to control the Bluetooth thread to return to a state before reconnection, and the first state is that the earphone is in a reconnection termination state. The method further comprises:

6. The method according to claim 2 or 3, characterized in that, In the preset time period, if it is detected that there is no disconnection trigger operation of the earphone, the state flag is set to a second state, and the reconnection operation process of the earphone is continued, and the second state is that the earphone is in a reconnection state. The method further comprises:

7. The method of claim 6, wherein, After the end of the preset time period and before the success of the reconnection of the earphone, if it is detected that there is a disconnection trigger operation of the earphone, the Bluetooth thread is controlled to return to a state before reconnection. The method further comprises:

8. The method of claim 1, wherein, The state flag is set to a first state to control the Bluetooth thread to return to a state before reconnection, and the first state is that the earphone is in a reconnection termination state. The earphone has a Hall sensor, and the method further comprises: If a reconnection trigger operation of the earphone is detected, a Bluetooth thread creation initialization flag is controlled, and the initialization flag is set to a first value, and the initialization flag is used to indicate the state of the Hall sensor; After the preset time period ends and before the earphone reconnection succeeds, if it is detected that there is a disconnection triggering operation on the earphone, the initialization flag bit is set to a second value.

9. The method according to claim 1 or 3, characterized in that, The method comprises the following steps of: After the preset time period ends and before the earphone reconnection succeeds, if it is detected that there is a disconnection triggering operation on the earphone, the initialization flag bit is set to a second value.

10. The method of claim 1, wherein, The method further comprises the following steps of: After the earphone reconnection succeeds, if there is a disconnection triggering operation on the earphone, the earphone is subjected to a disconnection operation process.

11. A headset return link device, characterized by The device comprises: A reconnection module is configured to start a reconnection operation process on the earphone if a reconnection triggering operation on the earphone is detected; wherein the reconnection operation process is performed on a terminal device with a higher priority that has been connected to the earphone; A first detection module is configured to detect whether there is a disconnection triggering operation on the earphone within a preset time period between the start of the reconnection operation process on the earphone and the success of the reconnection of the earphone; the detection whether there is a disconnection triggering operation on the earphone comprises detecting whether the earphone head is in a fitting state by a Hall sensor or detecting whether the earphone box is in a closed state; A disconnection module is configured to terminate the reconnection operation process if it is detected that there is a disconnection triggering operation on the earphone within a preset time period between the start of the reconnection operation process on the earphone and the success of the reconnection of the earphone; after the preset time period ends and before the earphone reconnection succeeds, if there is a disconnection triggering operation on the earphone, the reconnection operation process is continuously performed until the earphone reconnection succeeds; after the earphone reconnection succeeds, the earphone is subjected to a disconnection operation process.

12. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, which are suitable for being loaded and executed by a processor to perform the method steps of any one of claims 1-10.

13. An electronic device, comprising: The device comprises: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded and executed by the processor to perform the method steps of any one of claims 1-10.

Citation Information

Patent Citations

  • Earphone state switching method and device, TWS earphone and computer storage medium

    CN111314816A

  • TWS earphone, automatic reconnection method and device thereof, and computer storage medium

    CN112203179A

  • Bluetooth connection method and electronic equipment

    CN112449332A

  • Bluetooth playing device restarting and reconnecting method, Bluetooth playing device and electronic equipment

    CN113179505A

  • Method for disconnecting earphone, related device, and computer readable storage medium

    WO2020077493A1