Earphone wearing state detection method and device, electronic equipment and storage medium

By collecting headphone microphone and speaker signals, calculating the sound pressure difference and sound wave energy value, and combining two-dimensional signal fusion to determine the wearing status, the accuracy and stability problems of headphone wearing detection in the existing technology are solved, and high-integration and low-power wearing status detection is achieved.

CN120640186APending Publication Date: 2025-09-12GUANGDONG QINXIANG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510837333.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing headphone wearing detection technology is difficult to improve the accuracy and stability of detection in complex scenarios without increasing hardware costs. In particular, it is challenging to accurately judge the wearing status in dynamically changing scenarios.

Method used

By collecting the microphone signal and speaker signal of the headset, calculating the sound pressure difference value and sound wave energy value, combining two-dimensional signal fusion to judge the wearing status, and using the microphone and speaker modules of the headset for signal collection and processing, accurate detection of the wearing status can be achieved.

Benefits of technology

It significantly improves the robustness and misjudgment tolerance of wearing detection, is suitable for complex sound fields or atypical wearing scenarios, has high integration and low power consumption, and is easy to deploy in existing headphone systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120640186A_ABST
    Figure CN120640186A_ABST
Patent Text Reader

Abstract

The invention discloses an earphone wearing state detection method and device, electronic equipment and a storage medium, and the method comprises the steps: collecting a first detection signal and a second detection signal of a current state of an earphone, respectively calculating a first detection parameter and a second detection parameter, and respectively comparing the two detection parameters with different preset conditions, according to the method, two independent detection parameters are introduced at the same time, the acoustic environment and the physical coupling state of the earphone are reflected respectively, the wearing state is judged through two-dimensional signal fusion, the robustness and misjudgment tolerance of wearing detection are remarkably improved, and the wearing state of the earphone is determined by considering the two comparison results at the same time. The method is especially suitable for accurate judgment in a complex sound field or an atypical wearing scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to earphone wearing detection technology, and in particular to an earphone wearing status detection method, device, electronic equipment and storage medium. Background Art

[0002] In recent years, with the popularity of smart wearable devices such as true wireless stereo (TWS) headphones, users' demand for intelligent interactive experiences has continued to increase. To achieve functions such as automatic playback control, call management, and active noise cancellation switching, headphones need to be able to accurately identify whether the user is wearing them and provide corresponding intelligent responses in different usage scenarios.

[0003] To meet these needs, the industry has proposed a variety of headphone wear detection solutions. Some of these solutions rely on physical sensors, such as infrared proximity sensors, capacitive sensors, or skin contact detection modules, to monitor changes in the distance or contact between the headphone and the ear. These solutions offer advantages such as clear implementation principles and fast response times, but they often rely on additional hardware components, which can increase the complexity of headphone design, increase power consumption, or impose higher requirements on spatial layout, limiting their application in miniaturized headphones.

[0004] Some solutions also attempt to leverage certain system operating parameters or environmental state changes to indirectly infer whether a user is wearing headphones. These technologies typically optimize software algorithms while maintaining fixed hardware resources, offering significant cost advantages. However, in practice, they are susceptible to environmental fluctuations and individual user differences, leading to misjudgments and missed detections. This is especially true in complex scenarios such as low noise levels, weak signals, or improper wear. Detection robustness and accuracy still require improvement.

[0005] While existing headphone wear detection technologies have demonstrated some practicality, they still face technical bottlenecks such as insufficient detection accuracy, poor environmental adaptability, and limited algorithm robustness. Accurately determining wear status in dynamically changing scenarios remains a particular challenge. Therefore, improving the accuracy and stability of wear detection without significantly increasing hardware costs has become a key technical issue that urgently needs to be addressed in this field. Summary of the Invention

[0006] Based on this, the present invention aims to propose a method, device, electronic device and storage medium for detecting the wearing status of headphones, which can determine the wearing status of headphones through infrasound and noise residuals without the need for additional hardware detection, thereby improving the accuracy of wearing detection and user experience.

[0007] In a first aspect, the present invention provides a method for detecting a wearing state of an earphone, comprising:

[0008] After the earphone is removed from the charging compartment, a first detection signal and a second detection signal of the current state of the earphone are collected;

[0009] calculating a first detection parameter according to the first detection signal;

