Left-right state determination method, device and equipment of smart earphone and storage medium

By determining the connection status and power-on sequence of the earphones, the left and right states are automatically identified, solving the problems of cumbersome operation and complex production of existing smart earphones, improving user experience and reducing production costs.

CN116033305BActive Publication Date: 2026-04-24UBAIBO IND SHENZHEN CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
UBAIBO IND SHENZHEN CO LTD
Filing Date
2022-12-14
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing smart earphones are cumbersome and time-consuming to distinguish between left and right earphones, increasing the complexity for users. At the same time, the separate preparation of production and after-sales materials increases the difficulty and cost.

Method used

By judging the headphone connection status and power-on sequence, the left and right status can be automatically determined, or the left and right status can be determined according to the default settings, reducing the need for users to manually distinguish between them.

Benefits of technology

It enables automatic determination of the left and right states of the earphones, reducing the complexity of user operation and the difficulty and cost of production and after-sales materials.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116033305B_ABST
    Figure CN116033305B_ABST
Patent Text Reader

Abstract

The application provides a left-right state determination method, device and equipment of an intelligent earphone and a storage medium. The method comprises the following steps: determining whether the first earphone and the second earphone are in a connected state; if the first earphone and the second earphone are in a connected state, determining the order of starting up of the first earphone and the second earphone, and determining the respective left-right states of the first earphone and the second earphone according to the order of starting up of the first earphone and the second earphone; and / or if the first earphone and the second earphone are not in a connected state, determining the respective left-right states of the first earphone and the second earphone according to a default setting. Based on the method, the left-right states of the earphone can be automatically determined by the earphone when the earphone is used by a user, so that the left earphone and the right earphone can be adapted to each other, the complexity of using the earphone is reduced, the user experience is improved, and the difficulty and cost of earphone production and after-sales are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, device, and storage medium for determining the left and right states of a smart headset. Background Technology

[0002] With the widespread use of mobile devices, smartphones, laptops, and various music electronic devices have become indispensable electronic products in people's lives. Among these, the most important functions are communication, listening to music, and watching videos. To ensure a good listening experience, many users use headphones. The human ear's perception of sound is directional, requiring users to distinguish between the left and right earpieces. Currently, existing solutions for helping users correctly differentiate between left and right earpieces mainly rely on structural differences in the earpiece heads or markings on them. However, relying on these structural differences or markings presents several challenges. First, users need to manually adjust the earpiece heads, a cumbersome and time-consuming process that increases complexity and reduces the user experience. Second, from a manufacturing and sales perspective, the left and right earpieces need to be processed and manufactured separately, and some after-sales materials also need to be prepared separately, increasing the difficulty and cost of production and after-sales service. Summary of the Invention

[0003] In view of this, embodiments of this application provide a method, apparatus, device, and storage medium for determining the left and right states of smart headphones, which can automatically determine the left and right states of the headphones when the user uses them, so that the left and right headphones can be adapted to each other, solving the technical problems of cumbersome and time-consuming operation when using headphones in the prior art and / or the difficulty and high cost of producing headphones and equipping them with after-sales materials.

[0004] A first aspect of this application provides a method for determining the left and right states of a smart earphone, wherein the first earphone and the second earphone are two earphones in the same pair. The method includes: determining whether the first earphone and the second earphone are in a connected state; if the first earphone and the second earphone are in a connected state, determining the order in which the first earphone and the second earphone are turned on, and determining the left and right states of the first earphone and the second earphone respectively according to the order in which the first earphone and the second earphone are turned on; and / or if the first earphone and the second earphone are not in a connected state, determining the left and right states of the first earphone or the second earphone according to default settings.

[0005] In one possible implementation, before the step of determining the left and right states of the first and second earphones according to the order in which they are powered on, the method further includes: setting a first determination rule, wherein the first determination rule is either determining the earphone that powers on first as the left earphone state or determining the earphone that powers on first as the right earphone state; the step of determining the left and right states of the first and second earphones according to the order in which they are powered on includes: when the first determination rule is set to determine the earphone that powers on first as the left earphone, if the first earphone powers on... If the first earphone powers on before the second earphone, then the first earphone is designated as the left earphone and the second earphone as the right earphone. If the first earphone powers on after the second earphone, then the first earphone is designated as the right earphone and the second earphone as the left earphone. When the first determination rule is set to designate the earphone that powers on first as the right earphone, if the first earphone powers on before the second earphone, then the first earphone is designated as the right earphone and the second earphone as the left earphone. If the first earphone powers on after the second earphone, then the first earphone is designated as the left earphone and the second earphone as the right earphone.

[0006] In one possible implementation, after setting the first determination rule, wherein the first determination rule is either determining the first powered-on earphone as the left earphone state or determining the first powered-on earphone as the right earphone state, the method further includes: obtaining a first determination rule switching instruction; and reversing the first determination rule according to the first determination rule switching instruction.

[0007] In one possible implementation, the step of determining the power-on order of the first and second earphones includes: obtaining a first power-on time corresponding to the first earphone and a second power-on time corresponding to the second earphone; comparing the first power-on time and the second power-on time to determine whether the first power-on time is greater than the second power-on time; if the first power-on time is greater than the second power-on time, then determining that the first earphone powers on before the second earphone; if the first power-on time is less than the second power-on time, then determining that the first earphone powers on after the second earphone.

[0008] In one possible implementation, after the step of comparing the first power-on time with the second power-on time, the method further includes: if the first power-on time is equal to the second power-on time, then obtaining the first battery value corresponding to the first earphone and the second battery value corresponding to the second earphone; and determining the left and right states of the first earphone and the second earphone respectively based on the relationship between the first battery value and the second battery value.

[0009] In one possible implementation, before the step of determining the left and right states of the first and second earphones respectively based on the relationship between the first and second battery levels, the method further includes: setting a second determination rule, wherein the second determination rule is either determining the earphone with the larger battery level as the left earphone state or determining the earphone with the larger battery level as the right earphone state; the step of determining the left and right states of the first and second earphones respectively based on the relationship between the first and second battery levels includes: when the second determination rule is set to determine the earphone with the larger battery level as the left earphone state, if the first battery level is greater than the second battery level, then the first earphone is determined to be the left earphone state and the second earphone is determined to be the right earphone state; if the first battery level is less than the second battery level, then the first earphone is determined to be the right earphone state and the second earphone is determined to be the left earphone state; when the second determination rule is set to determine the earphone with the larger battery level as the right earphone state, if the first battery level is greater than the second battery level, then the first earphone is determined to be the right earphone state and the second earphone is determined to be the left earphone state; if the first battery level is less than the second battery level, then the first earphone is determined to be the left earphone state and the second earphone is determined to be the right earphone state.

