CN109257674B - Wearing condition detection method and device of wireless earphone and wireless earphone - Google Patents

Wearing condition detection method and device of wireless earphone and wireless earphone Download PDF

Info

Publication number
CN109257674B
CN109257674B CN201811139877.3A CN201811139877A CN109257674B CN 109257674 B CN109257674 B CN 109257674B CN 201811139877 A CN201811139877 A CN 201811139877A CN 109257674 B CN109257674 B CN 109257674B
Authority
CN
China
Prior art keywords
preset
value
infrared
distance
equal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811139877.3A
Other languages
Chinese (zh)
Other versions
CN109257674A (en
Inventor
陈维亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN201811139877.3A priority Critical patent/CN109257674B/en
Publication of CN109257674A publication Critical patent/CN109257674A/en
Application granted granted Critical
Publication of CN109257674B publication Critical patent/CN109257674B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1091Details not provided for in groups H04R1/1008 - H04R1/1083
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R29/00Monitoring arrangements; Testing arrangements

Abstract

The invention discloses a method and a device for detecting the wearing condition of a wireless earphone, the wireless earphone and a computer readable storage medium, relates to the technical field of portable listening equipment, and aims to solve the problems that the wearing condition detection by using a distance sensor is low in accuracy and not beneficial to user experience in the prior art. The method comprises the following steps: acquiring a first distance value acquired by a distance sensor according to a first preset time interval; judging whether a contact state which is more than or equal to a preset number of times exists in a preset time period or not according to the first distance value; if yes, determining that the wireless earphone is in a wearing state; according to the invention, the wearing state of the wireless earphone is determined under the condition that the contact state is more than or equal to the preset times in the preset time period, so that the error identification condition is reduced, the accuracy of the wearing condition detection is improved, the user experience is improved, the wearing condition detection which independently utilizes the distance sensor can be more accurate, and the setting cost and the power consumption of the earphone are reduced.

Description

Wearing condition detection method and device of wireless earphone and wireless earphone
Technical Field
The invention relates to the technical field of portable listening equipment, in particular to a method and a device for detecting the wearing condition of a wireless earphone, the wireless earphone and a computer readable storage medium.
Background
The earphone is a pair of conversion units for receiving the electric signal sent by the media player or receiver and converting the electric signal into audible sound waves by using a loudspeaker close to the ear.
The existing earphones can be divided into wired earphones and wireless earphones, wherein the wired earphones need a left earphone and a right earphone to form a left sound channel and a right sound channel in a wired connection mode, a stereo effect is generated, and the wearing is very inconvenient. The wireless headset communicates with the terminal through a wireless communication protocol (such as bluetooth), and compared with a wired headset, the wireless headset has the characteristics of no need of data line collection and convenience in use. Among them, the real wireless interconnection stereo bluetooth headset (TWS headset) that appears at present is a typical one of wireless headsets, and the TWS headset is more and more popular because of being convenient to wear and being capable of being used alone, and its development is very vigorous in recent years.
In the prior art, for detecting the wearing condition of the headset, a distance sensor (such as an infrared sensor or an IR sensor) or a combination of the distance sensor and other sensors (such as an accelerometer) is often required. However, when the existing distance sensor such as an infrared sensor is used independently, the logical relationship is that the distance sensor is considered to be worn if the infrared sensor is blocked, and is considered to be unworn if the distance sensor is released, so that the distance sensor can be mistakenly identified as being worn in many scenes (such as the infrared sensor is blocked by the hand of a user carelessly), the detection result of the wearing condition is not accurate enough, and the experience of the user is influenced; when the distance sensor is used in combination with other sensors, the setting cost and power consumption of the headset are increased.
Therefore, how to detect the wearing condition by using the distance sensor, the accuracy of the improved detection result improves the user experience, reduces the setting cost and the power consumption of the earphone, and is a problem which needs to be solved urgently nowadays.
Disclosure of Invention
The invention aims to provide a method and a device for detecting the wearing condition of a wireless earphone, the wireless earphone and a computer readable storage medium, so as to improve the accuracy of the wearing condition detection by using a distance sensor, improve the user experience and reduce the setting cost and the power consumption of the wireless earphone.
In order to solve the above technical problem, the present invention provides a method for detecting a wearing condition of a wireless headset, including:
acquiring a first distance value acquired by a distance sensor according to a first preset time interval; the distance sensor is arranged at the ear inlet end of the wireless earphone;
judging whether a contact state which is more than or equal to a preset number of times exists in a preset time period or not according to the first distance value; the contact state is a state that the first distance values of which the number is greater than or equal to a preset number are continuously in a preset contact range, and the preset times are greater than 1;
if so, determining that the wireless earphone is in a wearing state.
Optionally, when the distance sensor is an infrared sensor, determining whether a contact state of a preset number of times exists within a preset time period according to the first distance value includes:
and according to the acquisition sequence of the infrared values, sequentially comparing each infrared value with the preset contact range, and judging whether the contact state identifier which is more than or equal to the preset times is generated in the preset time period.
Optionally, the step of comparing each infrared value with the preset contact range in sequence according to the collection sequence of the infrared values, and determining whether a contact state identifier greater than or equal to the preset number of times is generated within the preset time period includes:
judging whether the current infrared value is greater than or equal to a threshold value; the threshold value is the minimum value of the preset contact range, and the current infrared value is any one infrared value;
if yes, judging whether n infrared values before the current infrared value are all larger than or equal to the threshold value, and the n +1 infrared value before the current infrared value is smaller than the threshold value; wherein n is the preset number minus 1;
and if so, generating the contact state identification.
Optionally, before acquiring the first distance value acquired by the distance sensor at the first preset time interval, the method further includes:
acquiring a second distance value acquired by the distance sensor according to a second preset time interval;
judging whether the second distance value is within a preset approaching range or not;
and if so, executing the step of acquiring a first distance value acquired by the distance sensor according to a first preset time interval.
Optionally, after determining that the wireless headset is in the wearing state, the method further includes:
acquiring a third distance value acquired by the distance sensor according to a third preset time interval;
judging whether the third distance value is within a preset distance range or not;
if so, determining that the wireless earphone is in a non-wearing state.
The invention also provides a device for detecting the wearing condition of the wireless earphone, which comprises:
the acquisition module is used for acquiring a first distance value acquired by the distance sensor according to a first preset time interval; the distance sensor is arranged at the ear inlet end of the wireless earphone;
the judging module is used for judging whether a contact state which is more than or equal to a preset number of times exists in a preset time period according to the first distance value; the contact state is a state that the first distance values of which the number is greater than or equal to a preset number are continuously in a preset contact range, and the preset times are greater than 1;
and the determining module is used for determining that the wireless earphone is in a wearing state if the contact state which is more than or equal to the preset times exists.
Optionally, when the distance sensor is an infrared sensor, the determining module includes:
and the judgment submodule is used for sequentially comparing each infrared value with the preset contact range according to the acquisition sequence of the infrared values and judging whether the contact state identifier which is more than or equal to the preset times is generated in the preset time period.
Optionally, the determining sub-module includes:
the first judgment unit is used for judging whether the current infrared value is greater than or equal to a threshold value; the threshold value is the minimum value of the preset contact range, and the current infrared value is any one infrared value;
a second determining unit, configured to determine whether n infrared values before the current infrared value are all greater than or equal to the threshold value and n +1 infrared value before the current infrared value is less than the threshold value if the n infrared values before the current infrared value are greater than or equal to the threshold value; wherein n is the preset number minus 1;
and the generating unit is used for generating the contact state identifier if the contact state identifier is satisfied.
The present invention also provides a wireless headset, comprising: a distance sensor, a memory, and a processor; wherein the memory is used for storing a computer program, and the processor is used for implementing the steps of the method for detecting the wearing condition of the wireless headset when executing the computer program.
Furthermore, the present invention also provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method for detecting wearing condition of a wireless headset according to any one of the above.
The invention provides a method for detecting the wearing condition of a wireless earphone, which comprises the following steps: acquiring a first distance value acquired by a distance sensor according to a first preset time interval; the distance sensor is arranged at the ear inlet end of the wireless earphone; judging whether a contact state which is more than or equal to a preset number of times exists in a preset time period or not according to the first distance value; the contact state is a state that the first distance values of which the number is greater than or equal to a preset number are continuously in a preset contact range, and the preset times are greater than 1; if yes, determining that the wireless earphone is in a wearing state;
therefore, the wireless headset is determined to be in the wearing state under the condition that the contact state which is more than or equal to the preset times exists in the preset time period, so that the false recognition condition is reduced, the wearing condition detection accuracy is improved, the user experience is improved, the wearing condition detection which independently utilizes the distance sensor can be more accurate, and the setting cost and the power consumption of the headset are reduced. In addition, the invention also provides a wearing condition detection device of the wireless earphone, the wireless earphone and a computer readable storage medium, and the wearing condition detection device, the wireless earphone and the computer readable storage medium also have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for detecting a wearing condition of a wireless headset according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a typical placement of an infrared sensor in a conventional wireless headset;
FIG. 3 is a diagram illustrating an exemplary infrared value collected by an infrared sensor during wearing of a wireless headset;
FIG. 4 is a diagram illustrating infrared values collected by an infrared sensor during wearing of another exemplary wireless headset;
FIG. 5 is a diagram illustrating infrared values collected by an infrared sensor during wearing of another exemplary wireless headset;
FIG. 6 is a schematic diagram of infrared values collected by an infrared sensor during placement of a typical wireless headset on a desktop;
FIG. 7 is a schematic diagram of infrared values collected by an infrared sensor during placement of a typical wireless headset in a charging box;
fig. 8 is a flowchart of another method for detecting wearing conditions of a wireless headset according to an embodiment of the present invention;
fig. 9 is a structural diagram of a wearing condition detecting device of a wireless headset according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for detecting a wearing condition of a wireless headset according to an embodiment of the present invention. The method can comprise the following steps:
step 101: acquiring a first distance value acquired by a distance sensor according to a first preset time interval; wherein, the distance sensor is arranged at the in-ear end of the wireless earphone.
The method for detecting the wearing condition of the wireless headset provided in this embodiment may be a method for detecting whether the wireless headset is worn by a user, that is, the method provided in this embodiment may be implemented when a processor, such as a single chip microcomputer, in the wireless headset executes a corresponding computer program, that is, an execution subject of the method provided in this embodiment may be the processor, such as the single chip microcomputer, in the wireless headset; the method provided by the present embodiment may also be implemented when a terminal, such as a mobile phone, detects whether a wireless headset paired with the terminal is worn by a user, that is, when a processor in the terminal paired with the wireless headset executes a corresponding computer program, that is, an execution subject of the method provided by the present embodiment may be a processor in the terminal paired with the wireless headset.
It should be noted that the distance sensor in this step may be an infrared sensor (ir sensor) as shown in fig. 2, or may also be another distance sensor such as an optical distance sensor, as long as the distance sensor can measure the distance of the relative position (e.g. the pinna of the user) when the user wears the wireless headset, which is not limited in this embodiment. The first distance value in this step may be a distance value collected by the distance sensor at a first preset time interval, and specific content of the first distance value may be set by a designer according to a practical scene and a user requirement, and if the first distance value is set according to a specific type of the distance sensor, if the distance sensor is an infrared sensor, the first distance value may be an infrared value collected by the infrared sensor at the first preset time interval, and if the distance sensor is a wireless headset shown in fig. 3, the greater the infrared value is, the closer the distance between the infrared sensor and the relative position is, and if the infrared value is close to 1023, the contact between the position where the infrared sensor is set in the wireless headset and the relative position (e.g., the auricle of the user) is illustrated. The present embodiment does not limit the first distance value as long as the first distance value can contain information on the distance measured by the distance sensor from the relative position.
Specifically, to the specific setting of the first preset time interval in this step, the setting can be set by the designer, if the distance sensor is an infrared sensor, the infrared sensor can collect infrared numerical values (first distance values) according to a sampling frequency of 50HZ, that is, 50 infrared numerical values can be collected per second, and the first preset time interval is set to 0.02 s. The present embodiment does not set any limit to this.
It can be understood that, through research, the applicant finds that there is a process of adjusting the wearing position of the wireless headset when the user wears the wireless headset, that is, as shown in fig. 3, during the process of adjusting the wearing position of the wireless headset by the user, the distance sensor disposed at the ear entrance end of the wireless headset can detect not only the distance from the pinna of the user (the infrared value is close to 1023), but also the distance from the ear hole of the user (the infrared value is reduced after being close to 1023). Correspondingly, the specific setting position of the distance sensor arranged at the ear-in end of the wireless headset in the step can be set by a designer, if the distance sensor is an infrared sensor, the existing typical infrared sensor setting position shown in fig. 2 can be adopted, the infrared value collected by the infrared sensor is 0 to 1023, and when the infrared value is 1023, the infrared sensor is completely blocked by the relative position. As long as the wearing position of the wireless headset can be adjusted by the user, the distance sensor can detect the distance from the pinna and the ear hole of the user. The present embodiment does not set any limit to this.
Further, the present embodiment may be directed to obtain the number of times of the contact state within a preset time period by comparing a first distance value acquired by the distance sensor at a first preset time interval with a preset contact range, so as to determine the wearing condition of the wireless headset. In order to save the power consumption of the wireless earphone, the method can further comprise the steps of obtaining a second distance value collected by the distance sensor according to a second preset time interval before the step; judging whether the second distance value is within a preset approaching range or not; if yes, the step is entered. That is, whether the method provided by the present embodiment needs to be performed may be determined by determining whether the second distance value is within a preset proximity range, using a setting of a preset proximity range (e.g., infrared values 1000 to 1023) that is larger than a range of a preset contact range (e.g., infrared values 200 to 1023).
Step 102: judging whether a contact state which is more than or equal to a preset number of times exists in a preset time period or not according to the first distance value; if yes, go to step 103.
The contact state is a state that the first distance values of which the number is greater than or equal to the preset number are continuously in the preset contact range, and the preset times are greater than 1.
It is understood that the preset contact range in this step may be a range of the first distance value set by the designer for determining whether the position where the distance sensor is disposed in the wireless headset is in contact with the relative position. The specific setting of the preset contact range may be set by the designer, as shown in fig. 2 and 3, when the infrared value (first distance value) acquired by the infrared sensor (distance sensor) at the first preset time interval is close to 1023 (peak value), the infrared sensor is in contact with the pinna of the user, and the preset contact range may be a range close to 1023 (e.g., 1000 to 1023).
Specifically, when the distance sensor is an infrared sensor, as shown in fig. 2 and 3, the contact state in this step may be a state in which the infrared values greater than or equal to the preset number are continuously close to 1023. Specifically, the specific value setting of the preset number can be set by the designer according to the practical scene and the user requirement, for example, the setting can be 10, that is, if the number of the infrared values approaching 1023 for the first time in fig. 3 reaches 10, two contact states (1023 for the first time and 1023 for the second time) are included in fig. 3. The present embodiment does not set any limit to this.
Correspondingly, as shown in fig. 3, 4 and 5, in the three exemplary processes of wearing the wireless headset by the user, if the infrared value collected by the infrared sensor in fig. 3 and continuously approaching 1023 for the first time can be the position of the infrared sensor contacting with the auricle for the first time when the wireless headset is worn by the user, the infrared sensor detects the distance to the ear cavity when the infrared value is reduced and the position of the wireless headset is adjusted for the user, and the infrared value continuously approaching 1023 for the second time can be the position of the infrared sensor contacting with the auricle for the second time after the wireless headset is adjusted for the user; the difference between fig. 4 and 5 and fig. 3 may be that the infrared sensor position of the wireless headset is first followed by a brief consecutive 1023 (first consecutive 1023) infrared value before it touches the pinna, which first consecutive 1023 may be caused by the infrared sensor position touching the user's face. When the preset number is 10, if the number of the infrared numerical values approaching 1023 for the first time in fig. 4 and 5 does not reach 10 and the number of the infrared numerical values approaching 1023 for the second time in fig. 4 and 5 reaches 10, both the two contact states (1023 for the second time and 1023 for the third time) are included in fig. 4 and 5. That is, the interference of the short contact (e.g., the first continuous access 1023 in fig. 4 and 5) other than the contact state can be excluded by setting the preset number.
It should be noted that, for the specific process of determining whether the contact state greater than or equal to the preset times exists in the preset time period according to the first distance value in this step, the specific process may be set by a designer according to a practical scene and a user requirement, and the first distance value acquired in the preset time period may be directly compared with the preset contact range according to the acquisition sequence to determine whether the contact state greater than or equal to the preset times exists in the preset time period; or according to the collection sequence of the first distance values, each first distance value is compared with a preset contact range in sequence to judge whether a contact state identifier which is more than or equal to a preset number of times is generated in a preset time period, if the contact state identifier is generated, whether the contact state identifier which is more than or equal to the preset times minus 1 is generated again in a first preset time period (such as the time of the preset time period minus the time of the contact state identifier) after the current time is judged, or after the contact state identifier is generated, whether the difference between the current time and the generation time of the regenerated first preset number minus 1 contact state identifier is smaller than a first preset time period or whether the generated preset number minus 1 contact state identifier exists in a first preset time period (such as the time of the preset time period minus the time of the contact state identifier) before the current time after the contact state identifier is generated is judged. The present embodiment does not limit the present invention as long as it can be determined whether or not the contact state greater than or equal to the preset number of times exists within the preset time period.
Correspondingly, the contact state identifier may be an identifier generated in the contact state, and the specific generation process of the contact state identifier may be set by a designer, for example, in the process of sequentially comparing each first distance value with the preset contact range, the contact state identifier may be generated when the first distance value does not belong to the preset contact range and a continuous preset number of first distance values belong to the preset contact range; or when the first distance value belongs to the preset contact range and does not belong to the preset contact range, if the number of the first distance values which previously belong to the preset contact range is greater than or equal to the preset number, generating the contact state identifier. The embodiment does not limit the content, and similarly, the specific content of the contact status identifier may be set by a designer, and the embodiment does not limit the content.
Specifically, the specific value setting of the preset times in this step may be set by a designer, as shown in fig. 3, the value of the preset times may be set to 2, that is, when two contact states exist in the preset time period, it may be determined that the wireless headset is in the wearing state. The present embodiment does not set any limit to this.
Step 103: determining that the wireless headset is in a worn state.
It should be noted that the wearing condition of the wireless headset in this embodiment may include a wearing state and a non-wearing state. The wearing state in this step may be a state in which the user wears the wireless headset.
The method further comprises the following steps of acquiring a third distance value acquired by the distance sensor according to a third preset time interval; judging whether the third distance value is in a preset distance range or not; and if so, determining that the wireless earphone is in a non-wearing state so as to determine whether the user takes off the worn wireless earphone. The preset distance range may be a range outside the preset contact range, where the range is used for determining a distance value collected by the distance sensor when the user does not wear the wireless headset, and if the distance sensor is an infrared sensor, the preset distance range may be an infrared value smaller than 200.
It is understood that the purpose of this step may be to determine that the wireless headset is in a wearing state in a case where there are more than or equal to a preset number of contact states within a preset time period, that is, when it is determined that the user is wearing the wireless headset using the distance sensor. Specifically, as shown in this embodiment, when the wearing condition of the wireless headset is detected only by using the distance sensor, it can be directly determined that the wireless headset is in a wearing state through this step; if the wearing condition of the wireless earphone is detected by using the distance sensor and other sensors, the step can also include a detection process of the wearing condition by other sensors before the step, namely after the situation that the user wears the wireless earphone can be determined by using other sensors, the step is entered to determine that the wireless earphone is in a wearing state. As long as the wireless headset can be determined to be in the wearing state under the condition that the contact state greater than or equal to the preset number of times exists in the preset time period, the embodiment does not limit this.
It can be understood that, with the method provided by the embodiment, for the process that the wireless headset is still on the desktop as shown in fig. 6, since the preset number of times is greater than 1, there is no contact state greater than or equal to the preset number of times within the preset time period, that is, there is only one contact state (continuously close to 1023) in fig. 6, and the wireless headset is not erroneously detected as the wearing state. For the process of placing the wireless earphones in the charging box as shown in fig. 7, since the infrared sensors are not completely blocked after the two wireless earphones are placed in the charging box, the two wireless earphones are close to each other, and the final infrared value is stabilized at about 700. No matter whether 700 belongs to the preset proximity range or not, since there is no contact state greater than or equal to the preset number of times within the preset time period, the wireless headset is not erroneously detected as the wearing state.
In the embodiment of the invention, the wireless earphone is determined to be in the wearing state under the condition that the contact state which is more than or equal to the preset times exists in the preset time period, so that the false recognition condition is reduced, the wearing condition detection accuracy is improved, the user experience is improved, the wearing condition detection which independently utilizes the distance sensor can be more accurate, and the setting cost and the power consumption of the earphone are reduced.
Referring to fig. 8, fig. 8 is a flowchart illustrating another method for detecting a wearing condition of a wireless headset according to an embodiment of the present invention. The method can comprise the following steps:
step 201: and acquiring an infrared numerical value acquired by the infrared sensor according to a second preset time interval.
It is understood that the second predetermined time interval in this step can be set by the designer, for example, the second predetermined time interval can be set to the same value as the first predetermined time interval, for example, 0.02 s; in order to further reduce the power consumption of the wireless headset, the second preset time interval may also be set to a value greater than the first preset time interval, which is not limited in this embodiment.
Step 202: judging whether the infrared numerical value is in a preset approaching range or not; if yes, go to step 203.
The purpose of this step may be to further detect the wearing condition of the wireless headset by sequentially determining whether the infrared values collected at the second preset time interval are within the preset proximity range, and entering step 203 to call a corresponding algorithm program when the infrared values within the preset proximity range exist.
Specifically, the specific range of the preset proximity range in this step may be set by the designer, such as the infrared sensor shown in fig. 2, which acquires an infrared value in a range from 0 to 1023, and if the preset contact range is greater than or equal to 1000(1000 to 1023), the minimum value of the preset proximity range in this step may be set to a value less than 1000, such as 200, that is, the preset proximity range is greater than or equal to 200(200 to 1023).
It can be understood that, in this embodiment, it may be directly determined whether the infrared value is within the preset proximity range through this step, and a manner similar to this step may also be adopted to determine a wearing condition of the wireless headset, that is, whether the user needs to wear the wireless headset, for example, to determine whether the infrared value is within the preset proximity range for multiple times (for example, twice). The present embodiment does not set any limit to this.
Step 203: and acquiring an infrared numerical value acquired by the infrared sensor according to a first preset time interval.
It can be understood that, in this step, the processor acquires the infrared value acquired by the infrared sensor at the first preset time interval by controlling the infrared sensor to acquire the infrared value at the first preset time interval. Specifically, the specific frequency of the infrared value acquired by the infrared sensor at the first preset time interval is acquired by the processor, and the specific frequency can be set by a designer, if the first preset time interval is 0.02s, namely the frequency of the infrared value acquired by the infrared sensor is 50HZ, the infrared value acquired by the infrared sensor can be acquired by the processor once every 0.5s, and 25 infrared values are acquired every 0.5s, so that the wearing condition of the wireless headset is detected by calling an algorithm program through the following steps.
Step 204: according to the acquisition sequence of the infrared numerical values, sequentially comparing each infrared numerical value with a preset contact range, and judging whether a contact state identifier which is more than or equal to a preset number of times is generated in a preset time period; if yes, go to step 205.
Specifically, the step may generate the contact state identifier in the following manner, including:
step 301: judging whether the current infrared value is greater than or equal to a threshold value; wherein the threshold value is the minimum value of a preset contact range; if yes, go to step 302.
The current infrared value in this step may be any one of the infrared values acquired by the infrared sensor in step 203 at the first preset time interval, that is, an infrared value obtained by comparing the current time with the preset contact range. The threshold in this step may correspond to a preset contact range, for example, as shown in fig. 2, the infrared sensor collects an infrared value in a range from 0 to 1023, and if the preset contact range is from 1000 to 1023, the threshold in this step may be 1000, which is not limited in this embodiment.
Specifically, for the case where the current infrared value is less than the threshold, the next infrared value may continue to be compared with the contact range.
Step 302: judging whether n infrared values before the current infrared value are all larger than or equal to a threshold value, and the n +1 infrared value before the current infrared value is smaller than the threshold value; if yes, go to step 302.
It is understood that n in this step may be a preset number minus 1. That is, if all the n infrared values before the current infrared value are greater than or equal to the threshold, it indicates that the state where the current infrared value is located has the preset number of infrared values continuously located in the preset contact range, and whether the next infrared value is greater than or equal to the threshold, the state where the current infrared value is located can be determined as the contact state; if the (n + 1) th infrared value before the current infrared value is smaller than the threshold, the contact state where the current infrared value is located is a new contact state, and is not a previous continuous contact state (that is, the contact state corresponding to the contact state identifier is generated).
In the case where the determination condition in this step is not satisfied, the next infrared value may be continuously compared with the contact range.
Step 303: and generating a contact state identifier.
It can be understood that, for the specific process of determining whether the contact state identifier greater than or equal to the preset number of times is generated within the preset time period by using the generated contact state identifier in step 204, the specific process may be set by a designer according to a practical scene and a user requirement, and if the timing is started after step 203 is entered, the specific process may be determined whether the contact state identifier greater than or equal to the preset number of times is generated within the preset time period; after the contact state identifier is generated, whether the contact state identifier which is greater than or equal to the preset number minus 1 is generated again in a first preset time period (such as the time of the preset time period minus the time of the contact state identifier) after the current time is judged; after the contact state identifier is generated, whether the difference between the current time and the generation time of the regenerated first preset times minus 1 contact state identifier is smaller than a first preset time period or not is judged; or after the contact state identifier is generated, whether the contact state identifier generated by subtracting 1 from the preset number exists in a first preset time period (for example, the time of the preset time period minus the time of the contact state identifier) before the current time is judged. The embodiment does not limit the generation of the contact state identifier greater than or equal to the preset number of times within the preset time period as long as it can be determined.
Correspondingly, the specific value setting of the preset time period in step 204 may be set by an actual person, which is not limited in this embodiment.
Specifically, for a case that the contact state identifier greater than or equal to the preset number of times is not generated within the preset time period, the current wearing condition of the wireless headset can be maintained.
Step 205: determining that the wireless headset is in a worn state.
It can be understood that, in order to further ensure the detection accuracy of the wearing condition of the wireless headset, before this step, it may further include determining whether the collected infrared value is continuously within the preset contact range within a second preset time period, that is, under the condition that the contact state identifier greater than or equal to the preset number of times is generated within the preset time period, further determining whether the user wears the wireless headset.
Step 206: and acquiring an infrared numerical value acquired by the infrared sensor according to a third preset time interval.
It should be noted that the third preset time interval in this step may be set by the designer, for example, the third preset time interval may be set to the same value as the first preset time interval, for example, 0.02 s; in order to further reduce the power consumption of the wireless headset, the third preset time interval may also be set to a value greater than the first preset time interval, which is not limited in this embodiment.
It can be understood that, in order to improve the detection speed of the wearing condition of the wireless headset, when the step 204 determines that the contact state identifier generated within the preset time period is greater than or equal to the preset number of times while the wireless headset is in the wearing state, the user may not complete the adjustment of wearing the wireless headset, and therefore, this step may be performed after a certain time period after the step 205, so as to avoid the influence on the wearing condition detection when the adjustment process of wearing the wireless headset by the user is long.
Step 207: judging whether the infrared numerical value is in a preset far range or not; if yes, go to step 208.
The purpose of this step may be to determine whether the infrared values collected at the third preset time interval are within the preset distance range by sequentially judging whether the infrared values collected at the third preset time interval are within the preset distance range under the condition that the wireless headset is determined to be in the wearing state, and if the infrared values within the preset distance range exist, step 208 is performed to determine that the wireless headset is in the non-wearing state, that is, the user takes off the worn wireless headset.
Specifically, the specific range of the preset distance range in this step may be set by the designer, for example, the infrared sensor shown in fig. 2, acquires an infrared value in a range from 0 to 1023, and if the preset contact range is greater than or equal to 1000(1000 to 1023), the maximum value of the preset distance range in this step may be set to a value less than 1000, for example, 700, that is, the preset distance range is less than or equal to 700(0 to 700).
It can be understood that, in this embodiment, it may be directly determined whether the infrared value is within the preset distance range through this step, and a manner similar to this step may also be adopted to determine the wearing condition of the wireless headset, that is, whether the user has taken off the worn wireless headset, for example, to determine whether the infrared value is within the preset distance range for multiple times (for example, twice). The present embodiment does not set any limit to this.
Step 208: determining that the wireless headset is in a non-worn state.
The non-wearing state in this step may be a state in which the user does not wear the wireless headset.
In the embodiment, whether the infrared value is in the preset proximity range or not is judged, and whether the user needs to wear the wireless earphone or not is determined, so that the wearing condition of the wireless earphone is not detected by calling an algorithm program when the user does not need to wear the wireless earphone, and the power consumption of the wireless earphone is reduced; whether the infrared numerical value is within the preset distance range or not is judged, whether the worn wireless earphone is taken down by the user or not is determined, the wearing state of the wireless earphone can be automatically adjusted to be a non-wearing state, and user experience is further improved.
Referring to fig. 9, fig. 9 is a structural diagram of a wearing condition detecting device of a wireless headset according to an embodiment of the present invention. The apparatus may include:
the acquisition module 100 is configured to acquire a first distance value acquired by a distance sensor at a first preset time interval; the distance sensor is arranged at the ear inlet end of the wireless earphone;
the judging module 200 is configured to judge whether a contact state greater than or equal to a preset number of times exists within a preset time period according to the first distance value; the contact state is a state that the first distance values of which the number is greater than or equal to a preset number are continuously in a preset contact range, and the preset times are greater than 1;
the determining module 300 is configured to determine that the wireless headset is in a wearing state if the contact state is greater than or equal to a preset number of times.
Optionally, when the distance sensor is an infrared sensor, the determining module 200 may include:
and the judgment submodule is used for sequentially comparing each infrared value with a preset contact range according to the acquisition sequence of the infrared values and judging whether the contact state identifier which is more than or equal to the preset times is generated in a preset time period.
Optionally, the determining sub-module may include:
the first judgment unit is used for judging whether the current infrared value is greater than or equal to a threshold value; wherein the threshold value is the minimum value of a preset contact range;
the second judgment unit is used for judging whether n infrared values before the current infrared value are all larger than or equal to the threshold value if the infrared values are larger than or equal to the threshold value, and the n +1 th infrared value before the current infrared value plus 1 infrared value is smaller than the threshold value; wherein n is the preset number minus 1;
and the generating unit is used for generating the contact state identification if the contact state identification is satisfied.
Optionally, the apparatus may further include:
the second distance value acquisition module is used for acquiring a second distance value acquired by the distance sensor according to a second preset time interval;
the approach judgment module is used for judging whether the second distance value is in a preset approach range or not; if yes, a start signal is sent to the obtaining module 100.
Optionally, the apparatus may further include:
the third distance value acquisition module is used for acquiring a third distance value acquired by the distance sensor according to a third preset time interval;
the far-away judging module is used for judging whether the third distance value is in a preset far-away range or not;
and the non-wearing determining module is used for determining that the wireless earphone is in a non-wearing state if the third distance value is in the preset far range.
In this embodiment, in the embodiment of the present invention, the determining module 300 determines that the wireless headset is in the wearing state when the contact state greater than or equal to the preset number of times exists in the preset time period, so that the number of false recognition cases is reduced, the accuracy of wearing state detection is improved, the user experience is improved, more accurate wearing state detection using the distance sensor alone can be realized, and the setting cost and power consumption of the headset are reduced.
An embodiment of the present invention further provides a wireless headset, including: a distance sensor, a memory, and a processor; the memory is used for storing a computer program, and the processor is used for implementing the steps of the method for detecting the wearing condition of the wireless headset provided by any one of the above embodiments when the computer program is executed.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for detecting the wearing condition of a wireless headset according to any of the above embodiments are implemented.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device, the wireless headset and the computer-readable storage medium disclosed by the embodiment correspond to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The method and the device for detecting the wearing condition of the wireless headset, the wireless headset and the computer readable storage medium provided by the invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (8)

1. A method for detecting the wearing condition of a wireless earphone is characterized by comprising the following steps:
acquiring a first distance value acquired by a distance sensor according to a first preset time interval; the distance sensor is arranged at the ear inlet end of the wireless earphone;
judging whether a contact state which is more than or equal to a preset number of times exists in a preset time period or not according to the first distance value; the contact state is a state that the first distance values of which the number is greater than or equal to a preset number are continuously in a preset contact range, and the preset times are greater than 1;
if yes, determining that the wireless earphone is in a wearing state;
when the distance sensor is an infrared sensor, whether a contact state with preset times exists in a preset time period or not is judged according to the first distance value, and the method comprises the following steps:
and according to the acquisition sequence of the infrared values, sequentially comparing each infrared value with the preset contact range, and judging whether the contact state identifier which is more than or equal to the preset times is generated in the preset time period.
2. The method for detecting the wearing condition of the wireless earphone according to claim 1, wherein the step of sequentially comparing each infrared value with the preset contact range according to the collection sequence of the infrared values to determine whether the contact state identifier greater than or equal to the preset number of times is generated within the preset time period comprises:
judging whether the current infrared value is greater than or equal to a threshold value; the threshold value is the minimum value of the preset contact range, and the current infrared value is any one infrared value;
if yes, judging whether n infrared values before the current infrared value are all larger than or equal to the threshold value, and the n +1 infrared value before the current infrared value is smaller than the threshold value; wherein n is the preset number minus 1;
and if so, generating the contact state identification.
3. The method for detecting the wearing condition of the wireless headset according to claim 1, wherein before acquiring the first distance value acquired by the distance sensor at the first preset time interval, the method further comprises:
acquiring a second distance value acquired by the distance sensor according to a second preset time interval;
judging whether the second distance value is within a preset approaching range or not;
and if so, executing the step of acquiring a first distance value acquired by the distance sensor according to a first preset time interval.
4. The method for detecting the wearing condition of the wireless earphone according to any one of claims 1 to 3, wherein after determining that the wireless earphone is in the wearing state, the method further comprises:
acquiring a third distance value acquired by the distance sensor according to a third preset time interval;
judging whether the third distance value is within a preset distance range or not;
if so, determining that the wireless earphone is in a non-wearing state.
5. A wearing condition detection device for a wireless headset, comprising:
the acquisition module is used for acquiring a first distance value acquired by the distance sensor according to a first preset time interval; the distance sensor is arranged at the ear inlet end of the wireless earphone;
the judging module is used for judging whether a contact state which is more than or equal to a preset number of times exists in a preset time period according to the first distance value; the contact state is a state that the first distance values of which the number is greater than or equal to a preset number are continuously in a preset contact range, and the preset times are greater than 1;
the determining module is used for determining that the wireless earphone is in a wearing state if the contact state which is more than or equal to the preset times exists;
when the distance sensor is an infrared sensor, the judging module comprises:
and the judgment submodule is used for sequentially comparing each infrared value with the preset contact range according to the acquisition sequence of the infrared values and judging whether the contact state identifier which is more than or equal to the preset times is generated in the preset time period.
6. The apparatus for detecting wearing condition of wireless earphone according to claim 5, wherein the determining sub-module comprises:
the first judgment unit is used for judging whether the current infrared value is greater than or equal to a threshold value; the threshold value is the minimum value of the preset contact range, and the current infrared value is any one infrared value;
a second determining unit, configured to determine whether n infrared values before the current infrared value are all greater than or equal to the threshold value and n +1 infrared value before the current infrared value is less than the threshold value if the n infrared values before the current infrared value are greater than or equal to the threshold value; wherein n is the preset number minus 1;
and the generating unit is used for generating the contact state identifier if the contact state identifier is satisfied.
7. A wireless headset, comprising: a distance sensor, a memory, and a processor; wherein the memory is configured to store a computer program, and the processor is configured to implement the steps of the method for detecting wearing condition of a wireless headset according to any one of claims 1 to 4 when executing the computer program.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method for detecting the wearing condition of a wireless headset according to any one of claims 1 to 4.
CN201811139877.3A 2018-09-28 2018-09-28 Wearing condition detection method and device of wireless earphone and wireless earphone Active CN109257674B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811139877.3A CN109257674B (en) 2018-09-28 2018-09-28 Wearing condition detection method and device of wireless earphone and wireless earphone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811139877.3A CN109257674B (en) 2018-09-28 2018-09-28 Wearing condition detection method and device of wireless earphone and wireless earphone

Publications (2)

Publication Number Publication Date
CN109257674A CN109257674A (en) 2019-01-22
CN109257674B true CN109257674B (en) 2020-03-24

Family

ID=65048222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811139877.3A Active CN109257674B (en) 2018-09-28 2018-09-28 Wearing condition detection method and device of wireless earphone and wireless earphone

Country Status (1)

Country Link
CN (1) CN109257674B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110650397B (en) * 2019-09-18 2021-01-22 歌尔股份有限公司 Wireless earphone detection method and detection device
CN110677768A (en) * 2019-10-31 2020-01-10 歌尔科技有限公司 Wireless earphone control method and device, wireless earphone and storage medium
CN111225320B (en) * 2019-12-31 2021-07-13 歌尔股份有限公司 Earphone wearing state detection method, earphone and readable storage medium
CN111479185B (en) * 2020-02-24 2021-08-31 刘春艳 Automatic adsorption mechanism driving system for protecting eardrum
CN111366175A (en) * 2020-04-20 2020-07-03 深圳市科奈信科技有限公司 Wireless earphone, method and device for detecting wearing state of wireless earphone and storage medium
DE102020208682A1 (en) 2020-07-10 2022-01-13 Robert Bosch Gesellschaft mit beschränkter Haftung Method for determining a wearing condition of an earphone and earphone system
CN114268872A (en) * 2021-11-29 2022-04-01 歌尔科技有限公司 Wireless earphone wearing detection method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202998416U (en) * 2012-12-26 2013-06-12 广东欧珀移动通信有限公司 Earphone and terminal equipment controlling audio playing through the earphone
CN104808772A (en) * 2014-01-24 2015-07-29 北京奇虎科技有限公司 Device and method for detecting continuous attaching of head-wearing intelligent device on human body
CN105101016A (en) * 2015-08-07 2015-11-25 深圳市金立通信设备有限公司 Earphone sound channel switching method and terminal
CN106645978A (en) * 2016-10-28 2017-05-10 广东美的制冷设备有限公司 Wearing state detecting method and detecting device for intelligent wearable equipment
CN106792314A (en) * 2016-12-29 2017-05-31 歌尔科技有限公司 A kind of detection method of ear-sticking headphone and its wearing state

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5880340B2 (en) * 2012-08-02 2016-03-09 ソニー株式会社 Headphone device, wearing state detection device, wearing state detection method
US9326058B2 (en) * 2012-09-26 2016-04-26 Sony Corporation Control method of mobile terminal apparatus
KR102049781B1 (en) * 2013-02-26 2019-11-28 삼성전자 주식회사 Application Controlling Method of Electronic Device and Apparatus thereof, and Earphone device and Application Controlling system supporting the same

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202998416U (en) * 2012-12-26 2013-06-12 广东欧珀移动通信有限公司 Earphone and terminal equipment controlling audio playing through the earphone
CN104808772A (en) * 2014-01-24 2015-07-29 北京奇虎科技有限公司 Device and method for detecting continuous attaching of head-wearing intelligent device on human body
CN105101016A (en) * 2015-08-07 2015-11-25 深圳市金立通信设备有限公司 Earphone sound channel switching method and terminal
CN106645978A (en) * 2016-10-28 2017-05-10 广东美的制冷设备有限公司 Wearing state detecting method and detecting device for intelligent wearable equipment
CN106792314A (en) * 2016-12-29 2017-05-31 歌尔科技有限公司 A kind of detection method of ear-sticking headphone and its wearing state

Also Published As

Publication number Publication date
CN109257674A (en) 2019-01-22

Similar Documents

Publication Publication Date Title
CN109257674B (en) Wearing condition detection method and device of wireless earphone and wireless earphone
CN108810788B (en) Wearing condition detection method and device of wireless earphone and wireless earphone
CN110418232B (en) Volume adjusting method and device and computer readable storage medium
CN108712697B (en) Wireless earphone and working mode determining method, device, equipment and storage medium thereof
CN108810696B (en) Electric quantity prompting method, TWS earphone and earphone charging equipment
CN109618263B (en) Head/neck inclination angle detection method, device and system and wireless earphone controller
CN108886653B (en) Earphone sound channel control method, related equipment and system
CN109348334B (en) Wireless earphone and environment monitoring method and device thereof
CN108848429A (en) The pairing connection method of wireless transmitting-receiving equipments and wireless transmitting-receiving equipments
CN108766468B (en) Intelligent voice detection method, wireless earphone, TWS earphone and terminal
CN112911487B (en) In-ear detection method for wireless headset, wireless headset and storage medium
EP3823311A1 (en) Microphone hole blockage detection method and related product
CN110896511A (en) Earphone control method and device, storage medium and computer equipment
CN111768600A (en) Head-lowering detection method and device and wireless earphone
CN109089201B (en) Microphone hole blockage detection method and related product
CN113596657A (en) Earphone in-ear detection method, terminal and computer readable storage medium
EP3157270B1 (en) Hearing device with vibration sensitive transducer
CN113920975A (en) Noise reduction parameter setting method and device, earphone equipment and storage medium
CN109361987B (en) Sports earphone and control method, device and equipment thereof
CN114286219B (en) Method for configuring headphone channel, headphone assembly, and computer-readable storage medium
CN117440282A (en) Earphone wearing state detection method and device, earphone and storage medium
CN106572410A (en) Portable device and method for entering power-saving mode
CN117319870A (en) Earphone wearing state detection method and device, earphone and storage medium
EP4294037A1 (en) Wearing detection method, wearable device and storage medium
CN108882112A (en) Audio play control method, device, storage medium and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant