CN110896511A - Earphone control method and device, storage medium and computer equipment - Google Patents
Earphone control method and device, storage medium and computer equipment Download PDFInfo
- Publication number
- CN110896511A CN110896511A CN201911259312.3A CN201911259312A CN110896511A CN 110896511 A CN110896511 A CN 110896511A CN 201911259312 A CN201911259312 A CN 201911259312A CN 110896511 A CN110896511 A CN 110896511A
- Authority
- CN
- China
- Prior art keywords
- target
- preset
- vibration
- acceleration value
- instruction
- 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.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R1/00—Details of transducers, loudspeakers or microphones
- H04R1/10—Earpieces; Attachments therefor ; Earphones; Monophonic headphones
- H04R1/1041—Mechanical or electronic switches, or control elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R3/00—Circuits for transducers, loudspeakers or microphones
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R2201/00—Details of transducers, loudspeakers or microphones covered by H04R1/00 but not provided for in any of its subgroups
- H04R2201/10—Details of earpieces, attachments therefor, earphones or monophonic headphones covered by H04R1/10 but not provided for in any of its subgroups
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Acoustics & Sound (AREA)
- Signal Processing (AREA)
- Telephone Function (AREA)
Abstract
The application discloses a method, a device, a storage medium and a computer device for controlling an earphone, wherein the method comprises the following steps: acquiring target vibration information within preset time, wherein the target vibration information comprises vibration frequency; judging whether the vibration frequency is within a preset vibration frequency range; if the vibration frequency is not within the preset vibration frequency range, filtering the target vibration information; if the vibration frequency is within the preset vibration frequency range, matching the target vibration information with a preset first instruction mapping table, wherein the first instruction mapping table is used for recording the corresponding mapping relation between each vibration information and each control instruction; if the control instruction which has the mapping relation with the target vibration information is matched in the first instruction mapping table, the corresponding action is executed according to the matched control instruction, so that even if a user wears the earphone, the user can control the earphone to execute the corresponding action without manually pressing keys, and the convenience of using the earphone is greatly improved.
Description
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for controlling an earphone, a storage medium, and a computer device.
Background
At present, earphones are widely applied to life, entertainment and work of people, and are various in types, such as multimedia earphones, bluetooth earphones, earphones including head phones, ear plugs and the like, but with the technical development, the requirements of people on the earphones are higher and higher.
The headphone and the earplug earphone on the market are mostly operated through keys, so that the earphone is controlled to play, cut songs, talk and the like, but because the keys are usually arranged on the earphone, a user cannot see the keys after wearing the earphone, the earphone is often required to be taken down to be operated and then worn, and the earphone is very inconvenient to use.
Disclosure of Invention
The present application mainly aims to provide a method and an apparatus for controlling a headset, and a readable storage medium, and aims to solve the technical problem of inconvenience in controlling the headset in the prior art.
Based on the above object, the present application provides an earphone control method, including:
acquiring target vibration information within preset time, wherein the target vibration information comprises vibration frequency;
judging whether the vibration frequency is within a preset vibration frequency range;
if the vibration frequency is not within a preset vibration frequency range, filtering the target vibration information;
if the vibration frequency is within a preset vibration frequency range, matching the target vibration information with a preset first instruction mapping table, wherein the first instruction mapping table is used for recording the corresponding mapping relation between each vibration information and each control instruction;
and if the control instruction which has the mapping relation with the target vibration information is matched in the first instruction mapping table, executing corresponding action according to the matched control instruction.
Further, the step of acquiring the target vibration information within the preset time includes:
acquiring a target acceleration value in a preset direction, and detecting whether the target acceleration value reaches a preset threshold value or not;
when the target acceleration value reaches a preset threshold value, starting timing and continuously acquiring the target acceleration value, detecting whether the target acceleration value is kept unchanged within a preset interval time, and if the target acceleration value is kept unchanged, ending the timing to obtain the target acceleration value from the beginning of timing to the end of timing;
and calculating to obtain the target vibration information according to the target acceleration value and the duration from the beginning timing to the end timing.
Further, the preset threshold is a first threshold or a second threshold, and the first threshold is smaller than the second threshold; the step of acquiring a target acceleration value in a preset direction and detecting whether the target acceleration value reaches a preset threshold value comprises the following steps:
respectively acquiring acceleration values in a first direction, a second direction and a third direction through an acceleration sensor, wherein the first direction, the second direction and the third direction are mutually vertical directions in pairs, and the preset direction is the first direction;
detecting whether the acceleration values in the second direction and the third direction are zero or not;
if the acceleration values in the second direction and the third direction are both zero, detecting whether the target acceleration value in the preset direction reaches a first threshold value;
and if the acceleration values in the second direction and the third direction are not detected to be zero, detecting whether the target acceleration value in the preset direction reaches a second threshold value.
Further, the step of acquiring a target acceleration value in a preset direction and detecting whether the target acceleration value reaches a preset threshold value includes:
respectively acquiring acceleration values in a first direction, a second direction and a third direction through an acceleration sensor, wherein the first direction, the second direction and the third direction are mutually vertical directions in pairs, and the preset direction is the first direction; if the acceleration value in the second direction and/or the third direction is detected to be not zero, calculating the acceleration value in the second direction and/or the third direction and the acceleration value in the first direction to obtain the target acceleration value, and detecting whether the target acceleration value reaches the preset threshold value.
Further, the step of executing the corresponding action according to the control command includes:
triggering a voice acquisition instruction according to the control instruction;
acquiring voice information input by a user according to the voice acquisition instruction;
matching the voice information with a second instruction mapping table to find out a target instruction matched with the voice information, wherein the second instruction mapping table is used for recording the corresponding mapping relation between each voice information and each target instruction;
and executing corresponding actions according to the target instruction.
Further, the step of acquiring the target vibration information within the preset time includes:
and acquiring target vibration information generated by knocking the earphone or tapping the teeth of the user within preset time.
Further, the target vibration information includes the number of vibration pulses and the interval time of the vibration pulses.
The application also provides an earphone control device, including:
the target obtaining unit is used for obtaining target vibration information in preset time, and the target vibration information comprises vibration frequency;
the judging frequency unit is used for judging whether the vibration frequency is in a preset vibration frequency range or not;
the filtering information unit is used for filtering the target vibration information if the vibration frequency is not within a preset vibration frequency range;
the matching information unit is used for matching the target vibration information with a preset first instruction mapping table if the vibration frequency is within a preset vibration frequency range, and the first instruction mapping table is used for recording the corresponding mapping relation between each vibration information and each control instruction;
and the action execution unit is used for executing corresponding action according to the matched control instruction if the control instruction which has the mapping relation with the target vibration information is matched in the first instruction mapping table.
The present application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, which when executed implements the headphone control method of any of the above.
The present application further proposes a computer device, which includes a processor, a memory, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the earphone control method according to any one of the above embodiments is implemented.
The beneficial effect of this application:
the application provides an earphone control method, a device, a storage medium and a computer device, in the method, target vibration information meeting matching conditions is matched with an instruction mapping table to obtain a corresponding control instruction, and corresponding action is executed according to the control instruction, so that even if a user wears an earphone, the earphone can be controlled to execute the corresponding action without manual key pressing of the user, the convenience of the user for using the earphone is greatly improved, and compared with a voice control earphone, the method has the advantages that the energy consumption of a vibration sensor is low, the problems of standby current increase and cost great increase are avoided, only the target vibration information meeting the matching conditions can be matched to obtain the control instruction, and the problem of misoperation caused by voice recognition errors is reduced.
Drawings
Fig. 1 is a schematic flowchart of an earphone control method according to an embodiment of the present application;
fig. 2 is a block diagram schematically illustrating a structure of an earphone control device according to an embodiment of the present application;
FIG. 3 is a block diagram illustrating the structure of one embodiment of a storage medium of the present application;
FIG. 4 is a block diagram illustrating the structure of one embodiment of a computer device of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In addition, descriptions in this application as to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicit to the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
Referring to fig. 1, the present application provides a flowchart of a headphone control method, which may be implemented by a headphone control device, specifically implemented in software or hardware, and may be generally integrated in a multimedia headphone, such as a headset or an earphone type radio, an MP3 player, a bluetooth headset, a translator, and so on. The embodiment of the application provides an earphone control method, which comprises the following steps:
step S100: acquiring target vibration information within preset time, wherein the target vibration information comprises vibration frequency;
step S200: judging whether the vibration frequency is within a preset vibration frequency range;
step S300: if the vibration frequency is not within a preset vibration frequency range, filtering the target vibration information;
step S400: if the vibration frequency is within a preset vibration frequency range, matching the target vibration information with a preset first instruction mapping table, wherein the first instruction mapping table is used for recording the corresponding mapping relation between each vibration information and each control instruction;
step S500: and if the control instruction which has the mapping relation with the target vibration information is matched in the first instruction mapping table, executing corresponding action according to the matched control instruction.
As described in step S100, the target vibration information is obtained by a bone conduction vibration measurement sensor, which may be a sensor with small volume and low power consumption and capable of detecting low-frequency knocking vibration, such as a piezoelectric sensor or a MEMS (micro-electro-mechanical system) 3D acceleration sensor. In this embodiment, target vibration information within a preset time is acquired by a sensor, where the target vibration information includes a vibration frequency, the preset time is a time period from a specified start timing time to a specified end timing time, the specified start timing time may be a time when a vibration pulse with a specified intensity is received, and the end timing time may be a time when no vibration pulse is received within a certain time after the vibration pulse is received.
Preferably, the step S100 includes:
step S001: and acquiring target vibration information generated by knocking the earphone or tapping the teeth of the user within preset time.
As described in step S001 above, the bone conduction vibration measurement sensor is disposed in the earphone, and the sensor is usually tightly attached to the face or ear canal when the user wears the earphone, so that the user can generate low-frequency vibration pulses by tapping the casing of the earphone or tapping the teeth, and the low-frequency vibration pulses are picked up by the bone conduction vibration measurement sensor.
Specifically, the process of the piezoelectric sensor acquiring the target vibration information includes: the piezoelectric sensor generates mechanical deformation under the action of external force so as to generate charges on a polarization surface, then generates voltages at two ends, amplifies and converts impedance through a charge amplifier, sends the voltages to a comparator for threshold comparison, outputs a square wave signal when the voltages exceed a vibration threshold, and then analyzes and processes the data of the square wave signal through a microprocessor to obtain the target vibration information. The processing process of the MEMS 3D acceleration sensor comprises the following steps: the acceleration sensor is directly connected with the microprocessor through an I2S interface, received change information of certain axial vibration acceleration generated by knocking or tapping is directly transmitted to the microprocessor through the interface, and further, an interrupt input interface of the microprocessor can be connected with an interrupt output interface of the acceleration sensor, so that the purpose of saving electricity can be achieved when knocking action is not detected.
As described in the foregoing steps S200 to S300, in order to reduce errors and reduce misoperation, after the target vibration information is acquired, it is determined whether the vibration frequency is within a preset vibration frequency range, and filtering may be performed to filter out too low or too high vibration frequency. The vibration information is obtained by knocking or tapping the teeth by a user and has a certain speed range, for example, the knocking speed of the user by fingers is about 3-4 times per second, the action of knocking the teeth by the user is basically the same as the frequency of knocking by the fingers, namely, the frequency of continuous vibration is 3-4 HZ, at this time, if the vibration with the frequency of more than 6HZ is obtained, the vibration is probably caused by non-artificial action, and the obtained vibration with the frequency of less than 2HZ is easily confused with daily action, so the vibration information can be filtered to avoid misoperation.
As described in the above steps S400-S500, the target vibration information further includes the number of vibration pulses and the interval time of the vibration pulses, and the frequency is the number of times that the material completes the periodic change within 1S, for example, the number of vibration pulses is 4, each interval time is 0.2 seconds, that is, the vibration pulses are a motion that periodically changes, since the interval time is 0.2 seconds, the number of times that the material can complete within one second is 5, that is, the vibration frequency is 5, and if the interval time of the vibration pulses is 0.25 seconds, the vibration frequency is 4, that is, the vibration frequency can be calculated by the interval time of the vibration pulses. When the vibration frequency is within the preset vibration frequency range, but there is a situation that the combination of the number of vibration pulses and the interval time in the target vibration information does not conform to the preset combination, that is, the target vibration information may not match the first instruction mapping table, so that the target vibration information needs to be matched with the first instruction mapping table. The first instruction mapping table is used for recording the corresponding mapping relation between each piece of vibration information and each control instruction, different control instructions control the earphone to execute different actions, and if the control instruction having the mapping relation with the target vibration information is matched in the first instruction mapping table, the action corresponding to the control instruction is executed according to the control instruction, such as controlling the earphone to pause songs, switching channels and the like.
Furthermore, the invention can obtain various control instructions by combining different vibration pulse numbers and vibration pulse interval time, and is worth noting that as long as at least one of two parameters of the vibration pulse numbers and the vibration pulse interval time is different, the two parameters correspond to different control instructions, thereby realizing all key functions of the earphone.
For example, when the interval time is within a certain range, different knocking times correspond to different control instructions, the duration of each knocking is 40-100 milliseconds, the interval time is 0.15-0.3 seconds, stopping for more than 1 second after 5 times of knocking represents function switching, stopping for more than 1 second after 4 times of knocking represents playing, and stopping for more than 1 second after 3 times of knocking represents channel changing or song changing. Or the interval time and the knocking times are different, the control commands correspond to different control commands, when the knocking interval time is 0.3-0.6 seconds, stopping for more than one second after knocking for 3 times represents pause, and when the knocking interval time is 0.1-0.3 seconds, stopping for more than one second after knocking for 4 times represents fast forward.
According to the invention, the target vibration information is obtained by knocking the earphone shell or the teeth by the user, and then the corresponding control instruction can be matched according to the first instruction mapping table, so that the user can easily control the earphone to execute the corresponding action under the condition of wearing the earphone conveniently, and compared with a voice control earphone, the problem of standby current or great cost increase or easy misoperation can not be caused because the information is picked up by the vibration sensor. The target vibration information is obtained by combining different vibration pulse numbers and vibration interval time, different key functions of the earphone can be obtained by different combinations, all the key functions of the existing earphone can be included due to the diversity of the combinations, and compared with the earphone operated by keys in the prior art, the target vibration information not only saves the layout space of the keys, but also has more complete functions.
In an embodiment, when the control instruction having the mapping relation with the target vibration information is not matched in the first instruction mapping table, it indicates that the received target vibration information is not information for controlling the earphone input by the user, and may be misoperation, so the target vibration information can be directly filtered; then repeating the steps S100-S400 until a control command which has a mapping relation with the target vibration information is matched in the first command mapping table; that is, the target vibration information is obtained again, and then whether the vibration frequency of the target vibration information is within the preset vibration range is judged, if not, the target vibration information is filtered, if yes, the target vibration information is matched with the specified mapping table, and when a corresponding control instruction is matched, the step S500 is executed.
In one embodiment, the step S100 includes:
step S110: acquiring a target acceleration value in a preset direction, and detecting whether the target acceleration value reaches a preset threshold value or not;
step S120: when the target acceleration value reaches a preset threshold value, starting timing and continuously acquiring the target acceleration value, detecting whether the target acceleration value is kept unchanged within a preset interval time, and if the target acceleration value is kept unchanged, ending the timing to obtain the target acceleration value between the beginning of timing and the end of timing;
step S130: calculating to obtain the target vibration information according to the target acceleration value and the duration from the beginning timing to the end timing;
in this embodiment, the target vibration information is obtained by an acceleration sensor, that is, the target vibration information can be obtained by an acceleration value, the preset direction can be set by a user according to an actual situation, for example, when the acceleration sensor is arranged close to a face and a shell of the earphone is knocked, a knocking vibration direction is a direction perpendicular to a receiving plane of the earphone, that is, a direction perpendicular to the face, and at this time, the direction perpendicular to the face is also the preset direction. After the target acceleration value in the preset direction is obtained, in order to avoid misoperation, whether the target acceleration value reaches a preset threshold value or not can be judged firstly, so that the acceleration value which does not meet the matching requirement is preliminarily filtered, running resources are saved, when the target acceleration value reaches the preset threshold value, timing is started and the acceleration value is continuously obtained, the periodic acceleration value is generated when a user knocks the earphone shell or knocks the teeth, for example, the acceleration value with the largest numerical value is generated during knocking, then the process is stopped, the acceleration value is reduced, the acceleration value with the largest numerical value is generated again during knocking again, the process is repeated, namely, the periodic acceleration value is continuously obtained through the acceleration sensor, whether the target acceleration value is kept unchanged within the preset interval time is detected, if the target acceleration value is continuously changed all the time, namely, the knocking action of the user is not finished, the target acceleration value is kept to be obtained, if the acceleration value is detected to be kept unchanged within the preset interval time, namely the user stops knocking, timing is ended at the moment, so that a target acceleration value between the beginning of timing and the ending of timing and change information of the acceleration value in the time are obtained, the change information can be continuously obtained acceleration information with the acceleration value changing periodically, then the vibration frequency and the interval time are obtained through calculation according to the acceleration value and the duration between the beginning of timing and the ending of timing, the duration is also the preset time, because the acceleration value changing periodically is obtained within the duration, the maximum acceleration value in each period is generated by the user knocking the earphone once, namely generating vibration once, the period frequency in the duration is calculated, and the vibration frequency can be obtained, wherein the time of one period is the interval time, then, the information of the vibration frequency and the interval time is recorded as the target vibration information.
In one embodiment, the step S110 includes:
step S111: respectively acquiring acceleration values in a first direction, a second direction and a third direction through an acceleration sensor, wherein the first direction, the second direction and the third direction are mutually vertical directions in pairs, and the preset direction is the first direction;
step S112: detecting whether the acceleration values in the second direction and the third direction are zero or not;
step S113: if the acceleration values in the second direction and the third direction are both zero, detecting whether the target acceleration value in the preset direction reaches a first threshold value;
step S114: and if the acceleration values in the second direction and the third direction are not detected to be zero, detecting whether the target acceleration value in the preset direction reaches a second threshold value.
As the 3D acceleration sensor is used to acquire the target vibration information in the steps S111 to S114, acceleration values in three directions, namely, the first direction, the second direction and the third direction, may be acquired, and the first direction, the second direction and the third direction are perpendicular to each other in pairs, for example, three directions of the X, Y, Z axis, respectively, and the predetermined direction may be any one of the three directions. In this embodiment, the preset direction is a first direction, acceleration in different directions may be generated in different motion directions, for example, walking in a second direction or riding in a third direction, acceleration in the second direction or the third direction may be generated at this time, and the tapping or tapping motion may only cause acceleration change in one or two directions, for example, a user may only generate one acceleration direction perpendicular to the face by tapping the earphone housing, the acceleration directions perpendicular to the upper and lower teeth may be generated by tapping the teeth, and the obtaining of the acceleration values in different directions may cause interference to the target acceleration values in the preset direction, so the acceleration values in the second direction and the third direction may be detected first, and then whether the acceleration value in the preset direction reaches a preset threshold value is detected, where the preset threshold value in step S110 is the first threshold value or the second threshold value, and the first threshold value is smaller than the second threshold value, when the acceleration values in the second direction and the third direction are detected to be zero, whether the target acceleration value in the preset direction reaches the first threshold value is detected, and when the acceleration values in the second direction and the third direction are detected to be nonzero, whether the target acceleration value in the preset direction reaches the second threshold value is detected, so that under the condition that the acceleration values in the second direction and the third direction are provided, in order to avoid interference, the force required to be knocked is larger, and at the moment, the target acceleration value in the first direction is larger than the target acceleration value under the condition that the acceleration values in the second direction and the third direction are not provided. In addition, when the acceleration values in the first direction, the second direction and the third direction are obtained, the acceleration values in the second direction and the third direction can be directly filtered out, so that the finally obtained acceleration value is a target acceleration value in a preset direction.
In another embodiment, the step S110 further includes:
step S115: respectively acquiring acceleration values in a first direction, a second direction and a third direction through an acceleration sensor, wherein the first direction, the second direction and the third direction are mutually vertical directions in pairs, and the preset direction is the first direction;
step S116: if the acceleration value in the second direction and/or the third direction is detected to be not zero, calculating the acceleration value in the second direction and/or the third direction and the acceleration value in the first direction to obtain the target acceleration value, and detecting whether the target acceleration value reaches the preset threshold value.
As shown in the above steps S115 to S116, the acceleration values in the first direction, the second direction and the third direction are obtained through the 3D acceleration sensor, where the first direction, the second direction and the third direction are respectively two directions perpendicular to each other, in this embodiment, the preset direction is set as the first direction, and then whether the acceleration values in the second direction and the third direction are zero or not is detected, and when it is detected that the acceleration values in the second direction and the third direction are both zero, whether the target acceleration value in the preset direction reaches the preset threshold value or not is detected; when the user may knock the earphone housing or knock the teeth, acceleration in multiple directions may be generated, and the acceleration value in the second direction and the acceleration value in the third direction may be calculated, for example, when the acceleration value in the second direction is detected to be not zero and the acceleration value in the third direction is detected to be not zero, the acceleration value in the second direction and the acceleration value in the first direction may be calculated, when the acceleration value in the second direction is detected to be zero and the acceleration value in the third direction is detected to be not zero, the acceleration value in the third direction and the acceleration value in the first direction may be calculated, and when the acceleration value in the second direction and the acceleration value in the third direction are detected to be not zero, the acceleration value in the second direction and the acceleration value in the third direction and the acceleration value in the first direction may be calculated to obtain the target acceleration value, for example, and calculating the vector sum of the accelerations in all directions to obtain the final target acceleration, then obtaining a corresponding target acceleration value, and detecting whether the target acceleration value reaches a preset threshold value. For example, if the preset direction includes the first direction and the second direction, the sum of the vectors of the first direction and the second direction may be calculated, and then it is determined whether the sum of the vectors is greater than the preset threshold. For another example, if the first direction in the acceleration sensor is a direction perpendicular to the face, the first direction is used as a reference, and when the acceleration in the first direction is detected, the first direction and at least one of the other two directions are calculated to obtain a final result, and then the final result is compared with a preset threshold.
In another embodiment, when the acceleration value in the second direction and/or the third direction is detected to be not zero, it is further detected whether the mobile phone is moving through the distance sensor or the positioning module, if the mobile phone is moving, it indicates that the acceleration in the second direction or the third direction is generated due to the movement of the user, rather than due to the user knocking or tapping, and then the acceleration value in the second direction and/or the third direction is filtered out, so as to ensure that the finally obtained target acceleration value generated by the user knocking or tapping the earphone is further improved in accuracy.
In another embodiment, when it is detected that the acceleration values in the second direction and the third direction are not zero, it is further detected whether the acceleration values in the second direction and the third direction are periodically changed within a preset time, if so, it is indicated that the acceleration values in the second direction and the third direction are generated by a person knocking the earphone housing or knocking the teeth, at this time, the acceleration values in the first direction, the second direction and the third direction are compared, the acceleration value in the direction with the maximum value is taken as a parameter for calculating the vibration frequency and the interval time, and then the target vibration information is obtained through the acceleration value and the periodic change information. Or when the acceleration value in the second direction is detected to be not zero and the acceleration value in the third direction is detected to be zero, further detecting whether the acceleration value in the second direction is a periodically-changing acceleration value, if so, comparing the acceleration values in the first direction and the second direction, and taking the largest acceleration value of the two to calculate. Similarly, when detecting that the acceleration value in the second direction is zero and the acceleration value in the third direction is not zero, further detecting whether the acceleration value in the third direction is a periodically changing acceleration value, if so, comparing the acceleration values in the first direction and the third direction, and taking the largest acceleration value of the two values to calculate. That is, when the acceleration value in any one of the second direction and the third direction is not zero, the acceleration value in the direction is further detected to judge whether the acceleration value in the direction is a periodically changing acceleration value, if so, the acceleration value in the direction is compared with the first direction, and the highest acceleration value in the direction is taken as a calculation parameter.
In another embodiment, before the step S100, detecting to determine whether a device implementing the earphone control method is feasible, first performing software initialization, setting the instruction mapping table, setting a preset direction, a preset threshold and a duration of the acceleration sensor, then entering a vibration detection program, generating an interrupt to the microprocessor when the acceleration in the preset direction reaches the preset threshold, starting timing by the microprocessor and continuously reading an acceleration value of the acceleration sensor, obtaining the duration, the number of vibrations and an interval time of the vibrations through an algorithm, ending the timing when no change in the acceleration is detected at an interval of 1 second, then comparing with a set instruction mapping condition, if yes, controlling the earphone to perform a corresponding action, if no, clearing the measured data, and then entering the vibration detection program again, and starting detection to ensure that when the obtained vibration information matched with the instruction mapping table is obtained, an instruction corresponding to the vibration information is generated, and the earphone is controlled to execute corresponding action.
In one embodiment, the step S500 includes:
step S510: triggering a voice acquisition instruction according to the control instruction;
step S520: acquiring voice information input by a user according to the voice acquisition instruction;
step S530: matching the voice information with a second instruction mapping table to find out a target instruction matched with the voice information, wherein the second instruction mapping table is used for recording the corresponding mapping relation between each voice information and each target instruction;
step S540: and executing corresponding actions according to the target instruction.
In this embodiment, the earphone may be controlled to execute a corresponding action by combining voice and vibration, at this time, the vibration information may be used as trigger information, that is, the control instruction matched with the target vibration information is a trigger instruction for triggering a voice acquisition instruction, then the voice input by the user is acquired according to the voice acquisition instruction, then the voice is recognized to obtain corresponding voice information, such as "play", "cut song", "pause", and the like, then the voice information is matched with a second instruction mapping table, where the second instruction mapping table is a table in which different voice information and different target instructions have one-to-one mapping relationships, when the matching is not successful, the voice information input by the user is repeatedly acquired, and if the matching is successful, the target instruction matched with the voice information is found out, and then the corresponding action is executed according to the target instruction. Therefore, the voice collection is triggered through the vibration information, so that the voice collection module is not required to be continuously standby, and is started only after receiving a voice collection instruction, and can enter the dormancy after the collection is finished, so that the standby current cannot be increased even though the earphone is controlled through voice, and the cost is greatly reduced.
In another embodiment, the control instruction may also be generated in a manner of combining voice and vibration information, that is, obtaining vibration information through a sensor, collecting voice through a recorder or the sensor, then recognizing the obtained voice, then combining the vibration information with the voice information, matching with an instruction mapping table to find a control instruction matched with the combination, then generating the control instruction, and then controlling an earphone to execute the control instruction, where the instruction mapping table is a table in which different combinations of vibration information and voice information and different control instructions have mapping relationships, for example, after continuously tapping for 3 times, "one" is input through voice, and the corresponding control instruction is a play instruction; after the continuous knocking is carried out for 3 times, inputting 'two' through voice, wherein the corresponding control instruction is a pause instruction; after the earphone is continuously knocked for 3 times, the third sound is input through voice, the corresponding control instruction is a song switching instruction and the like, so that the earphone can be controlled to realize corresponding functions through simple knocking actions and simple words, and the earphone is more convenient and trouble-saving.
The present application also proposes a headset control device for executing the headset control method, which can be implemented in software or hardware, and can be generally integrated into a multimedia headset, such as a headset or an earphone radio, an MP3 player, a bluetooth headset, a translator, etc. Referring to fig. 2, the headphone control device includes:
the target obtaining unit 100 is configured to obtain target vibration information within a preset time, where the target vibration information includes a vibration frequency;
a frequency determining unit 200, configured to determine whether the vibration frequency is within a preset vibration frequency range;
a filtering information unit 300, configured to filter the target vibration information if the vibration frequency is not within a preset vibration frequency range;
a matching information unit 400, configured to match the target vibration information with a preset first instruction mapping table if the vibration frequency is within a preset vibration frequency range, where the first instruction mapping table is used to record a corresponding mapping relationship between each vibration information and each control instruction;
an action execution unit 500, configured to execute a corresponding action according to the matched control instruction if the control instruction having a mapping relationship with the target vibration information is matched in the first instruction mapping table.
As described above for obtaining the target unit 100, the target vibration information is obtained by a bone conduction vibration measurement sensor, which may be a sensor with small volume and low power consumption, and capable of detecting low-frequency knocking vibration, such as a piezoelectric sensor or a MEMS (micro-electro-mechanical system) 3D acceleration sensor. In this embodiment, target vibration information within a preset time is acquired by a sensor, where the target vibration information includes a vibration frequency, the preset time is a time period from a specified start timing time to a specified end timing time, the specified start timing time may be a time when a vibration pulse with a specified intensity is received, and the end timing time may be a time when no vibration pulse is received within a certain time after the vibration pulse is received.
Preferably, the above-mentioned acquisition target unit 100 includes:
and the acquisition vibrator unit is used for acquiring target vibration information generated by knocking the earphone or tapping the teeth by a user within preset time.
As above-mentioned gather the vibrator unit, above-mentioned bone conduction vibration measurement sensor sets up in the earphone, and the position of sensor hugging closely face or duct usually when the user wears, and the user accessible beats the earphone shell or produces low frequency vibration pulse through beating the tooth, picks up through above-mentioned bone conduction vibration measurement sensor, in this embodiment, gathers the target vibration information who produces because the user beats the earphone or beats the tooth in the preset time through above-mentioned sensor.
Specifically, the process of the piezoelectric sensor acquiring the target vibration information includes: the piezoelectric sensor generates mechanical deformation under the action of external force so as to generate charges on a polarization surface, then generates voltages at two ends, amplifies and converts impedance through a charge amplifier, sends the voltages to a comparator for threshold comparison, outputs a square wave signal when the voltages exceed a vibration threshold, and then analyzes and processes the data of the square wave signal through a microprocessor to obtain the target vibration information. The processing process of the MEMS 3D acceleration sensor comprises the following steps: the acceleration sensor is directly connected with the microprocessor through an I2S interface, received change information of certain axial vibration acceleration generated by knocking or tapping is directly transmitted to the microprocessor through the interface, and further, an interrupt input interface of the microprocessor can be connected with an interrupt output interface of the acceleration sensor, so that the purpose of saving electricity can be achieved when knocking action is not detected.
As described in the foregoing frequency determining unit 200 and the information filtering unit 300, in order to reduce errors and reduce misoperation, after the target vibration information is obtained, it is determined whether the vibration frequency is within a preset vibration frequency range, and filtering can be performed if the vibration frequency is too low or too high. The vibration information is obtained by knocking or tapping the teeth by a user and has a certain speed range, for example, the knocking speed of the user by fingers is about 3-4 times per second, the action of knocking the teeth by the user is basically the same as the frequency of knocking by the fingers, namely, the frequency of continuous vibration is 3-4 HZ, at this time, if the vibration with the frequency of more than 6HZ is obtained, the vibration is probably caused by non-artificial action, and the obtained vibration with the frequency of less than 2HZ is easily confused with daily action, so the vibration information can be filtered to avoid misoperation.
As described in the matching information unit 400 and the performing action unit 500, the target vibration information further includes the number of vibration pulses and the interval time of the vibration pulses, and it is understood that the frequency is the number of times that the material completes the periodic change within 1s, for example, the number of vibration pulses is 4, each interval time is 0.2 seconds, that is, the vibration pulses are a motion in which the vibration pulses periodically change, since the interval time is 0.2 seconds, the number of times that the material can complete within one second is 5, that is, the vibration frequency is 5, and if the interval time of the vibration pulses is 0.25 seconds, the vibration frequency is 4, that is, the vibration frequency can be calculated by the interval time of the vibration pulses. When the vibration frequency is in the preset vibration frequency range, but the combination of the number of vibration pulses and the interval time in the target vibration information does not accord with the preset combination, that is, the target vibration information may not match with the first instruction mapping table, so that the target vibration information is matched with the first instruction mapping table, the first instruction mapping table is used for recording the corresponding mapping relation between each vibration information and each control instruction, different control instructions control the earphone to execute different actions, if the control instruction having the mapping relation with the target vibration information is matched in the instruction mapping table, the action corresponding to the control instruction is executed according to the control instruction, for example, the earphone is controlled to pause songs, switch songs, change stations and the like.
Furthermore, the invention can obtain various control instructions by combining different vibration pulse numbers and vibration pulse interval time, and is worth noting that as long as at least one of two parameters of the vibration pulse numbers and the vibration pulse interval time is different, the two parameters correspond to different control instructions, thereby realizing all key functions of the earphone.
For example, when the interval time is within a certain range, different knocking times correspond to different control instructions, the duration of each knocking is 40-100 milliseconds, the interval time is 0.15-0.3 seconds, stopping for more than 1 second after 5 times of knocking represents function switching, stopping for more than 1 second after 4 times of knocking represents playing, and stopping for more than 1 second after 3 times of knocking represents channel changing or song changing. Or the interval time and the knocking times are different, the control commands correspond to different control commands, when the knocking interval time is 0.3-0.6 seconds, stopping for more than one second after knocking for 3 times represents pause, and when the knocking interval time is 0.1-0.3 seconds, stopping for more than one second after knocking for 4 times represents fast forward.
According to the invention, the target vibration information is obtained by knocking the earphone shell or the teeth by the user, and then the corresponding control instruction can be matched according to the first instruction mapping table, so that the user can easily control the earphone to execute the corresponding action under the condition of wearing the earphone conveniently, and compared with a voice control earphone, the problem of standby current or great cost increase or easy misoperation can not be caused because the information is picked up by the vibration sensor. The target vibration information is obtained by combining different vibration pulse numbers and vibration interval time, different key functions of the earphone can be obtained by different combinations, all the key functions of the existing earphone can be included due to the diversity of the combinations, and compared with the earphone operated by keys in the prior art, the target vibration information not only saves the layout space of the keys, but also has more complete functions.
In an embodiment, when the control instruction having the mapping relation with the target vibration information is not matched in the first instruction mapping table, it indicates that the received target vibration information is not information for controlling the earphone input by the user, and may be misoperation, so the target vibration information can be directly filtered; then repeating the steps until a control instruction which has a mapping relation with the target vibration information is matched in the first instruction mapping table; the target vibration information is obtained again, whether the vibration frequency of the target vibration information is within a preset vibration range or not is judged, if not, the target vibration information is filtered, if yes, the target vibration information is matched with a specified mapping table, and when a corresponding control instruction is matched, corresponding action is executed according to the control instruction.
In one embodiment, the above target unit 100 includes:
the acquisition value-adding subunit is used for acquiring a target acceleration value in a preset direction and detecting whether the target acceleration value reaches a preset threshold value;
the detection information subunit is used for starting timing and continuously acquiring the target acceleration value when the target acceleration value reaches a preset threshold value, detecting whether the target acceleration value is kept unchanged within a preset interval time, and ending timing if the target acceleration value is kept unchanged to obtain the target acceleration value from the start of timing to the end of timing;
the calculation information subunit is used for calculating to obtain the target vibration information according to the target acceleration value and the duration from the beginning timing to the end timing;
in this embodiment, the target vibration information is obtained by an acceleration sensor, that is, the target vibration information can be obtained by an acceleration value, the preset direction can be set by a user according to an actual situation, for example, when the acceleration sensor is arranged close to a face and a shell of the earphone is knocked, a knocking vibration direction is a direction perpendicular to a receiving plane of the earphone, that is, a direction perpendicular to the face, and at this time, the direction perpendicular to the face is also the preset direction. After the target acceleration value in the preset direction is obtained, in order to avoid misoperation, whether the target acceleration value reaches a preset threshold value or not can be judged firstly, so that the acceleration value which does not meet the matching requirement is preliminarily filtered, running resources are saved, when the target acceleration value reaches the preset threshold value, timing is started and the acceleration value is continuously obtained, the periodic acceleration value is generated when a user knocks the earphone shell or knocks the teeth, for example, the acceleration value with the largest numerical value is generated during knocking, then the process is stopped, the acceleration value is reduced, the acceleration value with the largest numerical value is generated again during knocking again, the process is repeated, namely, the periodic acceleration value is continuously obtained through the acceleration sensor, whether the target acceleration value is kept unchanged within the preset interval time is detected, if the target acceleration value is continuously changed all the time, namely, the knocking action of the user is not finished, the target acceleration value is kept to be obtained, if the acceleration value is detected to be kept unchanged within the preset interval time, namely the user stops knocking, timing is ended at the moment, so that a target acceleration value between the beginning of timing and the ending of timing and change information of the acceleration value in the time are obtained, the change information can be continuously obtained acceleration information with the acceleration value changing periodically, then the vibration frequency and the interval time are obtained through calculation according to the acceleration value and the duration between the beginning of timing and the ending of timing, the duration is also the preset time, because the acceleration value changing periodically is obtained within the duration, the maximum acceleration value in each period is generated by the user knocking the earphone once, namely generating vibration once, the period frequency in the duration is calculated, and the vibration frequency can be obtained, wherein the time of one period is the interval time, then, the information of the vibration frequency and the interval time is recorded as the target vibration information.
In one embodiment, the value-added sub-unit comprises:
the acquisition value-adding module is used for respectively acquiring acceleration values in a first direction, a second direction and a third direction through an acceleration sensor, the first direction, the second direction and the third direction are mutually perpendicular in pairs, and the preset direction is the first direction;
the detection value adding module is used for detecting whether the acceleration values in the second direction and the third direction are zero or not;
the first detection module is used for detecting whether the target acceleration value in the preset direction reaches a first threshold value or not if the acceleration values in the second direction and the third direction are detected to be zero;
and the second detection module is used for detecting whether the target acceleration value in the preset direction reaches a second threshold value or not if the acceleration values in the second direction and the third direction are detected to be not zero.
As described above, since the 3D acceleration sensor is used to obtain the target vibration information, the acceleration values in the first direction, the second direction and the third direction may be obtained, and the first direction, the second direction and the third direction are perpendicular to each other in pairs, for example, three directions of the X, Y, Z axis, respectively, and the predetermined direction may be any one of the three directions. In this embodiment, the preset direction is a first direction, acceleration in different directions is generated in different motion directions, for example, walking in a second direction or riding in a third direction, acceleration in the second direction or the third direction is generated at this time, and the tapping or tapping motion usually only causes acceleration change in one or two directions, for example, a user only has one acceleration direction perpendicular to the face by tapping the earphone housing, the acceleration directions perpendicular to the upper and lower teeth can be generated by tapping the teeth, and the acquisition of the acceleration values in different directions simultaneously interferes with the target acceleration values in the preset direction, so the acceleration values in the second direction and the third direction can be detected first, and then whether the acceleration value in the preset direction reaches a preset threshold value is detected, where the preset threshold value in the value-adding subunit is the first threshold value or the second threshold value, and the first threshold value is smaller than the second threshold value, when the acceleration values in the second direction and the third direction are detected to be zero, whether the target acceleration value in the preset direction reaches the first threshold value is detected, and when the acceleration values in the second direction and the third direction are detected to be nonzero, whether the target acceleration value in the preset direction reaches the second threshold value is detected, so that under the condition that the acceleration values in the second direction and the third direction are provided, in order to avoid interference, the force required to be knocked is larger, and at the moment, the target acceleration value in the first direction is larger than the target acceleration value under the condition that the acceleration values in the second direction and the third direction are not provided. In addition, when the acceleration values in the first direction, the second direction and the third direction are obtained, the acceleration values in the second direction and the third direction can be directly filtered out, so that the finally obtained acceleration value is a target acceleration value in a preset direction.
In another embodiment, the value-added obtaining sub-unit further includes:
the speed acquisition module is used for respectively acquiring acceleration values in a first direction, a second direction and a third direction through an acceleration sensor, the first direction, the second direction and the third direction are mutually perpendicular in pairs, and the preset direction is the first direction;
and the third detection module is used for calculating the acceleration value in the second direction and/or the third direction and the acceleration value in the first direction to obtain the target acceleration value if the acceleration value in the second direction and/or the third direction is detected to be not zero, and detecting whether the target acceleration value reaches a preset threshold value.
In the embodiment, the acceleration values in the first direction, the second direction and the third direction are obtained through a 3D acceleration sensor, wherein the first direction, the second direction and the third direction are respectively two directions which are perpendicular to each other, the preset direction is set as the first direction, then whether the acceleration value in the second direction and/or the third direction is zero or not is detected, and when the acceleration values in the second direction and the third direction are detected to be zero, whether the target acceleration value in the preset direction reaches a preset threshold value or not is detected; when the user may knock the earphone housing or knock the teeth, acceleration in multiple directions may be generated, and the acceleration value in the second direction and the acceleration value in the third direction may be calculated, for example, when the acceleration value in the second direction is detected to be not zero and the acceleration value in the third direction is detected to be not zero, the acceleration value in the second direction and the acceleration value in the first direction may be calculated, when the acceleration value in the second direction is detected to be zero and the acceleration value in the third direction is detected to be not zero, the acceleration value in the third direction and the acceleration value in the first direction may be calculated, and when the acceleration value in the second direction and the acceleration value in the third direction are detected to be not zero, the acceleration value in the second direction and the acceleration value in the third direction and the acceleration value in the first direction may be calculated to obtain the target acceleration value, for example, and calculating the vector sum of the accelerations in all directions to obtain the final target acceleration, then obtaining a corresponding target acceleration value, and detecting whether the target acceleration value reaches a preset threshold value. For example, if the preset direction includes the first direction and the second direction, the sum of the vectors of the first direction and the second direction may be calculated, and then it is determined whether the sum of the vectors is greater than the preset threshold. For another example, if the first direction in the acceleration sensor is a direction perpendicular to the face, the first direction is used as a reference, and when the acceleration in the first direction is detected, the first direction and at least one of the other two directions are calculated to obtain a final result, and then the final result is compared with a preset threshold.
In another embodiment, when the acceleration value in the second direction and/or the third direction is detected to be not zero, it is further detected whether the mobile phone is moving through the distance sensor or the positioning module, if the mobile phone is moving, it indicates that the acceleration in the second direction or the third direction is generated due to the movement of the user, rather than due to the user knocking or tapping, and then the acceleration value in the second direction and/or the third direction is filtered out, so as to ensure that the finally obtained target acceleration value generated by the user knocking or tapping the earphone is further improved in accuracy.
In another embodiment, when it is detected that the acceleration values in the second direction and the third direction are not zero, it is further detected whether the acceleration values in the second direction and the third direction are periodically changed within a preset time, if so, it is indicated that the acceleration values in the second direction and the third direction are generated by a person knocking the earphone housing or knocking the teeth, at this time, the acceleration values in the first direction, the second direction and the third direction are compared, the acceleration value in the direction with the maximum value is taken as a parameter for calculating the vibration frequency and the interval time, and then the target vibration information is obtained through the acceleration value and the periodic change information. Or when the acceleration value in the second direction is detected to be not zero and the acceleration value in the third direction is detected to be zero, further detecting whether the acceleration value in the second direction is a periodically-changing acceleration value, if so, comparing the acceleration values in the first direction and the second direction, and taking the largest acceleration value of the two to calculate. Similarly, when detecting that the acceleration value in the second direction is zero and the acceleration value in the third direction is not zero, further detecting whether the acceleration value in the third direction is a periodically changing acceleration value, if so, comparing the acceleration values in the first direction and the third direction, and taking the largest acceleration value of the two values to calculate. That is, when the acceleration value in any one of the second direction and the third direction is not zero, the acceleration value in the direction is further detected to judge whether the acceleration value in the direction is a periodically changing acceleration value, if so, the acceleration value in the direction is compared with the first direction, and the highest acceleration value in the direction is taken as a calculation parameter.
In another embodiment, the detection is performed to determine whether the device for implementing the earphone control method is feasible, software initialization is performed first, the instruction mapping table is set, the axial direction, the preset threshold and the duration of the acceleration sensor are set, then a vibration detection program is entered, when the set axial acceleration reaches the preset threshold, an interrupt is generated to a microprocessor, the microprocessor starts timing and continuously reads the acceleration value of the acceleration sensor, the duration, the vibration times and the interval time of vibration are obtained through an algorithm, when no acceleration change is detected at an interval of 1 second, the timing is ended, then the comparison with the set instruction mapping condition is performed, if the acceleration value is met, the earphone is controlled to execute corresponding action, if the acceleration value is not met, the measured data is cleared, then the vibration detection program is entered again, and the detection is started to ensure that when the obtained vibration information matched with the instruction mapping table, and generating an instruction corresponding to the vibration information, and controlling the earphone to execute corresponding action.
In one embodiment, the action executing unit 500 includes:
the triggering acquisition subunit is used for triggering a voice acquisition instruction according to the control instruction;
the voice acquisition subunit is used for acquiring voice information input by a user according to the voice acquisition instruction;
the matching voice subunit is used for matching the voice information with a second instruction mapping table to find out a target instruction matched with the voice information, and the second instruction mapping table is used for recording the corresponding mapping relation between each piece of voice information and each target instruction;
and the action execution subunit is used for executing the corresponding action according to the target instruction.
In this embodiment, the earphone may be controlled to execute a corresponding action by combining voice and vibration, at this time, the vibration information may be used as trigger information, that is, the control instruction matched with the target vibration information is a trigger instruction for triggering a voice acquisition instruction, then the voice input by the user is acquired according to the voice acquisition instruction, then the voice is recognized to obtain corresponding voice information, such as "play", "cut song", "pause", and the like, then the voice information is matched with a second instruction mapping table, where the second instruction mapping table is a table in which different voice information and different target instructions have one-to-one mapping relationships, when the matching is not successful, the voice information input by the user is repeatedly acquired, and if the matching is successful, the target instruction matched with the voice information is found out, and then the corresponding action is executed according to the target instruction. Therefore, the voice collection is triggered through the vibration information, so that the voice collection module is not required to be continuously standby, and is started only after receiving a voice collection instruction, and can enter the dormancy after the collection is finished, so that the standby current cannot be increased even though the earphone is controlled through voice, and the cost is greatly reduced.
In another embodiment, the control instruction may also be generated in a manner of combining voice and vibration information, that is, obtaining vibration information through a sensor, collecting voice through a recorder or the sensor, then recognizing the obtained voice, then combining the vibration information with the voice information, matching with an instruction mapping table to find a control instruction matched with the combination, then generating the control instruction, and then controlling an earphone to execute the control instruction, where the instruction mapping table is a table in which different combinations of vibration information and voice information and different control instructions have mapping relationships, for example, after continuously tapping for 3 times, "one" is input through voice, and the corresponding control instruction is a play instruction; after the continuous knocking is carried out for 3 times, inputting 'two' through voice, wherein the corresponding control instruction is a pause instruction; after the earphone is continuously knocked for 3 times, the third sound is input through voice, the corresponding control instruction is a song switching instruction and the like, so that the earphone can be controlled to realize corresponding functions through simple knocking actions and simple words, and the earphone is more convenient and trouble-saving.
Referring to fig. 3, the present application also provides a storage medium 21 readable by a computer, wherein the storage medium 21 stores a computer program 22, which when run on the computer, causes the computer to execute the headset control method described in the above embodiment.
With reference to fig. 4, the present application also provides a computer device 34 containing instructions, the computer device comprising a memory 31 and a processor 33, the memory 31 storing a computer program 32, the processor 33 implementing the headphone control method described in the above embodiments when executing the computer program 32.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.
Claims (10)
1. A headset control method, comprising:
acquiring target vibration information within preset time, wherein the target vibration information comprises vibration frequency;
judging whether the vibration frequency is within a preset vibration frequency range;
if the vibration frequency is not within a preset vibration frequency range, filtering the target vibration information;
if the vibration frequency is within a preset vibration frequency range, matching the target vibration information with a preset first instruction mapping table, wherein the first instruction mapping table is used for recording the corresponding mapping relation between each vibration information and each control instruction;
and if the control instruction which has the mapping relation with the target vibration information is matched in the first instruction mapping table, executing corresponding action according to the matched control instruction.
2. The headphone control method as described in claim 1, wherein the step of obtaining the target vibration information within a preset time comprises:
acquiring a target acceleration value in a preset direction, and detecting whether the target acceleration value reaches a preset threshold value or not;
when the target acceleration value reaches a preset threshold value, starting timing and continuously acquiring the target acceleration value, detecting whether the target acceleration value is kept unchanged within a preset interval time, and if the target acceleration value is kept unchanged, ending the timing to obtain the target acceleration value from the beginning of timing to the end of timing;
and calculating to obtain the target vibration information according to the target acceleration value and the duration from the beginning timing to the end timing.
3. The headphone control method as claimed in claim 2, wherein the preset threshold is a first threshold or a second threshold, and the first threshold is smaller than the second threshold; the step of acquiring a target acceleration value in a preset direction and detecting whether the target acceleration value reaches a preset threshold value comprises the following steps:
respectively acquiring acceleration values in a first direction, a second direction and a third direction through an acceleration sensor, wherein the first direction, the second direction and the third direction are mutually vertical directions in pairs, and the preset direction is the first direction;
detecting whether the acceleration values in the second direction and the third direction are zero or not;
if the acceleration values in the second direction and the third direction are both zero, detecting whether the target acceleration value in the preset direction reaches a first threshold value;
and if the acceleration values in the second direction and the third direction are not detected to be zero, detecting whether the target acceleration value in the preset direction reaches a second threshold value.
4. The headphone control method as claimed in claim 2, wherein the step of obtaining a target acceleration value in a preset direction and detecting whether the target acceleration value reaches a preset threshold value comprises:
respectively acquiring acceleration values in a first direction, a second direction and a third direction through an acceleration sensor, wherein the first direction, the second direction and the third direction are mutually vertical directions in pairs, and the preset direction is the first direction;
if the acceleration value in the second direction and/or the third direction is detected to be not zero, calculating the acceleration value in the second direction and/or the third direction and the acceleration value in the first direction to obtain the target acceleration value, and detecting whether the target acceleration value reaches the preset threshold value.
5. The headphone control method as described in claim 1, wherein the step of performing the corresponding action according to the control command comprises:
triggering a voice acquisition instruction according to the control instruction;
acquiring voice information input by a user according to the voice acquisition instruction;
matching the voice information with a second instruction mapping table to find out a target instruction matched with the voice information, wherein the second instruction mapping table is used for recording the corresponding mapping relation between each voice information and each target instruction;
and executing corresponding actions according to the target instruction.
6. The headphone control method as described in claim 1, wherein the step of obtaining the target vibration information within a preset time comprises:
and acquiring target vibration information generated by knocking the earphone or tapping the teeth of the user within preset time.
7. The headphone control method according to claim 1, wherein the target vibration information includes a number of vibration pulses and an interval time of the vibration pulses.
8. An earphone control device, comprising:
the target obtaining unit is used for obtaining target vibration information in preset time, and the target vibration information comprises vibration frequency;
the judging frequency unit is used for judging whether the vibration frequency is in a preset vibration frequency range or not;
the filtering information unit is used for filtering the target vibration information if the vibration frequency is not within a preset vibration frequency range;
the matching information unit is used for matching the target vibration information with a preset first instruction mapping table if the vibration frequency is within a preset vibration frequency range, and the first instruction mapping table is used for recording the corresponding mapping relation between each vibration information and each control instruction;
and the action execution unit is used for executing corresponding action according to the matched control instruction if the control instruction which has the mapping relation with the target vibration information is matched in the first instruction mapping table.
9. A storage medium, characterized in that it is a computer-readable storage medium on which a computer program is stored, which computer program, when executed, implements the headphone control method according to any one of claims 1 to 7.
10. A computer device comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, the processor implementing the headphone control method according to any one of claims 1 to 7 when executing the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911259312.3A CN110896511A (en) | 2019-12-10 | 2019-12-10 | Earphone control method and device, storage medium and computer equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911259312.3A CN110896511A (en) | 2019-12-10 | 2019-12-10 | Earphone control method and device, storage medium and computer equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110896511A true CN110896511A (en) | 2020-03-20 |
Family
ID=69787432
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911259312.3A Pending CN110896511A (en) | 2019-12-10 | 2019-12-10 | Earphone control method and device, storage medium and computer equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110896511A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112249026A (en) * | 2020-10-26 | 2021-01-22 | 广州小鹏汽车科技有限公司 | Vehicle control method and device |
CN113156877A (en) * | 2021-05-31 | 2021-07-23 | 苏州调皮鱼电子科技有限公司 | Low-cost cold chain monitored control system |
CN113589727A (en) * | 2021-07-29 | 2021-11-02 | 深圳市于斯为盛科技有限公司 | Heating insole and control method thereof |
CN113791839A (en) * | 2021-09-10 | 2021-12-14 | 中国第一汽车股份有限公司 | Control method, device, equipment and storage medium |
CN113965865A (en) * | 2021-10-20 | 2022-01-21 | 武汉左点科技有限公司 | Single-key input adjusting method and device |
CN114002973A (en) * | 2021-09-28 | 2022-02-01 | 深圳面元智能科技有限公司 | Vibration control method, device, vibration control equipment and readable storage medium |
WO2022222714A1 (en) * | 2021-04-23 | 2022-10-27 | 华为技术有限公司 | Control method and electronic device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003143683A (en) * | 2001-10-31 | 2003-05-16 | Ntt Docomo Inc | Command entry device |
CN103765919A (en) * | 2011-04-01 | 2014-04-30 | 博恩托恩通信有限公司 | System and apparatus for controlling user interface with bone conduction transducer |
CN104125523A (en) * | 2014-08-01 | 2014-10-29 | 周祥宇 | Dynamic earphone system and application method thereof |
CN109412544A (en) * | 2018-12-20 | 2019-03-01 | 歌尔科技有限公司 | A kind of voice acquisition method of intelligent wearable device, device and associated component |
CN110175014A (en) * | 2019-05-28 | 2019-08-27 | 歌尔科技有限公司 | A kind of wireless headset method for controlling volume, system and wireless headset and storage medium |
CN110234044A (en) * | 2019-05-10 | 2019-09-13 | 万魔声学科技有限公司 | A kind of voice awakening method, voice Rouser and earphone |
-
2019
- 2019-12-10 CN CN201911259312.3A patent/CN110896511A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003143683A (en) * | 2001-10-31 | 2003-05-16 | Ntt Docomo Inc | Command entry device |
CN103765919A (en) * | 2011-04-01 | 2014-04-30 | 博恩托恩通信有限公司 | System and apparatus for controlling user interface with bone conduction transducer |
CN104125523A (en) * | 2014-08-01 | 2014-10-29 | 周祥宇 | Dynamic earphone system and application method thereof |
CN109412544A (en) * | 2018-12-20 | 2019-03-01 | 歌尔科技有限公司 | A kind of voice acquisition method of intelligent wearable device, device and associated component |
CN110234044A (en) * | 2019-05-10 | 2019-09-13 | 万魔声学科技有限公司 | A kind of voice awakening method, voice Rouser and earphone |
CN110175014A (en) * | 2019-05-28 | 2019-08-27 | 歌尔科技有限公司 | A kind of wireless headset method for controlling volume, system and wireless headset and storage medium |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112249026A (en) * | 2020-10-26 | 2021-01-22 | 广州小鹏汽车科技有限公司 | Vehicle control method and device |
WO2022222714A1 (en) * | 2021-04-23 | 2022-10-27 | 华为技术有限公司 | Control method and electronic device |
CN113156877A (en) * | 2021-05-31 | 2021-07-23 | 苏州调皮鱼电子科技有限公司 | Low-cost cold chain monitored control system |
CN113589727A (en) * | 2021-07-29 | 2021-11-02 | 深圳市于斯为盛科技有限公司 | Heating insole and control method thereof |
CN113589727B (en) * | 2021-07-29 | 2023-09-26 | 深圳市于斯为盛科技有限公司 | Heating insole and control method thereof |
CN113791839A (en) * | 2021-09-10 | 2021-12-14 | 中国第一汽车股份有限公司 | Control method, device, equipment and storage medium |
CN114002973A (en) * | 2021-09-28 | 2022-02-01 | 深圳面元智能科技有限公司 | Vibration control method, device, vibration control equipment and readable storage medium |
CN114002973B (en) * | 2021-09-28 | 2024-06-21 | 深圳面元智能科技有限公司 | Vibration control method, device, vibration control apparatus, and readable storage medium |
CN113965865A (en) * | 2021-10-20 | 2022-01-21 | 武汉左点科技有限公司 | Single-key input adjusting method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110896511A (en) | Earphone control method and device, storage medium and computer equipment | |
JP6986112B2 (en) | In-ear wearing detection method of wireless earphone and wireless earphone | |
CN108848429A (en) | The pairing connection method of wireless transmitting-receiving equipments and wireless transmitting-receiving equipments | |
EP2277301B1 (en) | An improved headset | |
CN109257674B (en) | Wearing condition detection method and device of wireless earphone and wireless earphone | |
CN108763901B (en) | Ear print information acquisition method and device, terminal, earphone and readable storage medium | |
CN108668009B (en) | Input operation control method, device, terminal, earphone and readable storage medium | |
CN108810693A (en) | Apparatus control method and Related product | |
CN107708009B (en) | Wireless earphone operation method and device, wireless earphone and storage medium | |
EP3823311A1 (en) | Microphone hole blockage detection method and related product | |
CN108881568A (en) | Method, apparatus, electronic device and the storage medium of display screen sounding | |
WO2020207376A1 (en) | Denoising method and electronic device | |
CN108766468B (en) | Intelligent voice detection method, wireless earphone, TWS earphone and terminal | |
US20180120930A1 (en) | Use of Body-Area Network (BAN) as a Kinetic User Interface (KUI) | |
CN115735363A (en) | Wearable audio device placement detection | |
US20240152313A1 (en) | Wearing detection method, wearable device, and storage medium | |
CN109618263A (en) | Head/neck inclination angle detection method, apparatus, system and wireless headset controller | |
US20190327551A1 (en) | Wireless headphone system | |
CN111768600A (en) | Head-lowering detection method and device and wireless earphone | |
US20240257795A1 (en) | Noise reduction parameter setting method and apparatus, earphone device and storage medium | |
CN114640922B (en) | Intelligent earphone and in-ear adaptation method and medium thereof | |
CN109151699B (en) | Microphone hole blockage detection method and related product | |
WO2023159717A1 (en) | Earbud operation control method, ring earbuds, and storage medium | |
CN106803849B (en) | Communication control method based on wearable device and wearable device | |
CN215647269U (en) | Wearable device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200320 |