[0010] In one possible implementation, the step of determining whether the first earphone and the second earphone are in a connected state includes: monitoring the first earphone for a first preset time after it is powered on, and monitoring the second earphone for a second preset time after it is powered on; if the first earphone and the second earphone are detected to be directly handshaking during the first preset time or the second preset time, then the first earphone and the second earphone are determined to be in a first connected state; if the first earphone is detected to be handshaking with the terminal device during the first preset time and the second earphone is detected to be handshaking with the terminal device during the second preset time, then the first earphone and the second earphone are determined to be in a second connected state; if the first earphone is detected not to be handshaking with the second earphone during the first preset time, then the first earphone and the second earphone are determined to be in a second connected state; if the first earphone is detected not to be handshaking with the second earphone during the first preset time, then the first earphone and the second earphone are determined to be in a second connected state. If the first earpiece directly hands over to the terminal device and the second earpiece hands over to the terminal device, but no handshake is detected between the second earpiece and the terminal device, then the first earpiece and the second earpiece are determined to be in a disconnected state. If, within a second preset time period, the second earpiece does not directly handshake with the first earpiece and does not handshake with the terminal device, but no handshake is detected between the first earpiece and the terminal device, then the first earpiece and the second earpiece are determined to be in a disconnected state. If, within the first preset time period, the first earpiece does not directly handshake with the second earpiece and does not handshake with the terminal device, then the first earpiece and the second earpiece are determined to be in a disconnected state within the first earpiece. If, within the second preset time period, the second earpiece does not handshake with the first earpiece and does not handshake with the terminal device, then the first earpiece and the second earpiece are determined to be in a disconnected state within the second earpiece.

[0011] In one possible implementation, if the first earphone and the second earphone are in a first connection state, the step of obtaining the first power-on time corresponding to the first earphone and the second power-on time corresponding to the second earphone includes: starting a timer when the first earphone is powered on, stopping the timer when the first earphone and the second earphone shake hands, obtaining a first timer duration, and determining the first timer duration as the first power-on time corresponding to the first earphone; and starting a timer when the second earphone is powered on, stopping the timer when the first earphone and the second earphone shake hands, obtaining a second timer duration, and determining the second timer duration as the second power-on time corresponding to the second earphone.

[0012] In one possible implementation, if the first earphone and the second earphone are in a second connection state, the step of obtaining the first power-on time corresponding to the first earphone and the second power-on time corresponding to the second earphone includes: starting a timer when the first earphone is powered on, stopping the timer when the first earphone shakes hands with the terminal device to obtain a third timer duration, and determining the third timer duration as the first power-on time corresponding to the first earphone; and starting a timer when the second earphone is powered on, stopping the timer when the second earphone shakes hands with the terminal device to obtain a fourth timer duration, and determining the fourth timer duration as the second power-on time corresponding to the second earphone.

[0013] In one possible implementation, the step of determining the left or right state of the first or second earphone according to default settings when the first earphone and the second earphone are not connected includes: if it is determined at the first preset time that the first earphone and the second earphone are not connected, then the first earphone is defaulted to powering on before the second earphone, so as to determine the left or right state of the first earphone according to the first earphone powering on before the second earphone; and / or if it is determined at the second preset time that the first earphone and the second earphone are not connected, then the second earphone is defaulted to powering on before the first earphone, so as to determine the left or right state of the second earphone according to the second earphone powering on before the first earphone.

[0014] In one possible implementation, after determining the left and right states of the first and second earphones respectively, the method further includes: locking the left and right states of the first and second earphones and monitoring the first and second earphones in real time; when it is detected that either the first or second earphone has switched to a power-off state, clearing the locked left and right state of that earphone and retaining the locked left and right state of the other earphone; when it is detected that the first and second earphones are in a connected state or the connection is broken but both the first and second earphones are in a powered-on state, maintaining the locked left and right states of the first and second earphones.

[0015] In one possible implementation, after detecting that either the first earphone or the second earphone has switched to a power-off state, clearing the left / right lock state of the first earphone, and retaining the left / right lock state of the other earphone, the method further includes: when detecting that the first earphone has switched back to a power-on state, after the first earphone and the other earphone re-shake hands, determining the left / right state of the first earphone based on the left / right lock state of the other earphone, and re-locking the left / right state of the first earphone.

[0016] In one possible implementation, after the step of locking the left and right states of the first and second earphones, the method further includes: obtaining an earphone left and right state switching instruction; and swapping the left and right states of the first and second earphones according to the earphone left and right state switching instruction.

[0017] A second aspect of this application provides a device for determining the left and right states of a smart earphone, comprising: a judging module for judging whether the first earphone and the second earphone are in a connected state; a first determining module for determining the power-on order of the first earphone and the second earphone if the first earphone and the second earphone are in a connected state, and determining the left and right states corresponding to the first earphone and the second earphone respectively according to the power-on order of the first earphone and the second earphone; and / or a second determining module for determining the left and right states corresponding to the first earphone or the second earphone according to default settings if the first earphone and the second earphone are not in a connected state.

[0018] A third aspect of this application provides an earphone, including a memory, a processor, and a computer program stored in the memory and executable on an electronic device. When the processor executes the computer program, it implements the steps of the left and right state determination method for the smart earphone provided in the first aspect.

[0019] A fourth aspect of this application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the electronic device. When the processor executes the computer program, it implements the steps of the method for determining the left and right states of smart headphones provided in the first aspect.

[0020] A fifth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method for determining the left and right states of a smart headset provided in the first aspect.

[0021] The present application provides a method, apparatus, electronic device, and storage medium for determining the left and right states of a smart headset, which has the following beneficial effects:

[0022] This application determines whether the first and second earphones are connected. If they are connected, the order in which they are powered on is determined, and then the left / right state of each earphone is determined based on this order. If they are not connected, the default settings are used to determine the left / right state of either earphone. Based on this application, the earphones can automatically determine their left / right state when the user uses them, making them interchangeable. Either earphone can be worn in either the left or right ear, eliminating the need for users to distinguish left from right based on the earphones' appearance or markings. This reduces the complexity of earphone use and improves the user experience. Furthermore, since users don't need to distinguish left from right based on the earphones' appearance or markings, more materials can be shared between the left and right earphones during production and after-sales service, reducing the difficulty and cost of earphone production and after-sales service. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A flowchart illustrating the implementation of a method for determining the left and right states of a smart earphone, as provided in an embodiment of this application.

[0025] Figure 2 A flowchart of the first method for determining the left and right states of a smart earphone provided in this application embodiment;

[0026] Figure 3 A flowchart of a method for switching a first determination rule in the method for determining the left and right states of a smart earphone provided in an embodiment of this application;

[0027] Figure 4 A flowchart of a method for determining the power-on order of the first and second earphones in the method for determining the left and right states of smart earphones provided in this application embodiment;

[0028] Figure 5 A flowchart of the second method for determining the left and right states of a smart earphone provided in this application embodiment;

[0029] Figure 6A flowchart illustrating a method for determining the left and right states of a smart earphone based on its battery level, as provided in this application embodiment.

[0030] Figure 7 A flowchart of a method for switching a second determination rule in the method for determining the left and right states of smart headphones provided in this application embodiment;

[0031] Figure 8 A flowchart of a method for determining whether the first earphone and the second earphone are in a connected state in the left and right state determination method of the smart earphone provided in the embodiments of this application;

[0032] Figure 9 A flowchart illustrating a method for managing the left and right states of a smart earphone provided in this application embodiment;

[0033] Figure 10 A flowchart illustrating a method for swapping the left and right states of the earphones in the left and right state determination method provided in this application embodiment;

[0034] Figure 11 A basic structural block diagram of a left and right state determination device for a smart earphone provided in an embodiment of this application;

[0035] Figure 12 This is a basic structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0037] The method for determining the left and right states of smart headphones provided in this application is mainly applied to smart wireless headphones.

[0038] Please see Figure 1 , Figure 1 This is a flowchart illustrating the implementation of a method for determining the left and right states of a smart headset, as provided in an embodiment of this application. Specifically, it may include the following steps S11 to S13.

[0039] S11: Determine whether the first earphone and the second earphone are in a connected state.