[0010] calculating a second detection parameter according to the second detection signal;

[0011] Comparing the first detection parameter with the first preset condition to obtain a first comparison result, and comparing the second detection parameter with the second preset condition to obtain a second comparison result;

[0012] The wearing state of the earphone is determined according to the first comparison result and the second comparison result.

[0013] Furthermore, collecting the first detection signal includes:

[0014] The first detection signal in the current state of the headset is collected by using the microphone of the headset.

[0015] Furthermore, collecting a first detection signal in a current state of the headset using a microphone of the headset includes:

[0016] The first noise signal and the second noise signal are collected respectively by using a feedforward microphone and a feedback microphone of the earphone, and the first detection signal includes the first noise signal and the second noise signal.

[0017] Further, calculating the first detection parameter according to the first detection signal includes:

[0018] A sound pressure difference value is calculated according to the first noise signal and the second noise signal, and the sound pressure difference value is determined as a first detection parameter.

[0019] Furthermore, collecting the second detection signal includes:

[0020] The speaker of the headset is controlled to play the test sound wave and the sound wave data is collected and recorded as a second detection signal.

[0021] Further, calculating the second detection parameter according to the second detection signal includes:

[0022] Calculate the sound wave energy value corresponding to the sound wave data.

[0023] Furthermore, comparing the first detection parameter with the first preset condition to obtain a first comparison result includes:

[0024] The first comparison result is obtained by comparing the sound pressure difference value with the preset in-ear characteristic value.

[0025] Furthermore, comparing the second detection parameter with the second preset condition to obtain a second comparison result includes:

[0026] The sound wave energy value is compared with a preset ear threshold to obtain a second comparison result.

[0027] Furthermore, determining the wearing state of the earphone according to the first comparison result and the second comparison result includes:

[0028] When both the first comparison result and the second comparison result meet the preset conditions, it is determined that the earphone is in the in-ear state; otherwise, the earphone is in the out-of-ear state.

[0029] Furthermore, determining the wearing state of the earphone according to the first comparison result and the second comparison result includes:

[0030] When the first comparison result does not meet the preset condition, return to executing the acquisition of the first detection parameter until the first preset number of times is reached;

[0031] and / or,

[0032] When the second comparison result does not meet the preset condition, returning to execute collecting the second detection parameter until a second preset number of times is reached;

[0033] The wearing state of the earphone is determined according to the first comparison result and the second comparison result.

[0034] In a second aspect, the present invention provides a device for detecting a wearing state of an earphone, comprising:

[0035] A signal acquisition module, configured to collect a first detection signal and a second detection signal of the current state of the earphone after the earphone is removed from the charging compartment;

[0036] A first parameter calculation module, configured to calculate a first detection parameter according to the first detection signal;

[0037] A second parameter calculation module, configured to calculate a second detection parameter according to the second detection signal;

[0038] a parameter comparison module, configured to compare the first detection parameter with the first preset condition to obtain a first comparison result, and to compare the second detection parameter with the second preset condition to obtain a second comparison result;

[0039] The earphone state determination module is used to determine the wearing state of the earphone according to the first comparison result and the second comparison result.

[0040] In a third aspect, the present invention provides an electronic device comprising a memory storing computer-executable instructions and a processor, wherein when the computer-executable instructions are executed by the processor, the device executes the various steps of the headphone wearing status detection method provided in the first aspect.

[0041] In a fourth aspect, the present invention provides a readable storage medium storing a computer executable program, which, when executed, can implement the various steps of the headphone wearing status detection method provided in the first aspect.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] The present invention proposes a method for detecting the wearing status of an earphone, wherein a first detection signal and a second detection signal of the current status of the earphone are collected, which are respectively used to calculate a first detection parameter and a second detection parameter, and the two detection parameters are respectively compared with different preset conditions to obtain two comparison results. The wearing status of the earphone is determined by considering the two comparison results at the same time. The present invention also introduces two independent detection parameters, which respectively reflect the acoustic environment and physical coupling state of the earphone. The wearing status is judged by two-dimensional signal fusion, which significantly improves the robustness and misjudgment tolerance of the wearing detection, and is particularly suitable for accurate judgment in complex sound fields or atypical wearing scenarios; a further embodiment only relies on the microphone and speaker modules already provided in the conventional configuration of the earphone for signal acquisition, and the relevant judgment process can be completed in the digital signal processor (DSP) on the earphone side, with high integration and low power consumption, and is easy to be quickly deployed and implemented in the existing earphone system. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0045] Figure 1 A flowchart of a method for detecting earphone wearing status according to an embodiment of the present invention;

[0046] Figure 2 A flowchart of a method for detecting earphone wearing status according to another embodiment of the present invention;

[0047] Figure 3 A schematic structural diagram of a headphone wearing status detection device provided by one embodiment of the present invention;

[0048] Figure 4 This is a diagram of the electronic device architecture provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0050] See Figure 1 One embodiment of the present invention provides a method for detecting a wearing state of an earphone, comprising the following steps:

[0051] Step S110: After the earphone is removed from the charging compartment, a first detection signal and a second detection signal of the current state of the earphone are collected.

[0052] This step is used to start the multi-channel acquisition mechanism to acquire data on the external and internal acoustic environments after the earphones are separated from the charging case and enter the ready-to-wear or worn state. The acquisition operation can be triggered by a detection control signal when the earphones are separated from the charging case. For example, it can be automatically started through the disconnection of the charging contacts, the opening signal of the case cover, or the low-power Bluetooth protocol instruction, providing the necessary original acoustic data for the status determination of the subsequent steps.

[0053] Furthermore, the first detection signal is collected by the headset microphone, and the second detection signal is collected by the headset speaker after playing a test sound wave within a specified time window, such as low-frequency / infrasound wave data. In a more specific embodiment, the first detection signal is used to describe the difference in sound pressure inside and outside the ear canal, and the second detection signal represents the energy value of the infrasound wave.

[0054] Specifically, the first detection signal includes collecting a first noise signal and a second noise signal using the headphone's feedforward microphone (FFMIC) and feedback microphone (FBMIC), respectively. The feedforward microphone is typically located on the outside of the headphone, facing the external environment, and is used to capture ambient noise, which is recorded as the first noise signal. The feedback microphone is typically located on the inside of the headphone, facing the ear canal, and is used to capture the actual sound in the ear canal, which is recorded as the second noise signal. This includes the audio played by the headphone and residual noise.

[0055] The second detection signal is a test sound wave played by the speaker of the earphone, such as an infrasound wave, and can usually be received as an ear canal reflection signal by a built-in FBMIC.

[0056] Step S120: Calculate a first detection parameter according to the first detection signal.

[0057] This step processes the first detection signal obtained in step S110 to extract acoustic characteristic parameters reflecting the wearing status. The relevant calculations can be directly completed by the digital signal processor (DSP) on the earphone side directly receiving the signal for processing.

[0058] The sound pressure difference reflects the difference, ratio, or functional relationship between the sound pressure outside the earphone and the sound pressure inside the ear canal. It can be defined and calculated in different ways. When the earphone is not worn, the difference between the inside and outside of the ear canal is small, and the sound pressure difference is typically low (e.g., 0–5dB). When the earphone is worn tightly, the ear canal is closed, and the sound pressure received by the FBMIC is significantly attenuated. The sound pressure difference is typically higher (e.g., 15–30dB). In this case, the sound pressure difference threshold can serve as a basis for judgment.

[0059] Specifically, the signals collected by FFMIC and FBMIC are synchronized to the same time window and preprocessed (such as band-pass filtering and time domain DC drift removal). The effective sound pressure value (RMS) or short-time energy of the feedforward and feedback signals are calculated respectively, and the difference between the feedforward sound pressure and the feedback sound pressure is calculated and recorded as the first detection parameter.

[0060] Step S130: Calculate a second detection parameter according to the second detection signal.

[0061] Specifically, this step analyzes the test sound waves emitted by the speaker to extract an energy indicator representing the degree of coupling. A feedback microphone can then be used to pick up the response signal of the test sound waves within the ear canal. Similarly, the headphone's digital signal processor (DSP) directly receives and processes the signal. When the earphones are worn in the ear canal, the closed acoustic cavity creates an enhanced sound wave reflection, and the collected energy value is significantly higher than when the earphones are not worn.

[0062] Step S140: Compare the first detection parameter with the first preset condition to obtain a first comparison result, and compare the second detection parameter with the second preset condition to obtain a second comparison result.

