Method for identifying left earphone and right earphone, storage medium and earphone

By collecting and processing attitude parameters through the internal accelerometer of the earphone, the earphone wearing position can be identified, which solves the problems of hardware dependence and computing power consumption in the existing technology, realizes adaptive left and right earphone recognition, reduces power consumption and improves user experience.

CN121692001APending Publication Date: 2026-03-17JIANGXI RUISHENG ELECTRONIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing headphones require additional hardware and consume a lot of computing power to identify the wearing position of the left and right earphones, resulting in low accuracy and timeliness of identification.

Method used

Initial posture parameters are collected by the accelerometer inside the earphone, and specific posture parameters are obtained after preprocessing. The wearing position of the earphone is identified based on the motion trend information, reducing the use of additional hardware and reducing the chip computing power consumption.

Benefits of technology

It achieves adaptive recognition of the left and right earphones, reduces power consumption, improves recognition efficiency and accuracy, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121692001A_ABST
    Figure CN121692001A_ABST
Patent Text Reader

Abstract

The invention discloses a method for identifying left and right earphones, a storage medium and earphones. The method comprises the following steps: detecting whether a user takes an earphone in an earphone box in an open box state or not; if yes, triggering an acceleration sensor in the earphone to collect initial posture parameters from the time when the user takes the earphone to the time when the user wears the earphone; preprocessing the initial attitude parameter to obtain a specific attitude parameter; based on the specific posture parameters, obtaining motion trend information of the earphone; and recognizing wearing position information of the earphone according to the motion trend information. Compared with the prior art, the motion trend information of the earphone is obtained through the initial posture parameters of the earphone collected by the acceleration sensor in the earphone, and then the wearing position information of the earphone is recognized, so that the use of additional hardware is reduced, the occupation of a wearing position recognition function on chip computing power is reduced, the power consumption of the earphone is reduced, and the user experience is improved. The self-adaptive identification without distinguishing wearing of the left earphone and the right earphone is realized, and the use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of headphone technology, and in particular to a method for identifying left and right headphones, a storage medium, and headphones. Background Technology

[0002] In existing headphone assemblies, the left earpiece is usually marked with an "L" and the right earpiece with an "R," allowing users to distinguish between the left and right earpieces. With advancements in electronic technology, some clip-on headphones are now adopting a design where both earpieces are identical, eliminating the need to differentiate between left and right ears. Instead, the headphones automatically identify the wearing position. However, existing methods of earpiece position recognition require additional hardware, consuming significant computing power from the headphone chip, and resulting in relatively lower accuracy and timeliness.

[0003] Therefore, it is necessary to provide a method for left and right earphone identification, a storage medium, and earphones to solve the above problems. Summary of the Invention

[0004] In view of the shortcomings of the existing technology, the present invention provides a method, storage medium and earphone for left and right earphone identification, which can reduce the use of additional hardware, reduce the chip computing power occupation of the wearing position identification function, realize the non-distinguishing wearing of left and right earphones, and improve the user experience.

[0005] To achieve the above objectives, a first aspect of the present invention provides a method for left and right earphone recognition, the steps of which include:

[0006] Detect whether the user has taken the earphones from the earphone case when it is open;

[0007] If so, the accelerometer inside the earphones will be triggered to collect the initial posture parameters from when the user takes the earphones out to when the earphones are worn.

[0008] Preprocess the initial attitude parameters to obtain specific attitude parameters;

[0009] Based on specific posture parameters, the motion trend information of the headphones is obtained;

[0010] Based on motion trend information, the wearing position information of the headphones can be identified.

[0011] In one implementation, the step of detecting whether the user has taken the earphones from the earphone case in the opened state includes:

[0012] Check if the earphone case is open;

[0013] If so, check whether the contacts between the earphones and the earphone case are conductive.

[0014] In one implementation, the step of triggering the accelerometer in the earphones to acquire initial posture parameters from the time the user takes the earphones out to the time the earphones are worn includes:

[0015] If the system detects that the user has taken the earphones out of the earphone case, it will activate the accelerometer inside the earphones.

[0016] Detect whether headphones are being worn;

[0017] If so, stop the accelerometer and obtain the initial attitude parameters.

[0018] In one implementation, the step of preprocessing the initial attitude parameters to obtain specific attitude parameters includes:

[0019] Obtain the acquisition duration from the accelerometer;