[0040] In this embodiment, the earphones generally exist in pairs, with the first earphone and the second earphone being two earphones from the same pair. For example, the process of determining whether the first earphone and the second earphone are in a connected state can be as follows: after the first earphone and the second earphone are powered on, the first earphone and the second earphone are monitored respectively. Then, based on the monitoring results, it is determined whether the first earphone and the second earphone directly shake hands and whether the first earphone and the second earphone shake hands with the same terminal device. If the first earphone and the second earphone directly shake hands and / or both the first earphone and the second earphone shake hands with the same terminal device, it is determined that the first earphone and the second earphone are in a connected state; otherwise, it is determined that the first earphone and the second earphone are not in a connected state.

[0041] S12: If the first earphone and the second earphone are in a connected state, determine the order in which the first earphone and the second earphone are turned on, and determine the left and right states of the first earphone and the second earphone respectively according to the order in which the first earphone and the second earphone are turned on.

[0042] In this embodiment, the core of determining the power-on order of the first and second earpieces lies in comparing the difference between their power-on times. Any value reflecting the magnitude of the power-on times of the two earpieces can be used to determine their power-on order. In this embodiment, the first power-on time for the first earpiece can be represented as the duration of the handshake phase from when the first earpiece powers on until it establishes communication with the second earpiece. The second power-on time can be represented as the duration of the handshake phase from when the second earpiece powers on until it establishes communication with the first earpiece. By comparing the lengths of the two obtained durations, the longer duration is determined, and the earpiece with the longer duration powers on before the earpiece with the shorter duration. It should be noted that the handshake refers to the process of mutual recognition between the first and second earpieces before communication. The handshake can be a direct handshake between the first and second earpieces or an indirect handshake between the first and second earpieces through a terminal device. In this embodiment, after determining the power-on order of the first and second earpieces, the left and right states of each earpiece can be determined based on the order. For example, assuming the preset left earphone is determined to be the earphone that powers on first, if the first earphone powers on before the second earphone based on the first and second power-on times, then the first earphone can be determined to be the left earphone and the second earphone to be the right earphone. In this way, the first and second earphones can determine their own corresponding left and right states.

[0043] S13: If the first earphone and the second earphone are not connected, the left or right state of the first earphone or the second earphone is determined according to the default settings.

[0044] In this embodiment, the situation where the first and second earpieces are not connected includes a state where only the first earpiece is connected to the terminal device, a state where the first earpiece is connected to the terminal device, or a state where the first and second earpieces are connected to different terminal devices. In this embodiment, when the first and second earpieces are not connected, the left or right state of the first or second earpiece connected to the terminal device can be determined according to default settings. For example, when determining the left or right state of the first or second earpiece according to default settings, the default settings include, but are not limited to, any of the following settings:

[0045] Set the earphone to left earphone mode;

[0046] Set the earphone to the right earphone mode;

[0047] Based on the current battery level of the earphones, the left earphone is selected when the battery level is above 50%.

[0048] Based on the current battery level of the earphones, the right earphone is selected when the battery level is above 50%.

[0049] As can be seen from the above, the method for determining the left and right states of smart earphones provided in this application determines whether the first earphone and the second earphone are connected. If they are connected, the order in which they are powered on is determined, and then the left and right states of the first and second earphones are determined according to this order. If they are not connected, the left and right states of the first or second earphone are determined according to default settings. Based on this application, the earphones can automatically determine their left and right states when the user uses them, making the left and right earphones compatible. Either earphone can be worn in both the left and right ears, eliminating the need for the user to distinguish between left and right earphones based on their appearance or markings before use. This reduces the complexity of earphone use and improves the user experience. Furthermore, since the user does not need to distinguish between left and right earphones based on their appearance or markings before use, more materials can be shared between the left and right earphones during production and after-sales service, reducing the difficulty and cost of earphone production and after-sales service.

[0050] In some embodiments of this application, please refer to Figure 2 , Figure 2 A flowchart of the first method for determining the left and right states of the smart earphones provided in this application embodiment is shown below. Details are as follows:

[0051] S21: Set a first determination rule, wherein the first determination rule is either to determine the earphone that is powered on first as the left earphone state or to determine the earphone that is powered on first as the right earphone state;

[0052] S22: When the first determination rule is set to determine the earphone that is turned on first as the left earphone, if the first earphone is turned on before the second earphone, then the first earphone is determined to be the left earphone and the second earphone is determined to be the right earphone; if the first earphone is turned on after the second earphone, then the first earphone is determined to be the right earphone and the second earphone is determined to be the left earphone.

[0053] S23: When the first determination rule is set to determine the earphone that is turned on first as the right earphone, if the first earphone is turned on before the second earphone, then the first earphone is determined to be the right earphone and the second earphone is determined to be the left earphone; if the first earphone is turned on after the second earphone, then the first earphone is determined to be the left earphone and the second earphone is determined to be the right earphone.

[0054] In this embodiment, a first determination rule can be preset to determine the left and right states of the first and second earphones. In this embodiment, to cater to user habits and improve user experience, the first determination rule includes two options: determining the earphone that powers on first as the left earphone and determining the earphone that powers on first as the right earphone. Users can choose either one to determine the left and right states of the earphones according to their own preferences.

[0055] In this embodiment, when the first determination rule is set to identify the earphone that powers on first as the left earphone, if the first earphone powers on before the second earphone, the first earphone is identified as the left earphone and the second earphone as the right earphone. If the first earphone powers on after the second earphone, the first earphone is identified as the right earphone and the second earphone as the left earphone. For example, suppose the first earphone powers on at 15:34:40 on November 24, 2022, and the second earphone powers on at 15:38:37 on November 24, 2022. The first and second earphones then perform a handshake at 15:40:03 on November 24, 2022. Based on the power-on time, it can be determined that the first earphone powers on before the second earphone, thus identifying the first earphone as the left earphone and the second earphone as the right earphone. For example, suppose the first earphone is powered on at 15:34:40 on November 24, 2022, and the second earphone is powered on at 15:32:30 on November 24, 2022. The first earphone and the second earphone shake hands at 15:35:03 on November 24, 2022. At this time, based on the power-on time, it can be determined that the first earphone was powered on after the second earphone, and thus the first earphone is determined to be the right earphone and the second earphone is determined to be the left earphone.

[0056] In this embodiment, when the first determination rule is set to identify the earphone that powers on first as the right earphone, if the first earphone powers on before the second earphone, the first earphone is identified as the right earphone and the second earphone as the left earphone. If the first earphone powers on after the second earphone, the first earphone is identified as the left earphone and the second earphone as the right earphone. For example, suppose the first earphone powers on at 15:34:40 on November 24, 2022, and the second earphone powers on at 15:38:37 on November 24, 2022. The first and second earphones then perform a handshake at 15:40:03 on November 24, 2022. Based on the power-on time, it can be determined that the first earphone powers on before the second earphone, thus identifying the first earphone as the right earphone and the second earphone as the left earphone. For example, suppose the first earphone is powered on at 15:34:40 on November 24, 2022, and the second earphone is powered on at 15:32:30 on November 24, 2022. The first earphone and the second earphone shake hands at 15:35:03 on November 24, 2022. At this time, based on the power-on time, it can be determined that the first earphone was powered on after the second earphone, and thus the first earphone is determined to be the left earphone and the second earphone is determined to be the right earphone.