[0063] This step compares the thresholds of the two detection parameters to obtain conclusions about their respective statuses. Specifically, for the first detection parameter, represented by the sound pressure difference value, a preset in-ear characteristic value can be set. If this value is reached, the first preset condition is satisfied. For the second detection parameter, represented by the sound wave energy value, a preset in-ear threshold value can be set. If this value is reached, the second preset condition is satisfied.

[0064] The essence of the first comparison result and the second comparison result is represented as satisfying the preset condition or not satisfying the preset condition.

[0065] Step S150: Determine the wearing status of the earphone according to the first comparison result and the second comparison result.

[0066] This step forms the final state judgment based on the combination of the two comparison results. Specifically, if both comparison results meet the preset conditions, it is determined that the earphone is currently in the in-ear state, otherwise it is in the out-of-ear state. The state judgment logic proposed by the present invention is that the earphone is only determined to be in-ear when both comparison results meet the preset conditions. If only one comparison result meets the conditions or both comparison results do not meet the conditions, it is not determined that the earphone is in-ear. The sound pressure difference calculation may cause misjudgment in a high-noise environment, and the sound wave energy detection can provide additional verification, thereby improving the robustness of the overall system.

[0067] Furthermore, within the detection cycle, if any comparison result does not meet the preset conditions, the corresponding signal acquisition, parameter calculation and comparison process are repeated until the preset number of times is reached. If before the preset number of times is reached, any comparison result meets the preset conditions, the corresponding comparison result is output as meeting the preset conditions. If the preset conditions are still not met when the preset number of times is reached, the corresponding comparison result is output as not meeting the preset conditions.

[0068] Specifically, step S150 includes the following process:

[0069] When the first comparison result does not meet the preset condition, return to executing the acquisition of the first detection parameter until the first preset number of times is reached;

[0070] and / or,

[0071] When the second comparison result does not meet the preset condition, returning to execute collecting the second detection parameter until a second preset number of times is reached;

[0072] The wearing state of the earphone is determined according to the first comparison result and the second comparison result.

[0073] By setting a first preset number and a second preset number (which can be the same or independently configured), when the first comparison result of any detection parameter does not meet the preset conditions, a multi-cycle repetition mechanism is introduced to make the judgment process more resistant to accidental disturbances, signal jitter or transient unstable states.

[0074] In order to better understand the present invention, the technical solutions of the present invention are described in detail below in conjunction with specific embodiments, but the present invention is not limited to the contents defined in the following embodiments.

[0075] See Figure 2 One embodiment of the present invention provides a method for detecting the wearing status of an earphone, which is applicable to an in-ear wireless earphone system including a feedforward microphone (FFMIC), a feedback microphone (FBMIC), a speaker (SPK), and a digital signal processor (DSP). The method comprises the following steps:

[0076] Step S210: collecting detection signals.

[0077] When it is detected that the earphones have been removed from the charging case (for example, triggered by disconnection from the charging port, power recovery, or lid opening), the DSP controls the microphone module to start working. Within a preset time window (for example, 100ms), it collects: the environmental residual sound signals received by the FFMIC and FBMIC, which are recorded as the first detection signal; and the response signal received by the FBMIC during the playback of the infrasound test waveform (such as an 80Hz sine wave), which is recorded as the second detection signal.

[0078] The test waveform can be emitted by the SPK inside the headset, with a duration of 50ms~200ms and an amplitude that does not affect user perception (below the hearing threshold).

[0079] Step S220: Calculate the first detection parameter.

[0080] The DSP calculates the effective sound pressure (RMS) values ​​of the FFMIC channel and the FBMIC channel in the first detection signal respectively, and further calculates the sound pressure difference value as the first detection parameter.

[0081] Step S230: Calculate the second detection parameter.

[0082] The DSP extracts the response waveform under SPK excitation from the second detection signal, and performs single-point energy calculation on it as the second detection parameter.

[0083] Step S240: Compare the detection parameters with the preset conditions.

[0084] The system sets a preset in-ear characteristic value and a preset in-ear threshold, and the DSP judges respectively: if the first detection parameter reaches the preset in-ear characteristic value, the first comparison result is "meets the preset conditions"; if the second detection parameter reaches the preset in-ear threshold, the second comparison result is "meets the preset conditions".

