TWS earphone pairing method, storage medium, chip and TWS earphone

By receiving and comparing the working state time of TWS headphones and controlling the pairing of TWS headphones with a preset time threshold, the problem of easy string matching or mismatch of TWS headphones in the prior art is solved, and the pairing efficiency and reliability are improved.

CN114401518BActive Publication Date: 2025-04-18SHENZHEN BLUETRUM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210004845.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-04
Publication Date
2025-04-18
Estimated Expiration
2042-01-04

AI Technical Summary

Technical Problem

When there are multiple TWS devices around the existing TWS headsets, they are easily matched in series or mismatched with other headsets, reducing pairing efficiency.

Method used

By receiving the pairing information sent by the second TWS headset, the time it enters the working state is determined, and the pairing between the two is controlled in combination with the first TWS headset's entry state time and the preset time threshold.

Benefits of technology

Effective and reliable automatic control of TWS headset pairing to avoid serial matching or mismatch, and improve pairing efficiency and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114401518B_ABST
    Figure CN114401518B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of TWS earphones, and discloses a TWS earphone pairing method, a storage medium, a chip and a TWS earphone. The TWS earphone pairing method is applied to a first TWS earphone, and the TWS earphone pairing method includes: receiving pairing information sent by a second TWS earphone, determining a second time when the second TWS earphone enters a working state according to the pairing information, obtaining a first time when the first TWS earphone enters a working state, and controlling the pairing between the first TWS earphone and the second TWS earphone according to the first time, the second time and a preset time threshold. This embodiment can effectively and reliably automatically control the pairing between the first TWS earphone and the second TWS earphone, and try to avoid the phenomenon of serial matching or mismatching, and the pairing operation is simple, which is conducive to improving the pairing efficiency of the TWS earphone.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of TWS earphones, and in particular to a TWS earphone pairing method, a storage medium, a chip and a TWS earphone. Background Art

[0002] TWS earphones are true wireless Bluetooth earphones. They do not require any wires to connect. Bluetooth communication is used between the left earphone and the right earphone. TWS earphones support mono working mode and dual-channel stereo mode.

[0003] Before using the existing TWS headset, the left and right earphones need to be paired. The prior art provides a TWS headset pairing method, where one TWS headset broadcasts its pairing information, and the other TWS headset authenticates according to the pairing information. After the authentication is passed, the two TWS headsets can be paired. However, when there are many TWS devices around the TWS headset, the TWS headset is easy to be paired or mismatched with the surrounding headsets in the broadcast state, thereby reducing the pairing efficiency. Summary of the invention

[0004] An object of an embodiment of the present invention is to provide a TWS headset pairing method, a storage medium, a chip and a TWS headset, which are conducive to improving the pairing efficiency of TWS headsets.

[0005] In a first aspect, an embodiment of the present invention provides a TWS headset pairing method, which is applied to a first TWS headset, including:

[0006] Receiving pairing information sent by the second TWS headset, and determining, according to the pairing information, a second time when the second TWS headset enters a working state;

[0007] Obtaining the first time when the first TWS headset enters the working state;

[0008] According to the first time, the second time and a preset duration threshold, pairing between the first TWS headset and the second TWS headset is controlled.

[0009] Optionally, the method also includes: when detecting that the first TWS headset enters a working state, recording the current local time as the first time.

[0010] Optionally, controlling the pairing between the first TWS headset and the second TWS headset according to the first time, the second time and a preset duration threshold includes:

[0011] Calculating an absolute value of a time difference between the first time and the second time;

[0012] Determine whether the absolute value is less than or equal to the preset duration threshold;

[0013] If the absolute value is less than or equal to the preset duration threshold, the first TWS headset is controlled to pair with the second TWS headset.

[0014] Optionally, controlling the pairing between the first TWS headset and the second TWS headset according to the first time, the second time and a preset duration threshold further includes:

[0015] If the absolute value is greater than the preset time threshold, it is determined that within the preset time, the first TWS headset detects the RSSI strength of each of the second TWS headsets and the absolute value corresponding to each of the second TWS headsets;

[0016] Control the pairing between the first TWS headset and the second TWS headset according to the RSSI strength and the absolute value corresponding to each of the second TWS headsets.

[0017] Optionally, controlling the pairing of the first TWS headset with the second TWS headset according to the RSSI strength and the absolute value corresponding to each of the second TWS headsets includes:

[0018] Normalizing the RSSI intensity and absolute value corresponding to each of the second TWS earphones respectively to obtain a first normalized value and a second normalized value respectively;

[0019] Calculate a weighted sum corresponding to each of the second TWS headphones according to the first normalized value and the first weight factor and the second normalized value and the second weight factor;

