Earphone state detection method, device, equipment and storage medium

文档序号:196439 发布日期:2021-11-02 浏览:33次 中文

阅读说明:本技术 耳机状态检测方法、装置、设备及存储介质 (Earphone state detection method, device, equipment and storage medium ) 是由 赵于成 陈智威 隋昊 于 2021-07-19 设计创作,主要内容包括:本发明涉及耳机技术领域,公开了一种耳机状态检测方法、装置、设备及存储介质,所述方法包括:获取耳机与目标检测点的距离信息;若所述距离信息小于预设距离阈值,获取所述耳机的方位信息;根据所述耳机的方位信息确定所述耳机的使用状态。通过判断耳机与目标检测物之间的距离在预设距离阈值之后,确定耳机的方位信息,最终通过方位信息进行出入耳状态的综合判断,从而可以提高耳机状态检测的准确率。(The invention relates to the technical field of earphones, and discloses an earphone state detection method, an earphone state detection device, earphone state detection equipment and a storage medium, wherein the method comprises the following steps: acquiring distance information between the earphone and a target detection point; if the distance information is smaller than a preset distance threshold, acquiring the azimuth information of the earphone; and determining the use state of the earphone according to the direction information of the earphone. After the distance between the earphone and the target detection object is judged to be within the preset distance threshold value, the direction information of the earphone is determined, and finally the comprehensive judgment of the in-and-out-of-ear state is carried out through the direction information, so that the accuracy of earphone state detection can be improved.)

1. A method for detecting a state of a headset, the method comprising:

acquiring distance information between the earphone and a target detection point;

if the distance information is smaller than a preset distance threshold, acquiring the azimuth information of the earphone;

and determining the use state of the earphone according to the direction information of the earphone.

2. The method for detecting the state of the headset according to claim 1, wherein the obtaining the orientation information of the headset if the distance information is smaller than a preset distance threshold comprises:

if the distance information is smaller than a preset distance threshold value, acquiring the motion data of the earphone;

and if the motion data meet a static state condition, determining the azimuth information of the earphone, wherein the static state condition is the state of the change value of the motion data in a preset interval within a preset time period.

3. The method for detecting the state of the headset according to claim 2, wherein after obtaining the motion data of the headset if the distance information is smaller than a preset distance threshold, the method further comprises:

and if the motion data meet a motion state condition, re-executing the step of acquiring the distance information between the earphone and the target detection point, wherein the motion state condition is a state that the change value of the motion data in a preset time period is outside a preset interval.

4. The method for detecting the state of a headset of claim 2, wherein the determining the orientation information of the headset if the motion data satisfies a stationary state condition comprises:

and if the motion data meet the static state condition, determining the azimuth information of the earphone according to a preset coordinate system.

5. A headset state detecting method according to any of claims 1-4, wherein the determining the usage state of the headset based on the orientation information of the headset comprises:

acquiring horizontal axis coordinate orientation information, vertical axis coordinate orientation information and vertical axis coordinate orientation information in the orientation information;

if the horizontal axis coordinate position information is larger than first coordinate position information or smaller than second coordinate position information, determining the use state of the earphone according to the vertical axis coordinate position information and the vertical axis coordinate position information, wherein the first coordinate position information is larger than the second coordinate position information;

and if the longitudinal axis coordinate position information is greater than the first coordinate position information or less than the second coordinate position information, determining the use state of the earphone according to the transverse axis coordinate position information and the vertical axis coordinate position information.

6. The method for detecting the status of a headphone according to claim 5, wherein determining the usage status of the headphone according to the ordinate orientation information of the vertical axis and the ordinate orientation information if the abscissa orientation information is greater than the first ordinate orientation information or less than the second ordinate orientation information comprises:

if the horizontal axis coordinate position information is larger than the first coordinate position information or smaller than the second coordinate position information, judging whether the vertical axis coordinate position information is larger than third coordinate position information or smaller than fourth coordinate position information, wherein the third coordinate position information is larger than the fourth coordinate position information;

if the vertical axis coordinate position information is larger than third coordinate position information or smaller than fourth coordinate position information, judging whether the longitudinal axis coordinate position information is larger than fifth coordinate position information and smaller than sixth coordinate position information, wherein the fifth coordinate position information is larger than the sixth coordinate position information;

and if the longitudinal axis coordinate position information is greater than the fifth coordinate position information and less than the sixth coordinate position information, determining the use state of the earphone.

7. The method for detecting the status of a headphone according to claim 5, wherein if the information on the coordinate position of the vertical axis is greater than the information on the coordinate position of the first axis or less than the information on the coordinate position of the second axis, determining the usage status of the headphone according to the information on the coordinate position of the horizontal axis and the information on the coordinate position of the vertical axis comprises:

if the longitudinal axis coordinate position information is larger than the first coordinate position information or smaller than the second coordinate position information, judging whether the vertical axis coordinate position information is larger than the third coordinate position information or smaller than the fourth coordinate position information;

if the vertical axis coordinate position information is larger than the third coordinate position information or smaller than the fourth coordinate position information, judging whether the horizontal axis coordinate position information is larger than the fifth coordinate position information and smaller than the sixth coordinate position information;

and if the information of the coordinate position of the transverse axis is greater than the information of the fifth coordinate position and less than the information of the sixth coordinate position, determining the use state of the earphone.

8. An earphone state detection apparatus, characterized by comprising:

the acquisition module is used for acquiring distance information between the earphone and the target detection point;

the direction confirmation module is used for acquiring the direction information of the earphone if the distance information is smaller than a preset distance threshold;

and the state confirmation module is used for determining the use state of the earphone according to the direction information of the earphone.

9. An earphone state detection device characterized by comprising: a memory, a processor, and a headset state detection program stored on the memory and executable on the processor, the headset state detection program configured to implement the headset state detection method of any one of claims 1 to 7.

10. A storage medium having a headphone state detection program stored thereon, the headphone state detection program implementing the headphone state detection method according to any one of claims 1 to 7 when executed by a processor.

Technical Field

The present invention relates to the field of earphone technologies, and in particular, to a method, an apparatus, a device, and a storage medium for detecting an earphone status.

Background

In recent years, with the non-development of the True Wireless Stereo (TWS) headset market, the technology is continuously improved, the number of users is continuously increased, and the experience requirement of an individual user for the TWS headset is higher and higher. Currently, the TWS headset is mainly in-ear type or semi-in-ear type. To going into ear and detecting, mostly use on the market at present optical detection or electric capacity detection scheme, optical detection scheme need punch on the earphone surface and lead to light, be unfavorable for the earphone to do waterproof design like this, in addition, a large amount of earphone products adopt the detection scheme of a single light path, this will lead to when the earphone is not worn, run into the material that blocks the light path and just trigger the detection easily, cause unnecessary consumption, and electric capacity detection scheme, receive the influence of temperature easily, especially in the area of high latitude, because only detect electric capacity change amount, probably be greater than the earphone electric capacity change far away, misjudgment appears very easily, thereby lead to wearing the inefficacy that detects.

The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.

Disclosure of Invention

The invention mainly aims to provide a method, a device, equipment and a storage medium for detecting the state of an earphone, and aims to solve the technical problem of how to improve the accuracy of earphone state detection in the prior art.

In order to achieve the above object, the present invention provides a method for detecting a state of an earphone, the method comprising the steps of:

acquiring distance information between the earphone and a target detection point;

if the distance information is smaller than a preset distance threshold, acquiring the azimuth information of the earphone;

and determining the use state of the earphone according to the direction information of the earphone.

Optionally, if the distance information is smaller than a preset distance threshold, acquiring the orientation information of the headset includes:

if the distance information is smaller than a preset distance threshold value, acquiring the motion data of the earphone;

and if the motion data meet a static state condition, determining the azimuth information of the earphone according to the acceleration sensor, wherein the static state condition is the state of the change value of the motion data in a preset interval within a preset time period.

Optionally, after obtaining the motion data of the headset if the distance information is smaller than a preset distance threshold, the method further includes:

and if the motion data meet a motion state condition, re-executing the step of acquiring the distance information between the earphone and the target detection point, wherein the motion state condition is a state that the change value of the motion data in a preset time period is outside a preset interval.

Optionally, if the motion data satisfies a stationary condition, determining the orientation information of the headset according to an acceleration sensor includes:

and if the motion data meet the static state condition, determining the azimuth information of the earphone according to a preset coordinate system.

Optionally, the determining the usage state of the headset according to the orientation information of the headset includes:

acquiring the horizontal axis coordinate orientation information, the vertical axis coordinate orientation information and the vertical axis coordinate orientation information of the orientation information;

if the horizontal axis coordinate position information is larger than first coordinate position information or smaller than second coordinate position information, determining the use state of the earphone according to the vertical axis coordinate position information and the vertical axis coordinate position information, wherein the first coordinate position information is larger than the second coordinate position information;

and if the longitudinal axis coordinate position information is greater than the first coordinate position information or less than the second coordinate position information, determining the use state of the earphone according to the transverse axis coordinate position information and the vertical axis coordinate position information.

Optionally, if the horizontal axis coordinate position information is greater than the first coordinate position information or less than the second coordinate position information, determining the use state of the headset according to the vertical axis coordinate position information and the vertical axis coordinate position information, including:

if the horizontal axis coordinate position information is larger than the first coordinate position information or smaller than the second coordinate position information, judging whether the vertical axis coordinate position information is larger than third coordinate position information or smaller than fourth coordinate position information, wherein the third coordinate position information is larger than the fourth coordinate position information;

if the vertical axis coordinate position information is larger than third coordinate position information or smaller than fourth coordinate position information, judging whether the longitudinal axis coordinate position information is larger than fifth coordinate position information and smaller than sixth coordinate position information, wherein the fifth coordinate position information is larger than the sixth coordinate position information;

and if the longitudinal axis coordinate position information is greater than the fifth coordinate position information and less than the sixth coordinate position information, determining the use state of the earphone.

Optionally, if the information on the coordinate position of the longitudinal axis is greater than the information on the coordinate position of the first axis or less than the information on the coordinate position of the second axis, determining the use state of the headset according to the information on the coordinate position of the transverse axis and the information on the coordinate position of the vertical axis, including:

if the longitudinal axis coordinate position information is larger than the first coordinate position information or smaller than the second coordinate position information, judging whether the vertical axis coordinate position information is larger than the third coordinate position information or smaller than the fourth coordinate position information;

if the vertical axis coordinate position information is larger than the third coordinate position information or smaller than the fourth coordinate position information, judging whether the horizontal axis coordinate position information is larger than the fifth coordinate position information and smaller than the sixth coordinate position information;

and if the information of the coordinate position of the transverse axis is greater than the information of the fifth coordinate position and less than the information of the sixth coordinate position, determining the use state of the earphone.

In addition, in order to achieve the above object, the present invention further provides an earphone state detection device, including:

the acquisition module is used for acquiring distance information between the earphone and the target detection point;

the direction confirmation module is used for acquiring the direction information of the earphone if the distance information is smaller than a preset distance threshold;

and the state confirmation module is used for determining the use state of the earphone according to the direction information of the earphone.

In addition, to achieve the above object, the present invention also provides an earphone status detection apparatus, including: a memory, a processor and a headphone state detection program stored on the memory and executable on the processor, the headphone state detection program being configured to implement the steps of the headphone state detection method as described above.

Furthermore, to achieve the above object, the present invention further provides a storage medium having a headphone state detection program stored thereon, which when executed by a processor implements the steps of the headphone state detection method as described above.

The earphone state detection method provided by the invention comprises the steps of acquiring distance information between an earphone and a target detection point; if the distance information is smaller than a preset distance threshold, acquiring the azimuth information of the earphone; and determining the use state of the earphone according to the direction information of the earphone. After the distance between the earphone and the target detection object is judged to be within the preset distance threshold value, the direction information of the earphone is determined, and finally the comprehensive judgment of the in-and-out-of-ear state is carried out in a direction information detection mode, so that the accuracy of earphone state detection can be improved.

Drawings

Fig. 1 is a schematic structural diagram of a headset state detection device in a hardware operating environment according to an embodiment of the present invention;

fig. 2 is a schematic flow chart of a first embodiment of a method for detecting states of earphones according to the present invention;

fig. 3 is a flowchart illustrating a second embodiment of a method for detecting states of earphones according to the present invention;

fig. 4 is a flowchart illustrating a method for detecting states of earphones according to a third embodiment of the present invention;

fig. 5 is a block diagram of a first embodiment of the earphone status detection apparatus according to the present invention.

The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.

Detailed Description

It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

Referring to fig. 1, fig. 1 is a schematic structural diagram of a headset state detection device in a hardware operating environment according to an embodiment of the present invention.

As shown in fig. 1, the earphone state detection apparatus may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.

Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the headphone state detection device, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.

As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a headset state detection program.

In the headphone state detection apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 of the earphone state detection device of the present invention may be provided in the earphone state detection device, and the earphone state detection device calls the earphone state detection program stored in the memory 1005 through the processor 1001 and executes the earphone state detection method provided by the embodiment of the present invention.

Based on the hardware structure, the embodiment of the earphone state detection method is provided.

An embodiment of the present invention provides a method for detecting an earphone status, and referring to fig. 2, fig. 2 is a schematic flow diagram of a first embodiment of a method for detecting an earphone status according to the present invention.

In a first embodiment, the headphone state detection method includes the steps of:

step S10: and acquiring distance information between the earphone and the target detection point.

It should be noted that the execution main body of this embodiment may be an earphone status detection device, and may also be other devices that can achieve the same or similar functions.

It should be understood that the distance information between the earphone and the target detection point may be acquired by a distance sensor, where the distance sensor may be disposed in the earphone, the earphone may be a TWS earphone, and the target detection point may be a body part of a wearer of the earphone, such as an ear, which is not limited in this embodiment. The distance sensor may be an infrared distance sensor, an optical distance sensor, an ultrasonic distance sensor, or the like, which is not limited in this embodiment, and the infrared distance sensor may be used as an example in a specific implementation process, so that the distance sensor emits an infrared light source, and determines whether to be close to the target detection point or far from the target detection point by receiving the reflection intensity, so as to sense the distance information between the earphone and the target detection point.

Step S20: and if the distance information is smaller than a preset distance threshold value, acquiring the direction information of the earphone.

It is understood that the preset distance threshold can be set by those skilled in the art, and the present embodiment is not limited thereto, by judging whether the distance information between the earphone and the earphone wearer is smaller than a preset distance threshold value or not, if the distance information between the earphone and the earphone wearer is smaller than the preset distance threshold value, the acceleration sensor is started, in the specific implementation process, the acceleration sensor can be a three-axis acceleration sensor, the acceleration sensor is used for detecting the movement data of the earphone, the movement state of the earphone can be determined according to the movement data, wherein the motion state of the earphone comprises a static state and a motion state, if the motion data meets the static state condition, the position information of the earphone is determined through a preset coordinate system, if the motion data meets the motion state condition, the earphone is probably in a wearing state, the distance needs to be determined again, so the step of obtaining the distance information between the earphone and the target detection point can be executed again.

It should be noted that the acceleration sensor may be disposed in the earphone, which is not limited in this embodiment, so that the acceleration sensor and the distance sensor may be directly initialized when the earphone is taken out of the box. The orientation information may be coordinate orientation information of the headset wearer in a coordinate system established centered on the acceleration sensor.

Furthermore, if the distance information between the earphone and the earphone wearer is greater than or equal to the preset distance information, it indicates that the earphone is not in the in-ear state, and therefore the operation of acquiring the distance information between the earphone and the target detection point can be executed again.

Step S30: and determining the use state of the earphone according to the direction information of the earphone.

It should be understood that the usage state of the headset includes an in-ear state and an out-of-ear state, the horizontal axis coordinate orientation information, the vertical axis coordinate orientation information and the vertical axis coordinate orientation information of the orientation information can be acquired in the specific implementation process, and the usage state of the headset can be confirmed by detecting whether the horizontal axis coordinate orientation information, the vertical axis coordinate orientation information and the vertical axis coordinate orientation information of the orientation information are within a judgment range debugged in advance.

It should be noted that, since the wearer may be in an upright or lying position when the earphone is inserted into the ear, it is necessary to consider that the earphone wearer has an upright position and a lying position in the in-ear state, and different determination conditions are included for the in-ear state in the upright position and the in-ear state in the lying position, and therefore it is possible to determine whether the in-ear state based on the upright position and the in-ear state based on the lying position are within the corresponding pre-set determination range, and it is possible to more accurately confirm that the earphone wearer is in the in-ear state in the upright position and the in-ear state in the lying position.

The embodiment acquires the distance information between the earphone and the target detection point by the distance sensor; when the distance information is smaller than a preset distance threshold value, starting an acceleration sensor, detecting motion data of the earphone through the acceleration sensor, and if the earphone is in a static state, acquiring azimuth information of the earphone; and determining whether the position information of the earphone is in a preset judgment range or not according to the position information of the earphone, and if the position information of the earphone is in the preset judgment range, determining the use state of the earphone. After the distance between the earphone and the target detection object is judged to be within the preset distance threshold value, the direction information of the earphone is determined, and finally the comprehensive judgment of the in-and-out-of-ear state is carried out in a direction information detection mode, so that the accuracy of earphone state detection can be improved.

In an embodiment, referring to fig. 3, fig. 3 is a flowchart illustrating a method for detecting a state of an earphone according to a second embodiment of the present invention.

Based on the first embodiment, in step S20, the method for detecting the earphone status in this embodiment includes:

step S201, if the distance information is smaller than a preset distance threshold, obtaining motion data of the earphone.

It should be noted that the motion data may be acceleration data of the headset acquired by the acceleration sensor within a preset time period, where the preset time period may be set according to an acquisition requirement, and may be 0.5s in a specific implementation process, and when the distance information is smaller than a preset distance threshold, it is stated that the headset is closer to a headset wearer, and therefore, the acceleration sensor may be turned on, and the headset is determined to be in a motion state or a stationary state through a change condition of the acceleration data acquired by the acceleration sensor.

Further, after step S201 is implemented, the method further includes:

if the motion data meets the motion state condition, the step S10 is executed again, where the motion state condition is a state where the change value of the motion data is outside the preset interval within the preset time period.

It should be understood that, if a state in which a change value of the jerk data within a preset time period collected by the acceleration sensor is outside a preset interval indicates that the headset is in a motion state, where the change value of the jerk data may be a difference value between a maximum acceleration value and a minimum acceleration value in the jerk data, and the preset interval may be set by a person skilled in the art.

Step S202, if the motion data meets a static state condition, determining the direction information of the earphone, wherein the motion state condition is that the motion data is in a changing state within a preset time period.

It can be understood that, if the variation value of the motion data acquired by the acceleration sensor within the preset time period is outside the preset interval, it indicates that the headset is in a static state, and therefore the position information of the headset can be determined through the preset coordinate system.

Further, step S202 includes:

and if the motion data meet the static state condition, determining the azimuth information of the earphone according to a preset coordinate system.

It should be noted that the preset coordinate system may be a spatial coordinate system established by taking the position of the acceleration sensor as a center, which is not limited in this embodiment, if the motion data satisfies the condition that the earphone is in a stationary state, calibration and debugging of coordinate axes of the acceleration sensor are performed in advance according to the position and the assembling direction of the acceleration sensor in the earphone, and X, Y and three coordinate axes Z are preset, so as to determine the direction of the coordinate system of the acceleration sensor, where the direction of the Z axis is the direction of the rod body of the earphone, the direction of the X axis is the direction perpendicular to the plane where the sound opening is located at the earphone, and the direction of the Y axis is the direction perpendicular to both the X axis and the Z axis.

It is understood that the orientation information is determined by 6D direction identification according to the coordinate system direction and the motion data, and this embodiment does not limit this, wherein the orientation information includes horizontal axis coordinate orientation information, vertical axis coordinate orientation information, and vertical axis coordinate orientation information.

The embodiment acquires the distance information between the earphone and the target detection point by the distance sensor; if the distance information is smaller than a preset distance threshold value, acquiring the motion data of the earphone, wherein the motion data meets a motion state condition, re-executing the step of acquiring the distance information between the earphone and a target detection point, and if the motion data meets a static state condition, determining the azimuth information of the earphone according to a preset coordinate system; therefore, whether the coordinate and the azimuth information of the azimuth information are in the preset judgment range or not is determined according to the coordinate and the azimuth information of the azimuth information, and if the coordinate and the azimuth information are in the preset judgment range, the use state of the earphone can be determined. After the distance between the earphone and the target detection object is judged to be within the preset distance threshold value, the direction information of the earphone is determined, and finally the comprehensive judgment of the in-and-out-of-ear state is carried out through the direction information, so that the efficiency of earphone state detection accuracy is further improved.

In an embodiment, referring to fig. 4, fig. 4 is a flowchart illustrating a method for detecting a state of an earphone according to a third embodiment of the present invention.

Based on the above embodiment of detecting the earphone status, the step S30 includes:

step S301: and acquiring the horizontal axis coordinate orientation information, the vertical axis coordinate orientation information and the vertical axis coordinate orientation information of the orientation information.

It can be understood that the horizontal axis coordinate orientation information, the vertical axis coordinate orientation information, and the vertical axis coordinate orientation information may be coordinate values of X, Y and Z axes of the acquisition headset recognized by the acceleration sensor through the 6D direction, and in a specific implementation process, g (x) may be used to represent the horizontal axis coordinate orientation information, g (y) may be used to represent the vertical axis coordinate orientation information, and g (Z) may be used to represent the vertical axis coordinate orientation information, which is not limited in this embodiment.

Step S302: and if the horizontal axis coordinate position information is larger than first coordinate position information or smaller than second coordinate position information, determining the use state of the earphone according to the vertical axis coordinate position information and the vertical axis coordinate position information, wherein the first coordinate position information is larger than the second coordinate position information.

Further, the step S302 includes:

if the horizontal axis coordinate position information is larger than the first coordinate position information or smaller than the second coordinate position information, judging whether the vertical axis coordinate position information is larger than third coordinate position information or smaller than fourth coordinate position information, wherein the third coordinate position information is larger than the fourth coordinate position information.

It is to be understood that the first coordinate position information, the second coordinate position information, the third coordinate position information, and the fourth coordinate position information may be judgment range information that is debugged in advance by those skilled in the art, and this embodiment is not limited thereto, and for convenience of understanding, the first coordinate position information may be represented by a, the second coordinate position information may be represented by b, the third coordinate position information may be represented by c, and the fourth coordinate position information may be represented by d, where a > b, and c > d.

