Headphone status detection method, headphone and storage medium

By collecting the sound pressure signal of the same sound source when the headphones are not worn and worn, and using the difference in sound pressure to detect the status of the headphones, the accuracy problem of headphone wearing and plugging detection in the existing technology is solved, and the audio playback effect and user experience are improved. experience.

CN113766411BActive Publication Date: 2024-08-27ANHUI HUAMI HEALTH TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111146290.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-28
Publication Date
2024-08-27
Estimated Expiration
2041-09-28

AI Technical Summary

Technical Problem

The existing technology is difficult to accurately detect whether the earphones are worn properly and whether the holes are blocked, which affects the audio playback effect and user experience.

Method used

By collecting the sound pressure signal of the same sound source when the headphones are not worn and when they are worn, the sound pressure difference is used to determine the status of the headphones to detect whether the headphones are worn properly and whether the holes are blocked, offset the influence of physical factors of the headphones, and improve detection accuracy .

Benefits of technology

It effectively detects whether the headphones are worn properly and whether the holes are blocked, which improves the audio playback effect and user experience and reduces misjudgments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113766411B
    Figure CN113766411B
Patent Text Reader

Abstract

The present disclosure provides a method for detecting the state of an earphone, an earphone, and a storage medium, which are conducive to improving the detection accuracy of the state of the earphone, the method comprising: using a microphone in the earphone to collect a first sound signal when the earphone is not worn; using the microphone to collect a second sound signal when the earphone is worn; wherein the first sound signal and the second sound signal are from the same sound source; determining the state of the earphone according to the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal, wherein the state of the earphone includes at least one of whether the earphone is worn in place and whether the earphone blocks the hole. The embodiments of the present disclosure realize the detection of at least one of whether the earphone is worn in place and whether the earphone blocks the hole, and effectively offsets the influence of physical factors of the earphone, thereby improving the accuracy of the earphone state detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of acoustic technology, and in particular to a method for detecting the state of an earphone, an earphone, and a storage medium. Background Art

[0002] With the continuous development of headphone technology and the continuous improvement of people's consumption level, various types of headphones have emerged, such as headphones, earbuds and in-ear headphones, and people's demand for headphones has become more and more diverse. Among them, the status of the headphones during the use of the user, such as whether the headphones are worn properly or whether the headphones are blocked, is also an important factor affecting the audio playback effect and user experience. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present disclosure provides a method for detecting the state of an earphone, an earphone and a storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, a method for detecting a state of an earphone is provided, comprising:

[0005] Under the condition that the earphone is not worn, using a microphone in the earphone to collect a first sound signal;

[0006] Under the condition that the earphone is worn, using the microphone to collect a second sound signal; wherein the first sound signal and the second sound signal come from the same sound source;

[0007] The state of the earphone is determined according to a difference between a sound pressure corresponding to the first sound signal and a sound pressure corresponding to the second sound signal, wherein the state of the earphone comprises at least one of whether the earphone is properly worn and whether the earphone blocks the hole.

[0008] Optionally, both the first sound signal and the second sound signal are ambient sound signals; or,

[0009] The first sound signal and the second sound signal are both collected by the microphone when the earphone plays preset audio.

[0010] Optionally, when the headset is in a non-quiet environment, both the first sound signal and the second sound signal are ambient sound signals, wherein a collection interval between the first sound signal and the second sound signal is no greater than a preset time interval.

[0011] Optionally, the collecting the first sound signal using a microphone in the headset when the headset is not worn includes:

[0012] Under the condition that the earphone is not worn, using the microphone to collect ambient sound signals at a certain frequency, and storing the collected ambient sound signals;

[0013] The determining the state of the earphone according to the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal includes:

[0014] The state of the earphone is determined according to a difference between a sound pressure corresponding to a most recently collected ambient sound signal and a sound pressure corresponding to an ambient sound signal collected when the earphone is worn.

[0015] Optionally, the first sound signal and the second sound signal are both collected by the microphone when the earphone plays a preset audio;

[0016] The method further includes: in response to receiving a user instruction, playing the preset audio before the headset is worn and after the headset is worn respectively.

[0017] Optionally, the first sound signal and the second sound signal are both collected by the microphone when the earphone plays a preset audio;

[0018] Before collecting the first sound signal using the microphone in the headset, the method further includes:

[0019] Using the microphone to collect an ambient sound signal, and determining a current environment type based on a sound pressure corresponding to the ambient sound signal;

[0020] Based on the current environment type, a current state detection strategy is determined, wherein the state detection strategy indicates a processing method for the first sound signal and the second sound signal.

[0021] Optionally, determining a current state detection strategy based on the current environment type includes:

[0022] If the current environment type is a quiet environment, determine to adopt a first state detection strategy, wherein, in the first state detection strategy, the state of the headset is determined by the sound pressure difference between the first sound signal and the second sound signal collected; and / or

[0023] If the current environment type is a non-quiet environment, determine to adopt a second state detection strategy, wherein, in the second state detection strategy, the first sound signal and the second sound signal are compensated respectively using the ambient sound signal, and the state of the earphone is determined using the sound pressure difference between the compensated first sound signal and the compensated second sound signal.

[0024] Optionally, determining the state of the earphone according to a difference between a sound pressure corresponding to the first sound signal and a sound pressure corresponding to the second sound signal includes:

[0025] determining the sound isolation of the earphone according to a difference between a sound pressure corresponding to the first sound signal and a sound pressure corresponding to the second sound signal;

[0026] The state of the earphone is determined according to the sound isolation of the earphone.