[0020] According to each of the weighted sums, pairing of the first TWS headset with the second TWS headset is controlled.

[0021] Optionally, controlling pairing of the first TWS headset with the second TWS headset according to each weighted sum includes:

[0022] According to each of the weighted sums, determining whether a second TWS headset having a weighted sum greater than or equal to a preset weighted threshold can be screened out;

[0023] If so, the second TWS headset whose weighted sum is greater than or equal to the preset weighted threshold is selected as the TWS headset to be paired, and the TWS headset to be paired corresponding to the maximum weighted sum is selected from each of the TWS headsets to be paired as the target TWS headset, and the first TWS headset is controlled to be paired with the target TWS headset;

[0024] If not, control the first TWS headset to refuse to pair with each of the second TWS headsets.

[0025] Optionally, the pairing information includes an external encrypted message and a public key. Before determining, according to the pairing information, a second time when the second TWS headset enters a working state, the method further includes:

[0026] Decoding the external encrypted message according to the public key to obtain a globally unique identifier and an identity identifier;

[0027] Determining whether the globally unique identifier matches the local globally unique identifier, and whether the identity identifier matches the local identity identifier;

[0028] If yes, proceed to the step of determining a second time when the second TWS headset enters a working state according to the pairing information;

[0029] If not, the pairing information is discarded.

[0030] Optionally, the pairing information further includes a headset characteristic parameter. Before determining, according to the pairing information, a second time when the second TWS headset enters a working state, the method further includes:

[0031] Determining whether the earphone characteristic parameters meet the characteristic matching conditions;

[0032] If yes, proceed to the step of determining a second time when the second TWS headset enters a working state according to the pairing information;

[0033] If not, the pairing information is discarded.

[0034] In a second aspect, an embodiment of the present invention provides a TWS headset pairing method, which is applied to a second TWS headset, including:

[0035] Determine a second time when the second TWS headset enters a working state;

[0036] Encapsulating the second time into pairing information;

[0037] The pairing information is sent to the first TWS headset, so that the first TWS headset determines the second time when the second TWS headset enters the working state and the first time when the first TWS headset enters the working state according to the pairing information, and controls the pairing between the first TWS headset and the second TWS headset according to the first time, the second time and a preset duration threshold.

[0038] In a third aspect, an embodiment of the present invention provides a storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to enable an electronic device to execute the above-mentioned TWS headset pairing method.

[0039] In a fourth aspect, an embodiment of the present invention provides a chip, including:

[0040] at least one processor; and,

[0041] a memory communicatively connected to the at least one processor; wherein,

[0042] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned TWS headset pairing method.

[0043] In a fifth aspect, an embodiment of the present invention provides a TWS headset, which can be used as a first TWS headset or a second TWS headset, including:

[0044] at least one processor; and,

[0045] a memory communicatively connected to the at least one processor; wherein,

[0046] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned TWS headset pairing method.

[0047] In the TWS earphone pairing method provided in an embodiment of the present invention, pairing information sent by the second TWS earphone is received, and according to the pairing information, the second time when the second TWS earphone enters the working state is determined, and the first time when the first TWS earphone enters the working state is obtained, and according to the first time, the second time and the preset time threshold, the pairing between the first TWS earphone and the second TWS earphone is controlled. Therefore, this embodiment can effectively and reliably automatically control the pairing between the first TWS earphone and the second TWS earphone, try to avoid the phenomenon of serial pairing or mispairing, and the pairing operation is simple, which is conducive to improving the pairing efficiency of the TWS earphone. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0049] Figure 1 A schematic diagram of the structure of a TWS headset system provided by an embodiment of the present invention;

[0050] Figure 2 A schematic diagram of a TWS headset pairing method provided by an embodiment of the present invention;

[0051] Figure 3 for Figure 2 The first flow chart of S24 shown;

[0052] Figure 4 A schematic diagram of a TWS headset group provided in an embodiment of the present invention;

[0053] Figure 5 for Figure 2 The second flow diagram of S24 shown;

[0054] Figure 6 for Figure 5 The schematic diagram of the process of S245 shown;

[0055] Figure 7 for Figure 6 The schematic diagram of the process of S2453 shown;

[0056] Figure 8 A schematic diagram of a TWS headset pairing method provided by another embodiment of the present invention;

[0057] Fig. 9 A schematic diagram of a TWS headset pairing method provided in another embodiment of the present invention;

[0058] Fig.10 A schematic diagram of a circuit structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0060] It should be noted that, if there is no conflict, the various features in the embodiments of the present invention can be combined with each other, all within the scope of protection of the present invention. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order from the module division in the device or the flow chart. Furthermore, the words "first", "second", "third", etc. used in the present invention do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.

