A method, system, computer and storage medium for detecting earphones against accidental touches and knocks
The accelerator's tapping action is detected by the acceleration sensor, and the method of dividing acceleration data and calculating ratios, the problems of tapping recognition accuracy and equipment cost in the prior art are solved, efficient tapping detection and multi-scene anti-interference touch, reducing hardware costs.
Patent Information
- Application Number
- CN202510274269.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-03-10
AI Technical Summary
Although tap control recognition based on multiple sensors in the prior art improves detection accuracy, it increases equipment cost, which is not conducive to the lightweight demand of the equipment.
The acceleration waveform diagram is obtained through the acceleration sensor, the headset's tapping action is detected, and the acceleration data is divided into the front and rear data, the maximum value ratio of the acceleration change value of the two segments is calculated, and the threshold is set to determine whether it is an effective tapping event.
Effectively distinguish between user active knocking and vibration interference caused by placement, collision or movement, reduce false touch rate, reduce hardware cost and power consumption, and achieve multi-scene anti-fault touch.
Smart Images

Figure CN119789037A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of earphone technology, and in particular to an earphone anti-mistouch knocking detection method, system, computer and storage medium. Background Art
[0002] Among the interactive methods of headphones, tapping control has become a common function due to its convenience. In traditional solutions, an acceleration sensor is usually used, and a threshold judgment is made based on the acceleration amplitude. When the acceleration amplitude exceeds the set threshold, it is considered that a tapping event is detected. In this way, when the user is exercising, such as walking or running, the headphones will also produce acceleration changes. These changes can easily trigger misjudgments, causing the headphones to frequently execute wrong commands. Moreover, when the headphones are slightly bumped or shaken by the outside world, they may also be misjudged as tapping operations.
[0003] In the prior art, in order to improve the recognition accuracy of tapping control interaction, a common solution is to improve the accuracy of tapping device detection by combining the signals of multiple sensors and adjusting the judgment weights. However, this method also increases the cost of the equipment and is not conducive to the lightweight requirements of the equipment. Summary of the invention
[0004] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a method, system, computer and storage medium for detecting false touches of headphones, aiming to solve the technical problem that the prior art relies on multiple sensors to identify tapping manipulations, which increases the cost of the equipment and is not conducive to the lightweight requirements of the equipment.
[0005] In order to achieve the above-mentioned object, in a first aspect, the present invention provides: a method for detecting earphones against false touches and knocks, comprising the following steps: Detecting the tapping action of the earphone through the acceleration waveform obtained by the acceleration sensor; When the instantaneous acceleration change is greater than a first preset threshold, an interrupt signal is triggered, and acceleration data along the tapping direction within a preset time period corresponding to the interrupt signal is collected; Dividing the acceleration data into front segment data and rear segment data according to time distribution, and calculating the maximum value of the acceleration change value of the front segment data and the acceleration change value of the rear segment data respectively, wherein the acceleration change value is the absolute value of the difference between the two acceleration data corresponding to the preset calculation interval; According to whether the ratio of the maximum value of the acceleration change value of the preceding data to the maximum value of the acceleration change value of the succeeding data is greater than a set threshold, judging whether it is a valid tapping event according to the comparison result; If the ratio is less than the set threshold, it is determined to be an invalid tap event and the interrupt signal is ignored.
[0006] According to one aspect of the above technical solution, the latter segment data includes the former sub-segment data and the latter sub-segment data. Before the step of determining whether it is a valid tapping event according to the comparison result, the method further includes: The average value and the maximum value of the acceleration change value of the front sub-segment data and the rear sub-segment data are calculated respectively, and it is determined whether the average value and the maximum value of the acceleration change value of the front sub-segment data and the rear sub-segment data both satisfy the following expressions: ; In the formula, is the average value of the acceleration change value of the previous sub-segment data, is the first adjustment coefficient, and the value of the first adjustment coefficient is 2. is the average value of the acceleration change value of the latter sub-segment data, is the maximum value of the acceleration change value of the previous sub-segment data, is the second adjustment coefficient, and the value of the second adjustment coefficient is 4. is the maximum value of the acceleration change value of the rear sub-segment data; If so, replace the ratio with the correction value and compare it with the set threshold: ; In the formula, is the correction value, is the maximum value of the acceleration change value of the previous data.
[0007] According to one aspect of the above technical solution, the method further includes: According to the relationship between the mean value of each acceleration data in the latter part of the data and the direction of gravity acceleration, it is judged whether the headset is in a natural flat placement state.
[0008] According to one aspect of the above technical solution, the step of judging whether the earphone is in a natural plane placement state according to the relationship between the mean value of each acceleration data in the latter data and the direction of gravity acceleration specifically includes: The component mean of the axial component of the striking direction of each acceleration data in the latter data is calculated. If the component mean is within a preset range, it is determined that the earphone is in a natural plane placement state.
[0009] According to one aspect of the above technical solution, the method further includes: When the headset is in a natural flat placement state, determining whether the maximum value of the acceleration change value of the preceding data is greater than a placement tapping setting value; If the maximum value of the acceleration change value of the previous data is less than the placement tap setting value, it is determined to be an invalid tap event and the interrupt signal is ignored.
[0010] According to one aspect of the above technical solution, the method further includes: Calculate the difference between the maximum and minimum values of the axis component of the striking direction of each acceleration data in the preceding data, and determine whether the difference is greater than the motion setting value; If the difference is smaller than the motion setting value, it is determined as an invalid tapping event and the interrupt signal is ignored.
[0011] According to one aspect of the above technical solution, the preset time period is 48 milliseconds, the calculation interval of the acceleration change value of the front-end data is 2 milliseconds, and the calculation interval of the acceleration change value of the back-end data is 1 millisecond.
[0012] In a second aspect, the present invention provides an earphone anti-mistouch knocking detection system, comprising: A knock detection module, used to detect the knocking action of the earphone through the acceleration waveform obtained by the acceleration sensor; An interrupt signal module, used to trigger an interrupt signal when the instantaneous acceleration change is greater than a first preset threshold value, and collect acceleration data along the tapping direction within a preset time period corresponding to the interrupt signal; A segmentation module, which divides the acceleration data into front segment data and rear segment data according to time distribution, and calculates the maximum value of the acceleration change value of the front segment data and the rear segment data respectively, wherein the acceleration change value is the absolute value of the difference between the two acceleration data corresponding to the preset calculation interval; A calculation module, used to determine whether it is a valid tap event according to the comparison result based on whether the ratio of the maximum value of the acceleration change value of the preceding data to the maximum value of the acceleration change value of the succeeding data is greater than a set threshold; The ignoring module is used to determine that the knocking event is an invalid event and ignore the interrupt signal if the ratio is less than a set threshold.
[0013] According to one aspect of the above technical solution, the latter segment data includes the former sub-segment data and the latter sub-segment data, and the system further includes: The correction module is used to calculate the average value and the maximum value of the acceleration change value of the front sub-segment data and the rear sub-segment data, respectively, and determine whether the average value and the maximum value of the acceleration change value of the front sub-segment data and the rear sub-segment data both satisfy the following expressions: ; In the formula, is the average value of the acceleration change value of the previous sub-segment data, is the first adjustment coefficient, and the value of the first adjustment coefficient is 2. is the average value of the acceleration change value of the latter sub-segment data, is the maximum value of the acceleration change value of the previous sub-segment data, is the second adjustment coefficient, and the value of the second adjustment coefficient is 4. is the maximum value of the acceleration change value of the rear sub-segment data; If so, replace the ratio with the correction value and compare it with the set threshold: ; In the formula, is the correction value, is the maximum value of the acceleration change value of the previous data.
[0014] According to one aspect of the above technical solution, the system further includes: The placement judgment module is used to judge whether the headset is in a natural plane placement state based on the relationship between the mean value of each acceleration data in the subsequent data and the direction of gravity acceleration.
[0015] According to one aspect of the above technical solution, the placement judgment module is specifically used for: The component mean of the axial component of the striking direction of each acceleration data in the latter data is calculated. If the component mean is within a preset range, it is determined that the earphone is in a natural plane placement state.
[0016] According to one aspect of the above technical solution, the system further includes: The anti-mistouch module is used to determine whether the maximum value of the acceleration change value of the previous data is greater than the placement tapping setting value when the headset is in a natural flat placement state; If the maximum value of the acceleration change value of the previous data is less than the placement tap setting value, it is determined to be an invalid tap event and the interrupt signal is ignored.
[0017] According to one aspect of the above technical solution, the system further includes: A motion module, used to calculate the difference between the maximum and minimum values of the axis component of the striking direction of each acceleration data in the preceding data, and determine whether the difference is greater than a motion setting value; If the difference is smaller than the motion setting value, it is determined as an invalid tapping event and the interrupt signal is ignored.
[0018] In a third aspect, the present invention also provides a computer, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the earphone anti-mistouch knock detection method as described in the above technical solution is implemented.
[0019] In a fourth aspect, the present invention further provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the earphone anti-mistouch knocking detection method as described in the above technical solution is implemented.
[0020] Compared with the prior art, the beneficial effects of the present invention are: by dividing the acceleration data into front-end data and back-end data, and calculating the maximum value ratio of the acceleration change values of the two segments, combined with the set threshold, it is effective to distinguish between the user's active tapping and the vibration interference caused by placement, collision or movement, avoid the influence of sudden noise at the end of the data on the judgment, and reduce the false touch rate; by analyzing the relationship between the mean value of the back-end acceleration and the direction of gravity, it is intelligently identified whether the headset is in a desktop placement state, and dynamically increases the set threshold for tapping judgment to avoid erroneous operations caused by desktop vibration or collision; tapping detection and multi-scenario anti-false touch can be completed only by relying on acceleration sensors, without the need for additional sensors (such as gyroscopes, pressure sensors), reducing hardware costs and power consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a flowchart of the method for detecting earphones against accidental touches and knocks in the first embodiment of the present invention; Figure 2 is a waveform diagram of the x-axis acceleration of the normal tapping of the earphone in the first embodiment of the present invention; Figure 3 This is a waveform diagram of the x-axis acceleration of the high-frequency vibration generated when the earphone is placed on a desktop in the first embodiment of the present invention; Figure 4 This is a waveform diagram of the x-axis acceleration after an interrupt signal is generated when the headset is placed on a desktop in the first embodiment of the present invention. Figure 5 It is a structural block diagram of the earphone false touch prevention knocking detection system in the fourth embodiment of the present invention; Figure 6 is a schematic diagram of the hardware structure of a computer in a fifth embodiment of the present invention; The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0022] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0023] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0025] Embodiment 1 See also Figure 1 , which is a flow chart of a method for detecting false touches and knocking of an earphone in a first embodiment of the present invention. As shown in the figure, the method includes the following steps: Step S100: detecting the tapping action of the earphone through the acceleration waveform obtained by the acceleration sensor.
[0026] For easy understanding, the characteristics of knock vibration are: the acceleration waveform of knock vibration usually shows a sudden peak, which represents the instantaneous acceleration change caused by knocking, followed by oscillation attenuation, reflecting that the vibration gradually weakens and tends to stabilize. Using acceleration difference can more sensitively capture the instantaneous change of acceleration during knocking, reduce noise interference, and more clearly reflect the attenuation process of vibration, thereby improving the detection accuracy and robustness of knock events.
[0027] Step S200: When the instantaneous acceleration change is greater than a first preset threshold, an interrupt signal is triggered, and acceleration data along the tapping direction within a preset time period corresponding to the interrupt signal is collected.
[0028] Step S300, dividing the acceleration data into front segment data and rear segment data according to time distribution, and calculating the maximum value of the acceleration change value of the front segment data and the rear segment data respectively, wherein the acceleration change value is the absolute value of the difference between the two acceleration data corresponding to the preset calculation interval.
[0029] Specifically, in this embodiment, the preset time period is 48 milliseconds, the calculation interval of the acceleration change value of the front-end data is 2 milliseconds, and the calculation interval of the acceleration change value of the back-end data is 1 millisecond.
[0030] Specifically, the waveform generated by earphone knocking takes about 2ms to 3ms or even longer to go from the lowest point to the highest point, while the waveform generated by unexpected situations often only takes 1ms to go from the lowest point to the highest point (mostly occurs when the earphone is placed on the desktop). Using the acceleration change value per millisecond cannot well reflect the acceleration change caused by the knocking. Adjust the time interval for calculating the acceleration change value and use an interval of 2ms to calculate the acceleration change value at each time point. For ease of understanding, the waveform of the x-axis acceleration of normal knocking of the earphone and the waveform of the x-axis acceleration of the high-frequency vibration generated by placing the earphone on the desktop are shown as follows. Figure 2 , Figure 3 As shown in the figure, the horizontal axis is the number of data sets of acceleration change values, and the vertical axis is the x-axis acceleration value output by the accelerometer.
[0031] Using acceleration change values at 2ms intervals can better reflect the acceleration changes caused by tapping vibration, and can also better distinguish the difference in acceleration changes caused by tapping and vibration caused by placing the device on the desktop (this is also equivalent to a kind of filtering). Therefore, the calculation of the maximum value of the acceleration change value of the previous data is changed to the maximum value of the acceleration change value every 2 milliseconds in the first half of an interruption.
[0032] In some application scenarios of this embodiment, when the acceleration sensor detects a tapping force reaching a certain level, an interrupt is generated to record 48ms of x-axis acceleration data (the direction in which the user taps the headset is the x-axis). The acceleration change value per millisecond in an interrupt is calculated. The maximum acceleration change value per millisecond in the front and back parts of an interrupt is counted (the maximum acceleration change value per 2 milliseconds in the first half from 1ms to 24ms is max_front, that is, the maximum value of the acceleration change value of the front data, and the maximum acceleration change value per millisecond in the second half from 25ms to 48ms is max_back), that is, the maximum value of the acceleration change value of the back data.
[0033] Step S400, judging whether it is a valid tapping event according to the comparison result, based on whether the ratio of the maximum value of the acceleration change value of the preceding data to the maximum value of the acceleration change value of the succeeding data is greater than a set threshold.
[0034] Preferably, in this embodiment, the latter segment data includes the former sub-segment data and the latter sub-segment data. Before the step of determining whether it is a valid tapping event according to the comparison result, the method further includes: Step S401, respectively calculating the average value and the maximum value of the acceleration change value of the front sub-segment data and the rear sub-segment data, and determining whether the average value and the maximum value of the acceleration change value of the front sub-segment data and the rear sub-segment data both satisfy the following expressions: ; In the formula, is the average value of the acceleration change value of the previous sub-segment data, is the first adjustment coefficient, and the value of the first adjustment coefficient is 2. is the average value of the acceleration change value of the latter sub-segment data, is the maximum value of the acceleration change value of the previous sub-segment data, is the second adjustment coefficient, and the value of the second adjustment coefficient is 4. is the maximum value of the acceleration change value of the rear sub-segment data; If so, replace the ratio with the correction value and compare it with the set threshold: ; In the formula, is the correction value, is the maximum value of the acceleration change value of the previous data.
[0035] It is easy to understand that the acceleration waveform generated by a normal tapping should gradually oscillate and decay within 30ms, and stabilize after 30ms. However, in actual data, it is found that the data exported by the sensor hardware will have noise, causing the acceleration data of a certain millisecond at the end of the interrupt data to suddenly increase and then immediately return to stability, affecting the calculation of the ratio and thus affecting the judgment of the tapping.
[0036] When the average value of the acceleration change value of the rear sub-segment data and the maximum value of the acceleration change value of the rear sub-segment data are abnormally greater than the average value of the acceleration change value of the front sub-segment data and the maximum value of the acceleration change value of the front sub-segment data, the correction value is used for replacement, which is equivalent to optimizing the rear segment data part in the comparison value to reduce the impact of noise.
[0037] Step S500: If the ratio is less than a set threshold, it is determined to be an invalid tapping event and the interrupt signal is ignored.
[0038] By calculating the ratio of max_front and max_back, and comparing whether the ratio is greater than a set threshold, it is determined whether it is a tap (determining whether the vibration caused by the tapping decays as expected, and the degree of attenuation is in line with expectations. The vibration generated by the headset being placed on the desktop has a slower decay in waveform amplitude, and the calculated ratio is smaller). The above-mentioned set threshold is preferably 11.
[0039] In summary, the earphone anti-false touch knock detection method in the above-mentioned embodiment of the present invention divides the acceleration data into front-end data and rear-end data, and calculates the maximum value ratio of the acceleration change values of the two segments, combined with the set threshold, to effectively distinguish between the user's active knocking and vibration interference caused by placement, collision or movement, avoid the influence of sudden noise at the end of the data on the judgment, and reduce the false touch rate; by analyzing the relationship between the mean value of the rear-end acceleration and the direction of gravity, it is intelligently identified whether the earphone is in a desktop placement state, and dynamically increases the set threshold for knock judgment to avoid erroneous operations caused by desktop vibration or collision; tap detection and multi-scenario false touch prevention can be completed only by relying on acceleration sensors, without the need for additional sensors (such as gyroscopes, pressure sensors), reducing hardware costs and power consumption.
[0040] Embodiment 2 The second embodiment of the present application provides a method for detecting false touches of an earphone, which is substantially the same in principle as the method in the first embodiment, except that: The method further comprises: Step S501, judging whether the earphone is in a natural flat placement state according to the relationship between the mean value of each acceleration data in the latter part of the data and the direction of gravity acceleration.
[0041] Further, in this embodiment, the step of judging whether the earphone is in a natural plane placement state according to the relationship between the mean value of each acceleration data in the latter data and the direction of gravity acceleration specifically includes: Calculate the component mean of the axial component of the tapping direction of each acceleration data in the latter data. If the component mean is within the preset range, it is determined that the headset is in a natural plane placement state. In the present embodiment, the above-mentioned preset range is preferably 220-350. Preferably, in the present embodiment, the above-mentioned tapping direction is preferably the data component of the x-axis output by the acceleration sensor. Due to the different shapes of the headset, the angle between the tapping direction and the gravity direction is different after the headset is naturally placed on the desktop. The y and z axis data can be used to supplement the judgment of whether it is in a natural plane placement state, that is, whether the y and z axis component mean is within the preset value range (-50~50) can be used to supplement the judgment to increase the judgment accuracy.
[0042] Preferably, in this embodiment, the method further includes: When the headset is in a natural flat placement state, determining whether the maximum value of the acceleration change value of the preceding data is greater than a placement tapping setting value; If the maximum value of the acceleration change value of the preceding data is less than the placement tap setting value, it is determined as an invalid tap event and the interrupt signal is ignored. Preferably, in the present embodiment, the placement tap setting value is preferably 2200. Specifically, in the present embodiment, the axis component of the tapping direction adopts the output data of the x-axis, but due to the different shapes of the earphones, the natural tilt angles of the earphones when placed are different, and the proportions of the components distributed to the x, y, and z axes are different. It can be understood that in other embodiments of the present application, one or more data of any x, y, and z axes can be used as a reference for determination based on the different tapping directions and tilt states.
[0043] like Figure 4 As shown in the figure, it is an x-axis acceleration waveform of the scene where the headset is placed on the desktop. After the headset is placed on the desktop, the state of the headset changes, and the gravity acceleration that originally mainly acts on the y and z axes is transferred to the x-axis used for tap detection. The average acceleration of the second half of an interruption is within the preset range. The current state of the headset is judged according to the average acceleration of the second half of an interruption (the x-axis is in the horizontal direction when normally worn, and the x-axis is in the vertical direction after being placed on the desktop). Then, a stricter standard is applied to the tapping judgment, that is, whether it is a tapping is determined by judging whether the maximum value of the acceleration change value of the previous data is greater than the placement tapping set value, so as to reduce false touches caused by impact when the headset is placed on the desktop. In the figure, the horizontal axis is the number of data groups of the acceleration change value, and the vertical axis is the size of the x-axis acceleration value output by the accelerometer.
[0044] Embodiment 3 The third embodiment of the present application provides a method for detecting false touches on an earphone, which is substantially the same in principle as the method in the first embodiment, except that: The method further comprises: Step S502, calculating the difference between the maximum and minimum values of the axis component of the striking direction of each acceleration data in the previous segment of data, and determining whether the difference is greater than the motion setting value; If the difference is smaller than the motion setting value, it is determined as an invalid tapping event and the interrupt signal is ignored.
[0045] It is easy to understand that knocking will cause a large instantaneous acceleration change, while running, wearing and removing headphones will cause limited vibration intensity, and the vibration is relatively mild, the instantaneous acceleration is small, and the degree of acceleration change is also small.
[0046] In this embodiment, the above-mentioned motion setting value is preferably 900, the main vibration direction caused by running is the z-axis direction, and the x-axis is used to calculate the knock. The difference between the maximum acceleration and the minimum acceleration of the x-axis (normal knocking direction) is calculated. If it is less than the set value of 900, it is not considered as a knock.
[0047] Embodiment 4 The fourth embodiment of the present application also provides an earphone anti-false touch knock detection system, which is used to implement the embodiments and preferred implementation modes, and will not be repeated here. As used below, the terms "module", "unit", "subunit", etc. can be a combination of software and / or hardware that implements predetermined functions. Although the systems described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0048] like Figure 5 As shown, the system includes: a knock detection module 100 , an interrupt signal module 200 , a segmentation module 300 , a calculation module 400 and an ignoring module 500 .
[0049] A knock detection module 100 is used to detect the knocking action of the earphone through the acceleration waveform obtained by the acceleration sensor; An interrupt signal module 200, for triggering an interrupt signal when the instantaneous acceleration change is greater than a first preset threshold, and collecting acceleration data along the tapping direction within a preset time period corresponding to the interrupt signal; The segmentation module 300 divides the acceleration data into front segment data and rear segment data according to time distribution, and calculates the maximum value of the acceleration change value of the front segment data and the acceleration change value of the rear segment data, respectively, wherein the acceleration change value is the absolute value of the difference between the two acceleration data corresponding to the preset calculation interval; The calculation module 400 is used to determine whether it is a valid tap event according to whether the ratio of the maximum value of the acceleration change value of the preceding data to the maximum value of the acceleration change value of the succeeding data is greater than a set threshold; The ignoring module 500 is used to determine that the knocking event is an invalid event and ignore the interrupt signal if the ratio is less than a set threshold.
[0050] Preferably, in this embodiment, the latter segment data includes the former sub-segment data and the latter sub-segment data, and the system further includes: The correction module is used to calculate the average value and the maximum value of the acceleration change value of the front sub-segment data and the rear sub-segment data, respectively, and determine whether the average value and the maximum value of the acceleration change value of the front sub-segment data and the rear sub-segment data both satisfy the following expressions: ; In the formula, is the average value of the acceleration change value of the previous sub-segment data, is the first adjustment coefficient, and the value of the first adjustment coefficient is 2. is the average value of the acceleration change value of the latter sub-segment data, is the maximum value of the acceleration change value of the previous sub-segment data, is the second adjustment coefficient, and the value of the second adjustment coefficient is 4. is the maximum value of the acceleration change value of the rear sub-segment data; If so, replace the ratio with the correction value and compare it with the set threshold: ; In the formula, is the correction value, is the maximum value of the acceleration change value of the previous data.
[0051] Preferably, in this embodiment, the system further includes: The placement judgment module is used to judge whether the headset is in a natural plane placement state based on the relationship between the mean value of each acceleration data in the subsequent data and the direction of gravity acceleration.
[0052] Preferably, in this embodiment, the placement determination module is specifically used for: The component mean of the axial component of the striking direction of each acceleration data in the latter data is calculated. If the component mean is within a preset range, it is determined that the earphone is in a natural plane placement state.
[0053] Preferably, in this embodiment, the system further includes: The anti-mistouch module is used to determine whether the maximum value of the acceleration change value of the previous data is greater than the placement tapping setting value when the headset is in a natural flat placement state; If the maximum value of the acceleration change value of the previous data is less than the placement tap setting value, it is determined to be an invalid tap event and the interrupt signal is ignored.
[0054] Preferably, in this embodiment, the system further includes: A motion module, used to calculate the difference between the maximum and minimum values of the axis component of the striking direction of each acceleration data in the preceding data, and determine whether the difference is greater than a motion setting value; If the difference is smaller than the motion setting value, it is determined as an invalid tapping event and the interrupt signal is ignored.
[0055] It should be noted that each module can be a functional module or a program module, and can be implemented by software or hardware. For modules implemented by hardware, each module can be located in the same processor; or each module can be located in different processors in any combination.
[0056] Embodiment 5 A fifth embodiment of the present application provides a computer, which may include a processor 81 and a memory 82 storing computer program commands.
[0057] Specifically, the processor 81 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0058] Among them, the memory 82 may include a large-capacity memory for data or commands. By way of example and not limitation, the memory 82 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 82 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 82 may be inside or outside the data processing device. In a specific embodiment, the memory 82 is a non-volatile memory. In a specific embodiment, the memory 82 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. Under appropriate circumstances, the RAM can be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM can be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0059] The memory 82 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program commands executed by the processor 81 .
[0060] The processor 81 reads and executes the computer program commands stored in the memory 82 to implement any one of the earphone false touch prevention and knock detection methods in the above embodiments.
[0061] In some embodiments, the computer may further include a communication interface 83 and a bus 80. Figure 6 As shown, the processor 81, the memory 82, and the communication interface 83 are connected via a bus 80 and communicate with each other.
[0062] The communication interface 83 is used to implement communication between the modules, devices, units and / or equipment in the embodiment of the present application. The communication interface 83 can also implement data communication with other components such as: external devices, image / data acquisition equipment, databases, external storage, and image / data processing workstations.
[0063] The bus 80 includes hardware, software or both, and couples the components of the computer to each other. The bus 80 includes but is not limited to at least one of the following: a data bus, an address bus, a control bus, an expansion bus, and a local bus. By way of example and not limitation, bus 80 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, bus 80 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
[0064] Embodiment 6 The sixth embodiment of the present application provides a readable storage medium having computer program commands stored thereon; when the computer program commands are executed by a processor, any one of the earphone false touch prevention and knocking detection methods in the above embodiments is implemented.
[0065] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0066] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for detecting earphones against accidental touches and knocks, characterized in that: The following steps are involved: Detecting the tapping action of the earphone through the acceleration waveform obtained by the acceleration sensor; When the instantaneous acceleration change is greater than a first preset threshold, an interrupt signal is triggered, and acceleration data along the tapping direction within a preset time period corresponding to the interrupt signal is collected; Dividing the acceleration data into front segment data and rear segment data according to time distribution, and calculating the maximum value of the acceleration change value of the front segment data and the acceleration change value of the rear segment data respectively, wherein the acceleration change value is the absolute value of the difference between the two acceleration data corresponding to the preset calculation interval; According to whether the ratio of the maximum value of the acceleration change value of the preceding data to the maximum value of the acceleration change value of the succeeding data is greater than a set threshold, judging whether it is a valid tapping event according to the comparison result; If the ratio is less than the set threshold, it is determined to be an invalid tapping event and the interrupt signal is ignored.
2. The earphone anti-mistouch knocking detection method according to claim 1, characterized in that: The latter segment data includes the former sub-segment data and the latter sub-segment data. Before the step of determining whether it is a valid tapping event according to the comparison result, the method further includes: The average value and the maximum value of the acceleration change value of the front sub-segment data and the rear sub-segment data are calculated respectively, and it is determined whether the average value and the maximum value of the acceleration change value of the front sub-segment data and the rear sub-segment data both satisfy the following expressions: ; In the formula, is the average value of the acceleration change value of the previous sub-segment data, is the first adjustment coefficient, and the value of the first adjustment coefficient is 2. is the average value of the acceleration change value of the latter sub-segment data, is the maximum value of the acceleration change value of the previous sub-segment data, is the second adjustment coefficient, and the value of the second adjustment coefficient is 4. is the maximum value of the acceleration change value of the rear sub-segment data; If so, replace the ratio with the correction value and compare it with the set threshold: ; In the formula, is the correction value, is the maximum value of the acceleration change value of the previous data.
3. The earphone anti-mistouch knocking detection method according to claim 1, characterized in that: The method further comprises: According to the relationship between the mean value of each acceleration data in the latter part of the data and the direction of gravity acceleration, it is judged whether the headset is in a natural flat placement state.
4. The earphone anti-mistouch knocking detection method according to claim 3, characterized in that: According to the relationship between the mean value of each acceleration data in the latter data and the direction of gravity acceleration, the step of determining whether the headset is in a natural plane placement state specifically includes: The component mean of the axial component of the striking direction of each acceleration data in the latter data is calculated. If the component mean is within a preset range, it is determined that the earphone is in a natural plane placement state.
5. The earphone anti-mistouch knocking detection method according to claim 4, characterized in that: The method further comprises: When the headset is in a natural flat placement state, determining whether the maximum value of the acceleration change value of the preceding data is greater than a placement tapping setting value; If the maximum value of the acceleration change value of the previous data is less than the placement tap setting value, it is determined to be an invalid tap event and the interrupt signal is ignored.
6. The earphone anti-mistouch knocking detection method according to claim 4, characterized in that: The method further comprises: Calculate the difference between the maximum and minimum values of the axis component of the striking direction of each acceleration data in the preceding data, and determine whether the difference is greater than the motion setting value; If the difference is smaller than the motion setting value, it is determined as an invalid tapping event and the interrupt signal is ignored.
7. The earphone anti-mistouch knocking detection method according to claim 1, characterized in that: The preset time period is 48 milliseconds, the calculation interval of the acceleration change value of the front-end data is 2 milliseconds, and the calculation interval of the acceleration change value of the back-end data is 1 millisecond.
8. An earphone anti-mistouch knocking detection system, characterized in that: include: A knock detection module, used to detect the knocking action of the earphone through the acceleration waveform obtained by the acceleration sensor; An interrupt signal module, used to trigger an interrupt signal when the instantaneous acceleration change is greater than a first preset threshold value, and collect acceleration data along the tapping direction within a preset time period corresponding to the interrupt signal; A segmentation module, which divides the acceleration data into front segment data and rear segment data according to time distribution, and calculates the maximum value of the acceleration change value of the front segment data and the rear segment data respectively, wherein the acceleration change value is the absolute value of the difference between the two acceleration data corresponding to the preset calculation interval; A calculation module, used to determine whether it is a valid tap event according to the comparison result based on whether the ratio of the maximum value of the acceleration change value of the preceding data to the maximum value of the acceleration change value of the succeeding data is greater than a set threshold; The ignoring module is used to determine that the knocking event is an invalid event and ignore the interrupt signal if the ratio is less than a set threshold.
9. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the earphone anti-mistouch knocking detection method as described in any one of claims 1-7 is implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the earphone anti-mistouch knocking detection method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Dynamic earphone system and application method thereof
CN104125523A
Method and system for preventing earphone touch false triggering, earphone and storage medium
CN110312184A
In-ear detection method and device for wireless earphone and wireless earphone
CN110505550A
Knocking event detection method and device, medium and head-mounted equipment
CN110987154A
Wireless earphone control method and device, wireless earphone and storage medium
CN113709617A