[0020] Based on the acquisition time and the preset comparison time, the first attitude parameters are obtained from the initial attitude parameters;

[0021] The first attitude parameters are filtered to obtain specific attitude parameters.

[0022] In one implementation, the step of obtaining the first attitude parameters from the initial attitude parameters based on the acquisition duration and a preset comparison duration includes:

[0023] Determine whether the data collection time is greater than the comparison time;

[0024] If so, the initial attitude parameters corresponding to the preset first duration will be used as the first attitude parameters;

[0025] If not, the initial attitude parameters corresponding to the acquisition duration will be used as the first attitude parameters.

[0026] In one implementation, the step of obtaining motion trend information of the headphones based on specific posture parameters includes:

[0027] Based on a preset division method, specific attitude parameters are divided into several attitude parameter intervals;

[0028] Based on the positive and negative changes of specific attitude parameters within the attitude parameter range, the motion trend information corresponding to the attitude parameter range is determined.

[0029] In one implementation, the step of identifying the wearing position information of the headphones based on motion trend information includes:

[0030] Obtain the matching degree between exercise trend information and preset exercise modes;

[0031] Determine whether the match is within the preset matching range;

[0032] If so, then determine the wearing position of the headphones to be the wearing position corresponding to the target mode;

[0033] If not, the wearing position information of the headphones is determined based on the type and quantity of motion trend information.

[0034] In one implementation, after identifying the wearing position information of the headphones based on motion trend information, the method further includes:

[0035] Detect whether a switching signal has been received;

[0036] If so, switch the current headphone wearing position information.

[0037] A second aspect of the present invention provides a computer-readable storage medium comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for left and right earphone recognition described above.

[0038] A third aspect of the present invention provides an earphone, the earphone including a left earphone and a right earphone, the left earphone and the right earphone respectively implementing the steps of the left and right earphone recognition method of any of the above claims.

[0039] The beneficial effects of this invention are as follows: by collecting the initial posture parameters of the earphone through the accelerometer inside the earphone, it obtains the motion trend information of the earphone, and then identifies the wearing position information of the earphone. This reduces the use of additional hardware, reduces the chip computing power occupation of the wearing position recognition function, reduces the power consumption of the earphone, realizes adaptive recognition of wearing without distinguishing between left and right earphones, and improves the user experience. Attached Figure Description

[0040] Figure 1 This is a flowchart illustrating the method for identifying left and right earphones disclosed in an embodiment of the present invention.

[0041] Figure 2 This is a schematic diagram of the module structure of the earphone disclosed in an embodiment of the present invention. Detailed Implementation

[0042] In this invention, the terms "set up," "equipped with," and "connected" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral structure; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium, or an internal connection between two devices, elements, or components. Those skilled in the art can understand the specific meaning of these terms in this invention according to the specific circumstances.

[0043] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0044] Furthermore, in addition to indicating direction or positional relationship, some of the aforementioned terms may also have other meanings. For example, the term "above" may also be used in certain situations to indicate a dependency or connection. Those skilled in the art can understand the specific meaning of these terms in this invention based on the specific circumstances.

[0045] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0046] The left and right earphone recognition method provided in this application is mainly applied to earphones, such as TWS earphones and OWS earphones. It obtains the earphone's motion trend information by collecting the initial posture parameters of the earphone through the accelerometer inside the earphone, and then identifies the earphone's wearing position information. This reduces the use of additional hardware, reduces the chip's computing power occupation for the wearing position recognition function, reduces the earphone's power consumption, realizes adaptive recognition of left and right earphones without distinguishing between wearing positions, and improves the user experience.

[0047] The following is the content of the first aspect of the present invention:

[0048] Please refer to Figure 1 In this embodiment, the steps of the left and right earphone recognition method include:

[0049] S1. Detect whether the user has taken the earphones from the earphone case, which is in an open state;

[0050] S2. If so, the accelerometer inside the earphone is triggered to collect the initial posture parameters from when the user takes the earphone to when the earphone is worn.

[0051] S3. Preprocess the initial attitude parameters to obtain specific attitude parameters;

[0052] S4. Based on specific posture parameters, obtain the motion trend information of the headphones;

[0053] S5. Based on motion trend information, identify the wearing position information of the headphones.