[0027] Optionally, determining the state of the earphone according to the sound isolation of the earphone includes:

[0028] If the sound isolation of the earphone is within a first preset range, determining that the earphone is blocking the jack; or

[0029] If the sound isolation of the earphone is higher than the first preset range and within the second preset range, it is determined that at least one of the earphone is not worn properly and the earphone is not blocking the hole; or

[0030] If the sound isolation of the earphone is higher than the second preset range, it is determined that the earphone is properly worn.

[0031] According to a second aspect of an embodiment of the present disclosure, there is provided a headset, comprising a microphone and a processor; the processor is connected to the microphone;

[0032] The microphone is used to collect a first sound signal when the earphone is not worn; and collect a second sound signal when the earphone is worn; wherein the first sound signal and the second sound signal come from the same sound source;

[0033] The processor is used to determine the state of the earphone according to the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal, wherein the state of the earphone includes at least one of whether the earphone is worn properly and whether the earphone blocks the hole.

[0034] In some embodiments, the microphone and the processor are used to perform the steps and / or processes in any possible implementation of the first aspect.

[0035] According to a third aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored. When the program is executed by a computer device, the program implements the steps and / or processes in any possible implementation method of the first aspect.

[0036] In the disclosed embodiment, when the earphone is not worn, the microphone in the earphone can be used to collect a first sound signal, and when the earphone is worn, the microphone can be used to collect a second sound signal, wherein, since the first sound signal and the second sound signal come from the same sound source, the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal can reflect the state of the earphone, thereby realizing detection of at least one of whether the earphone is properly worn and whether the sound hole of the earphone is blocked, and effectively offsetting the influence of physical factors of the earphone (such as wear of the earphone, at least partial blockage of the sound hole of the earphone by dirt, etc.), thereby improving the accuracy of earphone state detection.

[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0039] Figure 1 It is a flowchart of an example of a method for detecting wearing of headphones according to an embodiment of the present disclosure.

[0040] Figure 2 It is a schematic diagram of a process of detecting whether the earphone is worn according to an embodiment of the present disclosure.

[0041] Figure 3 It is a flowchart of another example of the earphone wearing detection method shown in an embodiment of the present disclosure.

[0042] Figure 4 It is a flowchart of another example of the earphone wearing detection method shown in an embodiment of the present disclosure.

[0043] Figure 5 It is a flowchart of another example of the earphone wearing detection method shown in an embodiment of the present disclosure.

[0044] Figure 6 It is a schematic diagram of the structure of the earphone shown in an embodiment of the present disclosure.

[0045] Figure 7 is another structural schematic diagram of the earphone shown in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0047] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0048] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0049] With the continuous development of headphone technology and the continuous improvement of people's consumption level, various types of headphones have emerged, such as headphones, earbuds and in-ear headphones, and people's demand for headphones has become more and more diverse. Among them, the status of the headphones during the use of the user, such as whether the headphones are worn properly or whether the headphones are blocked, is also an important factor affecting the audio playback effect and user experience.

[0050] In one example, taking whether the earphones are worn properly as an example, when the user wears the earphones, if they are worn properly, the earphones fit the skin of the user's ears well, the noise reduction effect of the earphones is good, and the sound quality of the audio played by them will be better. On the contrary, if the earphones are not worn correctly, that is, the earphones are not worn properly, the noise reduction effect of the earphones is poor, and the sound quality of the audio played by them will be poor, reducing the user's auditory experience.

[0051] In the embodiments of the present disclosure, "the earphone is properly worn" means that the earphone is worn at a suitable position on the ear of the user. When the earphone is properly worn, the audio played by the earphone can achieve good sound quality, and external noise has little or no effect on the audio played by the earphone; "the earphone is not properly worn" means that the position of the earphone is inappropriate. When the earphone is not properly worn, the sound quality of the audio played by the earphone is poor, and external noise has a greater impact on the audio played by the earphone.

[0052] The disclosed embodiment provides a method for detecting the state of an earphone, which can use a microphone in the earphone to collect a first sound signal when the earphone is not worn, and use the microphone to collect a second sound signal when the earphone is worn, wherein, since the first sound signal and the second sound signal come from the same sound source, the state of the earphone can be determined according to the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal, thereby accurately detecting at least one of whether the earphone is worn properly and whether the earphone is blocking the vent. Please refer to Figure 1 , Figure 1 This is a flow chart of a method for detecting the state of an earphone provided in an embodiment of the present disclosure. The method may be performed by the earphone, and the method includes:

[0053] In step S101, under the condition that the earphone is not worn, a first sound signal is collected using a microphone in the earphone.

[0054] In step S102, under the condition that the earphone is worn, the microphone is used to collect a second sound signal; wherein the first sound signal and the second sound signal come from the same sound source.

[0055] In step S103, the state of the earphone is determined according to the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal, wherein the state of the earphone includes at least one of whether the earphone is worn properly and whether the earphone blocks the hole.

[0056] For example, the greater the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal, the greater the possibility that the earphone is properly worn. The smaller the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal, the earphone may not be properly worn or the hole may be blocked.