[0061] See also Figure 1The TWS earphone system 100 includes a first TWS earphone 11, a second TWS earphone 12 and a charging compartment 13. The charging compartment 13 provides two receiving slots for accommodating the first TWS earphone 11 and the second TWS earphone 12 respectively. The charging compartment 13 can charge the first TWS earphone 11 and the second TWS earphone 12.

[0062] The first TWS headset 11 establishes a Bluetooth communication connection with the second TWS headset 12, and the first TWS headset 11 and the second TWS headset 12 communicate with each other based on the Bluetooth communication connection.

[0063] In some embodiments, the first TWS headset 11 can be the master headset, and the second TWS headset 12 can be the slave headset. For example, the first TWS headset 11 broadcasts its own pairing information, and the second TWS headset 12 scans the pairing information of the first TWS headset 11. If the second TWS headset 12 successfully authenticates the pairing information of the first TWS headset 11, the second TWS headset 12 can be paired with the first TWS headset 11, wherein the first TWS headset 11 is the master headset and the second TWS headset 12 is the slave headset. Of course, some embodiments can also customize the selection of the master headset and the slave headset in the first TWS headset 11 and the second TWS headset 12 according to some rules.

[0064] In some embodiments, the first TWS headset 11 may be a slave headset, and the second TWS headset 12 may be a master headset. For example, the second TWS headset 12 broadcasts its pairing information, and the first TWS headset 11 scans the pairing information of the second TWS headset 12. If the first TWS headset 11 successfully authenticates the pairing information of the second TWS headset 12, the first TWS headset 11 can be paired with the second TWS headset 12, wherein the first TWS headset 11 is a slave headset, and the second TWS headset 12 is a master headset.

[0065] In some embodiments, when the first TWS headset 11 or the second TWS headset 12 is placed in the charging compartment 13 for charging, the user takes out the first TWS headset 11 or the second TWS headset 12 from the charging compartment 13, and then the first TWS headset 11 or the second TWS headset 12 starts to enter the working state, for example, the first TWS headset 11 or the second TWS headset 12 starts to initialize and performs a reconnection operation or a pairing operation, wherein the reconnection operation refers to the two TWS headsets that have been successfully paired before. When one TWS headset enters the working state, this TWS headset starts to search for the pairing information of the other TWS headset. If it is found, it is paired. This process can be regarded as a reconnection operation. If it is not found, a suitable TWS headset is searched for pairing. Therefore, when the TWS headset is taken out of the charging compartment, the TWS headset automatically enters the working state.

[0066] In some embodiments, the difference from the above embodiments is that when the TWS earphone is taken out of the charging compartment, the TWS earphone is not yet able to enter the working state, and the TWS earphone needs to wait for the user's operation before entering the working state. For example, when the first TWS earphone 11 or the second TWS earphone 12 is placed in the charging compartment 13 for charging, after the user takes out the first TWS earphone 11 or the second TWS earphone 12 from the charging compartment 13, the user also needs to touch the start button of the first TWS earphone 11 or the second TWS earphone 12 before the first TWS earphone 11 or the second TWS earphone 12 can enter the working state.

[0067] When the first TWS headset 11 or the second TWS headset 12 enters the working state, the first TWS headset 11 or the second TWS headset 12 needs to record the current local time in order to subsequently execute the TWS headset pairing method described in the various embodiments below.

[0068] It can be understood that the first TWS earphone can be the left earphone and the second TWS earphone can be the right earphone, or the first TWS earphone can be the right earphone and the second TWS earphone can be the left earphone. This document does not limit the master-slave type of the first TWS earphone and the second TWS earphone, nor does it limit the left and right types of the first TWS earphone and the second TWS earphone.

[0069] An embodiment of the present invention provides a TWS earphone pairing method, which is applied to a first TWS earphone.

[0070] See also Figure 2 , TWS headset pairing methods include:

[0071] S21: receiving pairing information sent by the second TWS headset.

[0072] In this step, the pairing information is the information for pairing the second TWS headset with the first TWS headset, wherein the pairing information can be in a data format that meets the TWS protocol. For example, the pairing information includes an access code (Access Code), a data header (Header) and a message carrier (Payload), wherein the access code is associated with the Bluetooth address of the second TWS headset, the data header is used for transmission control, and the message carrier carries the data content to be sent. It can be understood that the data content in the message carrier can be customized by the user according to design requirements.

[0073] S22: Determine a second time when the second TWS headset enters a working state according to the pairing information.

