CN109511034B - Wearing detection method and device of earphone and earphone - Google Patents

Wearing detection method and device of earphone and earphone Download PDF

Info

Publication number
CN109511034B
CN109511034B CN201811526407.2A CN201811526407A CN109511034B CN 109511034 B CN109511034 B CN 109511034B CN 201811526407 A CN201811526407 A CN 201811526407A CN 109511034 B CN109511034 B CN 109511034B
Authority
CN
China
Prior art keywords
earphone
acceleration
acceleration data
event
detecting whether
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
CN201811526407.2A
Other languages
Chinese (zh)
Other versions
CN109511034A (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 Inc
Original Assignee
Goertek Inc
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 Inc filed Critical Goertek Inc
Priority to CN201811526407.2A priority Critical patent/CN109511034B/en
Publication of CN109511034A publication Critical patent/CN109511034A/en
Application granted granted Critical
Publication of CN109511034B publication Critical patent/CN109511034B/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/1008Earpieces of the supra-aural or circum-aural type
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01VGEOPHYSICS; GRAVITATIONAL MEASUREMENTS; DETECTING MASSES OR OBJECTS; TAGS
    • G01V9/00Prospecting or detecting by methods not provided for in groups G01V1/00 - G01V8/00

Landscapes

  • Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Life Sciences & Earth Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Geophysics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Headphones And Earphones (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a wearing detection method and device of an earphone and the earphone, wherein the wearing detection method comprises the following steps: detecting whether a first event that the earphone approaches the ear of the user occurs; controlling an acceleration sensor arranged on the earphone to acquire acceleration data when a first event is detected; and detecting whether the earphone is worn or not according to the acceleration data. Therefore, only under the condition that the earphone is close to the ear of the user, the acceleration sensor is started to collect acceleration data, and then the earphone wearing detection is executed according to the collected acceleration data, so that the power consumption of the earphone can be reduced.

Description

Wearing detection method and device of earphone and earphone
Technical Field
The invention relates to the technical field of earphone wearing detection, in particular to an earphone wearing detection method and device and an earphone.
Background
With the continuous improvement of the living standard and the gradual change of the scientific and technological development of people, the earphone has already gone into the life of people and is favored by consumers in general.
At present, more and more earphones are smaller in size, the battery power is lower, the standby time is prolonged for saving the power to the maximum extent, and the earphone can be worn and detected. And playing the audio in the condition that the earphone is detected to be worn in the ear. When the earphone is not detected to be worn, the earphone can enter a low power consumption mode, and the playing is paused to reduce the power consumption of the battery. Therefore, the service time of the earphone battery can be prolonged to the maximum extent, and the user experience is improved.
Therefore, it is valuable to provide a scheme capable of rapidly and accurately detecting whether the headset is worn or not and reducing the power consumption of the headset.
Disclosure of Invention
An object of the present invention is to provide a new solution for detecting wearing of an earphone.
According to a first aspect of the present invention, there is provided a wearing detection method of an earphone, including:
detecting whether a first event that the earphone approaches the ear of the user occurs;
controlling an acceleration sensor arranged on the earphone to acquire acceleration data when the first event is detected;
and detecting whether the earphone is worn or not according to the acceleration data.
Optionally, the first event includes:
detecting that the distance between the earphone and the ear of the user is smaller than or equal to a preset distance threshold value through a proximity sensor arranged on the earphone.
Optionally, the wearing detection method further includes:
controlling the acceleration sensor to cache the acquired acceleration data into a first-in first-out register of the acceleration sensor;
detecting whether a second event for reading the acceleration data cached in the first-in first-out register occurs or not;
and under the condition that the second event is detected to occur, reading the acceleration data cached in the first-in first-out register for wearing detection.
Optionally, the second event includes any one or more of the following:
the queue depth for caching the acceleration data in the first-in first-out register reaches a preset depth threshold value; the depth threshold is set according to the minimum quantity of acceleration data required for detecting whether the earphone is worn and the maximum value of queue depth for caching the acceleration data in the first-in first-out register;
the acceleration data cached in the first-in first-out register overflows;
a preset read cycle is reached.
Optionally, the wearing detection method further includes:
and controlling the acceleration sensor to stop acquiring the acceleration data under the condition that the detection result that the earphone is in a wearing state or a non-wearing state is obtained according to the acceleration data.
Optionally, the step of detecting whether the headset is worn according to the acceleration data includes:
determining the direction of the gravity acceleration in a preset coordinate system of the acceleration sensor according to the acceleration data;
determining an included angle between the direction of the gravity acceleration in the coordinate system and a set coordinate axis of the coordinate system;
and detecting whether the earphone is worn or not according to the included angle.
Optionally, the step of detecting whether the earphone is worn according to the included angle includes:
and under the condition that the included angle is within a preset included angle range, judging that the earphone is in a wearing state.
According to a second aspect of the present invention, there is provided a wearing detection device of a headphone, including:
a first event detection module for detecting whether a first event that the earphone approaches the ear of the user occurs;
the acquisition control module is used for controlling an acceleration sensor arranged on the earphone to acquire acceleration data under the condition that the first event is detected;
and the wearing detection module is used for detecting whether the earphone is worn or not according to the acceleration data.
Optionally, the first event includes:
detecting that the distance between the earphone and the ear of the user is smaller than or equal to a preset distance threshold value through a proximity sensor arranged on the earphone.
Optionally, the wearing detection device further includes:
the buffer control module is used for controlling the acceleration sensor to buffer the acquired acceleration data into a first-in first-out register of the acceleration sensor;
the second event detection module is used for detecting whether a second event for reading the acceleration data cached in the first-in first-out register occurs or not;
and the data reading module is used for reading the acceleration data cached in the first-in first-out register under the condition that the second event is detected to be generated, so that the wearing detection module can carry out wearing detection.
Optionally, the second event includes any one or more of the following:
the queue depth for caching the acceleration data in the first-in first-out register reaches a preset depth threshold value; the depth threshold is set according to the minimum quantity of acceleration data required for detecting whether the earphone is worn and the maximum value of queue depth for caching the acceleration data in the first-in first-out register;
the acceleration data cached in the first-in first-out register overflows;
a preset read cycle is reached.
Optionally, the wearing detection device further includes:
and the stop control module is used for controlling the acceleration sensor to stop acquiring the acceleration data under the condition that the detection result that the earphone is in a wearing state or a non-wearing state is obtained according to the acceleration data.
Optionally, the wearing detection module includes:
the gravity direction determining unit is used for determining the direction of the gravity acceleration in a preset coordinate system of the acceleration sensor according to the acceleration data;
the included angle determining unit is used for determining an included angle between the direction of the gravitational acceleration in the coordinate system and a set coordinate axis of the coordinate system;
and the wearing detection unit is used for detecting whether the earphone is worn or not according to the included angle.
Optionally, the wearing detection unit is further configured to:
and under the condition that the included angle is within a preset included angle range, judging that the earphone is in a wearing state.
According to a third aspect of the present invention, there is provided a headset comprising:
a wear detection device according to the second aspect of the invention; or,
a processor and a memory for storing executable instructions for controlling the processor to perform a wear detection method according to the first aspect of the invention.
The method and the device have the advantages that whether a first event that the earphone approaches to the ear of the user occurs or not is detected, the acceleration sensor is controlled to collect acceleration data under the condition that the first event occurs, and whether the earphone is worn or not is detected according to the acceleration data. Therefore, only under the condition that the earphone is close to the ear of the user, the acceleration sensor is started to collect acceleration data, and then the earphone wearing detection is executed according to the collected acceleration data, so that the power consumption of the earphone can be reduced.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a block diagram showing an example of a hardware configuration of a headphone that can be used to implement an embodiment of the present invention.
Fig. 2 shows a flowchart of one example of a headphone wear detection method of an embodiment of the present invention.
Fig. 3 shows a flowchart of one example of the earphone wearing detection step of the embodiment of the present invention.
Fig. 4 shows a flowchart of another example of the headphone wear detection method of the embodiment of the present invention.
Fig. 5 shows a block diagram of one example of the headphone wearing detection apparatus of the embodiment of the present invention.
Fig. 6 shows a block diagram of another example of the headphone wear detection apparatus of the embodiment of the present invention.
Fig. 7 shows a block diagram of one example of a headset wearing detection module of an embodiment of the present invention.
Fig. 8 shows a block diagram of one example of a headset of an embodiment of the invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
< hardware configuration >
Fig. 1 shows a block diagram of an example of a hardware configuration of a headset that can be used to implement an embodiment of the invention.
As shown in fig. 1, the headset 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. The processor 1100 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 1200 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, a USB interface, a headphone interface, and the like. The communication device 1400 is capable of wired or wireless communication, for example, and may specifically include Wifi communication, bluetooth communication, 2G/3G/4G/5G communication, and the like. The display device 1500 is, for example, a liquid crystal display panel, a touch panel, or the like. The input device 1600 may include, for example, a touch screen, a keyboard, a somatosensory input, and the like. A user can input/output voice information through the speaker 1700 and the microphone 1800.
The headset shown in fig. 1 is merely illustrative and is in no way meant to be any limitation of the present invention, its application or use. In an embodiment of the present invention, the memory 1200 of the headset 1000 is configured to store instructions for controlling the processor 1100 to operate to perform any one of the wear detection methods provided by the embodiments of the present invention. It will be appreciated by those skilled in the art that although a plurality of devices are shown for the headset 1000 in fig. 1, the present invention may relate to only some of the devices, for example, the headset 1000 may relate to only the processor 1100 and the memory device 1200. The skilled person can design the instructions according to the disclosed solution. How the instructions control the operation of the processor is well known in the art and will not be described in detail herein.
< example >
< method >
In the present embodiment, a wearing detection method of an earphone is provided. The method may be performed by a headset. The headset may be any headset having a processor and memory. In one example, the headset may be the headset 1000 shown in fig. 1.
Fig. 2 is a flowchart of an example of a wearing detection method of an earphone according to an embodiment of the present invention.
As shown in fig. 2, the wear detection method may include the following steps S2100 to S2300.
In step S2100, it is detected whether a first event occurs in which the earphone approaches the ear of the user.
In one embodiment of the invention, the first event that the headset approaches the user's headset may be: detecting that the distance between the earphone and the ear of the user is smaller than or equal to a preset distance threshold value through a proximity sensor arranged on the earphone; or the light intensity detected by a proximity sensor arranged on the earphone is less than or equal to a preset light intensity threshold value.
Specifically, the distance threshold may be preset in accordance with an application scenario, experimental data, experience, or the like, and stored in the proximity sensor. The light intensity threshold may be preset according to an application scenario, experimental data, experience, or the like, and stored in the proximity sensor.
The proximity sensor of the present embodiment may be an electro-optical proximity sensor. The common proximity sensor supports the interrupt triggering mode and has small power consumption.
In one example, the proximity sensor may be disposed inside the earphone, and the casing of the earphone may be provided with a sensing window. When the user holds the earphone close to the ear, the sensing window is shielded, so that the distance detected by the proximity sensor can be smaller than or equal to a preset distance threshold value, or the light intensity detected by the proximity sensor is smaller than or equal to a preset light intensity threshold value.
If the distance detected by the proximity sensor can be smaller than or equal to a preset distance threshold value, or the detected light intensity is smaller than or equal to a preset light intensity threshold value, the proximity sensor can trigger interruption, and report interruption information to the earphone. Then, the earphone may determine that the first event that the earphone approaches the ear of the user occurs in case of receiving the interrupt information reported by the proximity sensor.
If the proximity sensor detects a distance greater than a distance threshold or a light intensity greater than a light intensity threshold, the proximity sensor does not trigger an interrupt, and it can be determined that the first event of the headset approaching the user's ear has not occurred.
In another embodiment of the invention, a contact switch may be provided on the headset. When the earphone is placed horizontally or in a matched earphone box, the contact switch is in a pressed state. When the headset is picked up, the contact switch is in a raised state. Thus, the first event that the headset approaches the user's ear may also be that the contact switch is in a raised state. Then, it may be that in the case where the contact switch provided on the headphone is in a pressed state, it is determined that the first event has not occurred; in the case where the contact switch is in the lifted state, it is determined that the first event occurs.
In yet another embodiment of the present invention, electrode contacts may be provided on the headset and in the matching headset case for use therewith. When the earphone is placed in the earphone box, the earphone detects that the electrode contact of the earphone is provided with a voltage higher than a preset voltage threshold value. When the earphone is taken out of the earphone box, the earphone detects that the electrode contact voltage of the earphone is reduced to be lower than or equal to the voltage threshold value. Thus, the first event that the headset is close to the user's ear may also be that the electrode contact voltage provided on the headset is below or equal to the voltage threshold. Then, it may be determined that the first event does not occur in a case where it is detected that the voltage of the electrode contact provided on the earphone is higher than the voltage threshold; in the case where it is detected that the voltage of the electrode contact is lower than or equal to the voltage threshold, it is determined that the first event occurs.
In step S2200, in the case that the occurrence of the first event is detected, controlling an acceleration sensor provided on the headset to collect acceleration data.
Specifically, the acceleration sensor provided on the headphone may be a three-axis acceleration sensor. The acceleration data collected by the triaxial acceleration sensor may include acceleration components corresponding to three coordinate axes.
And step S2300, detecting whether the earphone is worn or not according to the acceleration data.
In the embodiment of the invention, the power consumption of the acceleration sensor for acquiring the acceleration data in real time is considered to be larger, and the battery power of the wireless earphone is limited, so that the step of acquiring the acceleration data by the acceleration sensor is triggered by detecting whether a first event that the earphone approaches to the ear of a user occurs, namely, the acceleration sensor is controlled to acquire the acceleration data under the condition that the first event occurs, and whether the earphone is worn or not is detected according to the acceleration data. Therefore, only under the condition that the earphone is close to the ear of the user, the acceleration sensor is started to collect acceleration data, and then the earphone wearing detection is executed according to the collected acceleration data, so that the power consumption of the earphone can be reduced.
In one embodiment, the step of detecting whether the headset is worn according to the acceleration data may further include steps S2310-S2330 as shown in fig. 3:
in step S2310, the direction of the gravitational acceleration in the coordinate system of the preset acceleration sensor is determined according to the acceleration data.
The three coordinate axes of the triaxial acceleration sensor may constitute a coordinate system of the acceleration sensor. When the posture of the earphone is changed, the posture of an acceleration sensor arranged on the earphone is also changed, so that the coordinate system of the acceleration sensor is changed. Specifically, the directions of the three coordinate axes may be changed.
However, in the usual case, the gravitational acceleration is fixed. Therefore, the direction of the gravitational acceleration in the coordinate system changes as the pose of the headset changes.
Since the magnitude of the gravitational acceleration is fixed, the direction of the gravitational acceleration in the coordinate system can be determined according to the magnitude of the gravitational acceleration and the acceleration data.
Step S2320, an included angle between the direction of the gravity acceleration in the coordinate system and a set coordinate axis in the coordinate system is determined.
The setting coordinate axis in this embodiment may be determined in advance according to the installation manner of the acceleration sensor in the earphone. The set coordinate axis may be one or more coordinate axes of the coordinate system. In the case where the set coordinate axis is a plurality of coordinate axes, an angle between the direction of the gravitational acceleration in the coordinate system and the set coordinate axis may be an angle between the direction of the gravitational acceleration in the coordinate system and each set coordinate axis.
Step S2330, whether the earphone is worn or not is detected according to the included angle.
Specifically, the earphone may be determined to be in a wearing state under the condition that the included angle is within a preset included angle range. And under the condition that the included angle is out of the range of the included angle, judging that the earphone is not worn.
The included angle range may be preset according to an application scenario or experimental data.
And whether the earphone rotates or not can be detected according to the change condition of an included angle between the direction of the gravity acceleration in the coordinate system and a set coordinate axis in the coordinate system, and whether the earphone is worn or not can be judged according to the detection result.
Specifically, the earphone is determined to rotate when the variation of the included angle is detected to be greater than or equal to a preset angle threshold value, and then the earphone can be determined to be in a wearing state. Under the condition that the detected included angle variation is smaller than the preset angle threshold value, the earphone can be judged not to rotate, and then the earphone can be judged to be in an unworn state.
The angle threshold may be preset according to an application scenario or experimental data.
Thus, it is possible to determine whether or not the earphone is worn, based on the acceleration data.
In one example, the acceleration data collected by the acceleration sensor is a sampled value. Then, before performing step S2300, the wear detection method may further include:
and converting the sampling value into an acceleration value with a set format according to a preset sampling interval and a sampling bit width, and carrying out wearing detection on the earphone.
Specifically, there may be a linear relationship between the sampled value and the acceleration value. The sampling interval and the sampling bit width are determined by the acceleration sensor itself. The sampling interval may be, for example, -2g to 2 g. Wherein g is a gravitational constant. The sampling bit width may be, for example, 14-16 bits. In the case where the sampling bit width is 16 bits, the size of the sampling value may be 0 or more and 2 or less16-1. Then, an acceleration value of-2 g for a sample value of 0 and a sample value of 216The acceleration value for-1 is 2 g. Therefore, a formula reflecting the linear relation between the sampling value and the acceleration value can be obtained according to the sampling interval and the bit width as follows:
Figure BDA0001904562260000091
wherein y/g is an acceleration value, g is a gravity constant, and x is a sampling value.
Therefore, whether the earphone is worn or not can be conveniently detected by converting the sampling value into the acceleration value with the set format.
In one embodiment, the wear detection method may further include steps S4100-S4300 as shown in fig. 4:
step S4100, controlling the acceleration sensor to cache the acquired acceleration data in its fifo register.
The acceleration sensor of the present embodiment may be provided with a first-in first-out register. The acceleration sensor can set the working mode of the acceleration sensor through the communication interface. When the acceleration sensor is set to be in a FIFO (First in First out) working mode, the acquired acceleration data can be cached into an internal FIFO register according to the working frequency at that time.
In step S4200, it is detected whether a second event for reading the acceleration data buffered in the fifo register occurs.
In one example, the second event may include any one or more of:
the queue depth of the acceleration data cached in the first-in first-out register reaches a preset depth threshold value;
overflowing the acceleration data cached in the first-in first-out register;
a preset read cycle is reached.
And under the condition that the second event comprises that the queue depth of the acceleration data cached in the first-in first-out register reaches a preset depth threshold, if the queue depth of the acceleration data cached in the first-in first-out register reaches the preset depth threshold, judging that the second event occurs. And if the queue depth of the acceleration data cached in the first-in first-out register does not reach a preset depth threshold value, judging that the second event does not occur, and continuing to cache the acceleration data.
Further, the depth threshold may be set according to a minimum number of acceleration data required for detecting whether the headset is worn and a maximum value of a queue depth for buffering the acceleration data in the first-in first-out register.
On this basis, the depth threshold may be close to or in a multiple relation with a minimum amount of acceleration data required for detecting whether the headset is worn. For example, in the case where the minimum number of acceleration data required for detecting whether or not the headphone is worn is 80 sets of acceleration data, if the maximum value of the queue depth for buffering the acceleration data in the first-in first-out register is greater than or equal to 80 sets, the depth threshold may be set to 80. In this way, the step of detecting whether the headset is worn can be performed once each time the occurrence of the second event is detected. In the case where the minimum number of acceleration data required for detecting whether the headset is worn is 80 sets of acceleration data, if the maximum value of the queue depth for buffering the acceleration data in the fifo register is less than 80 sets, for example, only 64 sets, the depth threshold may be set to 40. Thus, each time a second event is detected to occur, the acceleration data buffered in the FIFO register is read once. The step of detecting whether the headset is worn or not is performed every two reading cycles.
In the case that the second event includes that the acceleration data buffered in the fifo register overflows, the fifo register may overflow when the queue depth of the buffered acceleration data reaches a preset depth threshold. Then, in the event of an overflow of the first-in first-out register, it may be determined that the second event occurred. In the case where the FIFO register does not overflow, it may be determined that the second event has not occurred.
In the case where the second event includes reaching a preset read period, the read period may be set in advance according to a sampling period of the single acceleration data and a depth threshold of the fifo register. The read period may be a sampling period equal to a single acceleration data multiplied by a depth threshold. The sampling period of the single acceleration data may be determined according to the depth threshold and the operating frequency of the acceleration sensor. Specifically, the sampling period of the single acceleration data is equal to the depth threshold divided by the operating frequency of the acceleration sensor. The operating frequency of the acceleration sensor may be determined by the acceleration sensor itself.
Step S4300, when the second event is detected, reading the acceleration data buffered in the fifo register for wearing detection.
When step S4300 is completed, step S2300 described above is executed to detect whether or not the headphone is worn based on the read acceleration data.
Therefore, the acceleration data collected by the acceleration sensor are buffered in an internal first-in first-out register in batches, and the time for reading the acceleration data is shorter than that for reading the acceleration data once. And under the condition that a second event for reading the acceleration data cached in the first-in first-out register is detected to occur, reading the acceleration data cached in the first-in first-out register to carry out earphone wearing detection, packet loss cannot be generated, and the detection result of earphone wearing is more accurate.
In one example, if the queue depth of the acceleration data buffered in the fifo register is greater than or equal to the minimum number of acceleration data required for detecting whether the headset is worn, the detection result that the headset is in a worn state or a non-worn state may be obtained according to the acceleration data read in one reading cycle. If the queue depth of the acceleration data cached in the first-in first-out register is smaller than the minimum number of the acceleration data required for detecting whether the earphone is worn, the acceleration data read in the next reading period needs to be waited, and the wearing state of the earphone is detected according to the acceleration data read in the plurality of reading periods.
Therefore, according to the acceleration data read in one reading period, the obtained earphone wearing detection result can be in a wearing state, a non-wearing state or an insufficient data state, and cannot be judged. And under the condition that the detection result is that the data is insufficient and cannot be judged, the acceleration sensor is required to continuously acquire acceleration data for detection. And under the condition that the detection result that the earphone is in the wearing state or the non-wearing state is obtained according to the acceleration data detection, the acceleration sensor can be controlled to stop collecting the acceleration data. In this way, the power consumption of the headset can be further reduced.
< apparatus >
In the present embodiment, a wearing detection apparatus 5000 of an earphone is provided, as shown in fig. 5, including a first event detection module 5100, an acquisition control module 5200, and a wearing detection module 5300. The first event detecting module 5100 is configured to detect whether a first event occurs that the headset approaches the user's ear; the acquisition control module 5200 is configured to control an acceleration sensor disposed on the earphone to acquire acceleration data when detecting that a first event occurs; the wearing detection module 5300 is configured to detect whether the headset is worn according to the acceleration data.
The first event may include:
the distance between the earphone and the ear of the user is detected to be smaller than or equal to a preset distance threshold value through a proximity sensor arranged on the earphone.
In one embodiment, as shown in fig. 6, the wearing detection apparatus 5000 may further include a cache control module 6100, a second event detection module 6200, and a data reading module 6300. The cache control module 6100 is configured to control the acceleration sensor to cache the acquired acceleration data into its fifo register; the second event detecting module 6200 is configured to detect whether a second event occurs for reading the acceleration data cached in the fifo register; the data reading module 6300 is configured to read, when the second event is detected to occur, the acceleration data cached in the fifo register, so that the wearing detection module performs wearing detection.
Specifically, the second event includes any one or more of the following:
the queue depth of the acceleration data cached in the first-in first-out register reaches a preset depth threshold value; the depth threshold is set according to the minimum number of acceleration data required for detecting whether the earphone is worn and the maximum value of queue depth for caching the acceleration data in a first-in first-out register;
overflowing the acceleration data cached in the first-in first-out register;
a preset read cycle is reached.
In one embodiment, as shown in fig. 6, the wearing detection apparatus 5000 may further include a stop control module 6400 configured to control the acceleration sensor to stop collecting the acceleration data when a detection result that the headset is in a wearing state or a non-wearing state is detected according to the acceleration data.
In one embodiment, as shown in fig. 7, the wearing detection module 5300 may further include a gravity direction determination unit 5310, an included angle determination unit 5320, and a wearing detection unit 5330. The gravity direction determining unit 5310 is configured to determine a direction of the gravitational acceleration in a coordinate system of a preset acceleration sensor according to the acceleration data; the included angle determining unit 5320 is configured to determine an included angle between a direction of the gravitational acceleration in the coordinate system and a set coordinate axis of the coordinate system; the wearing detection unit 5330 is used for detecting whether the earphone is worn or not according to the included angle.
Further, the wearing detection unit 5330 is specifically configured to: and under the condition that the included angle is within the preset included angle range, the earphone is judged to be in a wearing state.
It will be appreciated by those skilled in the art that the wearing detection means 5000 of the headset may be implemented in various ways. For example, the wearing detection device 5000 of the headset may be implemented by an instruction configuration processor. For example, the wearing detection apparatus 5000 of the headset may be implemented by storing instructions in a ROM and reading the instructions from the ROM into a programmable device when the device is started. For example, the wearing detection device 5000 of the headphone may be solidified into a dedicated device (e.g., ASIC). The wearing detection device 5000 of the earphone may be divided into units independent of each other, or may be implemented by combining them together. The wearing detection device 5000 of the headphone may be implemented by one of the various implementations described above, or may be implemented by a combination of two or more of the various implementations described above.
< earphones >
In the present embodiment, there is also provided an earphone, and in an aspect, the electronic device may include the wearing detection apparatus 5000 of the earphone.
In another aspect, as shown in fig. 8, the headset 8000 may include a memory 8100 and a processor 8200. The memory 8100 is used for storing instructions; the instructions are used to control the processor 8200 to execute the wearing detection method of the earphone provided in the present embodiment.
In this embodiment, the electronic device 8000 may also include other hardware devices, such as the electronic device 1000 shown in fig. 1.
In the embodiment of the invention, whether a first event that the earphone approaches to the ear of the user occurs or not is detected, the acceleration sensor is controlled to collect acceleration data under the condition that the first event occurs, and whether the earphone is worn or not is detected according to the acceleration data. Thus, when the earphone approaches the ear of the user, the acceleration sensor is started to carry out earphone wearing detection, and the power consumption of the earphone can be reduced.
The present invention may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therewith for causing a processor to implement various aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present invention may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), with state information of computer-readable program instructions, which can execute the computer-readable program instructions.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, by software, and by a combination of software and hardware are equivalent.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (10)

1. A wearing detection method of an earphone is characterized by comprising the following steps:
detecting whether a first event that the earphone approaches the ear of the user occurs;
controlling an acceleration sensor arranged on the earphone to acquire acceleration data when the first event is detected;
detecting whether the earphone is worn or not according to the acceleration data;
wherein, the acceleration data is a sampling value, and the detecting whether the earphone is worn according to the acceleration data comprises:
converting the sampling value into an acceleration value with a set format according to a preset sampling interval and a sampling bit width, and detecting whether the earphone is worn or not according to the acceleration value;
in the case where the sampling interval is [ -2g, 2g ], and the sampling bit width is 16 bits, the formula for converting the sampling value into the acceleration value is:
Figure FDA0002593894970000011
wherein g is a gravity constant, x is the sampling value, and y is the acceleration value.
2. The wear detection method according to claim 1, characterized in that the first event includes:
detecting that the distance between the earphone and the ear of the user is smaller than or equal to a preset distance threshold value through a proximity sensor arranged on the earphone.
3. The wear detection method according to claim 1, characterized by further comprising:
controlling the acceleration sensor to cache the acquired acceleration data into a first-in first-out register of the acceleration sensor;
detecting whether a second event for reading the acceleration data cached in the first-in first-out register occurs or not;
and under the condition that the second event is detected to occur, reading the acceleration data cached in the first-in first-out register for wearing detection.
4. The wear detection method according to claim 3, characterized in that the second event comprises any one or more of:
the queue depth for caching the acceleration data in the first-in first-out register reaches a preset depth threshold value; the depth threshold is set according to the minimum quantity of acceleration data required for detecting whether the earphone is worn and the maximum value of queue depth for caching the acceleration data in the first-in first-out register;
the acceleration data cached in the first-in first-out register overflows;
a preset read cycle is reached.
5. The wear detection method according to claim 1, characterized by further comprising:
and controlling the acceleration sensor to stop acquiring the acceleration data under the condition that the detection result that the earphone is in a wearing state or a non-wearing state is obtained according to the acceleration data.
6. The wear detection method according to any one of claims 1 to 5, wherein the step of detecting whether the headphone is worn or not from the acceleration data includes:
determining the direction of the gravity acceleration in a preset coordinate system of the acceleration sensor according to the acceleration data;
determining an included angle between the direction of the gravity acceleration in the coordinate system and a set coordinate axis of the coordinate system;
and detecting whether the earphone is worn or not according to the included angle.
7. The wearing detection method according to claim 6, wherein the step of detecting whether the earphone is worn according to the included angle comprises:
and under the condition that the included angle is within a preset included angle range, judging that the earphone is in a wearing state.
8. A wearing detection device of an earphone, comprising:
a first event detection module for detecting whether a first event that the earphone approaches the ear of the user occurs;
the acquisition control module is used for controlling an acceleration sensor arranged on the earphone to acquire acceleration data under the condition that the first event is detected;
the wearing detection module is used for detecting whether the earphone is worn or not according to the acceleration data;
wherein, the acceleration data is the sampling value, wear the detection module and still be used for:
converting the sampling value into an acceleration value with a set format according to a preset sampling interval and a sampling bit width, and detecting whether the earphone is worn or not according to the acceleration value;
in the case where the sampling interval is [ -2g, 2g ], and the sampling bit width is 16 bits, the formula for converting the sampling value into the acceleration value is:
Figure FDA0002593894970000031
wherein g is a gravity constant, x is the sampling value, and y is the acceleration value.
9. The wear detection device of claim 8, further comprising:
the buffer control module is used for controlling the acceleration sensor to buffer the acquired acceleration data into a first-in first-out register of the acceleration sensor;
the second event detection module is used for detecting whether a second event for reading the acceleration data cached in the first-in first-out register occurs or not;
and the data reading module is used for reading the acceleration data cached in the first-in first-out register under the condition that the second event is detected to be generated, so that the wearing detection module can carry out wearing detection.
10. An earphone, comprising:
wear detection apparatus according to claim 8 or 9; or,
a processor and a memory for storing executable instructions for controlling the processor to perform the wear detection method of any one of claims 1-7.
CN201811526407.2A 2018-12-13 2018-12-13 Wearing detection method and device of earphone and earphone Active CN109511034B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811526407.2A CN109511034B (en) 2018-12-13 2018-12-13 Wearing detection method and device of earphone and earphone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811526407.2A CN109511034B (en) 2018-12-13 2018-12-13 Wearing detection method and device of earphone and earphone

Publications (2)

Publication Number Publication Date
CN109511034A CN109511034A (en) 2019-03-22
CN109511034B true CN109511034B (en) 2020-11-20

Family

ID=65752418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811526407.2A Active CN109511034B (en) 2018-12-13 2018-12-13 Wearing detection method and device of earphone and earphone

Country Status (1)

Country Link
CN (1) CN109511034B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109922401A (en) * 2019-04-26 2019-06-21 歌尔科技有限公司 Wireless headset control method, system and wireless headset, charging box and storage medium
CN112218196A (en) * 2019-07-10 2021-01-12 Oppo广东移动通信有限公司 Earphone and earphone control method
CN110418236A (en) * 2019-08-16 2019-11-05 歌尔股份有限公司 A kind of wireless headset wears detection device, method and TWS earphone
CN110677765A (en) * 2019-10-30 2020-01-10 歌尔股份有限公司 Wearing control method, device and system of headset
CN112911438A (en) * 2019-12-04 2021-06-04 罗伯特·博世有限公司 Earphone wearing state detection method and equipment and earphone
CN111372157A (en) * 2019-12-31 2020-07-03 歌尔科技有限公司 Wireless earphone, wearing detection method thereof and storage medium
CN111698632A (en) * 2020-06-03 2020-09-22 歌尔科技有限公司 Headset state detection method and device, TWS headset and computer storage medium
CN111866691A (en) * 2020-06-10 2020-10-30 歌尔科技有限公司 State detection method and device of wireless earphone and earphone
CN111698607B (en) * 2020-07-03 2022-05-06 歌尔科技有限公司 TWS earphone audio output control method, apparatus, device and medium
CN112013949A (en) * 2020-08-06 2020-12-01 歌尔科技有限公司 Earphone wearing state determining method and device and earphone
KR20220117011A (en) * 2021-02-16 2022-08-23 삼성전자주식회사 Wearable device and method for checking wearing condition using gyro sensor
CN113132843A (en) * 2021-03-10 2021-07-16 青岛歌尔智能传感器有限公司 Sensor working mode control method and device of wireless earphone
CN113179475B (en) * 2021-04-02 2022-03-25 歌尔股份有限公司 Earphone wearing state detection method and device, earphone and medium
CN113079434A (en) * 2021-04-07 2021-07-06 南京紫牛软件科技有限公司 Control method, device, storage medium and system of audio playing equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105611443A (en) * 2015-12-29 2016-05-25 歌尔声学股份有限公司 Control method and system of earphone and earphone
CN107046670A (en) * 2017-05-15 2017-08-15 刘圣银 A kind of headset detection system and control method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9326058B2 (en) * 2012-09-26 2016-04-26 Sony Corporation Control method of mobile terminal apparatus
CN108810788B (en) * 2018-06-12 2021-09-03 歌尔科技有限公司 Wearing condition detection method and device of wireless earphone and wireless earphone
CN108966087B (en) * 2018-07-26 2020-11-24 歌尔科技有限公司 Wearing condition detection method and device of wireless earphone and wireless earphone
CN108845552A (en) * 2018-09-14 2018-11-20 中国神华能源股份有限公司 data delay monitoring method, device, storage medium and processor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105611443A (en) * 2015-12-29 2016-05-25 歌尔声学股份有限公司 Control method and system of earphone and earphone
CN107046670A (en) * 2017-05-15 2017-08-15 刘圣银 A kind of headset detection system and control method

Also Published As

Publication number Publication date
CN109511034A (en) 2019-03-22

Similar Documents

Publication Publication Date Title
CN109511034B (en) Wearing detection method and device of earphone and earphone
JP6211090B2 (en) Message display method, message display device, terminal device, program, and recording medium thereof
WO2018166168A1 (en) Screen backlight control method and mobile terminal
CN106453829B (en) A kind of falling height detection method and device
JP6023780B2 (en) Method and apparatus for performing voice control operations on a terminal
CN103024205B (en) Method, device and terminal for controlling power
JP6068660B2 (en) Character selection method, character selection device, terminal device, program, and recording medium
CN110392298B (en) Volume adjusting method, device, equipment and medium
EP3684038A1 (en) Message processing method, message viewing method, and terminal
US20190340413A1 (en) Fingerprint Identification Assembly, Fingerprint Identification Method, and Electronic Device
WO2014180138A1 (en) Method and device for video processing
WO2019141142A1 (en) Data reporting method and related product
US11265639B2 (en) Method for earbud switching, wearable device, and storage medium
US10789171B2 (en) Information processing method and device, and method and device for displaying dynamic information
CN108492837B (en) Method, device and storage medium for detecting audio burst white noise
CN111177137A (en) Data deduplication method, device, equipment and storage medium
CN110933551A (en) Operation method and system of wireless earphone and wireless communication equipment
WO2018214745A1 (en) Application control method and related product
CN110753914B (en) Information processing method, storage medium and mobile terminal
WO2019072179A1 (en) Application running control method and apparatus
US20150070360A1 (en) Method and mobile terminal for drawing sliding trace
CN104267890A (en) Control content display method and device
CN111081198B (en) Data control method, data control device, storage medium and terminal equipment
JP2017146904A (en) Display control system and operation method
EP3240262A1 (en) Portable electronic instrument, control method, and control program

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