[0057] In the related art, one method for detecting whether the earphone is properly worn is: when the earphone is worn, the earphone plays a preset audio, and the sound pressure corresponding to the audio signal of the preset audio collected by the microphone in the earphone is compared with the reference sound pressure threshold to determine whether the earphone is properly worn, for example, when the sound pressure corresponding to the audio signal is greater than or equal to the reference sound pressure threshold, the earphone is determined to be properly worn. Among them, the reference sound pressure threshold is set when the earphone leaves the factory. As the earphone is used for an increasing period of time or the sound hole of the earphone is blocked by dirt, the components in the earphone are affected, so that the sound pressure when the earphone plays the preset audio will also change. Correspondingly, the sound pressure of the audio signal of the preset audio collected by the microphone also changes, which is easy to cause misjudgment. For example, due to the blockage of the sound hole of the earphone by dirt, the sound pressure of the audio signal of the preset audio collected by the microphone becomes larger. When the sound pressure of the audio signal is compared with the reference sound pressure threshold, the sound pressure of the audio signal is greater than the reference sound pressure threshold, so that the earphone is not properly worn but is misjudged as being properly worn. Obviously, the detection result of whether the earphone is properly worn is wrong.

[0058] In the disclosed embodiments, the state of the earphone is detected based on the difference in sound pressure of a sound signal of the same sound source when the earphone is worn and when it is not worn. The states of physical components in the earphone are basically the same or differ very little when it is worn and when it is not worn. Therefore, the influence of physical factors (such as wear of the earphone, at least partial blockage of the sound hole of the earphone by dirt, etc.) can be effectively offset, thereby improving the accuracy of earphone state detection.

[0059] In some embodiments, the headset state detection method can be executed by the headset, for example, the headset state detection method can be in the form of executable instructions stored in the memory of the headset, and can be executed by the processor in the headset. Exemplarily, the headset includes but is not limited to headphones, earbuds, and in-ear headphones, etc., and can be wired headphones or wireless headphones, such as true wireless stereo TWS headphones, etc.

[0060] In some embodiments, the state detection method of the headset of the embodiment of the present disclosure can be executed in response to a user instruction, that is, the user can determine whether to turn on the headset state detection function indicated by the state detection method according to actual needs. For example, the headset is provided with a designated control, and the designated control is used to indicate the execution of the headset state detection function. The headset executes the state detection method of the headset of the embodiment of the present disclosure in response to the triggering operation of the designated control; or a designated control is provided on a terminal associated with the headset, and the terminal can send an execution instruction of the headset state detection function to the headset when the designated control is triggered by the user, and the headset executes the state detection method of the headset of the embodiment of the present disclosure in response to the execution instruction.

[0061] In some other embodiments, the method for detecting the state of the earphone provided by the embodiments of the present disclosure can also be automatically executed in real time in the earphone. This embodiment does not impose any restrictions on this and can be specifically set according to the actual application scenario.

[0062] In some embodiments, the earphone is provided with a distance sensor, and the earphone can determine whether the earphone is worn according to the detection value of the distance sensor in the earphone. Exemplarily, please refer to Figure 2 , the distance sensor of the earphone includes two preset detection thresholds, namely a preset proximity threshold value x and a preset distance threshold value y. Among them, the preset proximity threshold value x is greater than the preset distance threshold value y. If the detection value of the distance sensor is greater than the preset proximity threshold value, it is determined that the earphone is worn; if the detection value is less than the preset distance threshold value, it is determined that the earphone is not worn. For example, in Figure 2 , assume that the current reading of the proximity sensor (i.e., the current detection value) is z. When z > x, it is determined that the earphone is worn, and when z < y, it is determined that the earphone is not worn.

[0063] In some other embodiments, it is also possible to determine whether the earphone is worn according to the state of the earphone. For example, when the earphone is in a charging state, it is determined that the earphone is not worn.

[0064] Exemplarily, in order to further improve the accuracy of state detection, it is also possible to comprehensively consider the detection value of the distance sensor and the state of the earphone to determine whether the earphone is worn. For example, if the detection value of the distance sensor is less than the preset distance threshold value and the earphone is currently in a charging state, it is determined that the earphone is not worn; if the earphone is currently in a non-charging state and the detection value is greater than the preset proximity threshold value, it is determined that the earphone is worn.

[0065] It can be understood that it is also possible to determine the wearing state of the earphone by other means. This embodiment does not impose any restrictions on this. For example, it is possible to determine whether the earphone is worn by an infrared temperature sensor. For example, if the temperature measured by the infrared temperature sensor is within the preset ear temperature range, it is determined that the earphone is worn, and if the temperature measured by the infrared temperature sensor is outside the preset ear temperature range, it is determined that the earphone is not worn.

[0066] In some embodiments, the microphone in the headset can be used to collect a first sound signal when the headset is not worn, and a second sound signal when the headset is worn, wherein the first sound signal and the second sound signal come from the same sound source, so that whether the headset is properly worn can be determined based on the difference in sound pressure of the same sound source before and after the headset is worn. In this case, the effects of physical factors (such as wear of the headset, at least partial blockage of the sound hole of the headset by dirt, etc.) on the components in the headset when it is worn and when it is not worn are basically the same or the difference is very small, thereby effectively offsetting the influence of physical factors on sound pressure, thereby improving the accuracy of headset status detection.

[0067] Here, an exemplary description is given of the same sound source from which the first sound signal and the second sound signal come:

[0068] In a possible implementation, both the first sound signal and the second sound signal are collected by the microphone when the headset plays the preset audio. Considering that if the preset audio is played directly without the user's permission, and if the occasion for playing the audio is inappropriate, such as the user is in a place where a low volume is required, it will obviously seriously affect the user's experience. Therefore, if the first sound signal and the second sound signal are collected by playing the preset audio through the headset, the status detection function of the headset needs to be performed only with the user's confirmation, that is, if the headset receives a user instruction, it can respond to the user instruction and play the preset audio before and after the headset is worn; if the headset does not receive the user instruction, the preset audio will not be played.