[0085] When the first comparison result or the first result of the second comparison result is "does not meet the preset conditions", the corresponding signal acquisition, parameter calculation and comparison process are repeated, and the preset number of times is 50 times. If the comparison result is "satisfies the preset conditions" within the 50-time detection cycle, it will stop. If it reaches the preset number of 50 times and is still "does not meet the preset conditions", the final comparison result is output as "does not meet the preset conditions".

[0086] Step S250: Determine the current wearing state of the headset according to the first comparison result and the second comparison result.

[0087] Determine the current wearing status based on two comparison results:

[0088] (1) If both comparison results are "satisfying the preset conditions", it is determined that the earphone is in the in-ear state;

[0089] (2) If any comparison result is "does not meet the preset conditions", it is determined that the earphones are in the out-of-ear state.

[0090] For the application of the present invention, when the in-ear state is detected, the system can automatically turn on the active noise reduction function or resume the paused audio playback; when the out-of-ear state is detected, the system pauses the audio output and turns off the noise reduction to avoid power waste and audio leakage.

[0091] The above-disclosed embodiments describe in detail a method for detecting the wearing status of an earphone, which collects a first detection signal and a second detection signal of the current status of the earphone, which are respectively used to calculate a first detection parameter and a second detection parameter, and compares the two detection parameters with different preset conditions to obtain two comparison results. The wearing status of the earphone is determined by considering the two comparison results at the same time. The present invention introduces two independent detection parameters at the same time, which respectively reflect the acoustic environment and physical coupling state of the earphone, and judges the wearing status through two-dimensional signal fusion, which significantly improves the robustness and misjudgment tolerance of wearing detection, and is particularly suitable for accurate judgment in complex sound fields or atypical wearing scenarios; a further embodiment only relies on the microphone and speaker modules already available in the conventional configuration of the earphone for signal acquisition, and the relevant judgment process can be completed in the digital signal processor (DSP) on the earphone side, with high integration and low power consumption, and is easy to be quickly deployed and implemented in the existing earphone system.

[0092] The disclosed method can be implemented using various devices. Therefore, the present invention also discloses an earphone wearing status detection device corresponding to the method. Specific embodiments are given below for detailed description.

[0093] like Figure 3 As shown, one embodiment of the present invention provides a device for detecting a wearing state of an earphone, comprising:

[0094] The signal acquisition module 302 is used to collect a first detection signal and a second detection signal of the current state of the earphone after the earphone is removed from the charging compartment;

[0095] A first parameter calculation module 304, configured to calculate a first detection parameter according to the first detection signal;

[0096] A second parameter calculation module 306, configured to calculate a second detection parameter according to the second detection signal;

[0097] a parameter comparison module 308 for comparing the first detection parameter with the first preset condition to obtain a first comparison result, and comparing the second detection parameter with the second preset condition to obtain a second comparison result;

[0098] The earphone state determination module 310 is configured to determine the wearing state of the earphone according to the first comparison result and the second comparison result.

[0099] The device provided in the embodiment of the present application has the same implementation principle and technical effects as those in the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding content in the aforementioned method embodiment.

[0100] The methods and related devices mentioned in the above embodiments are described with reference to the method flow charts and / or structural diagrams provided in the embodiments of the present application. Specifically, each process and / or block in the method flow charts and / or structural diagrams, as well as the combination of processes and / or blocks in the flow charts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 Schematic diagram of one or more processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including the instruction device, which implements the function specified in the process. Figure 1 Schematic diagram of one or more processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the process. Figure 1 The flow or flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.

[0101] The following embodiments illustrate this method using a computer device as an example. It is understood that the computer device may be any device with computing and processing capabilities, including, but not limited to, a server or a personal laptop. In one embodiment, the computer device may be an application server, which may be a server for running the application under test.

[0102] See Figure 4 , which shows a hardware block diagram of an electronic device, which is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.

[0103] like Figure 4As shown, the electronic device includes: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;

[0104] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;

[0105] The processor 1 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention;

[0106] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory;

[0107] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to: implement each processing flow of the aforementioned earphone wearing status detection solution.

[0108] An embodiment of the present invention further provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the various processing flows of the headphone wearing status detection solution provided in the above embodiment and / or any possible implementation method in combination with the embodiment are implemented.

