Capacitive touch sensor detection method, apparatus, electronic device, and storage medium
By combining multiple sampling frequencies and filtering algorithms, the problem of insufficient anti-interference capability of capacitive touch sensors in EMC testing is solved, the system's response performance and anti-interference capability are improved, and false triggering and trailing phenomena are reduced.
Patent Information
- Application Number
- CN202511523523.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2045-10-23
AI Technical Summary
Existing capacitive touch sensors lack sufficient anti-interference capability in stringent EMC tests, leading to false triggering or decreased response performance of the system.
Multiple sampling frequencies are used to sample the capacitive touch sensor. Combined with the time-division Sigma Delta ADC, the sampled data is processed through various filtering algorithms (such as mean filtering, median filtering, and maximum filtering) to improve anti-interference capability.
It effectively reduces the probability of false triggering of the system, improves response performance, reduces trailing phenomenon, and enhances the anti-interference ability of capacitive touch sensors.
Smart Images

Figure CN121411636B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of sensors, and more specifically, to a capacitive touch sensor detection method, apparatus, electronic device, and storage medium. Background Technology
[0002] In the design of capacitive touch sensors, existing technologies typically employ a relatively fixed combination scheme to pass EMC (Electromagnetic Compatibility) tests. The core of this scheme is to use a preset operating frequency for capacitive scanning, supplemented by digital filtering algorithms to process the sampled data and suppress environmental noise.
[0003] However, the aforementioned existing technical solutions suffer from insufficient anti-interference capabilities when facing stringent EMC tests such as Dynamic CS 10V (an electromagnetic compatibility testing standard in capacitive touch control technology). In such cases, simple general-purpose filters are insufficient to effectively filter out wideband interference, leading to false triggering or degraded system response performance. Summary of the Invention
[0004] This application provides a capacitive touch sensor detection method, apparatus, electronic device, and storage medium to improve anti-interference capability.
[0005] In a first aspect, this application provides a capacitive touch sensor detection method, comprising: acquiring sampling data; the sampling data being N capacitance values obtained by sequentially sampling a capacitive touch sensor using N sampling frequencies; wherein each sampling frequency corresponds to a capacitance value in the sampling data; for each sampling frequency, filtering is performed based on the capacitance value corresponding to that sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain a filtered capacitance value; based on the N filtered capacitance values, an output capacitance value is determined; and the output capacitance value is compared with a first standard capacitance value to obtain a detection result characterizing whether the capacitive touch sensor has been touched.
[0006] Secondly, this application provides a capacitive touch sensor detection device, comprising: an acquisition module and a processing module. The acquisition module is used to acquire sampling data; the sampling data consists of N capacitance values obtained by sequentially sampling a capacitive touch sensor using N sampling frequencies; wherein each sampling frequency corresponds to a capacitance value in the sampling data; the processing module is used to filter, for each sampling frequency, based on the capacitance value corresponding to that sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to that sampling frequency, to obtain a filtered capacitance value; based on the N filtered capacitance values, to determine an output capacitance value; and to compare the output capacitance value with a first standard capacitance value to obtain a detection result characterizing whether the capacitive touch sensor has been touched.
[0007] Thirdly, this application provides an electronic device, including: a memory and a processor, the memory and the processor being connected; the memory being used to store a program; the processor being used to invoke the program stored in the memory to execute the method described in the first aspect and / or in combination with any embodiment of the first aspect.
[0008] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a computer, performs the methods described in the first aspect and / or in combination with any embodiment of the first aspect.
[0009] Since the sampling data of this scheme is obtained by sampling the capacitive touch sensor through N sampling frequencies, even if one sampling frequency coincides with the external interference frequency, causing the sampling result to be distorted, the capacitance value obtained by the other sampling frequencies will not be greatly affected. This can improve the anti-interference capability and reduce the probability of system false triggering. Attached Figure Description
[0010] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a schematic flowchart illustrating the first capacitive touch sensor detection method according to an embodiment of this application; Figure 2 This is a schematic diagram of sampling data corresponding to different sampling frequencies, as shown in an embodiment of this application. Figure 3 This is a schematic diagram illustrating an example of interference in an embodiment of this application; Figure 4 This is a schematic diagram illustrating an embodiment of the present application that eliminates the trailing phenomenon; Figure 5 This is a schematic diagram of a signal suppression matrix shown in an embodiment of this application; Figure 6 This is a schematic flowchart illustrating a second capacitive touch sensor detection method according to an embodiment of this application; Figure 7 This is a structural block diagram of a capacitive touch sensor detection device shown in an embodiment of this application; Figure 8 This is a structural block diagram of an electronic device shown in an embodiment of this application. Detailed Implementation
[0012] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0013] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, relational terms such as "first," "second," etc., in the description of this application are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus.
[0014] The technical solution of this application will now be described in detail with reference to the accompanying drawings.
[0015] Please see Figure 1 , Figure 1 This is a flowchart illustrating a capacitive touch sensor detection method according to an embodiment of this application. The following will be combined with... Figure 1 The steps involved are explained.
[0016] S100: Acquire sampling data.
[0017] The sampling data consists of N capacitance values obtained by sequentially sampling the capacitive touch sensor using N sampling frequencies; where each sampling frequency corresponds to one capacitance value in the sampling data.
[0018] Optional, N is a positive integer greater than or equal to 2.
[0019] When sampling a capacitive touch sensor sequentially using N sampling frequencies, each detection cycle can be divided into N windows, and each window can be sampled using a different sampling frequency.
[0020] The detection cycle is determined by the detection frequency, which is the frequency at which the capacitive touch sensor detection method is executed. The capacitive touch sensor detection method is executed once in each detection cycle.
[0021] The capacitive touch sensor samples the data using a Sigma-Delta ADC (Sigma-Delta Analog-to-Digital Converter), which operates at different sampling frequencies in a time-division manner.
[0022] For each sampling frequency, after sampling through a sigma-delta ADC to obtain a set of initial sampled data (multiple capacitance values), this initial sampled data is filtered and downsampled to obtain a downsampled capacitance value. The capacitance value obtained after downsampling for each sampling frequency is the N capacitance values included in the sampled data. The specific downsampling method can be set according to actual needs, such as sampling 8 and discarding 7, sampling 9 and discarding 8, etc., as long as only one capacitance value is retained in the end.
[0023] Optionally, when dividing the detection period into N windows, each window can be of the same length. Alternatively, the lengths of different windows can also be different.
[0024] For ease of understanding, taking N=3 and a detection frequency of 100Hz (i.e., a detection period of 10ms) as an example, the three sampling frequencies can be 727kHz, 960kHz, and 1263kHz, respectively. When sampling the capacitive touch sensor using these three sampling frequencies, each detection period can be divided into three windows: window A, window B, and window C. In window A, the capacitive touch sensor is sampled using a sampling frequency of 727kHz; in window B, it is sampled using a sampling frequency of 960kHz; and in window C, it is sampled using a sampling frequency of 1263kHz.
[0025] After sampling in window A, an initial set of sampled data is obtained. This initial set of sampled data is downsampled to obtain the capacitance value A corresponding to 727kHz. Similarly, the initial sampled data obtained in window B is downsampled to obtain the capacitance value B corresponding to 960kHz. The initial sampled data obtained in window C is downsampled to obtain the capacitance value C corresponding to 1263kHz. Therefore, the sampled data includes three capacitance values: A, B, and C.
[0026] The capacitive touch sensor is sampled using a Sigma-Aldrich ADC, which operates in a time-division multiplexing manner across the three sampling frequencies. This example is for illustrative purposes only; the specific number and values of sampling frequencies can be selected based on actual needs and are not limited to the method illustrated here.
[0027] The degree of interference in the sampled data varies depending on the sampling frequency. For ease of understanding, let's take... Figure 2 The following explanation uses 600 kHz, 750 kHz, and 1100 kHz as examples. Figure 2 It can be seen that the degree of interference to the sampled data corresponding to different frequencies is different. Therefore, multiple sampling frequencies are selected for sampling. In this way, even if one sampling frequency coincides with the external interference frequency, causing the sampling result to be distorted, the capacitance values obtained by sampling at other sampling frequencies will not be greatly affected. Figure 2 The horizontal axis represents the index of the sampled data, and the vertical axis represents the capacitance value (in pf).
[0028] The sampling data can be obtained in real time by sampling the capacitive touch sensor using a sampling frequency, or it can be obtained from a third-party device. The third-party device obtains the sampling data by sampling the capacitive touch sensor using a sampling frequency and then sends it to the device executing the method.
[0029] Optionally, if there are M capacitive touch sensors, the acquired sampling data can include M sets of sampling data. Each set of sampling data corresponds to a different capacitive touch sensor. For each set of sampling data, subsequent steps S200-S400 are executed to obtain the detection result of whether each capacitive touch sensor has been touched.
[0030] In one implementation, after acquiring the sampling data, for each sampling frequency, the difference between the capacitance value corresponding to that sampling frequency and the second standard capacitance value corresponding to that sampling frequency can be determined first; the second standard capacitance value is the capacitance value of the capacitive touch sensor in the untouched state.
[0031] If the difference is less than the preset capacitance threshold, the capacitance value corresponding to the sampling frequency in the sampled data is replaced with the second standard capacitance value corresponding to the sampling frequency.
[0032] If the difference is greater than or equal to the preset capacitance threshold, the capacitance value will not be processed.
[0033] For ease of understanding, let chan0_data represent the capacitance value corresponding to sampling frequency 0 in the sampled data, and chan0_dc represent the second standard capacitance value corresponding to sampling frequency 0. When chan0_data - chan0_dc < TH, the capacitance value corresponding to that sampling frequency in the sampled data is replaced with the second standard capacitance value. When chan0_data - chan0_dc ≥ TH, no processing is performed on the capacitance value.
[0034] Since the second standard capacitance value is the capacitance value of the capacitive touch sensor in the untouched state, if the capacitance value of the capacitive touch sensor is much smaller than the second standard capacitance value (the difference is less than a preset capacitance threshold), an anomaly can be determined by subtracting the second standard capacitance value corresponding to the sampling frequency from the capacitance value corresponding to that sampling frequency. If an anomaly is identified, the capacitance value corresponding to that sampling frequency in the sampled data is replaced with the second standard capacitance value. This filters out abnormal capacitance values from the sampled data, preventing these values from continuously affecting the results of subsequent filtering processes.
[0035] The preset capacitance threshold can be set according to actual needs. For example, the preset capacitance threshold can range from -50 to 0 fF. This example is for illustrative purposes only, and the value of the preset capacitance threshold is not limited to the example shown here.
[0036] Optionally, the second standard capacitor value can be different for different sampling frequencies.
[0037] The second standard capacitance value can be a pre-set parameter, such as the capacitance value obtained by capacitance detection of a capacitive touch sensor under a specified scenario.
[0038] Alternatively, the second standard capacitance value can be obtained by first sampling the capacitive touch sensor X times after the device executing this method starts up, obtaining X sets of sampled data. Then, for each sampling frequency, the X capacitance values corresponding to that sampling frequency are subjected to mean filtering (or median filtering) to obtain the first capacitance value. Then, the first capacitance values (i.e., the N capacitance values) corresponding to the N sampling frequencies are processed (e.g., calculating the average, calculating the median, etc.) to obtain the second standard capacitance value.
[0039] Alternatively, the second standard capacitance value can be obtained by sampling the capacitance of the capacitive touch sensor after the device is started, resulting in a set of sampled data. Then, the N capacitance values included in this set of sampled data are subjected to mean filtering (or median filtering) to obtain the second capacitance value. This process is repeated X times to obtain X second capacitance values. Finally, the X first capacitance values are processed (e.g., calculating the average, calculating the median, etc.) to obtain the second standard capacitance value.
[0040] In one implementation, considering that the capacitance value of a capacitive touch sensor changes with environmental variations (such as ambient temperature), historical detection results from the previous detection can also be obtained after acquiring the sampling data. If the historical detection results indicate that the capacitive touch sensor has not been touched, N filtered capacitance values obtained during the previous detection process are acquired.
[0041] Then, for each sampling frequency: calculate the difference between the second standard capacitance value corresponding to that sampling frequency and the capacitance value corresponding to that sampling frequency in the sampled data. Finally, perform a weighted summation of the difference and the second standard capacitance value corresponding to that sampling frequency to obtain a new second standard capacitance value for that sampling frequency.
[0042] If historical test results indicate that the capacitive touch sensor has been touched, the second standard capacitance value will not be updated.
[0043] If this is the first test and there are no historical test results from previous tests, then the step of updating the second standard capacitance value can be skipped.
[0044] Optionally, the weights used in the weighted summation of the difference and the second standard capacitance value corresponding to the sampling frequency are pre-set. The specific values of the weights can be set according to actual needs. For example, the weight of the second standard capacitance value corresponding to the sampling frequency can be set to 0.99, and the weight of the difference can be set to 0.01; or the weight of the second standard capacitance value corresponding to the sampling frequency can be set to 0.97, and the weight of the difference can be set to 0.03. The examples here are only for ease of understanding and should not be taken as limitations on this application.
[0045] For ease of understanding, let's take chan0_dc k This represents the second standard capacitance value corresponding to sampling frequency 0 during the k-th detection; chan0_data k This represents the capacitance value corresponding to sampling frequency 0 in the sampled data during the k-th detection. Then chan0_dc k =0.99×chan0_dc k-1 +(chan0_data k - chan0_dc k-1×0.01. This example is for illustrative purposes only; the method for updating the second standard capacitance value is not limited to the method shown here.
[0046] In the presence of M capacitive touch sensors, the method for determining and updating the second standard capacitance value of each capacitive touch sensor is the same as described above. For the sake of brevity, it will not be elaborated further here.
[0047] S200: For each sampling frequency, filter the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value.
[0048] The multiple historical sampling capacitance values corresponding to each sampling frequency can be the capacitance values corresponding to that sampling frequency from among the multiple sets of historical sampling data that are most temporally closest to the currently obtained sampling data. Historical sampling data can be understood as the sampling data acquired in the detection cycles prior to the current detection cycle. For each sampling frequency, the historical sampling data corresponding to that sampling frequency is the capacitance value corresponding to that sampling frequency in the sampling data of previous detection cycles.
[0049] The number of historical sampling capacitor values can be set according to actual needs, such as 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, etc. The specific number of historical sampling capacitor values is not limited to the example given here.
[0050] To facilitate understanding of historical sampling capacitance values, we will take an example where the required number of historical sampling capacitance values is 4, and each set of sampling data includes capacitance value 1 corresponding to the first sampling frequency, capacitance value 2 corresponding to the second sampling frequency, and capacitance value 3 corresponding to the third sampling frequency.
[0051] If the i-th sampled data includes capacitance values 1_i, 2_i, and 3_i, the (i+1)-th sampled data includes capacitance values 1_i+1, 2_i+1, and 3_i+1, the (i+2)-th sampled data includes capacitance values 1_i+2, 2_i+2, and 3_i+2, and the (i+3)-th sampled data includes capacitance values 1_i+3, 2_i+3, and 3_i+3.
[0052] When the (i+3)th sampled data is obtained, the steps of S200 are as follows: for the first sampling frequency, the capacitor values 1_i+3, 1_i+2, 1_i+1, and 1_i are filtered to obtain the filtered capacitor values corresponding to the first sampling frequency.
[0053] Furthermore, for the second sampling frequency, the capacitance values 2_i+3, 2_i+2, 2_i+1, and 2_i are filtered to obtain the filtered capacitance value corresponding to the second sampling frequency. For the third sampling frequency, the capacitance values 3_i+3, 3_i+2, 3_i+1, and 3_i are filtered to obtain the filtered capacitance value corresponding to the third sampling frequency.
[0054] The examples provided are for illustrative purposes only and are not intended to limit the scope of this application.
[0055] In one implementation, for each sampling frequency, mean filtering (or median filtering, maximum filtering) can be performed on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value.
[0056] The method for applying mean filtering to the capacitance value corresponding to a certain sampling frequency in the sampled data and to multiple historical sampling capacitance values corresponding to that sampling frequency is as follows: calculate the average of the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency, and obtain the filtered capacitance value corresponding to that sampling frequency (i.e., the calculated average value). Therefore, for N sampling frequencies, there are N filtered capacitance values.
[0057] The method of applying median / maximum filtering to the capacitance value corresponding to each sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency is similar to the method of applying mean filtering. The only difference is that for each sampling frequency, the median / maximum value of the capacitance value corresponding to that sampling frequency and multiple historical sampling capacitance values corresponding to that sampling frequency are calculated to obtain the filtered capacitance value for that sampling frequency. Therefore, for N sampling frequencies, there are N filtered capacitance values.
[0058] In one implementation, for each sampling frequency, filtering is performed based on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency. The way to obtain the filtered capacitance value is as follows: first, obtain the historical detection results of the previous detection.
[0059] If the historical detection results indicate that the capacitive touch sensor has not been touched, for each sampling frequency, the median filter and / or mean filter are applied to the capacitance value corresponding to that sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value.
[0060] If the historical detection results indicate that the capacitive touch sensor has been touched, for each sampling frequency, the maximum value filter is applied to the capacitance value corresponding to that sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value.
[0061] The current filtering method is determined by the previous result. Since touch is not instantaneous but often lasts for a period of time, if the previous detection result indicates that the capacitive touch sensor has been touched, the probability that the capacitive touch sensor has still been touched in the next sampling data is relatively high. Therefore, using the maximum value filtering method can improve the detection accuracy.
[0062] The methods of filtering using median filtering, mean filtering, and maximum filtering have been clearly described above and will not be repeated here for the sake of brevity.
[0063] Optionally, for each sampling frequency, the method of performing median filtering and / or mean filtering on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency can be as follows: for each sampling frequency, perform median filtering and mean filtering on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency in sequence to obtain the filtered capacitance value corresponding to that sampling frequency.
[0064] By combining median filtering and average filtering, the filtering effect is improved, thereby increasing the accuracy of this solution.
[0065] Optionally, for each sampling frequency, the method of performing median filtering and mean filtering sequentially on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value for that sampling frequency can be as follows: For each sampling frequency, firstly, perform median filtering on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain a third capacitance value. Then, perform mean filtering based on multiple pre-obtained historical third capacitance values and the current third capacitance value to obtain the filtered capacitance value corresponding to that sampling frequency. Here, N sampling frequencies correspond to N filtered capacitance values.
[0066] The multiple historical third capacitance values can be multiple third capacitance values calculated before the currently calculated third capacitance value that are closest in time to the current value (i.e., third capacitance values obtained during previous executions of the capacitive touch sensor detection method), and the historical third capacitance values have the same sampling frequency as the currently calculated third capacitance value. The number of historical third capacitance values can be set according to actual needs, for example, it can be 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, etc. The specific number of historical third capacitance values is not limited to the example given here.
[0067] Optionally, for each sampling frequency, the method of performing median filtering and mean filtering sequentially on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value for that sampling frequency can be as follows: For each sampling frequency, firstly, perform mean filtering on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain a fourth capacitance value. Then, perform median filtering based on multiple pre-obtained historical fourth capacitance values and the current fourth capacitance value to obtain the filtered capacitance value corresponding to that sampling frequency. Here, N sampling frequencies correspond to N filtered capacitance values.
[0068] The multiple historical fourth capacitance values can be multiple fourth capacitance values calculated before the currently calculated fourth capacitance value that are closest in timing to the current value (i.e., fourth capacitance values obtained during previous executions of the capacitive touch sensor detection method), and the historical fourth capacitance values have the same sampling frequency as the currently calculated fourth capacitance value. The number of historical fourth capacitance values can be set according to actual needs, for example, it can be 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, etc. The specific number of historical fourth capacitance values is not limited to the example given here.
[0069] In one implementation, for each sampling frequency, the maximum value filtering is performed on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value. Specifically, for each sampling frequency, the maximum value filtering and average value filtering are performed sequentially on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value corresponding to that sampling frequency.
[0070] The filtering effect can be improved by adding an average value filter in conjunction with a maximum value filter.
[0071] Optionally, for each sampling frequency, the method of sequentially performing maximum value filtering and average value filtering on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency can be as follows: For each sampling frequency, firstly, perform maximum value filtering on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain a fifth capacitance value. Then, perform average value filtering based on multiple pre-obtained historical fifth capacitance values and the current fifth capacitance value to obtain the filtered capacitance value corresponding to that sampling frequency. Wherein, N sampling frequencies correspond to N filtered capacitance values.
[0072] The multiple historical fifth capacitance values can be multiple fifth capacitance values calculated before the currently calculated fifth capacitance value that are closest in time to the current value (i.e., fifth capacitance values obtained during the previous execution of the capacitive touch sensor detection method), and the historical fifth capacitance values have the same sampling frequency as the currently calculated fifth capacitance value. The number of historical fifth capacitance values can be set according to actual needs, for example, it can be 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, etc. The specific number of historical fifth capacitance values is not limited to the example given here.
[0073] In one implementation, for each sampling frequency, the maximum value filtering is performed on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value. This can be achieved by first determining whether there is interference based on the historical output capacitance value obtained from the previous detection.
[0074] If there is no interference, for each sampling frequency, the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency are sequentially subjected to maximum value filtering and average value filtering to obtain the filtered capacitance value corresponding to that sampling frequency.
[0075] If interference exists, for each sampling frequency, the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency are sequentially subjected to median filtering and average filtering to obtain the filtered capacitance value corresponding to that sampling frequency. The filtering method for the subsequent K sets of sampled data is the same: for each sampling frequency, the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency are sequentially subjected to median filtering and average filtering to obtain the filtered capacitance value corresponding to that sampling frequency.
[0076] In actual testing, it was found that when the interference signal of CS 10V scans to the operating frequency or harmonics of the capacitive touch sensor, the interference becomes very strong. Because maximum value filtering is performed when a touch is present, this interference manifests as a significant signal rise during a touch, such as... Figure 3 Several "peaks" can be observed. In terms of response time, this has little impact on the "trigger response," but it will cause a slow extinguishing reaction for the "raise-to-extinguish response." That is, if you raise your hand at the "peak," the signal needs to drop from a very high level to below the threshold before it is extinguished, which can easily result in the signal not dropping for a long time and causing a "tailing" phenomenon. Figure 3 The horizontal axis represents the index of the sampled data, and the vertical axis represents the capacitance value (in pf).
[0077] Based on this, the presence of interference is determined. If interference is confirmed, the filtering method is changed (i.e., median filtering and average filtering). Median filtering can quickly pull down the capacitance value, and then average filtering is performed to reduce the trailing phenomenon.
[0078] Optionally, determining the presence of interference based on historical output capacitance values can be achieved by checking whether the historical output capacitance value is less than an interference threshold. The interference threshold is the product of a pre-recorded historical maximum capacitance value and a preset coefficient. The historical maximum capacitance value is the maximum output capacitance value from the historical start time to the current time.
[0079] If the historical output capacitance value is greater than or equal to the interference threshold, it is confirmed that no interference has occurred.
[0080] If the historical output capacitance value is less than the interference threshold, interference is confirmed.
[0081] Since the interference threshold is the product of the pre-recorded historical maximum capacitance value and a preset coefficient, it is used to determine when the capacitive touch channel is not touched. That is, if the historical output capacitance value is less than the interference threshold, the capacitive touch channel is considered not to have been touched. Therefore, this method can accurately locate the moment when the capacitive touch channel is not touched, and due to the existence of the preset coefficient, it can effectively prevent the moment when the capacitive touch channel is touched from being mistakenly identified as not being touched.
[0082] The preset coefficient is a positive number less than 1. For example, the preset coefficient can be any value between 0.7 and 0.9, such as 0.7, 0.75, 0.8, 0.85, 0.9, etc.
[0083] Optionally, the historical maximum capacitance value can be a preset parameter, or the historical maximum capacitance value can be obtained by updating the output capacitance value.
[0084] Optionally, before determining whether the historical output capacitance value is less than the interference threshold, it can be first determined that the historical output capacitance value (the output capacitance value obtained in the previous detection) is less than the historical maximum capacitance value. Then, it can be determined whether the historical output capacitance value is less than the interference threshold.
[0085] If the historical output capacitance value is greater than or equal to the historical maximum capacitance value, it is determined that there is no interference. If the historical output capacitance value is greater than the historical maximum capacitance value, the historical maximum capacitance value is updated to the historical output capacitance value.
[0086] By comparing the historical output capacitance value with the historical maximum capacitance value, and updating the historical output capacitance value when the historical output capacitance value is larger, the accuracy of subsequent judgments on the existence of interference is improved.
[0087] Optionally, if the historical output capacitance value is less than the interference threshold, the historical maximum capacitance value can be reset to 0, and the current time can be set as the new historical start time.
[0088] Since interference is considered to exist when the historical output capacitance value is less than the interference threshold, the previous historical maximum capacitance value may be affected by interference, leading to inaccurate historical maximum capacitance values. Therefore, the historical maximum capacitance value is reset to 0, and the current time is set as the new historical start time to redetermine a new historical maximum capacitance value, thus eliminating the potential impact of interference on the previous historical maximum capacitance value.
[0089] To facilitate understanding of the filtering methods described above, examples will be provided below.
[0090] Retrieve historical test results from the previous test.
[0091] If the historical detection results indicate that the capacitive touch sensor has not been touched, the sampled data is filtered using median filtering, mean filtering, and multiple sets of historical sampling data to obtain N filtered capacitance values.
[0092] If the historical detection results indicate that the capacitive touch sensor has been touched, determine whether the historical output capacitance value is less than the historical maximum capacitance value.
[0093] If the historical output capacitance value is greater than or equal to the historical maximum capacitance value, it is determined that no interference has occurred. Furthermore, if the historical output capacitance value is greater than the historical maximum capacitance value, the historical maximum capacitance value is updated to the historical output capacitance value. Based on multiple sets of historical sampling data, the sampled data are sequentially subjected to maximum value filtering and average value filtering to obtain N filtered capacitance values.
[0094] If the historical output capacitance value is less than the historical maximum capacitance value, interference is determined. Based on multiple sets of historical sampling data, the sampled data is sequentially subjected to median filtering and average filtering to obtain N filtered capacitance values. The subsequent K sets of sampled data are filtered in the same way: based on multiple sets of historical sampling data, the sampled data is sequentially subjected to median filtering and average filtering to obtain N filtered capacitance values.
[0095] This method can effectively reduce the trailing effect, such as Figure 4 As shown. Figure 4 After using this method, the trailing phenomenon was significantly reduced (compared to...). Figure 3 A schematic diagram of ( ). Figure 4 The horizontal axis represents the index of the sampled data, and the vertical axis represents the capacitance value (in pf).
[0096] The specific implementation methods of each of the above steps have been clearly described above, and will not be repeated here for the sake of brevity.
[0097] S300: Determines the output capacitance value based on N filtered capacitance values.
[0098] The N filtered capacitance values are also the filtered capacitance values corresponding to each sampling frequency.
[0099] In one implementation, the output capacitance value can be determined based on N filtered capacitance values by calculating the average value of the N filtered capacitance values and using this average value as the output capacitance value.
[0100] Alternatively, the output capacitance value can be determined based on N filtered capacitance values by determining the median of the N filtered capacitance values and using that median as the output capacitance value.
[0101] If N is an integer greater than 3, the output capacitance value can also be determined based on the N filtered capacitance values by removing the maximum and minimum values from the N filtered capacitance values, and then calculating the average of the remaining capacitance values from the N filtered capacitance values as the output capacitance value.
[0102] In one implementation, the method for determining the output capacitance value from N filtered capacitance values can also be: if the historical detection result (the detection result of the previous detection of the capacitive touch sensor) indicates that the capacitive touch sensor has not been touched, the median (or average value) of the N filtered capacitance values is determined as the output capacitance value.
[0103] If the historical detection results indicate that the capacitive touch sensor has been touched, the maximum value of the N filtered capacitance values is determined as the output capacitance value.
[0104] Since touch is not instantaneous but often lasts for a period of time, if a previous detection result indicates that the capacitive touch sensor has been touched, there is a high probability that the capacitive touch sensor will still be touched in the next data sampling. Therefore, if historical detection results indicate that the capacitive touch sensor has been touched, the probability that it will still be touched in the current data is higher. Thus, the maximum value of N filtered capacitance values is selected as the output capacitance value to improve detection accuracy. Conversely, if historical detection results indicate that the capacitive touch sensor has not been touched, the median or average value is used as the output capacitance value to prevent false positives.
[0105] In one implementation, if there are M capacitive touch sensors, i.e., M sets of sampled data are acquired, each set of sampled data corresponds to a different capacitive touch sensor, the method for determining the output capacitance value from N filtered capacitance values can be as follows: For any set of sampled data: if the historical detection results indicate that the target capacitive touch sensor has been touched, the maximum value of the N filtered capacitance values is determined as the output capacitance value. Here, the target capacitive touch sensor is the capacitive touch sensor corresponding to that set of sampled data.
[0106] If the historical detection results indicate that the target capacitive touch sensor has not been touched, determine whether there are any historical detection results for other capacitive touch sensors indicating that they have been touched. Other capacitive touch sensors are the capacitive touch sensors corresponding to M-1 other sets of sampling data besides this set of sampling data.
[0107] If it exists, determine the minimum value of the N filtered capacitor values as the output capacitor value.
[0108] If it does not exist, determine the median of the N filtered capacitor values as the output capacitor value.
[0109] In the presence of M capacitive touch sensors, when one of them is touched, the adjacent (untouched) capacitive touch sensors also experience a slight signal boost. Therefore, to mitigate this crosstalk, for target capacitive touch sensors whose previous detection results indicate they were not touched, and for which other capacitive touch sensors were touched in the previous detection, the minimum of N filtered capacitance values is selected as the output capacitance value. This lowers the output capacitance values, thus reducing the slight signal boost observed in the untouched capacitive touch sensors.
[0110] For ease of understanding, we will use M=4 as an example. The four capacitive touch sensors are capacitive touch sensor 1, capacitive touch sensor 2, capacitive touch sensor 3, and capacitive touch sensor 4.
[0111] If capacitive touch sensor 2 was indicated as touched in the previous detection result, while the other three were not indicated as touched in the previous detection result, then after obtaining the current N filtered capacitance values for each of the four capacitive touch sensors, and since capacitive touch sensor 2 was indicated as touched in the previous detection result, the maximum value among the N filtered capacitance values corresponding to capacitive touch sensor 2 is taken as the output capacitance value.
[0112] For capacitive touch sensor 1, capacitive touch sensor 3, and capacitive touch sensor 4, the minimum value among their respective N filtered capacitance values is taken as their respective output capacitance value.
[0113] If the previous detection results of capacitive touch sensor 1, capacitive touch sensor 2, capacitive touch sensor 3, and capacitive touch sensor 4 all indicate that no touch has been detected, then for any one of these four capacitive touch sensors, the median of its corresponding N filtered capacitance values will be used as the output capacitance value.
[0114] The examples provided are for illustrative purposes only and should not be construed as limiting the scope of this application.
[0115] In one implementation, if during the filtering process, the presence of interference is determined based on the historical output capacitance values obtained from the previous detection, and different filtering methods are selected accordingly, then the method for determining the output capacitance value from N filtered capacitance values can also be: if the historical detection results indicate that the capacitive touch sensor has not been touched, the median of the N filtered capacitance values is determined as the output capacitance value.
[0116] If the historical detection results indicate that the capacitive touch sensor has been touched and there is no interference, the maximum value of the N filtered capacitance values is determined as the output capacitance value.
[0117] If historical detection results indicate that the capacitive touch sensor has been touched and there is interference, the median of the N filtered capacitance values is determined as the output capacitance value.
[0118] In the presence of interference, signals can easily linger for extended periods, resulting in a "tailing" effect. Therefore, this method uses the median of the N filtered capacitor values as the output capacitor value, which allows for a faster reduction in the output capacitor value, thereby mitigating the tailing phenomenon.
[0119] The question of whether interference exists has been explained in detail in the aforementioned step of determining whether interference exists based on the historical output capacitance value obtained from the previous detection, and will not be repeated here.
[0120] If the historical detection results indicate that the capacitive touch sensor has not been touched, the method for determining the output capacitance value from N filtered capacitance values is the same as the method described above. For the sake of brevity, it will not be repeated here.
[0121] S400: Compare the output capacitance value with the first standard capacitance value to obtain the detection result characterizing whether the capacitive touch sensor has been touched.
[0122] The first standard capacitance value is used to determine whether the capacitive touch sensor is being touched.
[0123] When the output capacitance value is greater than or equal to the first standard capacitance value, the detection result characterizing the capacitive touch sensor being touched is obtained.
[0124] When the output capacitance value is equivalent to the first standard capacitance value, a detection result characterizing that the capacitive touch sensor has not been touched is obtained.
[0125] The first standard capacitance value can be a pre-configured capacitance value, or it can be a capacitance value obtained by testing the capacitive touch sensor.
[0126] For example, the capacitance value of a capacitive touch sensor can be detected multiple times when it is touched, and then the minimum value can be selected as the second standard capacitance value.
[0127] Alternatively, the capacitance value of the capacitive touch sensor can be measured multiple times when it is touched, and then the average of these capacitance values can be calculated. This average value, along with the average capacitance value of the capacitive touch sensor when it is not touched, can then be used as a second standard capacitance value.
[0128] The method for determining the second standard capacitance value is not limited to the example given here. As long as the output capacitance value is greater than or equal to the first standard capacitance value, it can be determined that the capacitive touch sensor has been touched; if the output capacitance value is less than or equal to the first standard capacitance value, it can be determined that the capacitive touch sensor has not been touched.
[0129] In one implementation, if there are M capacitive touch sensors and M sets of sampling data are acquired, and each set of sampling data corresponds to a different capacitive touch sensor, the output capacitance value is compared with a first standard capacitance value to obtain a detection result characterizing whether the capacitive touch sensor has been touched. This can be achieved by determining whether there is a historical detection result characterizing whether the capacitive touch sensor has been touched among the M historical detection results from the previous detection.
[0130] If present, for adjacent capacitive touch sensors adjacent to the touched capacitive touch sensor: reduce the output capacitance value corresponding to the adjacent capacitive touch sensor, compare the reduced output capacitance value with the first standard capacitance value corresponding to the adjacent capacitive touch sensor, and obtain a detection result characterizing whether the adjacent capacitive touch sensor has been touched.
[0131] For capacitive touch sensors other than the adjacent capacitive touch sensor: compare the output capacitance value of the capacitive touch sensor with the first standard capacitance value of the capacitive touch sensor to obtain a detection result characterizing whether the capacitive touch sensor has been touched.
[0132] If not, for each capacitive touch sensor: compare the output capacitance value corresponding to the capacitive touch sensor with the first standard capacitance value corresponding to the capacitive touch sensor to obtain the detection result characterizing whether the capacitive touch sensor has been touched.
[0133] When a capacitive touch sensor is touched, the capacitance of its adjacent capacitive touch sensors increases. Therefore, if any of the M historical detection results from the previous detection indicate that a capacitive touch sensor has been touched, the capacitance of the adjacent capacitive touch sensors will increase. To improve detection accuracy, the capacitance of these adjacent capacitive touch sensors is reduced to prevent the increased capacitance of adjacent capacitive touch sensors from being mistakenly identified as a touch.
[0134] Optionally, when reducing the output capacitance value corresponding to the adjacent capacitive touch sensor, the specific reduction value can be obtained in advance and directly called when needed.
[0135] Optionally, a signal suppression matrix is pre-configured. This matrix includes the capacitive touch sensors that need to be reduced when touched, along with the corresponding reduction amount. For neighboring capacitive touch sensors adjacent to the touched sensor, the reduction of their output capacitance value can be achieved as follows: Based on the pre-configured signal suppression matrix, determine the reduction amount required for each neighboring capacitive touch sensor. Then, based on this reduction amount, reduce the output capacitance value of the neighboring capacitive touch sensor to obtain the reduced output capacitance value.
[0136] Since the signal suppression matrix includes the capacitive touch sensors that need to be reduced when each capacitive touch sensor is touched, along with the corresponding reduction amount, after determining the touched capacitive touch sensor using the M historical detection results from the previous detection, the neighboring capacitive touch sensors adjacent to the touched capacitive touch sensor, along with their respective reduction amounts, can be found from the signal suppression matrix.
[0137] The closer the object is to the capacitive touch sensor being touched, the greater the reduction in size.
[0138] For a better understanding of the signal suppression matrix above, please refer to [link / reference needed]. Figure 5 . Figure 5 This is an example diagram of a signal suppression matrix shown in an embodiment of this application.
[0139] like Figure 5 As shown, there are a total of 14 capacitive touch sensors, from chan0 to chan13. Figure 5 The position of each parameter in the signal suppression matrix shown can be represented by the horizontal and vertical coordinates (chani, chanj), where i and j range from 0 to 13. For example, the position of the first parameter 0.7 in the upper left corner can be represented as (chan0, chan0).
[0140] When the horizontal and vertical axes of a parameter are the same, the parameter represents the first standard capacitance value of the touch sensor corresponding to its horizontal axis. For example, a parameter value of 0.7 at coordinates (chan0, chan0) indicates that the first standard capacitance value of the capacitive touch sensor chan0 is 0.7 pF. Similarly, Figure 5 In the signal suppression matrix shown, the first standard capacitance values corresponding to the thirteen capacitive touch sensors chan1 to chan13 are 0.6pf, 0.22pf, 0.6pf, 0.7pf, 0.7pf, 0.8pf, 0.7pf, 0.17pf, 0.6pf, 0.2pf, 0.67pf, 0.7pf, and 0.65pf, respectively.
[0141] When the horizontal and vertical axes of a parameter are not the same, the parameter represents the amount of reduction in the capacitive touch sensor corresponding to the horizontal axis when the capacitive touch sensor corresponding to the vertical axis is touched. If the parameter is empty, it indicates that the capacitive touch sensor corresponding to its horizontal axis is not adjacent to the capacitive touch sensor corresponding to its vertical axis, and therefore no reduction is needed.
[0142] For example, taking the parameter -0.2 corresponding to the coordinates (chan1, chan0) as an example, it means that when chan0 is touched, the capacitance value corresponding to chan1 needs to be reduced by 0.2pF. The other parameters are similar, and will not be elaborated here.
[0143] To facilitate understanding of the capacitive touch sensor detection method described above, the following will combine... Figure 6 The steps involved are explained.
[0144] First, collect M sets of sampling data, each set of sampling data including N capacitance values.
[0145] Then, for each set of sampled data, the following is executed: Each capacitance value in the sampled data is corrected. Specifically, for each sampling frequency: the difference between the capacitance value corresponding to that sampling frequency and the second standard capacitance value corresponding to that sampling frequency is determined. The second standard capacitance value is the capacitance value of the capacitive touch sensor in the untouched state. If the difference is less than a preset capacitance threshold, the capacitance value corresponding to that sampling frequency in the sampled data is replaced with the second standard capacitance value; if the difference is greater than or equal to the preset capacitance threshold, no processing is performed on the capacitance value.
[0146] After obtaining the corrected sampling data, it can be determined whether the second standard capacitance value needs to be updated based on the historical detection results of the previous detection. If the historical detection results indicate that the capacitive touch sensor has not been touched, N filtered capacitance values obtained during the previous detection process are acquired. For each sampling frequency: the difference between the second standard capacitance value corresponding to that sampling frequency and the capacitance value corresponding to that sampling frequency in the sampling data is calculated; the difference and the second standard capacitance value corresponding to that sampling frequency are then weighted and summed (i.e., the aforementioned chan0_dc). k =0.99×chan0_dc k-1 +(chan0_data k - chan0_dc k-1 The new second standard capacitance value corresponding to the sampling frequency is obtained. If historical detection results indicate that the capacitive touch sensor has been touched, the second standard capacitance value is not updated.
[0147] The corrected sampled data is then filtered. Specifically, the historical detection results from the previous detection are first obtained. If the historical detection results indicate that the capacitive touch sensor was not touched, the sampled data is filtered using median filtering, mean filtering, and multiple sets of historical sampled data to obtain N filtered capacitance values. Among the N capacitance values obtained in this way, if the historical detection results indicate that the target capacitive touch sensor was not touched, it is determined whether there are any historical detection results indicating that other capacitive touch sensors were touched among the historical detection results for the other M-1 capacitive touch sensors. If so, the minimum value among the N filtered capacitance values is determined as the output capacitance value. If not, the median value among the N filtered capacitance values is determined as the output capacitance value.
[0148] If historical detection results indicate that the capacitive touch sensor has been touched, then it is determined whether the historical output capacitance value is less than 0.8 times the historical maximum capacitance value. If it is less, interference is confirmed; if it is greater than or equal to, interference is confirmed to be absent. If there is no interference, the sampled data is sequentially filtered by maximum value and average value based on multiple sets of historical sampling data to obtain N filtered capacitance values. The maximum value among the N filtered capacitance values is taken as the output capacitance value.
[0149] If interference exists, the sampled data is sequentially filtered by median and then by average based on multiple sets of historical sampling data to obtain N filtered capacitance values. The subsequent K sets of sampled data are filtered in the same way: by sequentially filtering by median and then by average based on multiple sets of historical sampling data to obtain N filtered capacitance values. The median of the N filtered capacitance values is used as the output capacitance value.
[0150] If the historical output capacitance value is greater than the historical maximum capacitance value, the historical maximum capacitance value needs to be updated to the historical output capacitance value. If the historical output capacitance value is less than 0.8 times the historical maximum capacitance value, the historical maximum capacitance value is reset to 0, and the current time is set as the new historical start time.
[0151] After obtaining the output capacitance value, a first standard capacitance value corresponding to each capacitive touch sensor can be determined according to a preset signal suppression matrix. Then, it is determined whether the output capacitance value is greater than the first standard capacitance value. If the output capacitance value is greater than or equal to the first standard capacitance value, a detection result indicating that the corresponding capacitive touch sensor has been touched is obtained. If the output capacitance value is less than the first standard capacitance value, a detection result indicating that the corresponding capacitive touch sensor has not been touched is obtained. This detection result is also used to determine the filtering method in the next detection process.
[0152] Each capacitive touch sensor obtains its corresponding detection result in this way, completing one detection of M capacitive touch sensors.
[0153] Figure 6 The specific implementation methods and principles of each step shown have been clearly described above, and will not be repeated here for the sake of brevity.
[0154] Based on the same technical concept, this application also provides a capacitive touch sensor detection device. For example... Figure 7 As shown, the capacitive touch sensor detection device 100 includes an acquisition module 110 and a processing module 120.
[0155] The acquisition module 110 is used to acquire sampling data; the sampling data consists of N capacitance values obtained by sequentially sampling a capacitive touch sensor using N sampling frequencies; wherein each sampling frequency corresponds to one capacitance value in the sampling data.
[0156] The processing module 120 is used to filter the capacitance value corresponding to the sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to the sampling frequency for each sampling frequency to obtain a filtered capacitance value; determine an output capacitance value based on N filtered capacitance values; and compare the output capacitance value with a first standard capacitance value to obtain a detection result characterizing whether the capacitive touch sensor has been touched.
[0157] The processing module 120 is specifically used to acquire the historical detection results of the previous detection; if the historical detection results indicate that the capacitive touch sensor has not been touched, for each sampling frequency, the median filter and / or mean filter are performed on the capacitance value corresponding to that sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value; if the historical detection results indicate that the capacitive touch sensor has been touched, for each sampling frequency, the maximum value filter is performed on the capacitance value corresponding to that sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value.
[0158] The processing module 120 is specifically used to perform median filtering and mean filtering on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency for each sampling frequency, so as to obtain the filtered capacitance value corresponding to that sampling frequency.
[0159] The processing module 120 is specifically used to perform maximum value filtering and average value filtering on the capacitance value corresponding to the sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to the sampling frequency for each sampling frequency, so as to obtain the filtered capacitance value corresponding to the sampling frequency.
[0160] The processing module 120 is specifically used to determine whether interference exists based on the historical output capacitance values obtained from the previous detection. If no interference exists, for each sampling frequency, the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency are sequentially subjected to maximum value filtering and average value filtering to obtain the filtered capacitance value corresponding to that sampling frequency. If interference exists, for each sampling frequency, the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency are sequentially subjected to median filtering and average value filtering to obtain the filtered capacitance value corresponding to that sampling frequency. The filtering method for the K sets of sampled data obtained in subsequent sampling is as follows: for each sampling frequency, the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency are sequentially subjected to median filtering and average value filtering to obtain the filtered capacitance value corresponding to that sampling frequency.
[0161] The processing module 120 is specifically used to determine whether the historical output capacitance value is less than an interference threshold; wherein, the interference threshold is the product of a pre-recorded historical maximum capacitance value and a preset coefficient, and the historical maximum capacitance value is the maximum value among the output capacitance values from the historical start time to the current time; if the historical output capacitance value is greater than or equal to the interference threshold, it is confirmed that no interference has occurred; if the historical output capacitance value is less than the interference threshold, it is confirmed that interference has occurred.
[0162] Before determining whether the historical output capacitance value is less than the interference threshold, the processing module 120 is further configured to determine that the historical output capacitance value is less than the historical maximum capacitance value; wherein, if the historical output capacitance value is greater than or equal to the historical maximum capacitance value, it is determined that no interference has occurred, and if the historical output capacitance value is greater than the historical maximum capacitance value, the historical maximum capacitance value is updated to the historical output capacitance value.
[0163] If the historical output capacitance value is less than the interference threshold, the processing module 120 is further configured to reset the historical maximum capacitance value to 0 and set the current time as the new historical start time.
[0164] The processing module 120 is specifically used to determine the median of N filtered capacitance values as the output capacitance value if the historical detection results indicate that the capacitive touch sensor has not been touched; and to determine the maximum value of N filtered capacitance values as the output capacitance value if the historical detection results indicate that the capacitive touch sensor has been touched.
[0165] If M sets of sampling data are obtained, each set of sampling data corresponds to a different capacitive touch sensor, the processing module 120 is specifically used for any set of sampling data: if the historical detection result indicates that the target capacitive touch sensor has been touched, determine the maximum value of the N filtered capacitance values as the output capacitance value; wherein, the target capacitive touch sensor is the capacitive touch sensor corresponding to this set of sampling data; if the historical detection result indicates that the target capacitive touch sensor has not been touched, determine whether there are historical detection results indicating that the other capacitive touch sensors have been touched in the historical detection results corresponding to other capacitive touch sensors; the other capacitive touch sensors are the capacitive touch sensors corresponding to the other M-1 sets of sampling data besides this set of sampling data; if they exist, determine the minimum value of the N filtered capacitance values as the output capacitance value; if they do not exist, determine the median value of the N filtered capacitance values as the output capacitance value.
[0166] The processing module 120 is specifically configured to: if the historical detection results indicate that the capacitive touch sensor has not been touched, determine the median of N filtered capacitance values as the output capacitance value; if the historical detection results indicate that the capacitive touch sensor has been touched and there is no interference, determine the maximum value of N filtered capacitance values as the output capacitance value; if the historical detection results indicate that the capacitive touch sensor has been touched and there is interference, determine the median of N filtered capacitance values as the output capacitance value.
[0167] After acquiring the sampling data, the processing module 120 is further configured to, for each sampling frequency, determine the difference between the capacitance value corresponding to the sampling frequency and the second standard capacitance value corresponding to the sampling frequency in the sampling data; the second standard capacitance value is the capacitance value of the capacitive touch sensor in the untouched state; if the difference is less than a preset capacitance threshold, the capacitance value corresponding to the sampling frequency in the sampling data is replaced with the second standard capacitance value corresponding to the sampling frequency; if the difference is greater than or equal to the preset capacitance threshold, the capacitance value is not processed.
[0168] The processing module 120 is further configured to acquire historical detection results from the previous detection; when the historical detection results indicate that the capacitive touch sensor has not been touched, acquire N filtered capacitance values obtained during the previous detection process; for each sampling frequency: calculate the difference between the second standard capacitance value corresponding to the sampling frequency and the capacitance value corresponding to the sampling frequency in the sampling data; and perform a weighted summation of the difference and the second standard capacitance value corresponding to the sampling frequency to obtain a new second standard capacitance value corresponding to the sampling frequency.
[0169] If M sets of sampling data are obtained, and each set of sampling data corresponds to a different capacitive touch sensor, the processing module 120 is specifically used to determine whether there is a historical detection result indicating that the capacitive touch sensor has been touched among the M historical detection results of the previous detection; if so, for the adjacent capacitive touch sensor next to the touched capacitive touch sensor: the output capacitance value corresponding to the adjacent capacitive touch sensor is reduced, and the reduced output capacitance value is compared with the first standard capacitance value corresponding to the adjacent capacitive touch sensor to obtain a detection result indicating whether the adjacent capacitive touch sensor has been touched; for other capacitive touch sensors besides the adjacent capacitive touch sensor: the output capacitance value corresponding to the capacitive touch sensor is compared with the first standard capacitance value corresponding to the capacitive touch sensor to obtain a detection result indicating whether the capacitive touch sensor has been touched; if not, for each capacitive touch sensor: the output capacitance value corresponding to the capacitive touch sensor is compared with the first standard capacitance value corresponding to the capacitive touch sensor to obtain a detection result indicating whether the capacitive touch sensor has been touched.
[0170] The processing module 120 is specifically used for the following purposes: for adjacent capacitive touch sensors adjacent to the touched capacitive touch sensor, based on a preset signal suppression matrix, determining the amount of reduction that needs to be performed; the signal suppression matrix includes the capacitive touch sensors that need to be reduced when each capacitive touch sensor is touched and the corresponding reduction amount; and reducing the output capacitance value corresponding to the adjacent capacitive touch sensor based on the reduction amount to obtain the reduced output capacitance value.
[0171] The capacitive touch sensor detection device 100 provided in this application embodiment has the same implementation principle and technical effect as the aforementioned capacitive touch sensor detection method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned capacitive touch sensor detection method embodiment.
[0172] Please see Figure 8 This is an electronic device 200 provided in an embodiment of this application. The electronic device 200 includes: a processor 210 and a memory 220.
[0173] The memory 220 and processor 210 are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The memory 220 is used to store computer programs, such as those containing... Figure 7The software functional module shown is the capacitive touch sensor detection device 100. The capacitive touch sensor detection device 100 includes at least one software functional module that can be stored in the memory 220 in the form of software or firmware, or embedded in the operating system (OS) of the electronic device 200. The processor 210 is used to execute executable modules stored in the memory 220, such as the software functional module or computer program included in the capacitive touch sensor detection device 100. In this case, the processor 210 is used to acquire sampling data; the sampling data consists of N capacitance values obtained by sequentially sampling the capacitive touch sensor using N sampling frequencies; each sampling frequency corresponds to one capacitance value in the sampling data; for each sampling frequency, filtering is performed based on the capacitance value corresponding to that sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain a filtered capacitance value; based on the N filtered capacitance values, an output capacitance value is determined; the output capacitance value is compared with a first standard capacitance value to obtain a detection result characterizing whether the capacitive touch sensor has been touched.
[0174] The memory 220 can be, but is not limited to, RAM (Random Access Memory), ROM (Read Only Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.
[0175] Processor 210 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be a DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor, or processor 210 can be any conventional processor.
[0176] Among them, the aforementioned electronic devices 200 include, but are not limited to, personal computers, servers, etc.
[0177] This application also provides a computer-readable storage medium (hereinafter referred to as the storage medium) storing a computer program. When the computer program is run by a computer, such as the electronic device 200 described above, it executes the capacitive touch sensor detection method described above. The computer-readable storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory, a random access memory, a magnetic disk, or an optical disk.
[0178] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A capacitive touch sensor detection method, characterized in that, include: Acquire sampling data; The sampling data consists of N capacitance values obtained by sequentially sampling a capacitive touch sensor using N sampling frequencies; wherein each sampling frequency corresponds to one capacitance value in the sampling data. For each sampling frequency, the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency are filtered to obtain the filtered capacitance value. Determine the output capacitance value based on N filtered capacitance values; The output capacitance value is compared with the first standard capacitance value to obtain a detection result characterizing whether the capacitive touch sensor has been touched; Specifically, for each sampling frequency, filtering is performed based on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value, including: Retrieve historical test results from the previous test; If the historical detection results indicate that the capacitive touch sensor has not been touched, for each sampling frequency, the median filter and / or mean filter are applied to the capacitance value corresponding to that sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value. If the historical detection results indicate that the capacitive touch sensor has been touched, for each sampling frequency, the maximum value filtering is performed on the capacitance value corresponding to that sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value.
2. The method according to claim 1, characterized in that, For each sampling frequency, median filtering and / or mean filtering are performed on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency, including: For each sampling frequency, the median filter and mean filter are applied sequentially to the capacitance value corresponding to that sampling frequency in the sampled data and to multiple historical sampling capacitance values corresponding to that sampling frequency, to obtain the filtered capacitance value corresponding to that sampling frequency.
3. The method according to claim 1, characterized in that, For each sampling frequency, the maximum value filtering is performed on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value, including: For each sampling frequency, the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency are sequentially subjected to maximum value filtering and average value filtering to obtain the filtered capacitance value corresponding to that sampling frequency.
4. The method according to claim 1, characterized in that, For each sampling frequency, the maximum value filtering is performed on the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value, including: Determine whether interference exists based on the historical output capacitance value obtained from the previous detection; If there is no interference, for each sampling frequency, the maximum value filter and the average value filter are applied sequentially to the capacitance value corresponding to that sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value corresponding to that sampling frequency. If interference exists, for each sampling frequency, the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency are sequentially subjected to median filtering and average filtering to obtain the filtered capacitance value corresponding to that sampling frequency; wherein, the filtering method for the K sets of sampled data obtained subsequently is as follows: for each sampling frequency, the capacitance value corresponding to that sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to that sampling frequency are sequentially subjected to median filtering and average filtering to obtain the filtered capacitance value corresponding to that sampling frequency.
5. The method according to claim 4, characterized in that, Determining the presence of interference based on historical output capacitance values obtained from the previous detection includes: Determine whether the historical output capacitance value is less than the interference threshold; wherein, the interference threshold is the product of the pre-recorded historical maximum capacitance value and a preset coefficient, and the historical maximum capacitance value is the maximum value of the output capacitance value from the historical start time to the current time. If the historical output capacitance value is greater than or equal to the interference threshold, it is confirmed that no interference has occurred; If the historical output capacitance value is less than the interference threshold, interference is confirmed to have occurred.
6. The method according to claim 5, characterized in that, Before determining whether the historical output capacitance value is less than the interference threshold, the method further includes: It is determined that the historical output capacitance value is less than the historical maximum capacitance value; If the historical output capacitance value is greater than or equal to the historical maximum capacitance value, it is determined that no interference has occurred, and if the historical output capacitance value is greater than the historical maximum capacitance value, the historical maximum capacitance value is updated to the historical output capacitance value.
7. The method according to claim 6, characterized in that, If the historical output capacitance value is less than the interference threshold, the method further includes: The historical maximum capacitance value is reset to 0, and the current time is set as the new historical start time.
8. The method according to claim 1, characterized in that, Determining the output capacitance value from the N filtered capacitance values includes: If the historical detection results indicate that the capacitive touch sensor has not been touched, the median of the N filtered capacitance values is determined as the output capacitance value; If the historical detection results indicate that the capacitive touch sensor has been touched, the maximum value of the N filtered capacitance values is determined as the output capacitance value.
9. The method according to claim 1, characterized in that, If M sets of sampling data are obtained, each set of sampling data corresponds to a different capacitive touch sensor, and the output capacitance value is determined from the N filtered capacitance values, including: For any of the aforementioned sets of sampled data: If the historical detection results indicate that the target capacitive touch sensor has been touched, the maximum value of the N filtered capacitance values is determined as the output capacitance value; wherein, the target capacitive touch sensor is the capacitive touch sensor corresponding to this set of sampled data; If the historical detection results indicate that the target capacitive touch sensor has not been touched, determine whether there are any historical detection results indicating that the other capacitive touch sensors have been touched in the historical detection results corresponding to other capacitive touch sensors; the other capacitive touch sensors are the capacitive touch sensors corresponding to the other M-1 sets of sampling data besides this set of sampling data; If it exists, determine the minimum value of the N filtered capacitor values as the output capacitor value; If it does not exist, the median of the N filtered capacitor values is determined as the output capacitor value.
10. The method according to claim 4, characterized in that, Determining the output capacitance value from the N filtered capacitance values includes: If the historical detection results indicate that the capacitive touch sensor has not been touched, the median of the N filtered capacitance values is determined as the output capacitance value; If the historical detection results indicate that the capacitive touch sensor has been touched and there is no interference, the maximum value of the N filtered capacitance values is determined as the output capacitance value. If the historical detection results indicate that the capacitive touch sensor has been touched and there is interference, the median of the N filtered capacitance values is determined as the output capacitance value.
11. The method according to claim 1, characterized in that, After acquiring the sampled data, the method further includes: For each sampling frequency: In the sampled data, determine the difference between the capacitance value corresponding to the sampling frequency and the second standard capacitance value corresponding to the sampling frequency; the second standard capacitance value is the capacitance value of the capacitive touch sensor in the untouched state. If the difference is less than a preset capacitance threshold, the capacitance value corresponding to the sampling frequency in the sampled data is replaced with the second standard capacitance value corresponding to the sampling frequency. If the difference is greater than or equal to a preset capacitance threshold, the capacitance value is not processed.
12. The method according to claim 11, characterized in that, The method further includes: Retrieve historical test results from the previous test; If the historical detection results indicate that the capacitive touch sensor has not been touched, obtain N filtered capacitance values obtained in the previous detection process. For each sampling frequency: Calculate the difference between the second standard capacitance value corresponding to the sampling frequency and the capacitance value corresponding to the sampling frequency in the sampled data; The difference and the second standard capacitance value corresponding to the sampling frequency are weighted and summed to obtain a new second standard capacitance value corresponding to the sampling frequency.
13. The method according to any one of claims 1-12, characterized in that, If M sets of sampling data are acquired, for each set of sampling data corresponding to a different capacitive touch sensor, the output capacitance value is compared with a first standard capacitance value to obtain a detection result characterizing whether the capacitive touch sensor has been touched, including: Determine whether there are any historical detection results in the previous M detection results that indicate that the capacitive touch sensor was touched; If present, for a neighboring capacitive touch sensor adjacent to the touched capacitive touch sensor: reduce the output capacitance value corresponding to the neighboring capacitive touch sensor, compare the reduced output capacitance value with the first standard capacitance value corresponding to the neighboring capacitive touch sensor, and obtain a detection result characterizing whether the neighboring capacitive touch sensor has been touched. For capacitive touch sensors other than the adjacent capacitive touch sensor: compare the output capacitance value corresponding to the capacitive touch sensor with the first standard capacitance value corresponding to the capacitive touch sensor to obtain a detection result characterizing whether the capacitive touch sensor has been touched; If not, for each capacitive touch sensor: compare the output capacitance value corresponding to the capacitive touch sensor with the first standard capacitance value corresponding to the capacitive touch sensor to obtain a detection result characterizing whether the capacitive touch sensor has been touched.
14. The method according to claim 13, characterized in that, For neighboring capacitive touch sensors adjacent to the touched capacitive touch sensor: the output capacitance value corresponding to the neighboring capacitive touch sensor is reduced, including: For adjacent capacitive touch sensors that are adjacent to the capacitive touch sensor being touched: Based on a preset signal suppression matrix, the amount of reduction that needs to be performed is determined; the signal suppression matrix includes the capacitive touch sensors that need to be reduced when each capacitive touch sensor is touched, and the corresponding amount of reduction. Based on the reduction amount, the output capacitance value corresponding to the adjacent capacitive touch sensor is reduced to obtain the reduced output capacitance value.
15. A capacitive touch sensor detection device, characterized in that, include: The acquisition module is used to acquire sampled data; The sampling data consists of N capacitance values obtained by sequentially sampling a capacitive touch sensor using N sampling frequencies; wherein each sampling frequency corresponds to one capacitance value in the sampling data. The processing module is used to filter the capacitance value corresponding to the sampling frequency in the sampled data and multiple historical sampling capacitance values corresponding to the sampling frequency for each sampling frequency to obtain a filtered capacitance value; determine an output capacitance value based on N filtered capacitance values; and compare the output capacitance value with a first standard capacitance value to obtain a detection result characterizing whether the capacitive touch sensor has been touched. The processing module is specifically used to acquire the historical detection results of the previous detection; if the historical detection results indicate that the capacitive touch sensor has not been touched, for each sampling frequency, the median filter and / or mean filter are applied to the capacitance value corresponding to that sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value; if the historical detection results indicate that the capacitive touch sensor has been touched, for each sampling frequency, the maximum value filter is applied to the capacitance value corresponding to that sampling frequency in the sampling data and multiple historical sampling capacitance values corresponding to that sampling frequency to obtain the filtered capacitance value.
16. An electronic device, characterized in that, include: A memory and a processor, wherein the memory and the processor are connected; The memory is used to store programs; The processor is configured to invoke a program stored in the memory to perform the method as described in any one of claims 1-14.
17. A computer-readable storage medium, characterized in that, It stores a computer program, which, when executed by a computer, performs the method as described in any one of claims 1-14.
Citation Information
Patent Citations
Touch detection method, medium, touch chip and touch display equipment
CN115599234A
Touch screen anti-interference automatic correction method
CN118838507A