[0069] When receiving the user instruction, for example, when the headset is not worn, the headset can control the speaker in the headset to play the preset audio in response to the user instruction, and use the microphone in the headset to collect the preset audio to obtain a first sound signal; when the headset is worn, the headset can control the speaker in the headset to play the preset audio in response to the user instruction, and use the microphone in the headset to collect the preset audio to obtain a second sound signal, thereby obtaining two sound signals from the same sound source before and after the headset is worn. It is understandable that the embodiment of the present disclosure does not impose any restrictions on the triggering method of the user instruction, and specific settings can be made according to actual application scenarios.

[0070] In another possible implementation, in order to further improve efficiency, the headset does not need to play preset audio, but directly collects ambient sound to detect whether the headset is worn properly, that is, the first sound signal and the second sound signal are both ambient sound signals, which is conducive to simplifying the detection process and realizing detection of whether the headset is worn properly without the user's perception, which is conducive to improving the user's experience. In addition, since the user is unaware of the collection of ambient sound signals, the headset status detection function can be performed with the user's confirmation, or the headset status detection function can be automatically performed according to the actual situation.

[0071] Of course, in addition to the two types of sound sources exemplified above, other sound sources may also be used according to actual conditions, and this embodiment does not impose any limitation on this.

[0072] In some embodiments, taking the first sound signal and the second sound signal both as ambient sound signals, see Figure 3 , Figure 3 Another schematic diagram of a method for detecting the state of an earphone provided in an embodiment of the present disclosure, the method comprising:

[0073] In step S201, under the condition that the earphone is not worn, the microphone is used to collect ambient sound signals at a certain frequency, and the collected ambient sound signals are stored.

[0074] In step S202, under the condition that the earphone is worn, the microphone is used to collect an ambient sound signal.

[0075] In step S203, the state of the earphone is determined based on the difference between the sound pressure corresponding to the most recently collected ambient sound signal and the sound pressure corresponding to the ambient sound signal collected when the earphone is worn, wherein the state of the earphone includes at least one of whether the earphone is worn properly and whether the earphone blocks the hole.

[0076] Among them, when collecting ambient sound to detect the status of the headset, the first sound signal and the second sound signal are signals collected in the same environment. Considering that the ambient sound in the same environment may also change with the passage of time, in order to ensure that the ambient sound in the environment is basically consistent or the difference is very small when collecting the first sound signal and the second sound signal, it is possible to require that the collection intervals of the first sound signal and the second sound signal are similar, for example, the collection interval of the first sound signal and the second sound signal is not greater than a preset time interval, such as the preset time interval is not greater than 30 seconds. As an example, the preset time interval is several to tens of milliseconds.

[0077] In a possible implementation, if it is determined to collect ambient sound to detect the state of the headset, the headset, when not being worn, can use the microphone to collect ambient sound signals at a certain frequency, and store the collected ambient sound signals until it is determined that the headset is being worn. The certain frequency may be a preset frequency, such as collecting ambient sound signals every 1 second, and storing the ambient sound signals until it is determined that the headset is being worn.

[0078] Then, under the condition that the earphone is worn, the microphone is also used to collect ambient sound signals. The collection interval of the most recently collected ambient sound signal stored when the earphone is not worn is close to the collection interval of the ambient sound signal collected when the earphone is worn. It can be considered that before and after the earphone is worn, the ambient sound in the environment is basically consistent or the difference is very small, and belongs to the same sound source. Therefore, the state of the earphone can be determined based on the sound pressure difference of the same sound source before and after the earphone is worn.

[0079] In addition, considering that the ambient sound collected in some environments may not meet the requirements for detecting whether the headset is in place, for example, in a relatively quiet environment, the sound pressure of the collected ambient sound signal is low, which may lead to inaccurate headset status detection results. Therefore, in order to further improve the accuracy of the headset status detection results (i.e., the results of detecting whether the headset is in place), it can be considered that when the headset is in a non-quiet environment, the headset does not need to play the preset audio, but directly collects the ambient sound to detect whether the headset is in place, which is conducive to improving the accuracy of headset status detection based on the ambient sound signal.

[0080] Among them, whether the current environment is a non-quiet environment can be determined by the ambient sound signal of the current environment collected by the microphone in the headset, for example, by the preset parameters of the ambient sound signal (such as sound pressure, volume, etc.). For example, the non-quiet environment refers to the preset parameters of the ambient sound of the current environment (such as sound pressure, volume, etc.) meeting the preset requirements, such as the preset requirements including at least one of the sound pressure of the ambient sound of the current environment being greater than the preset sound pressure value and the volume of the current ambient sound being greater than the preset volume value, and the preset sound pressure value and the preset volume value can be specifically set according to the actual application scenario. The disclosed embodiment collects ambient sound when the headset is in a non-quiet environment to detect whether the headset is worn in place, which is conducive to improving the accuracy of the detection result.

[0081] In some other embodiments, taking the example that both the first sound signal and the second sound signal are collected by the microphone when the earphone plays the preset audio, see Figure 4 , Figure 4Another flowchart of a method for detecting a wearing state of an earphone provided in an embodiment of the present disclosure is provided, and the method includes:

[0082] In step S301, the microphone is used to collect an ambient sound signal, and the current environment type is determined based on the sound pressure corresponding to the ambient sound signal.

[0083] In step S302, based on the current environment type, a current state detection strategy is determined; the state detection strategy indicates a processing method for the first sound signal and the second sound signal.