It is to be understood that, when it is first determined whether the abscissa orientation information is larger than the first coordinate orientation information or smaller than the second coordinate orientation information, it is further determined whether the ordinate orientation information is g (z) larger than the third coordinate orientation information c or smaller than the fourth coordinate orientation information d by determining whether the abscissa orientation information is larger than the first coordinate orientation information or smaller than the second coordinate orientation information, i.e., g (x) > a or g (x) < b.

If the vertical axis coordinate position information is larger than the third coordinate position information or smaller than the fourth coordinate position information, judging whether the vertical axis coordinate position information is larger than the fifth coordinate position information and smaller than the sixth coordinate position information, wherein the fifth coordinate position information is larger than the sixth coordinate position information.

It is to be understood that the fifth coordinate azimuth information and the sixth coordinate azimuth information may be judgment range information debugged in advance by those skilled in the art, which is not limited in this embodiment, and for convenience of understanding, the fifth coordinate azimuth information may be represented by e, and the sixth coordinate azimuth information may be represented by f, where f > e.

It is to be understood that by determining whether the vertical axis coordinate orientation information is larger than the third coordinate orientation information or smaller than the fourth coordinate orientation information, i.e., g (z) > c or g (z) < d, it is further determined whether the vertical axis coordinate orientation information g (y) is larger than the fifth coordinate orientation information e and smaller than the sixth coordinate orientation information f.

And if the longitudinal axis coordinate position information is greater than the fifth coordinate position information and less than the sixth coordinate position information, determining the use state of the earphone.

It should be understood that by judging that if the vertical axis coordinate orientation information is larger than the fifth coordinate orientation information and smaller than the sixth coordinate orientation information, i.e., e < g (y) < f, it is possible to determine that the earphone is in the use state and that the use state is in the in-ear state, and considering that the wearer has the upright posture state and the lying posture state, it is possible to further determine that the earphone is in the in-ear state in the upright posture state by the above judgment, and if the above judgment condition is not satisfied, it is indicated that the earphone is in the not-in-ear state, and therefore, it is necessary to perform the step of acquiring the distance information between the earphone and the target detection point in a reset manner.

Step S303: and if the longitudinal axis coordinate position information is greater than the first coordinate position information or less than the second coordinate position information, determining the use state of the earphone according to the transverse axis coordinate position information and the vertical axis coordinate position information.

Further, the step S303 includes:

and if the longitudinal axis coordinate position information is greater than the first coordinate position information or less than the second coordinate position information, judging whether the vertical axis coordinate position information is greater than the third coordinate position information or less than the fourth coordinate position information.

It should be understood that it is first determined whether the vertical axis coordinate orientation information is larger than the first coordinate orientation information or smaller than the second coordinate orientation information, and if the vertical axis coordinate orientation information is larger than the first coordinate orientation information or smaller than the second coordinate orientation information, i.e., g (y) > a or g (y) < b, it is further determined whether the vertical axis coordinate orientation information g (z) is larger than the third coordinate orientation information c or smaller than the fourth coordinate orientation information d.

And if the vertical axis coordinate position information is greater than the third coordinate position information or less than the fourth coordinate position information, judging whether the horizontal axis coordinate position information is greater than the fifth coordinate position information and less than the sixth coordinate position information.

It is understood that by determining whether the vertical axis coordinate orientation information is larger than the third coordinate orientation information or smaller than the fourth coordinate orientation information, i.e., g (z) > c or g (z) < d, it is further determined whether the horizontal axis coordinate orientation information g (x) is larger than the fifth coordinate orientation information e and smaller than the sixth coordinate orientation information f.

And if the information of the coordinate position of the transverse axis is greater than the information of the fifth coordinate position and less than the information of the sixth coordinate position, determining the use state of the earphone.

It should be understood that by judging that if the horizontal axis coordinate orientation information is greater than the fifth coordinate orientation information and less than the sixth coordinate orientation information, i.e., e < g (x) < f, the earphone can be determined to be in the use state and the use state is in the in-ear state, and considering that the wearer has the upright posture state and the lying posture state, the in-ear state of the earphone in the lying posture state can be further determined by the above judgment, and if the above judgment condition is not satisfied, the use state of the earphone is in the not-in-ear state, and therefore, the step of acquiring the distance information between the earphone and the target detection point needs to be reset and executed.