[0074] In this step, the second time is the time when the second TWS headset enters the working state. For example, after the second TWS headset is taken out of the charging compartment, the second TWS headset automatically enters the working state, so the second TWS headset starts to record the current local time and uses the current local time as the second time. For another example, after the second TWS headset is taken out of the charging compartment, the user touches to start the second TWS headset, and the second TWS headset enters the working state. So the second TWS headset starts to record the current local time and uses the current local time as the second time.

[0075] In some embodiments, the second TWS headset may encapsulate the second time into a message carrier, and the second time is received by the first TWS headset along with the pairing information of the second TWS headset.

[0076] In some embodiments, the second TWS headset stores the second time locally.

[0077] In some embodiments, the pairing information carries a timestamp, and the first TWS headset extracts the timestamp based on the pairing information, wherein the timestamp is signature data encapsulating the second time, and the first TWS headset parses the pairing information and extracts the timestamp therefrom. Then, the first TWS headset extracts the second time when the second TWS headset enters the working state based on the timestamp.

[0078] S23: Obtain the first time when the first TWS headset enters the working state.

[0079] In this step, the first time is the time when the first TWS headset enters the working state. For example, after the first TWS headset is taken out of the charging compartment, the first TWS headset automatically enters the working state, so the first TWS headset starts to record the current local time and uses the current local time as the first time. For another example, after the first TWS headset is taken out of the charging compartment, the user touches to start the first TWS headset, and the first TWS headset enters the working state. So the first TWS headset starts to record the current local time and uses the current local time as the first time.

[0080] In this step, the first TWS headset stores the first time locally.

[0081] S24: Control pairing between the first TWS headset and the second TWS headset according to the first time, the second time and the preset time threshold.

[0082] In this step, the preset time threshold can be customized by the user according to engineering experience. For example, the preset time threshold is 10 seconds, 30 seconds, 60 seconds, or 5 minutes.

[0083] This embodiment can effectively and reliably automatically control the pairing between the first TWS headset and the second TWS headset, avoiding the phenomenon of serial pairing or mismatching as much as possible, and the pairing operation is simple, which is conducive to improving the pairing efficiency of the TWS headset.

[0084] In some embodiments, see Figure 3 , S24 includes:

[0085] S241: Calculate the absolute value of the time difference between the first time and the second time;

[0086] S242: Determine whether the absolute value is less than or equal to a preset duration threshold;

[0087] S243: If the absolute value is less than or equal to the preset duration threshold, control the first TWS headset to pair with the second TWS headset.

[0088] In step S241, the first TWS headset calculates the absolute value of the time difference between the first time and the second time according to the following formula:

[0089] |T1-T2|=ΔT, wherein T1 is the first time, T2 is the second time, and ΔT is the absolute value of the time difference between the first time and the second time.

[0090] In step S242, the first TWS headset determines whether the absolute value is less than or equal to the preset time threshold according to the following formula: Determine ΔT≤Ts?, where Ts is the preset time threshold.

[0091] In step S243, if ΔT≤Ts, the first TWS headset is paired with the second TWS headset. Generally, assuming that the TWS headset automatically enters the working state after being taken out of the charging compartment, when the user needs to use the first TWS headset and the second TWS headset at the same time, the interval between the first removal operation of taking out the first TWS headset and the second removal operation of taking out the second TWS headset is relatively short, and this interval is short enough to distinguish other TWS headsets.

[0092] For example, see Figure 4 , assuming that there are a third TWS headset 43 and a fourth TWS headset 44, as well as a fifth TWS headset 45 and a sixth TWS headset 46 around the first TWS headset 41 and the second TWS headset 42, wherein the first TWS headset 41 and the second TWS headset 42 can be placed in the first charging compartment 47, the third TWS headset 43 and the fourth TWS headset 44 can be placed in the second charging compartment 48, and the fifth TWS headset 45 and the sixth TWS headset 46 can be placed in the third charging compartment 49.

[0093] Assume that the preset duration threshold is 30 seconds.

[0094] User A takes out the second TWS earphone 42 from the first charging bin 47 at time point t1 and takes out the first TWS earphone 41 from the first charging bin 47 at time point t2. Among them, the second TWS earphone 42 broadcasts pairing information, and the first TWS earphone 41 monitors the pairing information. Among them, t2 - t1 = 15 seconds.

[0095] User B takes out the fourth TWS earphone 44 from the second charging bin 48 at time point t3 and takes out the third TWS earphone 43 from the second charging bin 48 at time point t4. Among them, the fourth TWS earphone 44 broadcasts pairing information, and the third TWS earphone 43 monitors the pairing information. Among them, t1 < t3 < t2, t4 > t2, and t4 - t3 = 28 seconds, t4 - t1 = 33 seconds.