[0084] In step S303, under the condition that the earphone is not worn, a speaker in the earphone is used to play a preset audio and a microphone in the earphone is used to collect a first sound signal.

[0085] In step S304, under the condition that the earphone is worn, a speaker in the earphone is used to play a preset audio and a second sound signal is collected using the microphone.

[0086] In step S305, the state of the earphone is determined according to the difference between the sound pressure corresponding to the first sound signal in the state detection strategy and the sound pressure corresponding to the second sound signal in the state detection strategy, wherein the state of the earphone includes at least one of whether the earphone is worn properly and whether the earphone blocks the hole.

[0087] In some embodiments, the environment type includes a quiet type and a non-quiet type, which can be determined based on preset parameters (such as sound pressure, volume, etc.) of the ambient sound signal of the current environment collected by the microphone. In one example, if the sound pressure of the ambient sound signal is less than the preset sound pressure value, and / or the volume of the current ambient sound is less than the preset volume value, the current environment is determined to be a quiet environment; if the sound pressure of the ambient sound signal is greater than or equal to the preset sound pressure value, and / or the volume of the current ambient sound is greater than or equal to the preset volume value, the current environment is determined to be a non-quiet environment. It can be understood that the specific size of the preset sound pressure value and the preset volume value can be specifically set according to the actual application scenario, and this embodiment does not impose any restrictions on this.

[0088] Among them, the state detection strategy refers to a strategy for obtaining the state of the earphone according to the first sound signal and the second sound signal, and the state detection strategy is different in different environment types. In one example, such as in a quiet environment, the environmental noise is small, and the environmental noise has little effect on the sound pressure of the sound signal collected by the microphone of the earphone. At this time, there is no need to process the first sound signal and the second sound signal, but the first sound signal and the second sound signal can be directly used to detect the state of the earphone according to the sound pressure difference between the two. In another example, such as in a non-quiet environment, the environmental noise is large, and the environmental noise has a large effect on the sound pressure of the sound signal collected by the microphone of the earphone. In order to ensure accurate detection of the state of the earphone, it is necessary to eliminate the influence of the environmental noise on the first sound signal and the second sound signal, and use the sound pressure difference between the first sound signal and the second sound signal after eliminating the influence of the environmental noise to detect the state of the earphone.

[0089] Therefore, the state detection strategy may include a first state detection strategy and a second state detection strategy. The first state detection strategy indicates that the first sound signal and the second sound signal are not processed in a quiet environment, and the second state detection strategy indicates that the ambient sound signal is used in a non-quiet environment to compensate for the first sound signal and the second sound signal respectively, so as to eliminate the influence of ambient noise.

[0090] In some embodiments, if the current environment type is a quiet environment, it is determined to adopt a first state detection strategy, wherein in the first state detection strategy, it is not necessary to process the first sound signal and the second sound signal, and the state of the headset is determined directly by the sound pressure difference between the first sound signal and the second sound signal collected; and / or if the current environment type is a non-quiet environment, it is determined to adopt a second state detection strategy, wherein in the second state detection strategy, the first sound signal and the second sound signal are respectively compensated using the ambient sound signal, and the state of the headset is determined using the sound pressure difference between the compensated first sound signal and the compensated second sound signal. In the disclosed embodiments, different state detection strategies are adopted based on different environment types, thereby eliminating the influence of ambient noise on the headset state detection result, which is beneficial to improving the accuracy of the headset state detection.

[0091] Exemplarily, the process of using the ambient sound signal to compensate the first sound signal and the second sound signal respectively may be: the earphone obtains a compensation signal with a phase opposite to the ambient sound signal, and then uses the compensation signal to compensate the first sound signal and the second sound signal respectively, so that the ambient sound components in the first sound signal and the second sound signal are offset by the compensation signal, thereby eliminating the influence of the ambient sound signal and improving the accuracy of earphone status detection.

[0092] In order to further improve the accuracy of the headphone state detection, considering that the ambient sound signal in the current environment may be different before and after the headphone is worn, the ambient sound signal can be collected respectively before and after the headphone is worn, that is, if the current environment type is a non-quiet environment, under the condition that the headphone is not worn, the microphone is used to collect the first ambient sound signal in the current environment, and then the speaker in the headphone is controlled to play the preset audio, and the microphone in the headphone is used to collect the preset audio to obtain the first sound signal; under the condition that the headphone is worn, the microphone is used to collect the second ambient sound signal in the current environment, and then the speaker in the headphone is controlled to play the preset audio, and the microphone in the headphone is used to collect the preset audio to obtain the second sound signal, and then the first compensation signal obtained based on the first ambient sound signal can be used to compensate the first sound signal, and the second compensation signal obtained based on the second ambient sound signal can be used to compensate the second sound signal. In the embodiment of the present disclosure, considering the difference in the ambient sound signal in the current environment before and after the headphone is worn, the first ambient sound signal and the second ambient sound signal are collected respectively before playing the preset audio, which are used to compensate the first sound signal and the second sound signal respectively, so as to effectively eliminate the influence of different ambient noise, obtain two sound signals of the same sound source before and after the headphone is worn, and further improve the accuracy of the headphone state detection.

[0093] In some embodiments, in order to save computing resources, it can be considered that in a non-quiet environment, the first sound signal and the second sound signal are both collected by the microphone when the headset plays a preset audio; in a quiet environment, the first sound signal and the second sound signal are both ambient sound signals, so that the collected first sound signal and the second sound signal can be directly used to detect the status of the headset, without the need for additional processing of the first sound signal and the second sound signal (such as compensation processing), which is conducive to saving computing resources and improving the efficiency of detecting the headset status.