[0057] In some embodiments of this application, please refer to Figure 3 , Figure 3 A flowchart illustrating a method for switching the first determination rule in the left / right state determination method for smart headphones provided in this application embodiment is shown below. Details are as follows:

[0058] S31: Obtain the first judgment rule switching instruction;

[0059] S32: Reverse the first determination rule according to the first determination rule switching instruction.

[0060] In this embodiment, the first determination rule may include two types: determining the earphone that powers on first as the left earphone and determining the earphone that powers on first as the right earphone. This first determination rule can be changed through manual intervention. For example, the user performs a specified operation on the control button of the first earphone, the control button of the second earphone, or a terminal device connected to the first or second earphone. This includes double-clicking the control button on the earphone or clicking the first determination rule switching button displayed on the terminal device, thereby causing the first earphone, the second earphone, or the terminal device to receive a first determination rule switching instruction. After receiving the first determination rule switching instruction, the first earphone, the second earphone, or the terminal device can reverse the original first determination rule set on the first earphone, the second earphone, or the terminal device according to the instruction. Specifically, the reversal process includes: if the current first determination rule in the first earphone, the second earphone, or the terminal device is to determine the earphone that powers on first as the left earphone, then the first determination rule is switched to determine the earphone that powers on first as the right earphone. If the current first determination rule in the first earphone, second earphone, or terminal device is to determine the earphone that powers on first as the right earphone, then the first determination rule is switched to determine the earphone that powers on first as the left earphone. In some specific implementations of this embodiment, the switched first determination rule can be enabled after the earphone is powered on again or reconnected to the terminal device.

[0061] In some embodiments of this application, please refer to Figure 4 , Figure 4 A flowchart illustrating a method for determining the power-on order of the first and second earphones in a smart earphone left / right state determination method provided in this application embodiment is shown below. Details are as follows:

[0062] S41: Obtain the first power-on time corresponding to the first earphone and the second power-on time corresponding to the second earphone;

[0063] S42: Compare the first boot time with the second boot time to determine whether the first boot time is greater than the second boot time;

[0064] S43: If the first power-on time is greater than the second power-on time, then the first earphone is determined to power on before the second earphone; if the first power-on time is less than the second power-on time, then the first earphone is determined to power on after the second earphone.

[0065] In this embodiment, the first power-on time and the second power-on time are values ​​reflecting the magnitude of the power-on times of the first and second earphones. Specifically, when determining the power-on order of the first and second earphones, the first power-on time corresponding to the first earphone and the second power-on time corresponding to the second earphone can be obtained. After obtaining the first and second power-on times, their magnitudes can be compared to obtain the relationship between them. Based on this relationship, it can be determined whether the first power-on time is greater than the second power-on time. If the first power-on time is greater than the second power-on time, it is determined that the first earphone powers on before the second earphone; if the first power-on time is less than the second power-on time, it is determined that the first earphone powers on after the second earphone. It is understood that the first and second power-on times can be obtained through the earphones' own timing function.

[0066] In some embodiments of this application, see [reference] Figure 5 , Figure 5 A flowchart illustrating the second method for determining the left and right states of a smart earphone provided in this application embodiment. Details are as follows:

[0067] S51: If the first power-on time is equal to the second power-on time, then obtain the first battery value corresponding to the first earphone and the second battery value corresponding to the second earphone;

[0068] S52: Determine the left and right states of the first and second earphones respectively based on the relationship between the first and second battery levels.

[0069] In this embodiment, when determining the left and right states of the earphones by power-on time, the determination can only be made when the first power-on time corresponding to the first earphone is not equal to the second power-on time corresponding to the second earphone. When the first power-on time corresponding to the first earphone is equal to the second power-on time corresponding to the second earphone, the left and right states of the first and second earphones cannot be determined by power-on time. In this embodiment, the scenarios where the first power-on time equals the second power-on time include, but are not limited to, the following two: One scenario is when the handshake is only performed after the power-on time of both earphones reaches the recording threshold. For example, assuming the recording threshold for power-on time is set to 100 seconds, the recorded value of power-on time will no longer increase after 100 seconds. If the distance between the first earphone and the second earphone exceeds the maximum connection distance, the first earphone and the second earphone will only be moved to the connection range after the power-on time of both the first earphone and the second earphone has reached 100 seconds. In this case, the first power-on time corresponding to the first earphone will be equal to the second power-on time corresponding to the second earphone. The other scenario is when the first earphone and the second earphone are powered on almost simultaneously, and the recording accuracy of the earphone power-on time cannot reflect the order of the two. In this case, the first power-on time corresponding to the first earphone will be equal to the second power-on time corresponding to the second earphone.

[0070] In this embodiment, when the left and right states of the first and second earphones cannot be determined by the power-on time, the left and right states of the first and second earphones can be determined by acquiring their respective battery levels. Specifically, when the first power-on time equals the second power-on time, the first battery level of the first earphone and the second battery level of the second earphone can be acquired. By comparing the first and second battery levels, the left and right states of the first and second earphones can be determined based on their relative values. In this embodiment, the battery levels of the first and second earphones can be obtained through the earphones' own battery self-check function.

[0071] In practical applications, battery level is indicated by voltage. The headphone's self-checking function detects voltage, and there's a linear positive correlation between voltage and battery level. For example, if 4.2 volts corresponds to 100% battery, after some use, the voltage might drop to 3.9 volts, indicating approximately 80% battery. Therefore, headphones can determine battery level by detecting voltage.

[0072] In some embodiments of this application, please refer to Figure 6 , Figure 6 A flowchart illustrating a method for determining the left and right states of a smart earphone based on its battery level, as provided in this application embodiment, is shown below:

[0073] S61: Set a second determination rule, wherein the second determination rule is either to determine the earphone with the larger battery value as the left earphone state or to determine the earphone with the larger battery value as the right earphone state;

[0074] S62: When the second determination rule is set to determine the earphone with the larger battery value as the left earphone, if the first battery value is greater than the second battery value, then the first earphone is determined as the left earphone and the second earphone is determined as the right earphone; if the first battery value is less than the second battery value, then the first earphone is determined as the right earphone and the second earphone is determined as the left earphone.

[0075] S63: When the second determination rule is set to determine the earphone with the larger battery value as the right earphone, if the first battery value is greater than the second battery value, then the first earphone is determined as the right earphone and the second earphone is determined as the left earphone; if the first battery value is less than the second battery value, then the first earphone is determined as the left earphone and the second earphone is determined as the right earphone.

[0076] In this embodiment, when determining the left and right states of the earphones based on their battery levels, a second determination rule can be pre-set to determine the left and right states of the first and second earphones. In this embodiment, to cater to user habits and improve user experience, the second determination rule includes two options: determining the earphone with the higher battery level as the left earphone and determining the earphone with the higher battery level as the right earphone. Users can choose either one to determine the left and right states of the earphones according to their own preferences.

[0077] In this embodiment, when the second determination rule is set to identify the earphone with the higher battery level as the left earphone, the relationship between the first and second battery levels can be determined by comparing them. Specifically, if the first battery level is greater than the second battery level, then the first earphone can be identified as the left earphone and the second earphone as the right earphone. If the first battery level is less than the second battery level, then the first earphone can be identified as the right earphone and the second earphone as the left earphone.