[0054] An accelerometer is installed inside the earphone, with its central axis parallel to the earphone's axis, to detect the earphone's acceleration parameters along three axes. Initial attitude parameters are the earphone's acceleration parameters along the three axes, while specific attitude parameters are pre-processed versions of the initial attitude parameters used to determine the earphone's motion trend. Motion trend information refers to the earphone's motion state over a specific time period. Wearing position information includes left and right position information, indicating whether the earphone is worn on the user's left or right ear.

[0055] The posture parameters required for adaptively determining the earphone wearing position are the posture parameters corresponding to the time period from when the user takes the earphone to when the user finishes wearing the earphone. Therefore, it is necessary to first determine whether the user has taken the earphone from the earphone case, that is, it is necessary to first detect whether the user has taken the earphone from the earphone case. Specifically, it first detects whether the earphone case is in the open state. If the earphone case is in the open state, it then detects whether the electrical connection between the earphone case and the earphone is broken. When it is detected that the electrical connection between the earphone and the earphone case is broken, it can be determined that the user has taken the corresponding earphone from the earphone case, and then the preset acceleration sensor inside the earphone is activated.

[0056] After the accelerometer inside the earphones is activated, it collects posture parameters from the time the user picks up the earphones until they are worn, using these parameters as initial posture parameters. It's easy to understand that by limiting the collection of posture parameters by the accelerometer to the period from when the user picks up the earphones to when they are worn, the amount of posture parameters collected by the accelerometer is reduced, decreasing data processing complexity and unnecessary power consumption, while improving the response efficiency for recognizing the earphone wearing position. Specifically, after the user picks up the earphones, the accelerometer can detect whether the earphones are being worn, and trigger the cessation of data collection based on the wearing signal.

[0057] After collecting the initial posture parameters from when the user picks up the earphones to when they put them on, these parameters need to be preprocessed to obtain specific posture parameters containing feature information. Specifically, this preprocessing can be done by adjusting the acquisition duration and using specific parameter filtering. It's easy to understand that during the actual process of a user wearing the earphones, there are various situations such as the earphones remaining still or the user's hand shaking. By adjusting the acquisition duration and using specific filtering, the number of posture parameters that need to be processed subsequently can be effectively reduced, while improving the accuracy of the earphone motion trend information determined based on these specific posture parameters.

[0058] After obtaining specific posture parameters, analyzing these parameters reveals the headphone's motion trend information. Specifically, data analysis can be performed on specific posture parameters along a single axis, either holistically or segmentally, or on specific posture parameters across multiple axes, to determine the headphone's corresponding motion trend information. The choice can be made based on the actual hardware performance and design requirements.

[0059] After obtaining the corresponding motion trend information, and combining it with the wearing motion trajectory characteristics of the left and right earphones, the wearing position information of the earphones can be identified. Specifically, during the wearing process, the wearing trajectory characteristics of the left and right earphones are different. By observing the positive and negative changes of specific posture parameters of the earphones and / or the number of trend types in the motion trend information, the wearing mode corresponding to the current earphone wearing can be determined. Thus, the wearing position information of the earphones can be determined solely by the accelerometer sensor configured inside the earphones.

[0060] Understandably, this application obtains the motion trend information of the headphones by collecting the initial posture parameters of the headphones through the accelerometer inside the headphones, and then identifies the wearing position information of the headphones. This reduces the use of additional hardware, reduces the chip computing power occupation of the wearing position recognition function, reduces the power consumption of the headphones, realizes adaptive recognition of wearing without distinguishing between left and right headphones, and improves the user experience.

[0061] Furthermore, in one embodiment, step S1 of detecting whether the user has taken the earphones from the earphone case in the opened state includes:

[0062] S11. Check if the earphone case is in the open state;

[0063] S12. If yes, then check whether the contacts between the earphone and the earphone case are conductive.

[0064] Smart earbuds such as TWS or OWS earbuds are usually stored in an earbud case, and the earbuds are connected to the earbud case via a charging post. When the user needs to use the earbuds, they need to open the earbud case first and then take the earbuds out of the earbud case. Therefore, in order to realize the earbud wearing position recognition function, it is necessary to first determine whether the user has taken the earbuds out of the earbud case when it is open.

[0065] Preferably, the headphone case contains a magnet and a Hall sensor. The interaction between the Hall sensor and the magnet can detect whether the headphone is in the open state. When the user opens or closes the headphone case, the top cover of the headphone case rotates, causing the magnet to rotate. This changes the magnetic field strength at the sensing area of ​​the Hall sensor. The Hall sensor detects the change in magnetic field strength and outputs a corresponding detection signal, thereby determining whether the headphone case is in the open state.

[0066] Once the earphone case is confirmed to be open, the system can determine whether the user has taken the earphones out by checking if the contact points between the earphones and the case are conductive. Specifically, if the contact points between the earphones and the case are conductive, it means the user has not taken the earphones out of the case; if the contact points are not conductive, it means the user has taken the earphones out of the case.

[0067] Understandably, by detecting the open state of the earphone case and the continuity of the charging contacts, the accuracy of detecting whether the user has taken the earphones is improved, which can effectively reduce the frequent activation of the subsequent accelerometer and improve the earphone's battery life to a certain extent.

[0068] Furthermore, in one embodiment, step S2, which triggers the accelerometer within the earphones to collect initial posture parameters from the time the user takes the earphones out until the earphones are worn, includes:

[0069] S21. If the user is detected taking the earphones out of the earphone case, the accelerometer inside the earphones will be activated.

[0070] S22. Check if the headphones are being worn;

[0071] S23. If so, stop the accelerometer and obtain the initial attitude parameters.

[0072] After a user takes the earphones out of the charging case, the user may put them directly into their ears or put them on after a period of time. When a user wears the earphones, there are corresponding wearing trajectory characteristics. Therefore, after detecting that the user has taken the earphones out of the charging case, it is necessary to collect posture data within a specific time period for subsequent identification of the user's wearing trajectory characteristics, and thus identify the wearing position of the earphones.

[0073] Upon detecting that a user has removed the earbuds from the charging case, the accelerometer and wear detection sensor installed inside the earbuds are activated. The accelerometer begins collecting the earbuds' posture data, and the wear detection sensor detects whether the earbuds are being worn. Specifically, the wear detection sensor includes, but is not limited to, capacitive sensors, infrared optical sensors, and pressure sensors; preferably, the wear detection sensor is a capacitive sensor. Once the wear detection sensor detects that the user is wearing the earbuds, the accelerometer stops collecting data and uses the posture data collected by the accelerometer during the period from when the user removes the earbuds from the charging case to when they are being worn as the initial posture parameters.

[0074] Understandably, by collecting the earphone's posture data during the period from when the user takes the earphone out of the case to when they put it on, as the initial posture parameters, data redundancy is reduced to some extent, the power consumption of the earphone is reduced, the accuracy of the posture data used for subsequent user wearing trajectory feature recognition is improved, and the response efficiency for subsequent identification of earphone wearing position information is also improved.

[0075] Furthermore, in one embodiment, step S3, which preprocesses the initial attitude parameters to obtain specific attitude parameters, includes:

[0076] S31. Obtain the acquisition time of the accelerometer;

[0077] S32. Based on the acquisition time and the preset comparison time, obtain the first attitude parameters from the initial attitude parameters;

[0078] S33. Filter the first attitude parameters to obtain specific attitude parameters.

[0079] The acquisition duration is the time period from when the user takes the earphones out of the case to when they are worn. The comparison duration is a pre-set duration used to divide the acquisition duration into different scenarios. The first attitude parameter is the attitude data obtained after filtering the initial attitude parameters based on the acquisition duration. The specific attitude parameter is the attitude parameter obtained by filtering the first attitude parameter at a specific frequency.

[0080] During the process of a user taking the earphones out of the charging case and putting them on, there are various scenarios. After obtaining the initial attitude parameters from the accelerometer, to reduce data complexity and improve the accuracy of subsequently determining the trajectory features of earphone wearing and identifying the wearing position, the initial attitude parameters need to be preprocessed. Specifically, the initial attitude parameters can be processed based on the acquisition duration and / or small-amplitude, high-frequency repetitive changes in acceleration.

[0081] After obtaining the initial attitude parameters from the accelerometer, the data acquisition duration of the accelerometer is first determined. Since the user may not put the headphones on promptly after taking them out and then putting them on, the initial attitude parameters can be initially filtered based on the acquisition duration. After obtaining the acquisition duration, it can be compared with a preset comparison duration to identify corresponding situations, and then the required first attitude parameters can be obtained from the initial attitude parameters.

[0082] In one implementation, step S32, which obtains the first attitude parameter from the initial attitude parameters based on the acquisition duration and a preset comparison duration, includes:

[0083] S321. Determine whether the acquisition time is greater than the comparison time;

[0084] S322. If so, the initial attitude parameters corresponding to the preset first duration shall be used as the first attitude parameters.