[0094] In some embodiments, after acquiring the first sound signal and the second sound signal, the earphone can determine the sound isolation of the earphone according to the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal, and then determine whether the earphone is properly worn according to the sound isolation of the earphone, wherein the higher the sound isolation of the earphone, the greater the possibility that the earphone is properly worn; the lower the sound isolation of the earphone, the more likely that the earphone is not properly worn or the hole may be blocked. In this embodiment, the sound isolation of the earphone is strongly correlated with the state of the earphone, so the state of the earphone can be accurately detected by the sound isolation of the earphone.

[0095] In a possible implementation, in the process of determining the state of the earphone according to the isolation of the earphone for sound, if the isolation of the earphone for sound is within a first preset range, it is determined that the earphone is blocking the hole; or if the isolation of the earphone for sound is higher than the first preset range and within a second preset range, it is determined that at least one of the earphone is not worn properly and the earphone is not blocking the hole; or if the isolation of the earphone for sound is higher than the second preset range, it is determined that the earphone is worn properly. The first preset range is used to represent the reference isolation when the earphone is blocking the hole, and the second preset range is used to represent the reference isolation when the earphone is not blocking the hole and / or the earphone is not worn properly. This embodiment measures the isolation of the earphone for sound by using different reference ranges corresponding to the earphone status, thereby achieving accurate detection of the earphone status.

[0096] The maximum value in the first preset range is less than or equal to the minimum value in the second preset range. It is understandable that the first preset range and the second preset range can be specifically set according to actual conditions.

[0097] In one example, the minimum value in the first preset range can be set to 0 decibels, the maximum value can be set to a relatively weak sound pressure level that the user can perceive, such as 10 decibels, and the minimum value in the second preset range is greater than or equal to the maximum value in the first preset range, such as the minimum value in the second preset range is also set to 10 decibels. If the isolation of the earphone for sound is within the first preset range, it indicates that there is almost no difference between the first sound signal and the second sound signal, and it is possible that the earphone is completely or partially blocked. If the isolation of the earphone for sound is higher than the first preset range and within the second preset range, it indicates that the first sound signal and the second sound signal are very different, and it is possible that the earphone is not blocked or partially blocked, or the earphone is not worn properly, or both are possible. If the isolation of the earphone for sound is higher than the second preset range, it is determined that the earphone is worn properly, and the earphone can play audio according to user needs. In some embodiments, the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal and the isolation of the earphone for sound are positively correlated. The larger the difference, the higher the isolation of the earphone for sound, indicating that the possibility of the earphone being worn properly is greater. Exemplarily, the sound isolation of the earphone may be the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal. Exemplarily, the sound isolation of the earphone may also be the product of the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal and a preset parameter. This embodiment does not impose any limitation on this, and specific settings can be made according to actual application scenarios.

[0098] In an exemplary embodiment, the isolation of the earphone for sound is illustrated as the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal. The earphone can determine the state of the earphone according to the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal and the first preset range and the second preset range, respectively. If the difference is within the first preset range, it is determined that the earphone is blocking the hole; if the difference is higher than the first preset range and within the second preset range, it is determined that at least one of the earphone is not worn properly and the earphone is not blocking the hole; if the difference is higher than the second preset range, it is determined that the earphone is worn properly. The disclosed embodiment measures the isolation of the earphone for sound by using different reference ranges corresponding to the earphone status, thereby achieving accurate detection of the earphone status.

[0099] Among them, in order to improve the accuracy of headphone status detection, the first sound signal and the second sound signal come from different sound sources, and the corresponding first preset range and the second preset range are also different. For example, the first sound signal and the second sound signal are both ambient sound signals, and the corresponding first preset range and the second preset range are determined according to the difference in sound pressure of the ambient sound signal before and after the headphone is worn in the historical time period and the corresponding sound quality; for example, the first sound signal and the second sound signal are both collected by the microphone when the headphone plays the preset audio, and the corresponding first preset range and the second preset range are determined according to the difference in sound pressure of the preset audio collected before and after the headphone is worn in the historical time period and the corresponding sound quality.

[0100] In an exemplary embodiment, see Figure 5 , Figure 5 A flow chart of an example of a method for detecting the state of an earphone is shown, the method comprising:

[0101] In step S501, when the earphone is not worn, an ambient sound signal is collected using the microphone of the earphone.

[0102] In step S502, it is determined whether the sound pressure of the ambient sound signal is greater than a preset sound pressure threshold; if so, step S503 is executed; if not, step S504 is executed.

[0103] In step S503, if the sound pressure of the ambient sound signal is greater than the preset sound pressure threshold, the current environment is determined to be a non-quiet environment, and the ambient sound signal is stored; and when the earphone is not worn, step S501 is continued to be executed, and when the earphone is worn, step S505 is executed.

[0104] In step S505, when the earphone is worn, an ambient sound signal is collected using a microphone of the earphone.

[0105] In step S506, the sound isolation of the earphone is determined according to the difference between the sound pressure corresponding to the most recently collected ambient sound signal stored when the earphone is not worn and the sound pressure corresponding to the ambient sound signal collected when the earphone is worn.

[0106] In step S504, if the sound pressure of the ambient sound signal is less than or equal to the preset sound pressure threshold, it is determined that the current environment is a quiet environment, the preset audio is played using the speaker in the headset and the first sound signal is collected using the microphone in the headset; and when the headset is not worn, step S501 is continued to be executed, and step S507 is executed when the headset is worn.