[0096] User C takes out the sixth TWS earphone 46 from the third charging bin 49 at time point t5 and takes out the fifth TWS earphone 45 from the third charging bin 49 at time point t6. Among them, the sixth TWS earphone 46 broadcasts pairing information, and the fifth TWS earphone 45 monitors the pairing information. Among them, t4 < t5 < t6, and t6 - t5 = 20 seconds, t5 - t1 = 48 seconds.

[0097] As can be seen from the above description, the times when different users take out TWS earphones from the charging bin are usually different, and the absolute value of the time difference between two TWS earphones from different charging bins is also relatively large. Therefore, by comparing the absolute value with the preset duration threshold, the pairable TWS earphones can be effectively and reliably determined. As mentioned above, for the first TWS earphone 41, t2 - t1 = 15 seconds, and 15 seconds is less than the preset duration threshold of 30 seconds. t4 - t1 = 33 seconds, and 33 seconds is greater than the preset duration threshold of 30 seconds. t5 - t1 = 48 seconds, and 48 seconds is greater than the preset duration threshold of 30 seconds.

[0098] Therefore, for the first TWS earphone 41, the first TWS earphone 41 will pair with the second TWS earphone 42, rather than pairing with the fourth TWS earphone 44 or the sixth TWS earphone 46. By adopting this method, this embodiment is beneficial to improving the pairing reliability and pairing efficiency, thereby being able to enhance the user experience.

[0099] In some embodiments, when there are multiple second TWS earphones around the first TWS earphone, in order to accurately and reliably search for the pairable second TWS earphone among multiple second TWS earphones, please refer to Figure 5 , S24 further includes:

[0100] S244: If the absolute value is greater than the preset duration threshold, determine the RSSI strength of the first TWS earphone detecting each second TWS earphone and the absolute value corresponding to each second TWS earphone within the preset duration.

[0101] S245: Control pairing between the first TWS headset and the second TWS headset according to the RSSI strength and absolute value corresponding to each second TWS headset.

[0102] In step S244, when the second TWS headset broadcasts pairing information, the first TWS headset receives the pairing information and can also detect the RSSI strength of the second TWS headset. When there are multiple second TWS headsets in the first TWS headset, and the first TWS headset can search for the pairing information broadcast by each second TWS headset, the first TWS headset can detect the RSSI strength of each second TWS headset and the absolute value corresponding to each second TWS headset. Therefore, the first TWS headset can collect the RSSI strength and absolute value of all second TWS headsets within a preset time, so that the second TWS headset that can be paired can be reliably selected later.

[0103] In step S245, the first TWS headset may control pairing between the first TWS headset and the second TWS headset in combination with any suitable algorithm according to the RSSI strength and absolute value corresponding to each second TWS headset.

[0104] In some embodiments, step S245 includes: judging whether there is an RSSI strength greater than a preset strength threshold according to the RSSI strength corresponding to each second TWS headset, and if so, selecting the second TWS headset corresponding to the RSSI strength greater than the preset strength threshold as the candidate TWS headset, and selecting the second TWS headset corresponding to the maximum absolute value among the candidate TWS headsets as the target TWS headset, and controlling the first TWS headset to pair with the target TWS headset. If not, continue searching for pairing information.

[0105] For example, there are second TWS earphones B1, B2, B3, B4, B5, and B6 around the first TWS earphone. Since the RSSI strengths of the second TWS earphones B1, B3, and B5 are all less than the preset strength threshold, the first TWS earphone discards the second TWS earphones B1, B3, and B5, and selects the second TWS earphones B2, B4, and B6 as candidate TWS earphones.

[0106] Among the second TWS headset B2, the second TWS headset B4, and the second TWS headset B6, since the absolute value of the second TWS headset B4 is the largest, the first TWS headset selects the second TWS headset B4 as the target TWS headset, and the first TWS headset is paired with the second TWS headset B4. In this way, the first TWS headset can relatively reliably screen out the second TWS headset that can be paired.

[0107] In some embodiments, the difference from the above embodiments is that, see Figure 6 , step S245 includes:

[0108] S2451: Normalize the RSSI strength and absolute value corresponding to each second TWS headset to obtain a first normalized value and a second normalized value respectively;

[0109] S2452: Calculate a weighted sum corresponding to each second TWS headset according to the first normalized value and the first weight factor and the second normalized value and the second weight factor;

[0110] S2453: Control pairing of the first TWS headset with the second TWS headset according to each weighted sum.

[0111] In step S2451, please combine the above example. Around the first TWS headset, there are second TWS headset B1, second TWS headset B2, second TWS headset B3, second TWS headset B4, second TWS headset B5, and second TWS headset B6.