In the embodiment, the horizontal axis coordinate azimuth information, the vertical axis coordinate azimuth information and the vertical axis coordinate azimuth information of the azimuth information are obtained; judging whether the vertical axis coordinate position information is larger than the third coordinate position information or smaller than the fourth coordinate position information by judging whether the horizontal axis coordinate position information is larger than the first coordinate position information or smaller than the second coordinate position information; if the vertical axis coordinate position information is greater than the third coordinate position information or less than the fourth coordinate position information, judging whether the vertical axis coordinate position information is greater than the fifth coordinate position information and less than the sixth coordinate position information; if the longitudinal axis coordinate position information is greater than the fifth coordinate position information and less than the sixth coordinate position information, determining that the use state of the earphone is the in-ear state of the upright posture state, and judging whether the vertical axis coordinate position information is greater than the third coordinate position information or less than the fourth coordinate position information by judging if the longitudinal axis coordinate position information is greater than the first coordinate position information or less than the second coordinate position information; if the vertical axis coordinate position information is greater than the third coordinate position information or less than the fourth coordinate position information, judging whether the horizontal axis coordinate position information is greater than the fifth coordinate position information and less than the sixth coordinate position information; if the azimuth information of the horizontal axis coordinate is larger than the azimuth information of the fifth coordinate and smaller than the azimuth information of the sixth coordinate, the use state of the earphone is determined to be the ear state of the lying posture state, and therefore the earphone state detection accuracy is further improved.

In addition, an embodiment of the present invention further provides a storage medium, where the storage medium stores an earphone status detection program, and the earphone status detection program, when executed by a processor, implements the steps of the earphone status detection method described above.

Since the storage medium adopts all technical solutions of all the embodiments, at least all the beneficial effects brought by the technical solutions of the embodiments are achieved, and no further description is given here.

Referring to fig. 5, fig. 5 is a block diagram illustrating a first embodiment of the earphone status detecting device according to the present invention.

As shown in fig. 5, the earphone state detection apparatus according to the embodiment of the present invention includes:

and the obtaining module 10 is configured to obtain distance information between the earphone and the target detection point.

It should be understood that the distance information between the earphone and the target detection point may be acquired by a distance sensor, where the distance sensor may be disposed in the earphone, the earphone may be a TWS earphone, and the target detection point may be a body part of a wearer of the earphone, such as an ear, which is not limited in this embodiment. The distance sensor may be an infrared distance sensor, an optical distance sensor, an ultrasonic distance sensor, or the like, which is not limited in this embodiment, and the infrared distance sensor may be used as an example in a specific implementation process, so that the distance sensor emits an infrared light source, and determines whether to be close to the target detection point or far from the target detection point by receiving the reflection intensity, so as to sense the distance information between the earphone and the target detection point.

It should be noted that the preset distance threshold may be set by a person skilled in the art, which is not limited in this embodiment, by determining whether the distance information between the earphone and the earphone wearer is within the preset distance threshold, if the distance information between the earphone and the earphone wearer is greater than or equal to the preset distance information, it is indicated that the earphone is in a non-in-ear state at this time, and therefore, the operation of obtaining the distance information between the earphone and the target detection point may be performed again.

And the direction confirmation module 20 is configured to acquire the direction information of the headset if the distance information is smaller than a preset distance threshold.

It can be understood that the preset distance threshold may be set by a person skilled in the art, which is not limited in this embodiment, by determining whether the distance information between the earphone and the earphone wearer is smaller than the preset distance threshold, and if the distance information between the earphone and the earphone wearer is smaller than the preset distance threshold, turning on the acceleration sensor, in a specific implementation process, the acceleration sensor may be a three-axis acceleration sensor, detecting the motion data of the earphone through the acceleration sensor, and determining the motion state of the earphone according to the motion data, where the motion state of the earphone includes a static state and a motion state, if the motion data satisfies the static state condition, the orientation information of the earphone may be determined through a preset coordinate system, and if the motion data satisfies the motion state condition, it is indicated that the earphone is probably in a wearing state, the distance needs to be determined again, the step of obtaining distance information of the headset from the target detection point can be re-performed.

It should be noted that the acceleration sensor may be disposed in the earphone, which is not limited in this embodiment, so that the acceleration sensor and the distance sensor may be directly initialized when the earphone is taken out of the box. The orientation information may be coordinate orientation information of the headset wearer in a coordinate system established centered on the acceleration sensor.

Furthermore, if the distance information between the earphone and the earphone wearer is greater than or equal to the preset distance information, it indicates that the earphone is not in the in-ear state, and therefore the operation of acquiring the distance information between the earphone and the target detection point can be executed again.

And the state confirmation module 30 is used for determining the use state of the earphone according to the direction information of the earphone.

It should be understood that the usage state of the headset includes an in-ear state and an out-of-ear state, the horizontal axis coordinate orientation information, the vertical axis coordinate orientation information and the vertical axis coordinate orientation information of the orientation information can be acquired in the specific implementation process, and the usage state of the headset can be confirmed by detecting whether the horizontal axis coordinate orientation information, the vertical axis coordinate orientation information and the vertical axis coordinate orientation information of the orientation information are within a judgment range debugged in advance.