[0085] S323. If not, the initial attitude parameters corresponding to the acquisition duration shall be used as the first attitude parameters.

[0086] The first duration is a preset interception duration, and its termination time is the moment when the user is detected wearing headphones. That is, the preset interception duration calculated backward from the termination time is used as the first duration.

[0087] After obtaining the data collection duration, it is determined whether the duration exceeds a preset comparison duration to identify the specific circumstances during the user's process of picking up and putting on the headphones. Specifically, during this process, the user may put on the headphones within a short time interval or over a longer period; therefore, it is necessary to compare the data collection duration with the preset comparison duration.

[0088] When the collection time is greater than the comparison time, it means that the user took the headphones and then put them on after a relatively long time interval. During this period, the accelerometer in the headphones collected a relatively large amount of attitude data. In order to reduce the complexity of the attitude data to be processed, the collected data can be preliminarily processed based on the time dimension. That is, the initial attitude parameters corresponding to the preset first time can be used as the first attitude parameters to remove redundant data and improve the efficiency of subsequent data processing.

[0089] When the acquisition time is determined to be no greater than the comparison time, it means that the user put on the headphones after a relatively short time interval after taking them out. During this process, the accelerometer inside the headphones acquired an appropriate amount of attitude data. The complexity of processing the attitude data is relatively moderate, so the initial attitude parameters corresponding to the acquisition time can be directly used as the first attitude parameters.

[0090] Understandably, by comparing the acquisition time with the preset comparison time, the user's situation during the wearing of the headphones can be determined. Then, based on the time dimension, the attitude data collected by the accelerometer can be pre-processed, which can effectively reduce the redundancy of the initial attitude parameters, improve the efficiency of subsequent data processing, and reduce the occupation of chip computing power.

[0091] During the process of a user picking up and putting on the earphones, the user's hand may experience slight tremors or vibrations. The accelerometer inside the earphones records this redundant data. Therefore, after obtaining the first posture parameters based on time-dimensional preprocessing, further filtering can be performed on these first posture parameters to remove high-frequency recurring posture parameters, thereby obtaining specific posture parameters. It can be understood that by filtering specific frequencies, the redundancy of the first posture parameters can be further reduced, improving the efficiency and accuracy of using subsequent specific posture parameters to determine motion trend information, and thus improving the accuracy of identifying the earphone wearing position.

[0092] Furthermore, in one embodiment, step S4, which obtains the motion trend information of the headphones based on specific posture parameters, includes:

[0093] S41. Based on a preset division method, a specific attitude parameter is divided into several attitude parameter intervals;

[0094] S42. Based on the positive and negative changes of specific attitude parameters within the attitude parameter range, determine the motion trend information corresponding to the attitude parameter range.

[0095] The attitude parameter range is a set of specific attitude parameters. The motion trend information is the overall motion trend corresponding to that range, determined based on the specific attitude parameters within that range.

[0096] Specifically, after obtaining specific posture parameters, they can be divided based on an equal division method, that is, dividing all the obtained specific posture parameters according to the same specific time interval; or based on a weighted division method, that is, dividing all the obtained specific posture parameters according to different time interval sizes. In a preferred embodiment, the specific posture parameters can be divided into several posture parameter intervals according to the weighted division method. Specifically, the closer to the time when the headphones are worn, the higher the weight, that is, the time interval closer to the time when the headphones are worn is relatively smaller. It is easy to understand that by using a specific division method, motion trend information that better represents the motion state of the headphones can be obtained, thereby improving the accuracy of subsequent identification of the headphone wearing position.

[0097] After obtaining several attitude parameter ranges, the corresponding motion trend information is determined based on the positive and negative changes of specific attitude parameters within these ranges. Specifically, the accelerometer inside the headphones can measure the acceleration of the headphones along a specific axis. For example, when the headphones accelerate in the first direction of the X-axis, a positive value of the specific attitude parameter can be measured; when the headphones decelerate in the first direction of the X-axis or accelerate in the second direction of the X-axis, a negative value of the specific attitude parameter can be measured.

[0098] Understandably, obtaining motion trend information through intervalization can better reduce the interference of individual specific posture parameters on the motion trend information, improve the accuracy of the obtained motion trend information, and to a certain extent reduce the redundancy of subsequent headphone wearing position identification, thereby improving the accuracy of subsequent headphone wearing position identification.