[0112] The RSSI strength of the second TWS headset B1 is r1, and its absolute value is d1. The RSSI strength of the second TWS headset B2 is r2, and its absolute value is d2. The RSSI strength of the second TWS headset B3 is r3, and its absolute value is d3. The RSSI strength of the second TWS headset B4 is r4, and its absolute value is d4. The RSSI strength of the second TWS headset B5 is r5, and its absolute value is d5. The RSSI strength of the second TWS headset B6 is r6, and its absolute value is d6.

[0113] The first TWS headset normalizes the RSSI strength and absolute value corresponding to each second TWS headset according to the following formula, as described below:

[0114] η i =tanh(r i ) Formula 1

[0115] ζ i =tanh(d i ) Formula 2

[0116] ψ=α*η i +β*ζi Formula 3

[0117] 1=α+β Formula 4

[0118] Among them, η i is the first normalized value corresponding to the second TWS headset Bi, ζ i is the second normalized value corresponding to the second TWS headset Bi, r i is the RSSI strength corresponding to the second TWS headset Bi, d i is the absolute value corresponding to the second TWS headset Bi, α is the first weight factor, β is the second weight factor, and ψ is the weighted sum.

[0119] In step S2451, the first TWS headset calculates a first normalized value corresponding to each of the second TWS headsets according to Formula 1. The first TWS headset calculates a second normalized value corresponding to each of the second TWS headsets according to Formula 2.

[0120] In step S2452, the first TWS headset calculates the weighted sum corresponding to each second TWS headset according to equations 3 and 4.

[0121] In step S2453, the first TWS headset may control pairing of the first TWS headset with the second TWS headset in combination with any suitable algorithm according to each weighted sum.

[0122] In some embodiments, see Figure 7 , S2453 includes:

[0123] S71: According to each weighted sum, determine whether a second TWS headset whose weighted sum is greater than or equal to a preset weighted threshold can be screened out; if so, execute S72; if not, execute S75.

[0124] S72: If yes, the second TWS headset whose weighted sum is greater than or equal to the preset weighted threshold is selected as the TWS headset to be matched, and S73 is executed.

[0125] S73: Among the TWS earphones to be paired, select the TWS earphone to be paired corresponding to the maximum weighted sum as the target TWS earphone, and execute S74.

[0126] S74: Control the first TWS headset to pair with the target TWS headset.

[0127] S75: If not, control the first TWS headset to refuse pairing with each second TWS headset.

[0128] In combination with the above example, there are second TWS earphone B1, second TWS earphone B2, second TWS earphone B3, second TWS earphone B4, second TWS earphone B5, and second TWS earphone B6 around the first TWS earphone.

[0129] The weighted sum of the second TWS headset B1 is ψ1, the weighted sum of the second TWS headset B2 is ψ2, the weighted sum of the second TWS headset B3 is ψ3, the weighted sum of the second TWS headset B4 is ψ4, the weighted sum of the second TWS headset B5 is ψ5, and the weighted sum of the second TWS headset B6 is ψ6.

[0130] Among them, since the weighted sum ψ1, the weighted sum ψ3 and the weighted sum ψ6 are smaller than the preset weighted threshold, and the weighted sum ψ2, the weighted sum ψ4 and the weighted sum ψ5 are greater than the preset weighted threshold, the first TWS headset regards the second TWS headset B2, the second TWS headset B4 and the second TWS headset B5 as the TWS headsets to be matched.

[0131] Since the weighted sum ψ4 is the largest among the weighted sum ψ2, the weighted sum ψ4, and the weighted sum ψ5, the first TWS headset selects the second TWS headset B4 as the target TWS headset, and the first TWS headset is paired with the second TWS headset B4.

[0132] Since this embodiment takes both the RSSI strength and the absolute value of the time difference into consideration and performs a comprehensive evaluation, it is beneficial for the first TWS headset to search for the second TWS headset that can be paired more reliably and accurately.

[0133] It is understandable that the first weight factor, the second weight factor and the preset weighted threshold can be customized by the user according to engineering experience.

[0134] In some embodiments, the pairing information includes an external encrypted message and a public key. Before determining the second time when the second TWS headset enters the working state according to the pairing information, refer to Figure 8 , TWS headset pairing method also includes:

[0135] S25: Decode the external encrypted message according to the public key to obtain the globally unique identifier and the identity identifier.

[0136] S26: Determine whether the globally unique identifier matches the local globally unique identifier, and whether the identity identifier matches the local identity identifier. If so, proceed to step S22; if not, proceed to S27.

[0137] S27: Discard the pairing information.