[0078] In this embodiment, when the second determination rule is set to identify the earphone with the higher battery level as the right earphone, similarly, the relationship between the first and second battery levels can be determined by comparing them. Specifically, if the comparison result shows the first battery level is greater than the second battery level, then the first earphone is identified as the right earphone and the second earphone as the left earphone. If the comparison result shows the first battery level is less than the second battery level, then the first earphone is identified as the left earphone and the second earphone as the right earphone.

[0079] In some specific implementations of this embodiment, when the first power value is equal to the second power value, the left and right states of the first and second earphones cannot be determined by the power-on time. In this case, the connection status between the first and / or second earphones and the terminal device can be monitored. After the first and / or second earphones establish a connection with the terminal device, the user can be instructed in the terminal device to set the left and right states of the earphones.

[0080] In some embodiments of this application, please refer to Figure 7 , Figure 7 A flowchart illustrating a method for switching the second determination rule in the left / right state determination method for smart headphones provided in this application embodiment is shown below. Details are as follows:

[0081] S71: Obtain the second decision rule switching instruction;

[0082] S72: Reverse the second determination rule according to the second determination rule switching instruction.

[0083] In this embodiment, the second determination rule can include two types: determining the earphone with the higher battery level as the left earphone and determining the earphone with the higher battery level as the right earphone. This second determination rule can be changed manually. For example, the user performs a specified operation on the control button of the first earphone, the control button of the second earphone, or a terminal device connected to the first or second earphone. This includes pressing and holding the control button on the earphone for several seconds or clicking the second determination rule switching button displayed on the terminal device. This causes the first earphone, the second earphone, or the terminal device to receive a second determination rule switching instruction. After receiving the second determination rule switching instruction, the first earphone, the second earphone, or the terminal device can reverse the original second determination rule set on the first earphone, the second earphone, or the terminal device. Specifically, the reversal process includes: if the current second determination rule in the first earphone, the second earphone, or the terminal device is to determine the earphone with the higher battery level as the left earphone, then the second determination rule is switched to determine the earphone with the higher battery level as the right earphone. If the current second determination rule in the first earphone, second earphone, or terminal device is to identify the earphone with the higher battery level as the right earphone, then the second determination rule is switched to identify the earphone with the higher battery level as the left earphone. In some specific implementations of this embodiment, the switched second determination rule can be enabled after the earphone is restarted or reconnected to the terminal device.

[0084] In some embodiments of this application, please refer to Figure 8 , Figure 8 A flowchart illustrating a method for determining whether the first and second earphones are connected is provided in the left / right state determination method for smart earphones according to an embodiment of this application. Details are as follows:

[0085] S81: After the first earphone is powered on, the first earphone is monitored within a first preset time period, and after the second earphone is powered on, the second earphone is monitored within a second preset time period.

[0086] S82: If the first earphone and the second earphone are detected to be directly shaking hands within the first preset time or the second preset time, then it is determined that the first earphone and the second earphone are in the first connection state.

[0087] S83: If a handshake is detected between the first earphone and the terminal device within the first preset time period and a handshake is detected between the second earphone and the terminal device within the second preset time period, then it is determined that the first earphone and the second earphone are in a second connection state.

[0088] S84: If it is detected that the first earphone does not directly shake hands with the second earphone and the first earphone shakes hands with the terminal device but the second earphone does not shake hands with the terminal device within the first preset time, then it is determined that the first earphone and the second earphone are in a disconnected state.

[0089] S85: If it is detected that the second earphone does not directly shake hands with the first earphone and the second earphone shakes hands with the terminal device but the first earphone does not shake hands with the terminal device within the second preset time, then it is determined that the first earphone and the second earphone are in a disconnected state.

[0090] S86: If it is detected within the first preset time that the first earphone has not directly shaken hands with the second earphone and the first earphone has not shaken hands with the terminal device, then it is determined in the first earphone that the first earphone and the second earphone are in a disconnected state.

[0091] S87: If it is detected within the second preset time that the second earphone has not shaken hands with the first earphone and the second earphone has not shaken hands with the terminal device, then it is determined in the second earphone that the first earphone and the second earphone are in a disconnected state.

[0092] In this embodiment, when determining whether the first and second earphones are connected, a search duration can be preset. Based on this search duration, the time period for one earphone to search for the other earphone after it is powered on is determined, namely, the first preset time corresponding to the first earphone and the second preset time corresponding to the second earphone. For example, assuming the preset search duration is 5 minutes, and assuming the first earphone is powered on at 15:34:40 on November 24, 2022, and the second earphone is powered on at 15:38:37 on November 24, 2022, then the first preset time is the time period from 15:34:40 to 15:39:40 on November 24, 2022, and the second preset time is the time period from 15:43:37 on November 24, 2022. In this embodiment, after the first earphone is powered on, a first preset time can be determined based on the power-on time of the first earphone and a preset search duration. The first earphone can search its surroundings within this first preset time to find a second earphone and / or terminal device with which it can "shake hands." The search stops once a second earphone and / or terminal device with which it can "shake hands" is found, or after the first preset time has elapsed. Similarly, after the second earphone is powered on, a first preset time can be determined based on the power-on time of the second earphone and a preset search duration. The second earphone can search its surroundings within this first preset time to find a first earphone and / or terminal device with which it can "shake hands." The search stops once a first earphone and / or terminal device with which it can "shake hands" is found, or after the first preset time has elapsed. In this embodiment, before being powered on, the earphones are in, but not limited to, the following two states: The first state is the initial state after restoring factory settings. In this initial state, the earphones have not recorded any paired earphone information. Any earphone that meets the pairing conditions can be paired with it. It is understood that the first state is mainly for the convenience of factory production and to solve the problem of losing the other party's pairing information. The second state is when a handshake has already been completed between the two earphones, and both earphones have stored each other's information. In this state, one earphone, upon powering on, can automatically search for the other earphone. This second state represents the normal usage scenario for the earphones. For example, after the first and / or second earphone is powered on, the earphone can first check if it has stored information about the other earphone it has shaken with. If so, it directly searches for the other earphone in the vicinity via Bluetooth, WiFi, or other wireless networks based on the stored information, thus achieving a handshake. If the earphone determines that it has not stored information about the other earphone it has shaken with, i.e., it is in the initial state, then the earphone can directly transmit pairing messages to the surrounding area to find a pairing earphone and perform a handshake.In this embodiment, the first earphone can be monitored within a first preset time period, and the second earphone can be monitored within a second preset time period. If the first earphone and the second earphone are detected to directly shake hands within the first or second preset time period, it can be determined that the first earphone and the second earphone are in a first connected state. If the first earphone is detected to shake hands with the terminal device within the first preset time period and the second earphone is detected to shake hands with the terminal device within the second preset time period, it can be determined that the first earphone and the second earphone are in a connected state. That is, the connection state between the first earphone and the second earphone includes the following two types: the first is a connected state entered after the first earphone and the second earphone directly shake hands; the second is a connected state entered after both the first earphone and the second earphone shake hands with the same terminal device. If the first earphone is detected not to directly shake hands with the second earphone within the first preset time period, and the first earphone shakes hands with the terminal device but the second earphone does not shake hands with the terminal device, it can be determined that the first earphone and the second earphone are in a disconnected state. If the second earphone is detected not to directly shake hands with the first earphone within the second preset time period, and the second earphone shakes hands with the terminal device but the first earphone does not shake hands with the terminal device, it can be determined that the first earphone and the second earphone are in a disconnected state. If, within a first preset time period, it is detected that the first earpiece has not directly shaken hands with the second earpiece and has not shaken hands with the terminal device, it can be determined from the first earpiece that the first earpiece and the second earpiece are in a disconnected state. If, within a second preset time period, it is detected that the second earpiece has not shaken hands with the first earpiece and has not shaken hands with the terminal device, it can be determined from the second earpiece that the first earpiece and the second earpiece are in a disconnected state.