[0109] The above embodiments have described the invention in particular detail with respect to possible scenarios, and those skilled in the art will recognize that the invention can be practiced through other embodiments. The specific naming of components, capitalization of terms, attributes, data structures, or any other programming or structural aspects are not mandatory or important, and the mechanisms or features of the invention may have different names, forms, or procedures. The system may be implemented through a combination of hardware and software (as described), entirely through hardware elements, or entirely through software elements. The specific division of functions between the various system components described herein is exemplary only and not mandatory; rather, the functions performed by a single system component may be performed by multiple components, or the functions performed by multiple components may be performed by a single component.

[0110] Those skilled in the art will appreciate that the various steps of the method disclosed above can be implemented by a general-purpose computing device. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the embodiments disclosed herein are not limited to any specific combination of hardware and software.

[0111] The programs executable by these computing devices (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., a magnetic disk, an optical disk, a memory, a programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0112] Certain aspects of the present invention include the process steps and instructions described herein in the form of algorithms. It should be noted that the process steps and instructions of the present invention can be implemented in software, firmware and / or hardware, and when implemented in software, they can be downloaded, stored on different platforms used by various operating systems, and operated from the platforms.

[0113] Those skilled in the art will understand that the structures shown in the accompanying drawings are merely block diagrams of partial structures related to the scheme of the present application, and do not constitute a limitation on the terminal device to which the scheme of the present application is applied. The specific terminal device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0114] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "possible design" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and features of different embodiments or examples, unless they are mutually inconsistent.

[0115] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0116] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting earphone wearing status, characterized in that: include: After the earphone is removed from the charging compartment, a first detection signal and a second detection signal of the current state of the earphone are collected; calculating a first detection parameter according to the first detection signal; calculating a second detection parameter according to the second detection signal; Comparing the first detection parameter with a first preset condition to obtain a first comparison result, and comparing the second detection parameter with a second preset condition to obtain a second comparison result; The wearing state of the earphone is determined according to the first comparison result and the second comparison result.

2. The method according to claim 1, characterized in that Collecting the first detection signal includes: The first detection signal in the current state of the headset is collected by using the microphone of the headset.

3. The method according to claim 2, characterized in that Collecting a first detection signal of the current state of the headset by using a microphone of the headset includes: A first noise signal and a second noise signal are collected respectively by using a feedforward microphone and a feedback microphone of the earphone, and the first detection signal includes the first noise signal and the second noise signal.

4. The method according to claim 3, characterized in that Calculating a first detection parameter according to the first detection signal includes: A sound pressure difference value is calculated based on the first noise signal and the second noise signal, and the sound pressure difference value is determined as a first detection parameter.

5. The method according to claim 1, wherein Collecting the second detection signal includes: The speaker of the headset is controlled to play the test sound wave and collect sound wave data to be recorded as the second detection signal.

6. The method according to claim 5, characterized in that Calculating a second detection parameter according to the second detection signal includes: Calculate the sound wave energy value corresponding to the sound wave data.

7. The method according to claim 1, characterized in that Determining the wearing state of the headset according to the first comparison result and the second comparison result includes: When the first comparison result does not meet the preset condition, returning to execute collecting the first detection parameter until a first preset number of times is reached; and / or, When the second comparison result does not meet the preset condition, returning to execute collecting the second detection parameter until a second preset number of times is reached; The wearing state of the earphone is determined according to the first comparison result and the second comparison result.

8. A device for detecting earphone wearing status, characterized in that: include: A signal acquisition module, configured to collect a first detection signal and a second detection signal of the current state of the earphone after the earphone is removed from the charging compartment; a first parameter calculation module, configured to calculate a first detection parameter according to the first detection signal; A second parameter calculation module, configured to calculate a second detection parameter according to the second detection signal; a parameter comparison module, configured to compare the first detection parameter with a first preset condition to obtain a first comparison result, and to compare the second detection parameter with a second preset condition to obtain a second comparison result; The earphone state determination module is used to determine the wearing state of the earphone according to the first comparison result and the second comparison result.

9. An electronic device, characterized in that: The device comprises a memory storing computer-executable instructions and a processor, and when the computer-executable instructions are executed by the processor, the device executes the headphone wearing status detection method according to any one of claims 1 to 7.

10. A readable storage medium, characterized in that: A computer executable program is stored, and when the program is executed, the headphone wearing status detection method according to any one of claims 1 to 7 can be implemented.