[0099] Furthermore, in one embodiment, step S5, which identifies the wearing position information of the headphones based on motion trend information, includes:

[0100] S51. Obtain the matching degree between exercise trend information and preset exercise modes;

[0101] S52. Determine whether the matching degree is within the preset matching range;

[0102] S53. If yes, then determine that the wearing position of the headphones is the wearing position corresponding to the sports mode;

[0103] S54. If not, determine the wearing position information of the headphones based on the number of trend types in the motion trend information.

[0104] The motion trend information includes acceleration trend information and deceleration trend information. The motion mode is a pre-set pattern corresponding to the overall acceleration and deceleration during the wearing of the headphones. The motion modes include the motion mode corresponding to the left earphone and the motion mode corresponding to the right earphone.

[0105] During the process of a user picking up and putting on the earphones, there are significant differences in the wearing characteristics of the left and right earphones. For example, taking the rightward direction of the X-axis of the accelerometer as positive, when the earphone accelerates to the right, the motion trend is acceleration; when the earphone decelerates to the right or accelerates to the left, the motion trend is deceleration. During the process of the user picking up and putting the earphones into their ears, the wearing trajectory of the right earphone typically shows an overall acceleration trend followed by a deceleration trend; while the wearing trajectory of the left earphone typically shows an overall deceleration trend followed by an acceleration trend.

[0106] After obtaining the motion trend information from the headphones, this information is compared with preset motion modes. Specifically, the motion trend information is compared with the motion modes corresponding to the left and right headphones, respectively, to obtain the corresponding matching degree. After obtaining the matching degree, it is then determined whether the obtained matching degree falls within the matching range.

[0107] When the matching degree falls within the matching range, it indicates that the motion characteristics when wearing the headphones match the corresponding motion pattern. The wearing position information corresponding to the motion pattern is determined as the current wearing position of the headphones, and the corresponding wearing position information is defined as the wearing position of the headphones. For example, when it is determined that the motion trend information when wearing the headphones matches the motion pattern of the left headphone within the matching range, the current wearing position of that headphone is defined as the left headphone. The definition principle for the right headphone is the same as that for the left headphone.

[0108] When the matching degree does not fall within the matching range, the wearing position information of the headphones can be determined by utilizing the number of trend types in the motion trend information. During the wearing of the left and right headphones, the number of acceleration and deceleration trend information values ​​differs depending on the headphone's position. For example, taking the rightward direction of the X-axis of the accelerometer as positive, during the wearing of the left headphone, the number of acceleration values ​​in the X-axis motion trend information is usually greater than the number of deceleration values. It is easy to understand that, based on the determination of the number of trend types in the motion trend information, the wearing position information of the headphones can also be determined to some extent.

[0109] After confirming that the matching degree does not fall within the matching range, the quantity of acceleration and deceleration trend information in the motion trend information is counted separately. Specifically, the statistics can be performed on motion trend information of a single axis or integrated and counted on motion trend information of multiple axes, depending on the actual design requirements. After determining the quantity of acceleration and deceleration trend information, the two quantities are compared, and the wearing position information of the headphones is determined based on the comparison result.

[0110] Understandably, by comparing motion trend information with preset motion patterns and comparing the number of trend types, adaptive confirmation of headphone wearing position information can be achieved, effectively reducing the chip computing power occupied by the wearing position recognition function, reducing headphone power consumption, and improving the response efficiency of left and right headphone recognition.

[0111] Furthermore, in a preferred embodiment, after step S5 of identifying the wearing position information of the headphones based on the motion trend information, the method further includes:

[0112] S6. Detect whether a switching signal has been received;

[0113] S7. If yes, switch the current headphone wearing position information.

[0114] The switching signal is a control signal for switching the current headphone wearing position information.

[0115] After identifying the headphone's wearing position based on motion trend information, errors may occur. Therefore, a mechanism to switch the headphone wearing position information is needed. Specifically, when a user discovers an error in the headphone wearing position recognition, the user can control the switching signal through software on the terminal connected to the headphone, output a switching signal to the headphone, output a corresponding switching signal to the headphone charging case, or operate the headphone itself to output a corresponding switching signal. The choice can be made according to the actual design requirements.

[0116] After identifying the wearing position information of the headphones, the system checks whether a switching signal has been received. If a switching signal is detected, the current wearing position information of the headphones is switched. For example, if the current wearing position information of the headphones is defined as the left headphone, then the current wearing position information of the headphones will be switched from the left headphone to the right headphone. It can be understood that by setting up a switching mechanism, the situation where the headphone wearing position is incorrectly identified can be effectively dealt with, reducing the impact of headphone wearing position recognition errors on the user experience.