[0138] For example, in this embodiment, a globally unique identifier and an identity identifier are written on the message carrier. Since each product has a specific globally unique identifier, the globally unique identifiers of the same products are the same, and the identity identifier is a unique identifier assigned by the Bluetooth Association to each manufacturer. In some embodiments, the globally unique identifier and the identity identifier may form a 16-byte string. In this embodiment, a public key may be applied to encrypt the above string according to the AES encryption algorithm to generate an external encrypted message, wherein, in some embodiments, the public key is a 2-byte known pseudo-random number.

[0139] When the first TWS headset receives the pairing information and extracts the external encrypted message from the pairing information, it then uses the known public key to decode the external encrypted message, thereby obtaining the globally unique identifier and the identity identifier. Next, the first TWS headset matches the globally unique identifier with the local globally unique identifier, and matches the identity identifier with the local identity identifier. If both match at the same time, it means that the second TWS headset is a TWS headset produced by the company, so that the TWS headset produced by external manufacturers can be filtered, thereby further enhancing the pairing reliability and efficiency of the first TWS headset and the second TWS headset, and preventing other devices from camouflaging pairing and malicious attacks, thereby improving the security of pairing.

[0140] In some embodiments, the pairing information further includes earphone characteristic parameters. Before determining the second time when the second TWS earphone enters the working state according to the pairing information, refer to Fig. 9 , TWS headset pairing method also includes:

[0141] S29: Determine whether the earphone characteristic parameters meet the characteristic matching conditions. If so, go to step S22; if not, execute S30.

[0142] S30: discard the pairing information.

[0143] The headphone characteristic parameters include channel characteristic parameters, functional characteristic parameters, etc. The characteristic matching conditions can be customized by the user according to the product characteristics. For example, the characteristic matching conditions include that the channel characteristic parameters of the two TWS headphones are different or the functional characteristic parameters of the two TWS headphones are the same. If the channel characteristic parameters of the two TWS headphones are different or the functional characteristic parameters of the two TWS headphones are the same, the first TWS headset and the second TWS headset meet the characteristic matching conditions, otherwise not.

[0144] In some embodiments, the field of the headphone characteristic parameter consists of a 1-byte role characteristic field and a 2-byte function characteristic field.

[0145] The role attribute field is mainly used to indicate the following situations: 1. Whether the TWS function is supported. 2. Master-slave roles. 3. Whether there is a pairing record. 4. Whether to force pairing. 5. Left and right channel information. For example, if both TWS earphones are left channels, they cannot be paired.

[0146] The feature field is mainly used to indicate the following situations: 1. Whether AAC is supported. 2. Whether broadband voice is supported. 3. Whether synchronous ringing for incoming calls is supported. For example, if one TWS headset supports broadband voice and the other does not, they cannot be paired.

[0147] By adopting the above approach, the internal TWS device can be further filtered out, thereby further enhancing the pairing reliability and efficiency of the first TWS headset and the second TWS headset.

[0148] It should be noted that, in each of the above-mentioned embodiments, there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.

[0149] See also Fig.10 , Fig.10 A schematic diagram of a circuit structure of an electronic device provided by an embodiment of the present invention, wherein the electronic device may be a chip or a TWS headset, wherein when the electronic device is a TWS headset, it may be used as a first TWS headset or a second TWS headset. Fig.10 As shown, the electronic device includes one or more processors 101 and a memory 102. Among them, Fig.10 A processor 101 is taken as an example.

[0150] The processor 101 and the memory 102 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.

[0151] The memory 102 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the TWS headset pairing method in the embodiment of the present invention. The processor 101 implements the functions of the TWS headset pairing method provided in the above method embodiment by running the non-volatile software programs, instructions and modules stored in the memory 102.

[0152] The memory 102 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 102 may optionally include a memory remotely arranged relative to the processor 101, and these remote memories may be connected to the processor 101 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0153] The program instructions / modules are stored in the memory 102, and when executed by the one or more processors 101, the TWS headset pairing method in any of the above method embodiments is executed.

[0154] The embodiment of the present invention further provides a storage medium, wherein the storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors, such as Fig.10 A processor 101 in the embodiment may enable the one or more processors to execute the TWS headset pairing method in any of the above method embodiments.

[0155] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-volatile computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by an electronic device, the electronic device executes any one of the TWS headset pairing methods described.