[0107] In step S507, when the earphone is worn, a speaker in the earphone is used to play a preset audio and a microphone in the earphone is used to collect a second sound signal.

[0108] In step S508, the sound isolation of the earphone is determined according to the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal.

[0109] In step S509, it is determined whether the sound isolation of the earphone is within a first preset range; if so, step S510 is executed; if not, step S511 is executed.

[0110] In step S510, it is determined whether the headphone jack is blocked.

[0111] In step S511, determine whether the sound isolation of the earphone is higher than the first preset range and within the second preset range; if so, execute step S512; if not, execute step S513.

[0112] In step S512, it is determined that at least one of the earphone is not worn properly and the earphone does not block the hole.

[0113] In step S513, if the sound isolation of the earphone is higher than the second preset range, it is determined that the earphone is properly worn.

[0114] exist Figure 5 In the illustrated embodiment, an ambient sound signal is collected in a non-quiet environment; a preset audio is played in a non-quiet environment to collect a first sound signal and a second sound signal, so that the collected first sound signal and the second sound signal can be directly used to detect the state of the headset, without the need for additional processing of the first sound signal and the second sound signal (such as compensation processing), thereby helping to save computing resources and improve the efficiency of detecting the headset state.

[0115] The various technical features in the above embodiments can be arbitrarily combined as long as there is no conflict or contradiction between the combinations of features. However, due to space limitations, they are not described one by one. Therefore, any combination of the various technical features in the above embodiments also falls within the scope of this specification.

[0116] Accordingly, see Figure 6 , the present disclosure also provides a headset 400, including a microphone 42 for collecting sound signals and a processor 41;

[0117] The microphone 42 is used to collect a first sound signal when the earphone 400 is not worn; and to collect a second sound signal when the earphone 400 is worn; wherein the first sound signal and the second sound signal come from the same sound source;

[0118] The processor 41 is used to determine the state of the earphone 400 according to the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal, wherein the state of the earphone 400 includes at least one of whether the earphone is worn properly and whether the earphone blocks the hole.

[0119] In some embodiments, both the first sound signal and the second sound signal are ambient sound signals; or,

[0120] The first sound signal and the second sound signal are both collected by the microphone 42 when the earphone 400 plays a preset audio.

[0121] In some embodiments, when the headset 400 is in a non-quiet environment, the first sound signal and the second sound signal are both ambient sound signals, wherein the collection interval of the first sound signal and the second sound signal is no greater than a preset time interval.

[0122] In some embodiments, the microphone 42 is further used to collect ambient sound signals at a certain frequency using the microphone 42 and store the collected ambient sound signals when the headset 400 is not worn.

[0123] The processor 41 is specifically used to determine the state of the earphone 400 according to the difference between the sound pressure corresponding to the most recently collected ambient sound signal and the sound pressure corresponding to the ambient sound signal collected when the earphone 400 is worn.

[0124] In some embodiments, the first sound signal and the second sound signal are both collected by the microphone 42 when the earphone 400 plays a preset audio.

[0125] See also Figure 6 The earphone 400 further comprises a speaker 43, wherein the speaker 43 is used to play the preset audio before and after the earphone 400 is worn in response to receiving a user instruction.

[0126] In some embodiments, the first sound signal and the second sound signal are both collected by the microphone 42 when the earphone 400 plays a preset audio.

[0127] Before using the microphone 42 in the headset 400 to collect the first sound signal, the microphone 42 is also used to collect an ambient sound signal.

[0128] The processor 41 is also used to determine the current environment type based on the sound pressure corresponding to the ambient sound signal; based on the current environment type, determine the current state detection strategy, wherein the state detection strategy indicates the processing method of the first sound signal and the second sound signal.

[0129] In some embodiments, the processor 41 is also used to: if the current environment type is a quiet environment, determine to adopt a first state detection strategy, wherein, in the first state detection strategy, the state of the headset 400 is determined by the sound pressure difference between the collected first sound signal and the second sound signal; and / or if the current environment type is a non-quiet environment, determine to adopt a second state detection strategy, wherein, in the second state detection strategy, the ambient sound signal is used to compensate the first sound signal and the second sound signal respectively, and the state of the headset 400 is determined by the sound pressure difference between the compensated first sound signal and the compensated second sound signal.

[0130] In some embodiments, the processor 41 is also used to determine the sound isolation of the earphone 400 based on the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal; and determine the state of the earphone 400 based on the sound isolation of the earphone 400.

[0131] In some embodiments, the processor 41 is further configured to:

[0132] If the sound isolation of the earphone 400 is within a first preset range, it is determined that the earphone 400 is blocking the hole; or

[0133] If the sound isolation of the earphone 400 is higher than the first preset range and within the second preset range, it is determined that at least one of the earphone 400 is not worn properly and the earphone 400 is not blocking the hole; or

[0134] If the sound isolation of the earphone 400 is higher than the second preset range, it is determined that the earphone 400 is properly worn.

[0135] Accordingly, the present disclosure also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any of the above methods are implemented.

[0136] The present disclosure may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-usable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0137] like Figure 7 As shown, Figure 7 is another structural diagram of an earphone according to an exemplary embodiment of the present disclosure.

[0138] Reference Figure 7 , the headset 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .

[0139] The processing component 402 generally controls the overall operation of the headset 400, such as operations associated with display, phone calls, data communications, and recording operations. The processing component 402 may include one or more processors 41 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.