[0117] In summary, this application obtains the motion trend information of the earphone by collecting the initial posture parameters of the earphone through the accelerometer inside the earphone, and then identifies the wearing position information of the earphone. This reduces the use of additional hardware, reduces the chip computing power occupation of the wearing position recognition function, reduces the power consumption of the earphone, realizes adaptive recognition of wearing without distinguishing between left and right earphones, and improves the user experience.

[0118] The following is the content of the second aspect of the present invention:

[0119] The present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method for identifying left and right earphones.

[0120] The following is the content of the third aspect of the present invention:

[0121] A third aspect of the present invention provides an earphone, such as Figure 2 As shown, the earphone includes a memory 10, a processor 20, and a left and right earphone recognition method program instruction 30 stored in the memory 10 and executable on the processor 20. When the left and right earphone recognition method program instruction 30 is executed by the processor 20, the aforementioned left and right earphone recognition method is implemented.

[0122] In some embodiments, the processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor is typically used to control the overall operation of the headphones. In this embodiment, the processor is used to run program code stored in a readable storage medium or to process data.

[0123] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0124] The above are merely specific embodiments of this application. It should be noted that those skilled in the art can make several improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method of left and right earphone recognition, characterized in that, The method comprises the following steps: detecting whether a user takes out earphones from an earphone box in an open state; if yes, triggering an acceleration sensor in the earphones to collect initial posture parameters from the user taking out the earphones to wearing the earphones; preprocessing the initial posture parameters to obtain specific posture parameters; obtaining motion trend information of the earphones based on the specific posture parameters; identifying wearing position information of the earphones according to the motion trend information.

2. The method of left and right earphone recognition according to claim 1, wherein, The step of detecting whether a user takes out earphones from an earphone box in an open state comprises: detecting whether the earphone box is in an open state; if yes, detecting whether a contact between the earphones and the earphone box is conductive.

3. The method of left and right earphone recognition according to claim 1, wherein, The step of triggering an acceleration sensor in the earphones to collect initial posture parameters from the user taking out the earphones to wearing the earphones comprises: detecting that the user takes out the earphones from the earphone box, and then starting the acceleration sensor in the earphones; detecting whether the earphones are worn; if yes, stopping the acceleration sensor to obtain the initial posture parameters.

4. The method of left and right earphone recognition according to claim 1, wherein, The step of preprocessing the initial posture parameters to obtain specific posture parameters comprises: obtaining a collection duration of the acceleration sensor; obtaining first posture parameters from the initial posture parameters according to the collection duration and a preset comparison duration; performing filtering processing on the first posture parameters to obtain specific posture parameters.

5. The method of left and right earphone recognition according to claim 4, wherein, The step of obtaining first posture parameters from the initial posture parameters according to the collection duration and a preset comparison duration comprises: determining whether the collection duration is greater than the comparison duration; if yes, taking initial posture parameters corresponding to a preset first duration as the first posture parameters; if no, taking initial posture parameters corresponding to the collection duration as the first posture parameters.

6. The method of left and right earphone recognition according to claim 1, wherein, The step of obtaining motion trend information of the earphones based on the specific posture parameters comprises: dividing the specific posture parameters into posture parameter intervals according to a preset division manner; determining motion trend information corresponding to the posture parameter intervals according to positive and negative value changes of specific posture parameters in the posture parameter intervals.

7. The method of left and right earphone recognition according to claim 1, wherein, The step of identifying wearing position information of the earphones according to the motion trend information comprises: obtaining a matching degree between the motion trend information and a preset motion mode; determining whether the matching degree is in a preset matching interval; if yes, determining that a wearing position of the earphones is a wearing position corresponding to the motion mode; if no, determining wearing position information of the earphones based on a quantity of trend types of the motion trend information.

8. The method of left and right earphone recognition according to claim 1, wherein, The step of identifying wearing position information of the earphones according to the motion trend information further comprises: detecting whether a switching signal is received; if yes, switching the wearing position information of the earphones.

9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. The computer program is executed by a processor to implement steps of the method for identifying left and right earphones according to any one of claims 1 to 8.

10. An earpiece comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement steps of the method for identifying left and right earphones according to any one of claims 1 to 8.