[0156] The above described device or equipment embodiments are merely illustrative, wherein the unit modules described as separate components may or may not be physically separated, and the components displayed as module units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network module units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0157] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0158] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them. Under the concept of the present invention, the technical features in the above embodiments or different embodiments may also be combined, the steps may be implemented in any order, and there are many other changes in different aspects of the present invention as described above, which are not provided in detail for the sake of simplicity. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they may still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A TWS headset pairing method, applied to a first TWS headset, characterized in that: include: Receiving pairing information sent by the second TWS headset, and determining, according to the pairing information, a second time when the second TWS headset enters a working state; Obtaining the first time when the first TWS headset enters the working state; Calculating an absolute value of a time difference between the first time and the second time; According to the comparison result between the absolute value and the preset duration threshold, the pairing between the first TWS headset and the second TWS headset is controlled.

2. The method according to claim 1, characterized in that: Also includes: When it is detected that the first TWS headset enters the working state, the current local time is recorded as the first time.

3. The method according to claim 1, characterized in that The controlling the pairing between the first TWS headset and the second TWS headset according to the comparison result between the absolute value and the preset duration threshold comprises: Determine whether the absolute value is less than or equal to the preset duration threshold; If the absolute value is less than or equal to the preset duration threshold, the first TWS headset is controlled to pair with the second TWS headset.

4. The method according to claim 3, characterized in that: According to the comparison result of the absolute value and the preset duration threshold, controlling the pairing between the first TWS headset and the second TWS headset further includes: If the absolute value is greater than the preset time threshold, determine that within the preset time, the first TWS headset detects the RSSI strength of each of the second TWS headsets and the absolute value corresponding to each of the second TWS headsets; Control the pairing between the first TWS headset and the second TWS headset according to the RSSI strength and absolute value corresponding to each of the second TWS headsets.

5. The method according to claim 4, characterized in that The controlling the pairing of the first TWS headset with the second TWS headset according to the RSSI strength and the absolute value corresponding to each of the second TWS headsets includes: Normalize the RSSI strength and absolute value corresponding to each of the second TWS headphones to obtain a first normalized value and a second normalized value respectively; Calculate a weighted sum corresponding to each of the second TWS headphones according to the first normalized value and the first weight factor and the second normalized value and the second weight factor; According to each of the weighted sums, pairing of the first TWS headset with the second TWS headset is controlled.

6. The method according to claim 5, characterized in that The controlling the pairing of the first TWS headset with the second TWS headset according to each weighted sum includes: According to each of the weighted sums, determining whether a second TWS headset having a weighted sum greater than or equal to a preset weighted threshold can be screened out; If so, the second TWS headset whose weighted sum is greater than or equal to the preset weighted threshold is selected as the TWS headset to be paired, and the TWS headset to be paired corresponding to the maximum weighted sum is selected from each of the TWS headsets to be paired as the target TWS headset, and the first TWS headset is controlled to be paired with the target TWS headset; If not, control the first TWS headset to refuse to pair with each of the second TWS headsets.

7. The method according to any one of claims 1 to 6, characterized in that: The pairing information includes an external encrypted message and a public key. Before determining, according to the pairing information, a second time when the second TWS headset enters a working state, the method further includes: Decoding the external encrypted message according to the public key to obtain a globally unique identifier and an identity identifier; Determining whether the globally unique identifier matches the local globally unique identifier, and whether the identity identifier matches the local identity identifier; If yes, proceed to the step of determining a second time when the second TWS headset enters a working state according to the pairing information; If not, the pairing information is discarded.

8. The method according to claim 7, characterized in that The pairing information also includes earphone characteristic parameters. Before determining, according to the pairing information, a second time when the second TWS earphone enters the working state, the method further includes: Determining whether the earphone characteristic parameters meet the characteristic matching conditions; If yes, proceed to the step of determining a second time when the second TWS headset enters a working state according to the pairing information; If not, the pairing information is discarded.

9. A TWS headset pairing method, applied to a second TWS headset, characterized in that: include: Determine a second time when the second TWS headset enters a working state; Encapsulating the second time into pairing information; The pairing information is sent to the first TWS headset, so that the first TWS headset determines, according to the pairing information, a second time when the second TWS headset enters a working state and a first time when the first TWS headset enters a working state, calculates an absolute value of a time difference between the first time and the second time, and controls the pairing between the first TWS headset and the second TWS headset according to a comparison result of the absolute value and a preset duration threshold.

10. A storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to enable the electronic device to execute the TWS headset pairing method as described in any one of claims 1 to 8 or claim 9.

11. A chip, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the TWS headset pairing method as described in any one of claims 1 to 8 or claim 9.

12. A TWS headset, characterized in that: Can be used as the first TWS headset or the second TWS headset, including: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the TWS headset pairing method as described in any one of claims 1 to 8 or claim 9.

Citation Information

Patent Citations

  • Master-slave earphone switching control method and related products

    CN108958696A

  • Bluetooth headset pairing method and device and readable storage medium

    CN111107667A