[0140] The memory 404 is configured to store various types of data to support operations on the headset 400. Examples of such data include instructions, messages, audio, etc. for any application or method operating on the headset 400. The memory 404 can be implemented by any type of volatile or non-volatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0141] The power supply assembly 406 provides power to the various components of the headset 400. The power supply assembly 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the headset 400.

[0142] The multimedia component 408 includes a screen that provides an output interface between the headset 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a camera. When the headset 400 is in an operating mode, such as a shooting mode or a video mode, the camera may receive external multimedia data. Each front camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0143] The audio component 410 is configured to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the headset 400 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.

[0144] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, volume buttons, start buttons, and lock buttons.

[0145] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the headset 400. For example, the sensor assembly 414 can detect the open / closed state of the headset 400, the relative positioning of components, such as the display and keypad of the headset 400, and the sensor assembly 414 can also detect the change in position of the headset 400 or a component in the headset 400, the presence or absence of user contact with the headset 400, the orientation or acceleration / deceleration of the headset 400, and the temperature change of the headset 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0146] The communication component 416 is configured to facilitate wired or wireless communication between the headset 400 and other headsets. The headset 400 can access a wireless network based on a communication standard, such as WiFi, 2G, 4G or 4G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0147] In an exemplary embodiment, the headset 400 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing headsets (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0148] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the above instructions can be executed by the processor 41 of the headset 400 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage headset, etc.

[0149] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0150] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

[0151] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the scope of protection of the present disclosure.

Claims

1. A method for detecting the state of an earphone, characterized in that: include: Under the condition that the earphone is not worn, using a microphone in the earphone to collect a first sound signal; Under the condition that the earphone is worn, using the microphone to collect a second sound signal; wherein the first sound signal and the second sound signal come from the same sound source; The state of the earphone is determined according to a difference between a sound pressure corresponding to the first sound signal and a sound pressure corresponding to the second sound signal, wherein the state of the earphone comprises at least one of whether the earphone is properly worn and whether the earphone blocks the hole.

2. The method according to claim 1, characterized in that The first sound signal and the second sound signal are both ambient sound signals; or, The first sound signal and the second sound signal are both collected by the microphone when the earphone plays preset audio.

3. The method according to claim 1 or 2, characterized in that: When the headset is in a non-quiet environment, the first sound signal and the second sound signal are both ambient sound signals, wherein the collection interval of the first sound signal and the second sound signal is no greater than a preset time interval.

4. The method according to claim 1 or 2, characterized in that: The method of collecting a first sound signal using a microphone in the headset when the headset is not worn includes: Under the condition that the earphone is not worn, using the microphone to collect ambient sound signals at a certain frequency, and storing the collected ambient sound signals; The determining the state of the earphone according to the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal includes: The state of the earphone is determined according to a difference between a sound pressure corresponding to a most recently collected ambient sound signal and a sound pressure corresponding to an ambient sound signal collected when the earphone is worn.

5. The method according to claim 1 or 2, characterized in that: The first sound signal and the second sound signal are both collected by the microphone when the earphone plays the preset audio; The method further comprises: In response to receiving a user instruction, the preset audio is played before the earphone is worn and after the earphone is worn.

6. The method according to claim 1 or 2, characterized in that: The first sound signal and the second sound signal are both collected by the microphone when the earphone plays the preset audio; Before collecting the first sound signal using the microphone in the headset, the method further includes: Using the microphone to collect an ambient sound signal, and determining a current environment type based on a sound pressure corresponding to the ambient sound signal; Based on the current environment type, a current state detection strategy is determined, wherein the state detection strategy indicates a processing method for the first sound signal and the second sound signal.

7. The method according to claim 6, characterized in that The determining of the current state detection strategy based on the current environment type includes: If the current environment type is a quiet environment, determine to adopt a first state detection strategy, wherein, in the first state detection strategy, the state of the headset is determined by the sound pressure difference between the first sound signal and the second sound signal collected; and / or If the current environment type is a non-quiet environment, determine to adopt a second state detection strategy, wherein, in the second state detection strategy, the first sound signal and the second sound signal are compensated respectively using the ambient sound signal, and the state of the earphone is determined using the sound pressure difference between the compensated first sound signal and the compensated second sound signal.

8. The method according to claim 1 or 2, characterized in that: The determining the state of the earphone according to the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal includes: determining the sound isolation of the earphone according to a difference between a sound pressure corresponding to the first sound signal and a sound pressure corresponding to the second sound signal; The state of the earphone is determined according to the sound isolation of the earphone.

9. The method according to claim 8, characterized in that The determining the state of the earphone according to the sound isolation of the earphone comprises: If the sound isolation of the earphone is within a first preset range, determining that the earphone is blocking the jack; or If the sound isolation of the earphone is higher than the first preset range and within the second preset range, it is determined that at least one of the earphone is not worn properly and the earphone is not blocking the hole; or If the sound isolation of the earphone is higher than the second preset range, it is determined that the earphone is properly worn.

10. An earphone, characterized in that: It includes a microphone and a processor; the processor is connected to the microphone; The microphone is used to collect a first sound signal when the headset is not worn; and to collect a second sound signal when the headset is worn; wherein the first sound signal and the second sound signal come from the same sound source; The processor is used to determine the state of the earphone according to the difference between the sound pressure corresponding to the first sound signal and the sound pressure corresponding to the second sound signal, wherein the state of the earphone includes at least one of whether the earphone is worn properly and whether the earphone blocks the hole.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a computer device, the method according to any one of claims 1 to 9 is implemented.