An anti-mis-touch tapping detection method, system, computer and storage medium for earphones
The accelerator's tapping action is detected by the acceleration sensor, and the method of dividing the acceleration data segment and calculating the ratio, the problem of increasing costs of multiple sensors in the prior art is solved, achieving high-accurate tapping recognition and lightweight equipment requirements.
Patent Information
- Application Number
- CN202510274269.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-03-10
AI Technical Summary
Although the tap control recognition based on multiple sensors in the prior art improves the recognition accuracy, it increases the cost of equipment, which is not conducive to the lightweight demand of the equipment.
Acceleration waveform diagram is obtained through the acceleration sensor to detect the tapping action of the headset. The acceleration data is divided into the previous section data and the next section data, the maximum ratio of the acceleration change value of the two sections is calculated, and the threshold is combined to determine whether it is an effective knock event.
Effectively distinguish between user active knocking and vibration interference caused by placement, collision or movement, reduce false touch rate, and reduce hardware cost and power consumption.
Smart Images

Figure CN119789037B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of earphones, and particularly relates to a method, a system, a computer, and a storage medium for preventing accidental touch and detecting knocking of earphones. Background Art
[0002] In the interaction mode of earphones, the tapping operation has become a common function due to its convenience. In the traditional solution, 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, during the user's movement, such as walking or running, the earphones will also generate acceleration changes, and these changes are likely to trigger misjudgment, resulting in the earphones frequently executing incorrect instructions. Moreover, when the earphones are slightly collided 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 the tapping operation interaction, a common solution is to combine the signals of multiple sensors and adjust the decision weights to improve the accuracy of detecting the tapping device, but this method also increases the device cost and is not conducive to the lightweight requirement of the device. Summary of the Invention
[0004] Aiming at the deficiencies of the prior art, the purpose of the present invention is to provide a method, a system, a computer, and a storage medium for preventing accidental touch and detecting knocking of earphones, aiming to solve the technical problem that the tapping operation recognition based on multiple sensors in the prior art increases the device cost and is not conducive to the lightweight requirement of the device.
[0005] To achieve the above purpose, in the first aspect, the present invention provides: A method for preventing accidental touch and detecting knocking of earphones, comprising the following steps:
[0006] Detect the tapping action of the earphones through the acceleration waveform diagram obtained by the acceleration sensor;
[0007] When the instantaneous acceleration change is greater than the first preset threshold, trigger an interrupt signal, and collect the acceleration data along the tapping direction within a preset time period corresponding to the interrupt signal;
[0008] Divide the acceleration data into front-segment data and rear-segment data according to the time distribution, and calculate the maximum values of the acceleration change values of the front-segment data and the rear-segment data respectively, where the acceleration change value is the absolute value of the difference between two acceleration data corresponding to a preset calculation interval;
[0009] According to whether the ratio of the maximum value of the acceleration change value of the front-segment data to the maximum value of the acceleration change value of the rear-segment data is greater than the set threshold, determine whether it is a valid tapping event according to the comparison result;
[0010] If the ratio is less than the set threshold value, it is determined as an invalid tapping event, and the interruption signal is ignored.
[0011] According to one aspect of the above technical solution, the latter segment data includes front sub-segment data and rear sub-segment data. Before the step of determining whether it is a valid tapping event according to the comparison result, the method further includes:
[0012] Calculate the average value of the acceleration change values and the maximum value of the acceleration change values of the front sub-segment data and the rear sub-segment data respectively, and determine whether the average value of the acceleration change values and the maximum value of the acceleration change values of the front sub-segment data and the rear sub-segment data both satisfy the following expression:
[0013] ;
[0014] In the formula, is the average value of the acceleration change values of the front 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 values of the rear sub-segment data, is the maximum value of the acceleration change values of the front 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 values of the rear sub-segment data;
[0015] If so, compare the ratio with the set threshold value after replacing it with the correction value:
[0016] ;
[0017] In the formula, is the correction value, is the maximum value of the acceleration change values of the front segment data.
[0018] According to one aspect of the above technical solution, the method further includes:
[0019] Judge whether the earphone is in the natural plane placement state according to the relationship between the mean value of each acceleration data in the latter segment data and the direction of the gravitational acceleration.
[0020] According to one aspect of the above technical solution, the step of judging whether the earphone is in the natural plane placement state according to the relationship between the mean value of each acceleration data in the latter segment data and the direction of the gravitational acceleration specifically includes:
[0021] Calculate the component mean value of the axial component of the tapping direction of each acceleration data in the latter segment data. If the component mean value is within the preset range, it is judged that the earphone is in the natural plane placement state.
[0022] According to one aspect of the above technical solution, the method further includes:
[0023] When the earphone is in the natural flat placement state, determine whether the maximum value of the acceleration change value of the front-segment data is greater than the placement tap setting value;
[0024] If the maximum value of the acceleration change value of the front-segment data is less than the placement tap setting value, determine it as an invalid tap event and ignore the interrupt signal.
[0025] According to one aspect of the above technical solution, the method further includes:
[0026] Calculate the difference between the maximum value and the minimum value of the axis component of the tap direction of each acceleration data in the front-segment data, and determine whether the difference is greater than the motion setting value;
[0027] If the difference is less than the motion setting value, determine it as an invalid tap event and ignore the interrupt signal.
[0028] 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-segment data is 2 milliseconds, and the calculation interval of the acceleration change value of the rear-segment data is 1 millisecond.
[0029] In a second aspect, the present invention provides an earphone anti-mis-touch tap detection system, including:
[0030] A tap detection module, configured to detect the tap action of the earphone through the acceleration waveform diagram obtained by the acceleration sensor;
[0031] An interrupt signal module, configured to trigger an interrupt signal when the instantaneous acceleration change is greater than a first preset threshold, and collect the acceleration data along the tap direction within a preset time period corresponding to the interrupt signal;
[0032] A segmentation module, which divides the acceleration data into front-segment data and rear-segment data according to the time distribution, and respectively calculates the maximum value of the acceleration change value of the front-segment data and the rear-segment data, where the acceleration change value is the absolute value of the difference between two acceleration data corresponding to a preset calculation interval;
[0033] A calculation module, configured 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 front-segment data to the maximum value of the acceleration change value of the rear-segment data is greater than a set threshold;
[0034] An ignore module, configured to determine it as an invalid tap event and ignore the interrupt signal if the ratio is less than the set threshold.
[0035] According to one aspect of the above technical solution, the latter segment data includes front sub-segment data and rear sub-segment data, and the system further includes:
[0036] A correction module, configured to calculate the average value and the maximum value of the acceleration change values 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 values of the front sub-segment data and the rear sub-segment data both satisfy the following expression:
[0037] ;
[0038] wherein, is the average value of the acceleration change value of the front 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 rear sub-segment data, is the maximum value of the acceleration change value of the front 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;
[0039] If so, replace the ratio with the correction value and compare it with the set threshold:
[0040] ;
[0041] wherein, is the correction value, is the maximum value of the acceleration change value of the front segment data.
[0042] According to one aspect of the above technical solution, the system further includes:
[0043] A placement judgment module, configured to judge whether the earphone is in a natural flat placement state according to the relationship between the average value of each acceleration data in the latter segment data and the direction of the gravitational acceleration.
[0044] According to one aspect of the above technical solution, the placement judgment module is specifically configured to:
[0045] Calculate the component average value of the axis component of the knocking direction of each acceleration data in the latter segment data, and if the component average value is within a preset range, judge that the earphone is in a natural flat placement state.
[0046] According to one aspect of the above technical solution, the system further includes:
[0047] An anti-misoperation module, configured to judge whether the maximum value of the acceleration change value of the front segment data is greater than the placement knocking set value when the earphone is in a natural flat placement state;
[0048] If the maximum value of the acceleration change value of the front-segment data is less than the placed knock setting value, it is determined as an invalid knock event, and the interruption signal is ignored.
[0049] According to one aspect of the above technical solution, the system further includes:
[0050] A motion module, configured to calculate the difference between the maximum value and the minimum value of the axial component of the knock direction of each acceleration data in the front-segment data, and determine whether the difference is greater than the motion setting value;
[0051] If the difference is less than the motion setting value, it is determined as an invalid knock event, and the interruption signal is ignored.
[0052] In a third aspect, the present invention further provides a computer, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the earphone anti-mis-touch knock detection method described in the above technical solution is implemented.
[0053] In a fourth aspect, the present invention further provides a storage medium, on which a computer program is stored. When the program is executed by a processor, the earphone anti-mis-touch knock detection method described in the above technical solution is implemented.
[0054] Compared with the prior art, the beneficial effects of the present invention are as follows: By dividing the acceleration data into front-segment data and rear-segment data, calculating the maximum value ratio of the acceleration change values of the two segments, and combining the set threshold, it can effectively distinguish between the user's active knock and the vibration interference caused by placement, collision, or movement, avoid the influence of sudden noise at the end of the data on the determination, and reduce the mis-touch rate; By analyzing the relationship between the average value of the rear-segment acceleration and the gravity direction, it can intelligently identify whether the earphone is in the desktop placement state, and dynamically increase the set threshold for knock determination, avoiding misoperations caused by desktop vibration or collision; It can complete knock detection and multi-scene anti-mis-touch only relying on the acceleration sensor, without additional sensors (such as gyroscopes, pressure sensors), reducing the hardware cost and power consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a schematic flowchart of the earphone anti-mis-touch knock detection method in the first embodiment of the present invention;
[0056] Figure 2 It is a waveform diagram of the x-axis acceleration of a normal knock of the earphone in the first embodiment of the present invention;
[0057] Figure 3 It is a waveform diagram of the x-axis acceleration of the high-frequency vibration generated when the earphone is placed on the desktop in the first embodiment of the present invention;
[0058] Figure 4 The x-axis acceleration waveform diagram after the interruption signal is generated when the earphone is placed on the desktop in the first embodiment of the present invention
[0059] Figure 5 The structural block diagram of the earphone anti-misoperation tapping detection system in the fourth embodiment of the present invention
[0060] Figure 6 The schematic diagram of the hardware structure of the computer in the fifth embodiment of the present invention
[0061] The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings Specific Embodiments
[0062] To facilitate the understanding of the present invention, the present invention will be described more comprehensively below with reference to the relevant drawings. Several embodiments of the present invention are shown 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, these embodiments are provided to make the disclosure of the present invention more thorough and comprehensive
[0063] It should be noted that when an element is referred to as being "fixed to" another element, it can be directly on the other element or there may also be an intermediate element. When an element is considered to be "connected" to another element, it can be directly connected to the other element or there may be an intermediate element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only
[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs. The terms used in the description of the present invention herein 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
[0065] Embodiment 1
[0066] Please refer to Figure 1 , which shows the flowchart of the earphone anti-misoperation tapping detection method in the first embodiment of the present invention. As shown in the figure, the method includes the following steps
[0067] Step S100, detecting the tapping action of the earphone through the acceleration waveform diagram obtained by the acceleration sensor
[0068] For the sake of easy understanding, the characteristics of the tapping vibration are as follows: The acceleration waveform diagram of the tapping vibration usually shows a sudden peak, representing the instantaneous acceleration change generated by the tapping. Subsequently, it oscillates and decays, reflecting that the vibration gradually weakens and tends to be stable. Using the acceleration difference can more sensitively capture the instantaneous change of acceleration during tapping, reduce noise interference, and at the same time more clearly reflect the attenuation process of the vibration, thereby improving the detection accuracy and robustness of tapping events.
[0069] Step S200: When the instantaneous acceleration change is greater than the first preset threshold, trigger an interrupt signal, and collect the acceleration data along the tapping direction within a preset time period corresponding to the interrupt signal.
[0070] Step S300: Divide the acceleration data into front-segment data and back-segment data according to the time distribution, and calculate the maximum values of the acceleration change values of the front-segment data and the back-segment data respectively. Here, the acceleration change value is the absolute value of the difference between two acceleration data corresponding to a preset calculation interval.
[0071] Specifically, in this embodiment, the preset time period is 48 milliseconds, the calculation interval of the acceleration change value of the front-segment data is 2 milliseconds, and the calculation interval of the acceleration change value of the back-segment data is 1 millisecond.
[0072] Specifically, the waveform generated by tapping the earphone takes about 2 ms to 3 ms or even longer from the lowest point to the highest point, while the waveform generated by accidental situations often only takes 1 ms (mostly when the earphone is placed on the table). Using the acceleration change value per millisecond cannot well reflect the acceleration change generated by tapping. Adjust the time interval for calculating the acceleration change value and use an interval of 2 ms to calculate the acceleration change value at each time point. For the sake of easy understanding, the waveform diagrams of the x-axis acceleration of the normal tapping of the earphone and the x-axis acceleration of the high-frequency vibration generated when the earphone is placed on the table are respectively as Figure 2 、 Figure 3 shown. In the figure, the horizontal axis is the number of data groups of the acceleration change value, and the vertical axis is the magnitude of the x-axis acceleration output by the accelerometer.
[0073] Using the acceleration change value with a 2-ms interval can better reflect the acceleration change brought by the tapping vibration and can also better distinguish the difference in the acceleration change between tapping and the vibration generated when placed on the table (this is also equivalent to a kind of filtering). Therefore, the calculation of the maximum value of the acceleration change value of the front-segment data is changed to the maximum value of the acceleration change value every 2 milliseconds in the first half of the time during one interrupt.
[0074] In some application scenarios of this embodiment, when the acceleration sensor detects a knock with a certain force, an interruption is generated, and the x-axis acceleration data for 48 ms is recorded (the direction in which the user knocks on the earphone is the x-axis). Calculate the acceleration change value per millisecond during one interruption. Statistically, for each interruption, find the maximum acceleration change value per millisecond for each of the first and second parts (the maximum acceleration change value per 2 milliseconds within the first half from 1 ms to 24 ms, max_front, which is the maximum value of the acceleration change values of the front-section data, and the maximum acceleration change value per millisecond within the second half from 25 ms to 48 ms, max_back), that is, the maximum value of the acceleration change values of the rear-section data.
[0075] Step S400: Determine whether it is a valid knock event based on the comparison result by checking whether the ratio of the maximum acceleration change value of the front-section data to the maximum acceleration change value of the rear-section data is greater than a set threshold.
[0076] Preferably, in this embodiment, the above-mentioned rear-section data includes front sub-section data and rear sub-section data. Before the step of determining whether it is a valid knock event based on the comparison result, the method further includes:
[0077] Step S401: Calculate the average value of the acceleration change values and the maximum value of the acceleration change values of the front sub-section data and the rear sub-section data respectively, and determine whether the average value of the acceleration change values and the maximum value of the acceleration change values of the front sub-section data and the rear sub-section data both satisfy the following expressions:
[0078] ;
[0079] In the formula, is the average value of the acceleration change values of the front sub-section data, is the first adjustment coefficient, and the value of the first adjustment coefficient is 2, is the average value of the acceleration change values of the rear sub-section data, is the maximum value of the acceleration change values of the front sub-section data, is the second adjustment coefficient, and the value of the second adjustment coefficient is 4, is the maximum value of the acceleration change values of the rear sub-section data;
[0080] If so, replace the ratio with a correction value and compare it with the set threshold:
[0081] ;
[0082] In the formula, is the correction value, is the maximum value of the acceleration change values of the front-section data.
[0083] For ease of understanding, the acceleration waveform generated by a normal tap should gradually oscillate and decay within 30 ms and tend to be stable after 30 ms. However, it is found in the actual data that the data exported by the sensor hardware will have noise, resulting in a situation where the acceleration data in a certain millisecond at the end of the interrupted data suddenly becomes larger and then immediately returns to stability, affecting the calculation of the ratio and further affecting the determination of the tap.
[0084] When the average value of the acceleration change values of the subsequent sub-segment data and the maximum value of the acceleration change values of the subsequent sub-segment data are abnormally greater than the average value of the acceleration change values of the previous sub-segment data and the maximum value of the acceleration change values of the previous sub-segment data, use the correction value for replacement, which is equivalent to optimizing the subsequent segment data part in the ratio to reduce the influence of noise.
[0085] Step S500, if the ratio is less than the set threshold, it is determined as an invalid tap event and the interrupted signal is ignored.
[0086] By calculating the ratio of max_front and max_back, and by comparing whether the ratio is greater than the set threshold to determine whether it is a tap (judging whether the vibration caused by the tap decays as expected and the decay degree meets the expectation. For the vibration generated when the earphone is placed on the desktop, the waveform amplitude decays slowly and the calculated ratio is small). The above set threshold is preferably 11.
[0087] In summary, for the earphone anti-mis-touch tap detection method in the above embodiments of the present invention, by dividing the acceleration data into the previous segment data and the subsequent segment data, calculating the ratio of the maximum values of the acceleration change values of the two segments, and combining the set threshold, it can effectively distinguish the user's active tap from the vibration interference caused by placement, collision or movement, avoid the influence of sudden noise at the end of the data on the determination, and reduce the mis-touch rate; by analyzing the relationship between the average value of the subsequent segment acceleration and the direction of the gravity, it can intelligently identify whether the earphone is in the desktop placement state and dynamically increase the set threshold for tap determination to avoid misoperations caused by desktop vibration or collision; it can complete tap detection and multi-scene anti-mis-touch only relying on the acceleration sensor without additional sensors (such as gyroscopes, pressure sensors), reducing the hardware cost and power consumption.
[0088] Embodiment 2
[0089] The second embodiment of the present application provides an earphone anti-mis-touch tap detection method. The principle of this method is roughly the same as that of the method in the first embodiment, and the difference is that:
[0090] The method further includes:
[0091] Step S501, according to the relationship between the average value of each acceleration data in the subsequent segment data and the direction of the gravitational acceleration, judge whether the earphone is in the natural plane placement state.
[0092] Further, in this embodiment, the step of determining whether the earphone is in a natural planar placement state according to the relationship between the mean value of each acceleration data in the latter segment data and the direction of the gravitational acceleration specifically includes:
[0093] Calculate the component mean value of the axis component of the knocking direction of each acceleration data in the latter segment data. If the component mean value is within a preset range, it is determined that the earphone is in a natural planar placement state. In this embodiment, the above preset range is preferably 220 - 350. Preferably, in this embodiment, the above knocking direction is preferably the data component of the x-axis output by the acceleration sensor. Due to the different shapes of the earphones, the included angle between the knocking direction and the gravitational direction is different after the earphones are naturally placed on the desktop. The y and z axis data can be used to supplement the judgment of whether they are in the natural placement plane state, that is, whether the mean values of the y and z axis components are within the preset value range (-50~50) can be used to supplement the judgment to increase the judgment accuracy.
[0094] Preferably, in this embodiment, the method further includes:
[0095] When the earphone is in a natural planar placement state, determine whether the maximum value of the acceleration change value of the former segment data is greater than the placement knocking set value;
[0096] If the maximum value of the acceleration change value of the former segment data is less than the placement knocking set value, it is determined as an invalid knocking event, and the interruption signal is ignored. Preferably, in this embodiment, the above placement knocking set value is preferably 2200. Specifically, in this embodiment, the axis component of the above knocking direction uses the output data of the x-axis. However, due to the different shapes of the earphones, the natural inclination angles when the earphones are placed are different, and the proportions of the components distributed to the x, y, and z axes are different. Understandably, in other embodiments of the present application, based on the different knocking directions and inclination states, one or more of any x, y, and z axes can also be used as the determination reference.
[0097] As Figure 4 shown, it is the x-axis acceleration waveform diagram of the earphone placement desktop scenario. After being placed on the desktop, due to the change in the earphone state, the gravitational acceleration that originally mainly acted on the y and z axes is transferred to the x-axis for knocking detection. The acceleration mean value in the second half of a single interruption is within the preset range. According to the acceleration mean value in the second half of a single interruption to judge the current state of the earphone (when normally worn, the x-axis is in the horizontal direction, and when placed on the desktop, the x-axis is in the vertical direction), a more stringent standard is implemented for knocking determination, that is, it is determined whether it is a knock by judging whether the maximum value of the acceleration change value of the former segment data is greater than the placement knocking set value, so as to reduce the false touch caused by the impact when the earphone 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 magnitude of the x-axis acceleration value output by the accelerometer.
[0098] Embodiment III
[0099] The third embodiment of the present application provides a method for detecting accidental touch and knock of an earphone. The principle of this method is substantially the same as that of the method in the first embodiment, and the difference lies in that:
[0100] The method further includes:
[0101] Step S502: Calculate the difference between the maximum value and the minimum value of the axis component of the knock direction of each acceleration data in the front-segment data, and determine whether the difference is greater than the motion set value;
[0102] If the difference is less than the motion set value, it is determined as an invalid knock event, and the interruption signal is ignored.
[0103] For easy understanding, a knock will bring a great instantaneous acceleration change, while the vibration intensity caused by running, wearing and removing the earphone is limited, and the vibration is relatively gentle, the instantaneous acceleration is small, and the acceleration change degree is also small.
[0104] In this embodiment, the above-mentioned motion set value is preferably 900. The main vibration direction caused by running is the z-axis direction, while the x-axis is used to calculate the knock. Calculate the difference between the maximum acceleration and the minimum acceleration on the x-axis (normal knock direction). If it is less than the set value of 900, it is not considered a knock.
[0105] Embodiment IV
[0106] The fourth embodiment of the present application further provides an earphone accidental touch and knock detection system, which is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, terms such as "module", "unit", "sub-unit", etc. may be a combination of software and / or hardware that can achieve a predetermined function. Although the systems described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0107] As Figure 5 shown, the system includes: a knock detection module 100, an interruption signal module 200, a segmentation module 300, a calculation module 400, and an ignoring module 500.
[0108] The knock detection module 100 is used to detect the knock action of the earphone through the acceleration waveform diagram obtained by the acceleration sensor;
[0109] The interruption signal module 200 is used to trigger an interruption signal when the instantaneous acceleration change is greater than the first preset threshold, and collect the acceleration data along the knock direction within a preset time period corresponding to the interruption signal;
[0110] The segmentation module 300 divides the acceleration data into front - segment data and back - segment data according to time distribution, and calculates the maximum values of the acceleration change values of the front - segment data and the back - segment data respectively. Wherein, the acceleration change value is the absolute value of the difference between two acceleration data corresponding to a preset calculation interval;
[0111] The calculation module 400 is used to judge whether it is a valid tapping event according to whether the ratio of the maximum value of the acceleration change value of the front - segment data to the maximum value of the acceleration change value of the back - segment data is greater than a set threshold;
[0112] The ignoring module 500 is used to determine it as an invalid tapping event and ignore the interruption signal if the ratio is less than the set threshold.
[0113] Preferably, in this embodiment, the back - segment data includes front - sub - segment data and back - sub - segment data, and the system further includes:
[0114] 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 back - sub - segment data respectively, and judge whether the average value and the maximum value of the acceleration change value of the front - sub - segment data and the back - sub - segment data both satisfy the following expression:
[0115] ;
[0116] In the formula, is the average value of the acceleration change value of the front - 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 back - sub - segment data, is the maximum value of the acceleration change value of the front - 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 back - sub - segment data;
[0117] If so, replace the ratio with the corrected value and compare it with the set threshold:
[0118] ;
[0119] In the formula, is the corrected value, is the maximum value of the acceleration change value of the front - segment data.
[0120] Preferably, in this embodiment, the system further includes:
[0121] A placement judgment module, configured to judge 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-stage data and the direction of the gravitational acceleration.
[0122] Preferably, in this embodiment, the placement judgment module is specifically configured to:
[0123] Calculate the component mean value of the axis component of the knocking direction of each acceleration data in the latter-stage data. If the component mean value is within a preset range, it is judged that the earphone is in a natural plane placement state.
[0124] Preferably, in this embodiment, the system further includes:
[0125] An anti-misoperation module, configured to judge whether the maximum value of the acceleration change value of the front-stage data is greater than the placement knocking set value when the earphone is in a natural plane placement state;
[0126] If the maximum value of the acceleration change value of the front-stage data is less than the placement knocking set value, it is determined as an invalid knocking event, and the interruption signal is ignored.
[0127] Preferably, in this embodiment, the system further includes:
[0128] A motion module, configured to calculate the difference between the maximum value and the minimum value of the axis component of the knocking direction of each acceleration data in the front-stage data, and judge whether the difference is greater than the motion set value;
[0129] If the difference is less than the motion set value, it is determined as an invalid knocking event, and the interruption signal is ignored.
[0130] It should be noted that each of the above modules can be a functional module or a program module, and can be implemented either by software or by hardware. For the modules implemented by hardware, each of the modules can be located in the same processor; or each of the modules can also be located in different processors in any combined form.
[0131] Embodiment Five
[0132] The fifth embodiment of the present application provides a computer, which may include a processor 81 and a memory 82 storing computer program instructions.
[0133] Specifically, the above-mentioned processor 81 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC for short), or one or more integrated circuits configured to implement the embodiments of the present application.
[0134] Among them, the memory 82 may include a mass storage 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 disc, a magneto-optical disc, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In appropriate cases, the memory 82 may include removable or non-removable (or fixed) media. In appropriate cases, the memory 82 may be internal or external to the data processing device. In a particular embodiment, the memory 82 is non-volatile memory. In a particular embodiment, the memory 82 includes a read-only memory (ROM) and a random access memory (RAM). In appropriate cases, 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. In appropriate cases, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), where the DRAM may be a fast page mode dynamic random access memory (FPMDRAM), an extended date out dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0135] The memory 82 can 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.
[0136] The processor 81 reads and executes the computer program commands stored in the memory 82 to implement any one of the headphone anti-mis-touch tapping detection methods in the above embodiments.
[0137] In some of the embodiments, the computer may further include a communication interface 83 and a bus 80. Among them, as Figure 6 shown, the processor 81, the memory 82, and the communication interface 83 are connected through the bus 80 and complete communication with each other.
[0138] The communication interface 83 is used to implement communication between the modules, devices, units, and / or devices in the embodiments of the present application. The communication interface 83 can also implement data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.
[0139] Bus 80 includes hardware, software, or both, and couples the components of a computer to each other. Bus 80 includes, but is not limited to, at least one of the following: Data Bus, Address Bus, Control Bus, Expansion Bus, 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 bus or a combination of two or more of these. Where appropriate, Bus 80 may include one or more buses. Although the embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.
[0140] Embodiment Six
[0141] The sixth embodiment of the present application provides a readable storage medium. A computer program command is stored on the readable storage medium; when the computer program command is executed by a processor, any one of the headphone anti-mis-touch tapping detection methods in the above embodiments is implemented.
[0142] The technical features of the above-described embodiments can be combined arbitrarily. For the sake of brevity of description, 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, it should be considered as the scope described in this specification.
[0143] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended 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; Divide the acceleration data into front segment data and rear segment data according to time distribution, and calculate 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, and the calculation interval of the acceleration change value of the front segment data is 2 milliseconds; 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, and the calculation interval of the acceleration change value of the latter 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 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, and the calculation interval of the acceleration change value of the front segment data is 2 milliseconds; 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
Method and system for preventing earphone touch false triggering, earphone and storage medium
CN110312184A
Wireless earphone control method, wireless earphone, electronic equipment and storage medium
CN118214975A