It should be noted that, since the wearer may be in an upright or lying position when the earphone is inserted into the ear, it is necessary to consider that the earphone wearer has an upright position and a lying position in the in-ear state, and different determination conditions are included for the in-ear state in the upright position and the in-ear state in the lying position, and therefore it is possible to determine whether the in-ear state based on the upright position and the in-ear state based on the lying position are within the corresponding pre-set determination range, and it is possible to more accurately confirm that the earphone wearer is in the in-ear state in the upright position and the in-ear state in the lying position.

The embodiment acquires the distance information between the earphone and the target detection point by the distance sensor; if the distance information is smaller than a preset distance threshold value, acquiring the motion data of the earphone, wherein the motion data meets a motion state condition, re-executing the step of acquiring the distance information between the earphone and a target detection point, and if the motion data meets a static state condition, determining the orientation information of the earphone by direction identification according to a coordinate system established by taking the position of an acceleration sensor as a center; therefore, whether the coordinate and the azimuth information of the azimuth information are in the preset judgment range or not is determined according to the coordinate and the azimuth information of the azimuth information, and if the coordinate and the azimuth information are in the preset judgment range, the use state of the earphone can be determined. After the distance between the earphone and the target detection object is judged to be within the preset distance threshold value, the direction information of the earphone is determined, and finally the comprehensive judgment of the in-and-out-of-ear state is carried out through the direction information, so that the efficiency of earphone state detection accuracy is further improved.

In an embodiment, the direction confirmation module 20 is further configured to obtain motion data of the headset if the distance information is smaller than a preset distance threshold; and if the motion data meet the static state condition, determining the direction information of the earphone according to the acceleration sensor.

In an embodiment, the direction confirmation module 20 is further configured to re-execute the step of obtaining the distance information between the earphone and the target detection point if the motion data satisfies the motion state condition.

In an embodiment, the orientation determining module 20 is further configured to determine, if the motion data satisfies a stationary condition, orientation information of the headset according to a coordinate system established by taking a position of the acceleration sensor as a center through direction identification according to the coordinate system.

In an embodiment, the state confirmation module 30 is further configured to obtain horizontal axis coordinate position information, vertical axis coordinate position information, and vertical axis coordinate position information of the position information; if the horizontal axis coordinate position information is larger than first coordinate position information or smaller than second coordinate position information, determining the use state of the earphone according to the vertical axis coordinate position information and the vertical axis coordinate position information, wherein the first coordinate position information is larger than the second coordinate position information; and if the longitudinal axis coordinate position information is greater than the first coordinate position information or less than the second coordinate position information, determining the use state of the earphone according to the transverse axis coordinate position information and the vertical axis coordinate position information.

In an embodiment, the state confirmation module 30 is further configured to determine whether the vertical axis coordinate position information is greater than third coordinate position information or less than fourth coordinate position information if the horizontal axis coordinate position information is greater than the first coordinate position information or less than the second coordinate position information, where the third coordinate position information is greater than the fourth coordinate position information; if the vertical axis coordinate position information is larger than third coordinate position information or smaller than fourth coordinate position information, judging whether the longitudinal axis coordinate position information is larger than fifth coordinate position information and smaller than sixth coordinate position information, wherein the fifth coordinate position information is larger than the sixth coordinate position information; and if the longitudinal axis coordinate position information is greater than the fifth coordinate position information and less than the sixth coordinate position information, determining the use state of the earphone.

In an embodiment, the state confirmation module 30 is further configured to determine whether the vertical axis coordinate position information is greater than the third coordinate position information or less than the fourth coordinate position information if the vertical axis coordinate position information is greater than the first coordinate position information or less than the second coordinate position information; if the vertical axis coordinate position information is larger than the third coordinate position information or smaller than the fourth coordinate position information, judging whether the horizontal axis coordinate position information is larger than the fifth coordinate position information and smaller than the sixth coordinate position information; and if the information of the coordinate position of the transverse axis is greater than the information of the fifth coordinate position and less than the information of the sixth coordinate position, determining the use state of the earphone.

Other embodiments or specific implementation methods of the earphone state detection apparatus according to the present invention may refer to the above embodiments, and are not described in detail herein.

It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited thereto.

It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.

In addition, the technical details that are not described in detail in this embodiment may refer to the method for detecting the state of the earphone provided in any embodiment of the present invention, and are not described herein again.

Further, it is to be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.

The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.

Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.

The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种耳机入耳检测方法、终端及计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类