[0093] In some embodiments of this application, when the first earphone and the second earphone are in a first connection state, the process of obtaining the first power-on time corresponding to the first earphone and the second power-on time corresponding to the second earphone can specifically be as follows: timing begins when the first earphone is powered on, and timing stops when the first earphone and the second earphone shake hands, obtaining a first timing duration. This first timing duration is then determined as the first power-on time corresponding to the first earphone. Similarly, timing begins when the second earphone is powered on, and timing stops when the first earphone and the second earphone shake hands, obtaining a second timing duration. This second timing duration is then determined as the second power-on time corresponding to the second earphone. For example, suppose the first earphone is powered on at 15:34:40 on November 24, 2022, and the second earphone is powered on at 15:38:17 on November 24, 2022. The first earphone and the second earphone shake hands at 15:39:03 on November 24, 2022. In this case, the first timing duration can be obtained as 4 minutes and 23 seconds, and the second timing duration as 46 seconds.

[0094] In some embodiments of this application, when the first earphone and the second earphone are in a second connection state, the process of obtaining the first power-on time corresponding to the first earphone and the second power-on time corresponding to the second earphone can specifically be as follows: when both the first earphone and the second earphone are handshaking with the terminal device, timing can start when the first earphone is powered on and stop when the first earphone is handshaking with the terminal device to obtain a third timing duration, and the third timing duration is determined as the first power-on time corresponding to the first earphone. Furthermore, timing can start when the second earphone is powered on and stop when the second earphone is handshaking with the terminal device to obtain a fourth timing duration, and the fourth timing duration is determined as the second power-on time corresponding to the second earphone. For example, suppose the first earphone is powered on at 15:34:40 on November 24, 2022, and hands off with the target terminal device at 15:37:03 on November 24, 2022. The second earphone is powered on at 15:38:37 on November 24, 2022, and hands off with the target terminal device at 15:40:22 on November 24, 2022. Then, the third timing duration can be obtained as 2 minutes and 23 seconds, and the fourth timing duration as 1 minute and 45 seconds.

[0095] In some embodiments of this application, when the first and second earpieces are connected, the process of determining the left or right state of the first or second earpiece according to default settings can be as follows: If it is determined at a first preset time that the first and second earpieces are not connected, then the first earpiece is powered on before the second earpiece by default, so that the left or right state of the first earpiece is determined according to the first earpiece being powered on before the second earpiece. If it is determined at a second preset time that the first and second earpieces are not connected, then the second earpiece is powered on before the first earpiece by default, so that the left or right state of the second earpiece is determined according to the second earpiece being powered on before the first earpiece.

[0096] It is understood that in some embodiments of this application, a counter can be used to replace timing to obtain the count values ​​corresponding to the first and second earphones respectively, and the order in which the first and second earphones are powered on can be determined by the magnitude of the count values. For example, starting when the first and second earphones are powered on respectively, for each earphone, the counter value is incremented by 1 every 20 seconds until the first and second earphones shake hands, at which point the counting stops, and the order in which the first and second earphones are powered on is determined by the magnitude of the count values ​​recorded by the counters corresponding to the first and second earphones respectively.

[0097] It is understood that in some embodiments of this application, when determining the order in which the first and second earphones are powered on by timing, the self-test time before the earphones are powered on can be deleted, thereby improving the accuracy of determining the order in which the first and second earphones are powered on.

[0098] In some embodiments of this application, please refer to Figure 9 , Figure 9 A flowchart illustrating a method for managing the left and right states of a smart earphone provided in this application embodiment is shown below:

[0099] S91: Lock the left and right states of the first and second earphones, and monitor the first and second earphones in real time;

[0100] S92: If either the first earphone or the second earphone is detected to be switched to the power-off state, clear the left / right lock state of the first earphone and retain the left / right lock state of the other earphone;

[0101] S93: When it is detected that the first earphone and the second earphone are in a connected state or the connection state is broken but both the first earphone and the second earphone are in the powered-on state, the left and right states of the first earphone and the second earphone are locked.

[0102] In this embodiment, for the two earphones in a pair, the entire process from power-on to power-off includes the following three scenarios: The first scenario is that both earphones have completed a handshake after powering on and are not yet powered off; in this case, the left and right states of both earphones are determined and locked. The second scenario is that both earphones are powered on but have not completed a handshake; in this case, the left and right states of both earphones are not determined and are not locked. The third scenario is that after both earphones complete a handshake while powered on, one earphone is powered off and then powered on again; in this case, the earphone that remained powered on has its left and right states determined and locked, while the other earphone that was powered off and then powered on has its left and right states not determined and are not locked. In this embodiment, after the first and second earphones are powered on and complete a handshake, their respective left and right states can be determined. In this embodiment, after determining the respective left and right states of the first and second earphones, their left and right states can be locked, ensuring that the earphones remain powered off without human intervention. Throughout the entire process from powering on to powering off the headphones, after locking the left and right states of the first and second headphones respectively, the changes in the usage status of the first and second headphones can be determined by real-time monitoring of the first and second headphones.

[0103] In this embodiment, when either the first or second earphone is detected to switch to a powered-off state, the locked left / right state of that earphone can be cleared, while the locked left / right state of the other earphone remains. For example, assuming the first earphone is initially locked as the left earphone and the second earphone as the right earphone, if the first earphone is powered off during use, its locked left earphone state will be cleared, restoring it to an undetermined left / right state, while the second earphone continues to maintain its original locked right earphone state. In some specific implementations of this embodiment, after either earphone is powered off and its original locked left / right state is cleared, monitoring can continue. When it is detected that the earphone has switched back to a powered-on state, after the earphone re-handshakes with the other earphone, the left / right state of the first earphone can be determined based on the locked left / right state of the other earphone, and the locked left / right state of the first earphone can be re-locked. For example, if the first earphone is powered off and then powered on during use, the locked right earphone state of the second earphone can be used to re-determine the first earphone as the left earphone, and the re-determined left earphone state of the first earphone can be locked.

[0104] In this embodiment, when a connection is detected between the first and second earpieces, their locked left / right states are maintained. For example, assuming the first earpiece is initially locked as the left earpiece and the second earpiece as the right earpiece, and during earpiece use, a continuous connection is detected between the first and second earpieces, then the first earpiece remains locked as the left earpiece, and the second earpiece remains locked as the right earpiece. When the connection between the first and second earpieces is detected to be broken, but both earpieces are still powered on, their original locked left / right states are retained. For example, assuming the first earpiece is initially locked as the left earpiece and the second earpiece as the right earpiece, during earpiece use, pairing between the two earpieces is lost due to factors such as exceeding the maximum connection range or being in a strong interference area, causing the connection between the first and second earpieces to break, but both earpieces are still powered on. In this case, the original locked left / right states of the first and second earpieces can be retained; that is, the first earpiece remains locked as the left earpiece, and the right earpiece remains locked as the right earpiece. Based on this embodiment, the method for determining the left and right states of smart headphones can be applied to more headphone usage scenarios.

[0105] In some embodiments of this application, please refer to Figure 10 , Figure 10 A flowchart illustrating a method for swapping the left and right states of the earphones in the left and right state determination method provided in this application embodiment is shown below. Details are as follows:

[0106] S101: Obtain the command to switch the left and right states of the headphones;

[0107] S102: According to the left and right state switching instruction of the earphone, the left and right states of the first earphone and the second earphone are swapped.

[0108] In this embodiment, after the left and right states of the first and second earphones are locked, the left and right states of the two earphones cannot be automatically switched. It is understood that the locking of the left and right states of the first and second earphones is relative and can be changed through manual intervention. For example, in this embodiment, the first or second earphone can obtain a left / right state switching command based on user operation. For instance, if the user clicks the control button of the first or second earphone three times consecutively or presses and holds the control button of the first or second earphone for 10 seconds, the first or second earphone will automatically generate a left / right state switching command, thus obtaining the command. After obtaining the command, the first or second earphone can further swap the left and right states of the first and second earphones according to the command. For example, suppose that after the left and right states of the first and second earphones are locked, the first earphone is the left earphone and the second earphone is the right earphone. When the user presses and holds the control button on the first earpiece for 10 seconds, the first earpiece automatically generates a left / right switch command based on the user's action and switches its left earpiece to right earpiece mode accordingly. The second earpiece, upon detecting this switch, adaptively switches its right earpiece back to left earpiece mode, thus completing the left / right switch between the first and second earpieces. This embodiment allows for more flexible responses to users' actual earpiece usage needs, improving the user experience.

[0109] It is understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0110] In some embodiments of this application, please refer to Figure 11 , Figure 11 This is a basic structural block diagram of a left / right state determination device for a smart headset, provided as an embodiment of this application. In this embodiment, the device includes units used to perform the steps described in the above method embodiments. Please refer to the relevant descriptions in the above method embodiments for details. For ease of explanation, only the parts relevant to this embodiment are shown. Figure 11As shown, the left / right state determination device for smart earphones includes: a judgment module 111, a first determination module 112, and a second determination module 113. Specifically: the judgment module 111 determines whether the first earphone and the second earphone are in a connected state. The first determination module 112, if the first earphone and the second earphone are in a connected state, obtains the first power-on time corresponding to the first earphone and the second power-on time corresponding to the second earphone, compares the first power-on time and the second power-on time to determine the power-on order of the first earphone and the second earphone, and determines the left / right state of each earphone based on the power-on order. The second determination module 113, if the first earphone and the second earphone are not in a connected state, determines the left / right state of either the first earphone or the second earphone according to default settings.

[0111] It should be understood that the left and right state determination device of the above-mentioned smart earphone corresponds one-to-one with the left and right state determination method of the above-mentioned smart earphone, and will not be described again here.

[0112] In some embodiments of this application, please refer to Figure 12 , Figure 12 This is a basic structural block diagram of an electronic device provided in an embodiment of this application. The electronic device can be a headset or a terminal device. The implementation of this embodiment can be achieved by two headsets working together, or by the headset and the terminal device together, or by the terminal device independently. Figure 12 As shown, the electronic device 12 of this embodiment includes: a processor 121, a memory 122, and a computer program 123 stored in the memory 122 and executable on the processor 121, such as a program for determining the left and right states of smart headphones. When the processor 121 executes the computer program 123, it implements the steps in each embodiment of the left and right state determination method for smart headphones described above. Alternatively, when the processor 121 executes the computer program 123, it implements the functions of each module in the embodiment corresponding to the left and right state determination device for smart headphones described above. Please refer to the relevant descriptions in the embodiments for details, which will not be repeated here.

[0113] For example, the computer program 123 can be divided into one or more modules (units), which are stored in the memory 122 and executed by the processor 121 to complete this application. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 123 in the electronic device 12. For example, the computer program 123 can be divided into a judgment module, a first determination module, and a second determination module, with the specific functions of each module as described above.

[0114] The electronic device may include, but is not limited to, a processor 121 and a memory 122. Those skilled in the art will understand that... Figure 12 This is merely an example of electronic device 12 and does not constitute a limitation on electronic device 12. It may include more or fewer components than shown, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.

[0115] The processor 121 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0116] The memory 122 can be an internal storage unit of the electronic device 12, such as a hard disk or RAM of the electronic device 12. The memory 122 can also be an external storage device of the electronic device 12, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the electronic device 12. Furthermore, the memory 122 can include both internal and external storage units of the electronic device 12. The memory 122 is used to store the computer program and other programs and data required by the electronic device. The memory 122 can also be used to temporarily store data that has been output or will be output.

[0117] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0118] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above. In this embodiment, the computer-readable storage medium can be either non-volatile or volatile.

[0119] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps described in the various method embodiments above.

[0120] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0121] If the integrated module / unit is implemented as 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, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0122] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0123] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for determining the left and right states of a smart earphone, characterized in that, The first and second earphones are two earphones from the same pair of earphones, and the method includes: Determine whether the first earphone and the second earphone are connected. When the first earphone and the second earphone are connected, the first power-on time corresponding to the first earphone and the second power-on time corresponding to the second earphone are obtained to determine the power-on order of the first earphone and the second earphone, and the left and right states of the first earphone and the second earphone are determined according to the power-on order of the first earphone and the second earphone; wherein, the power-on order of the first earphone and the second earphone is determined by comparing the difference between the power-on times of the first earphone and the second earphone; the first power-on time corresponding to the first earphone is represented by the duration of the handshake phase before communication begins after the first earphone is powered on and establishes communication with the second earphone or terminal device; the second power-on time is represented by the duration of the handshake phase before communication begins after the second earphone is powered on and establishes communication with the first earphone or terminal device. If the first and second earphones are not connected, the left or right state of the first or second earphones will be determined according to the default settings.

2. The method for determining the left and right states of smart headphones according to claim 1, characterized in that, Before the step of determining the left and right states of the first and second earphones respectively based on the order in which they are turned on, the method further includes: A first determination rule is set, wherein the first determination rule is either to determine the earphone that is powered on first as the left earphone state or to determine the earphone that is powered on first as the right earphone state. The step of determining the left and right states of the first and second earphones respectively based on the order in which they are powered on includes: When the first determination rule is set to determine the earphone that is turned on first as the left earphone, if the first earphone is turned on before the second earphone, then the first earphone is determined to be the left earphone and the second earphone is determined to be the right earphone; if the first earphone is turned on after the second earphone, then the first earphone is determined to be the right earphone and the second earphone is determined to be the left earphone. When the first determination rule is set to identify the earphone that powers on first as the right earphone, if the first earphone powers on before the second earphone, then the first earphone is identified as the right earphone and the second earphone is identified as the left earphone; if the first earphone powers on after the second earphone, then the first earphone is identified as the left earphone and the second earphone is identified as the right earphone.

3. The method for determining the left and right states of smart headphones according to claim 2, characterized in that, The step of setting a first determination rule, wherein the first determination rule is either determining the earphone that powers on first as the left earphone state or determining the earphone that powers on first as the right earphone state, further includes: Obtain the instruction to switch the first judgment rule; According to the first determination rule switching instruction, the first determination rule is reversed.

4. The method for determining the left and right states of smart headphones according to claim 1, characterized in that, The step of determining the order in which the first and second earphones are turned on includes: The first boot time is compared with the second boot time to determine whether the first boot time is greater than the second boot time. If the first power-on time is greater than the second power-on time, then the first earphone is determined to power on before the second earphone; if the first power-on time is less than the second power-on time, then the first earphone is determined to power on after the second earphone.

5. The method for determining the left and right states of smart headphones according to claim 4, characterized in that, After the step of comparing the first boot time with the second boot time, the method further includes: If the first power-on time is equal to the second power-on time, then obtain the first battery value corresponding to the first earphone and the second battery value corresponding to the second earphone; Based on the relationship between the first battery level and the second battery level, the left and right states of the first and second earphones are determined respectively.

6. The method for determining the left and right states of smart headphones according to claim 5, characterized in that, Before the step of determining the left and right states of the first and second earphones respectively based on the relationship between the first and second battery levels, the method further includes: A second determination rule is set, wherein the second determination rule is either to determine the earphone with the larger battery value as the left earphone state or to determine the earphone with the larger battery value as the right earphone state; The step of determining the left and right states of the first and second earphones respectively based on the relationship between the first and second battery levels includes: When the second determination rule is set to identify the earphone with the larger battery value as the left earphone, if the first battery value is greater than the second battery value, then the first earphone is identified as the left earphone and the second earphone is identified as the right earphone; if the first battery value is less than the second battery value, then the first earphone is identified as the right earphone and the second earphone is identified as the left earphone. When the second determination rule is set to identify the earphone with the larger battery value as the right earphone, if the first battery value is greater than the second battery value, then the first earphone is identified as the right earphone and the second earphone is identified as the left earphone; if the first battery value is less than the second battery value, then the first earphone is identified as the left earphone and the second earphone is identified as the right earphone.

7. The method for determining the left and right states of smart headphones according to claim 1, characterized in that, The step of determining whether the first earphone and the second earphone are connected includes: After the first earphone is powered on, the first earphone is monitored for a first preset time period, and after the second earphone is powered on, the second earphone is monitored for a second preset time period. If a direct handshake between the first earphone and the second earphone is detected within the first preset time or the second preset time, it is determined that the first earphone and the second earphone are in a first connection state. If a handshake is detected between the first earphone and the terminal device within the first preset time period and a handshake is detected between the second earphone and the terminal device within the second preset time period, then it is determined that the first earphone and the second earphone are in a second connection state. If it is detected that the first earphone does not directly shake hands with the second earphone and the first earphone shakes hands with the terminal device but the second earphone does not shake hands with the terminal device within the first preset time, then it is determined that the first earphone and the second earphone are in a disconnected state. If it is detected that the second earphone does not directly shake hands with the first earphone and the second earphone shakes hands with the terminal device but the first earphone does not shake hands with the terminal device within the second preset time, then it is determined that the first earphone and the second earphone are in a disconnected state. If it is detected within the first preset time that the first earphone does not directly shake hands with the second earphone and does not shake hands with the terminal device, then it is determined in the first earphone that the first earphone and the second earphone are in a disconnected state. If it is detected within the second preset time that the second earphone has not shaken hands with the first earphone and has not shaken hands with the terminal device, then it is determined in the second earphone that the first earphone and the second earphone are in a disconnected state.

8. The method for determining the left and right states of smart headphones according to claim 7, characterized in that, If the first earphone and the second earphone are in a first connection state, the step of obtaining the first power-on time corresponding to the first earphone and the second power-on time corresponding to the second earphone includes: A timer is started when the first earpiece is powered on and stopped when the first earpiece shakes hands with the second earpiece, obtaining a first timeout duration. This first timeout duration is then determined as the first power-on time corresponding to the first earpiece. The timing starts when the second earphone is powered on and stops when the first earphone shakes hands with the second earphone, thus obtaining a second timing duration. The second timing duration is then determined as the second power-on time corresponding to the second earphone.

9. The method for determining the left and right states of smart headphones according to claim 7, characterized in that, If the first earphone and the second earphone are in a second connection state, the step of obtaining the first power-on time corresponding to the first earphone and the second power-on time corresponding to the second earphone includes: A timer starts when the first earpiece is powered on and stops when the first earpiece shakes hands with the terminal device, obtaining a third timing duration. This third timing duration is then determined as the first power-on time corresponding to the first earpiece. The timing starts when the second earpiece is powered on and stops when the second earpiece shakes hands with the terminal device, thus obtaining a fourth timing duration. The fourth timing duration is then determined as the second power-on time corresponding to the second earpiece.

10. The method for determining the left and right states of smart headphones according to claim 7, characterized in that, The step of determining the left or right state of the first or second earphone according to default settings when the first earphone and the second earphone are not connected includes: If it is determined at the first preset time that the first earphone and the second earphone are in a disconnected state, then by default the first earphone is powered on before the second earphone, so that the left and right states of the first earphone are determined according to the first earphone being powered on before the second earphone; and / or If it is determined at the second preset time that the first earphone and the second earphone are in a disconnected state, then by default the second earphone is powered on before the first earphone, so that the left and right states of the second earphone are determined according to the second earphone being powered on before the first earphone.

11. The method for determining the left and right states of smart headphones according to claim 1, characterized in that, After determining the left and right states of the first and second earphones respectively, the method further includes: Lock the left and right states of the first and second earphones, and monitor the first and second earphones in real time; When it is detected that either the first earphone or the second earphone has switched to the power-off state, the left and right lock states of the first earphone are cleared, while the left and right lock states of the other earphone are retained. When it is detected that the first earphone and the second earphone are in a connected state or the connection is broken but both the first earphone and the second earphone are powered on, the left and right states of the first earphone and the second earphone are kept locked.

12. The method for determining the left and right states of smart headphones according to claim 11, characterized in that, After the step of detecting that either the first or the second earphone has switched to a power-off state, clearing the left / right lock status of the first earphone, and retaining the left / right lock status of the other earphone, the method further includes: When it is detected that any of the earphones has switched back to the power-on state, after the earphones re-shake hands with the other earphone, the left and right states of the earphones are determined according to the locked left and right states of the other earphone, and the left and right states of the earphones are re-locked.

13. The method for determining the left and right states of smart headphones according to claim 11, characterized in that, After the step of locking the left and right states of the first and second earphones, the method further includes: Obtain the command to switch between left and right headphone states; According to the left / right state switching command of the earphone, the left and right states of the first earphone and the second earphone are swapped.

14. A device for determining the left and right states of a smart earphone, characterized in that, The first and second earphones are two earphones from the same pair, including: The determination module is used to determine whether the first earphone and the second earphone are in a connected state; The first determining module is configured to, if the first earphone and the second earphone are in a connected state, obtain the first power-on time corresponding to the first earphone and the second earphone, and the second power-on time corresponding to the second earphone, to determine the power-on order of the first earphone and the second earphone, and determine the left and right states corresponding to the first earphone and the second earphone respectively based on the power-on order of the first earphone and the second earphone; wherein, the power-on order of the first earphone and the second earphone is determined by comparing the difference between the power-on times of the first earphone and the second earphone; the first power-on time corresponding to the first earphone is represented as the duration of the handshake phase before communication begins after the first earphone is powered on and establishes communication with the second earphone or terminal device; the second power-on time is represented as the duration of the handshake phase before communication begins after the second earphone is powered on and establishes communication with the first earphone or terminal device. The second determining module is used to determine the left or right state of the first or second earphone according to the default settings if the first earphone and the second earphone are not in a connected state.

15. A pair of headphones, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 13.

16. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 13.

17. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 13.

Citation Information

Patent Citations

  • Method, terminal and system for realizing multichannel stereo output

    CN105282660A

  • Earphone master-slave state assignment method and device

    CN109151644A