Touch anti-interference algorithm scheme
By arranging driving and sensing channels on the touch screen, performing differential data processing and unified threshold judgment, the problem of signal strength difference caused by interference in the touch solution is solved, and the precise positioning and contour calculation of touch points are achieved.
Patent Information
- Application Number
- CN202511699267.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-03-03
AI Technical Summary
Traditional touch solutions are susceptible to interference from ambient light, electromagnetic interference, and power supply noise, which can lead to differences in signal strength across different parts of the touchscreen. This affects the accurate calculation of touch point coordinates and area information, and can easily result in offsets and errors.
The system employs a full-screen layout with M driving channels and N sensing channels. Through differential data processing and unified threshold judgment, interference noise is eliminated, the touch point area and coordinates are calculated, and the touch point information is corrected using an outer rectangular range.
It significantly improves the accuracy of touch point positioning and contour calculation, enhancing the user's operating experience.
Smart Images

Figure CN121597045A_ABST
Abstract
Description
Technical fields:
[0001] This invention belongs to the field of touch screen algorithm technology, and specifically relates to a touch anti-interference algorithm scheme. Background technology:
[0002] Traditional touch solutions (infrared and capacitive touch) directly collect voltage / current intensity to form signal strength. They determine the position and area of the actual touch point by comparing the changes in signal strength when there is a touch and when there is no touch. However, due to interference from ambient light, electromagnetic interference, and power supply noise, the signal strength of different parts of the touchscreen varies because the scanning time / sequence is different (they are not scanned at the same time). This leads to differences in the interference signal strength superimposed on each node of the touchscreen (because the interference may fluctuate over time). For example, if the electromagnetic interference strength is P1 in the first time period t1, the intensity of the nodes scanned in time period t1 will be superimposed with the interference of P1. If the electromagnetic interference strength is P2 in the next time period t2, the signal strength of other nodes scanned in time period t2 will be superimposed with the interference of P2. This results in inconsistent interference levels at different locations on the screen, leading to large differences in signal strength. This makes it difficult for the algorithm to accurately calculate the coordinates and area information of the touch point, and it is easy to cause problems such as point position offset and point area deviation. Summary of the Invention:
[0003] The purpose of this invention is to provide a touch anti-interference algorithm solution to solve the above-mentioned problems. It solves the defects of traditional touch solutions that are susceptible to interference from ambient light, electromagnetic interference, and power supply noise. Due to the differences in scanning time and timing of signals in different parts of the entire touch screen, the interference signal strength of each interference superimposed on different parts of the touch screen varies, which leads to difficulties in algorithm point positioning, coordinate offset, and distortion of contour calculation.
[0004] To address the above problems, the present invention provides a technical solution:
[0005] A touch anti-interference algorithm scheme includes the following steps:
[0006] S1: The entire screen is designed with M driving channels and N sensing channels according to rows and columns. Based on the rectangular structure of a typical TV display, the long side column is designed as the sensing channel Rx and the short side row is designed as the driving channel Tx.
[0007] S2: Perform one scan cycle to obtain the original signal strength of all nodes;
[0008] S3: Convert the original signal data into differential data. Differential data is obtained by performing the following operations on the original data of all nodes scanned at the same or similar times: Differential data of the first column node = Original signal data of the second column node - Original signal data of the first column node, Differential data of the second column node = Original signal data of the third column node - Original signal data of the second column node, ..., Differential data of the (N-1)th column node = Original signal data of the Nth column node - Original signal data of the (N-1)th column node, and set the differential data of the Nth column node to 0;
[0009] S4: Combine a threshold t to traverse rows and calculate and record the row touch area of each row: Set a threshold t, traverse the entire screen difference data row by row. If the absolute value of the difference data of the node in the j-th column (1≤j≤N) of the i-th row (1≤i≤M) is ≥t, it is determined to be the area where the touch point is located, that is, the (i,j) node belongs to the touch point range. Traverse the entire i-th row in this way. The first node with an absolute value ≥t from left to right in this row is called the starting node of the touch area of this row, and the last node with an absolute value ≥t is called the ending node of the touch area of this row. All nodes from the start to the end constitute the touch area of this row.
[0010] S5: Obtain the touch point region by merging the touch areas of the current row: Start traversing from the 2nd row. If the range of the row touch area B in this row is [s2, e2], and there is an overlap with the range of the row touch area A in the previous row, which is [s1, e1], that is: s2≤e1 and e2≥s1, then it is determined that A and B belong to the same touch point region, and all rows contained in this touch point region, as well as the start and end of each row, are recorded. Continue traversing the remaining rows in this way until the row touch areas of all rows have been traversed, thus obtaining all touch point regions.
[0011] S6: Calculate the coordinates and area information of each touch point; based on the row range [m1,m2] and column range [n1,n2] of the touch point area, determine the range of the circumscribed rectangle R, with rows from m1 to m2 and columns from n1 to n2. Based on the change X caused by the column ratio of the differential data to the column starting point of the original signal data, correct the range of the circumscribed rectangle R, with rows from m1 to m2 and columns from n1+X-n2. Based on the row and column range of R, the coordinates of the current touch point can be calculated as x = (n2+(n1+X)) / 2, y = (m2+m1) / 2, the width of the point is W = n2-(n1+X)+1, and the height of the point is H = m2-m1+1.
[0012] S7: Smooth the execution trajectory, convert the coordinates of each trajectory contact point and upload them to the host computer;
[0013] S8: Jump to step 2 and repeat.
[0014] Preferably, in step S2, one scanning cycle refers to the voltage and current of one Tx channel being scanned, and all Rx channels simultaneously and time-divisionally sensing and acquiring this voltage and current, in this way until all Tx channels have scanned once and all Rx channels have received and recorded the voltage and current signals scanned by these Tx channels.
[0015] Preferably, in step S6, the coordinate range of the circumscribed rectangle is calculated using the centroid formula:
[0016]
[0017] Taking x_c as an example: x_c represents the x-coordinate of the touch point obtained from the centroid calculation. After traversing the entire touch point area from the i-th node to the j-th node, x... k Let C be the x-coordinate of the k-th node. k is the signal strength value of the k-th node.
[0018] The beneficial effects of this invention include:
[0019] This invention, through research, discovered that the superposition values of various interferences between node signals with the same or similar scanning time are relatively close. Based on this, node signals with the same or similar scanning time can be differentially divided to form a whole-screen differential signal, thereby eliminating interference noise and retaining effective signals, making the changes in effective signals more obvious. At the same time, it proposes a unified threshold to determine the possible touch point range, proposes the concept of row touch area acquisition, and proposes a method to calculate point areas based on row touch areas. Finally, it calculates point coordinates and point width and height information by using an outer rectangle, which significantly improves the accuracy of touch point information acquisition and positioning, and enhances touch accuracy and the accuracy of point contour acquisition. Attached image description:
[0020] For ease of explanation, the present invention will be described in detail below with reference to specific embodiments and accompanying drawings.
[0021] Figure 1 This is a schematic diagram of the process of the present invention;
[0022] Figure 2 This is a schematic diagram illustrating the local signal intensity change caused by touching a touch point when the signal interference mechanism of this invention is normal and without interference.
[0023] Figure 3 This is a schematic diagram illustrating the change in local interference signal intensity during the occurrence of interference, as shown in the signal interference mechanism of this invention.
[0024] Figure 4 This is a schematic diagram illustrating the significant differences in interference experienced by local nodes at different scanning times, as shown in the signal interference mechanism of this invention.
[0025] Figure 5This is a schematic diagram illustrating the signal strength situation when there is both interference and touch point contact, which is the signal interference mechanism of the present invention. Detailed implementation method:
[0026] Example 1
[0027] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0028] like Figure 1-5 The touch anti-interference algorithm scheme shown includes the following steps:
[0029] S1: The entire screen is designed with M driving channels and N sensing channels according to rows and columns. Based on the rectangular structure of a typical TV display, the long side column is designed as the sensing channel Rx and the short side row is designed as the driving channel Tx.
[0030] S2: Perform one scan cycle to obtain the original signal strength of all nodes;
[0031] S3: Convert the original signal data into differential data. Differential data is obtained by performing the following operations on the original data of all nodes scanned at the same or similar times: Differential data of the first column node = Original signal data of the second column node - Original signal data of the first column node, Differential data of the second column node = Original signal data of the third column node - Original signal data of the second column node, ..., Differential data of the (N-1)th column node = Original signal data of the Nth column node - Original signal data of the (N-1)th column node, and set the differential data of the Nth column node to 0;
[0032] S4: Combine a threshold t to traverse rows and calculate and record the row touch area of each row: Set a threshold t, traverse the entire screen difference data row by row. If the absolute value of the difference data of the node in the j-th column (1≤j≤N) of the i-th row (1≤i≤M) is ≥t, it is determined to be the area where the touch point is located, that is, the (i,j) node belongs to the touch point range. Traverse the entire i-th row in this way. The first node with an absolute value ≥t from left to right in this row is called the starting node of the touch area of this row, and the last node with an absolute value ≥t is called the ending node of the touch area of this row. All nodes from the start to the end constitute the touch area of this row.
[0033] S5: Obtain the touch point region by merging the touch areas of the current row: Start traversing from the 2nd row. If the range of the row touch area B in this row is [s2, e2], and there is an overlap with the range of the row touch area A in the previous row, which is [s1, e1], that is: s2≤e1 and e2≥s1, then it is determined that A and B belong to the same touch point region, and all rows contained in this touch point region, as well as the start and end of each row, are recorded. Continue traversing the remaining rows in this way until the row touch areas of all rows have been traversed, thus obtaining all touch point regions.
[0034] S6: Calculate the coordinates and area information of each touch point; based on the row range [m1,m2] and column range [n1,n2] of the touch point area, determine the range of the circumscribed rectangle R, with rows from m1 to m2 and columns from n1 to n2. Based on the change X caused by the column ratio of the differential data to the column starting point of the original signal data, correct the range of the circumscribed rectangle R, with rows from m1 to m2 and columns from n1+X-n2. Based on the row and column range of R, the coordinates of the current touch point can be calculated as x = (n2+(n1+X)) / 2, y = (m2+m1) / 2, the width of the point is W = n2-(n1+X)+1, and the height of the point is H = m2-m1+1.
[0035] S7: Smooth the execution trajectory, convert the coordinates of each trajectory contact point and upload them to the host computer;
[0036] S8: Jump to step 2 and repeat.
[0037] Signal interference mechanism: When there is no interference, the change in the effective touch signal from no touch to touch point is relatively obvious and uniform; however, when there is interference, the change in the intensity of the local interference signal caused by the interference is similar to the change in the effective touch signal, and it is impossible to distinguish whether it is an interference signal from a mechanistic perspective, which can easily lead to misjudgment (and thus cause problems such as skipping points). At the same time, because the node signals in different areas are affected by interference differently due to differences in scanning time, they exhibit different characteristics. This invention is based on the research on the different characteristics of node signals in different areas due to differences in interference caused by differences in scanning time. Figure 2-5 .
[0038] In step S2, a scanning cycle refers to the voltage and current of a Tx channel being scanned. All Rx channels simultaneously and in a time-division manner collect this voltage and current, and so on until all Tx channels have scanned once and all Rx channels have received and recorded the voltage and current signals scanned by these Tx channels.
[0039] In step S6, the coordinate range of the circumscribed rectangle can also be calculated using the centroid formula:
[0040]
[0041] Taking x_c as an example: x_c represents the x-coordinate of the touch point obtained from the centroid calculation. After traversing the entire touch point area from the i-th node to the j-th node, x... k Let C be the x-coordinate of the k-th node. k is the signal strength value of the k-th node.
[0042] In the method of calculating differential data based on the original signal data, this scheme is described as back column to front column. It can also be obtained by front column to back column, with the first column set to 0. The method is similar. In this scheme, Rx is laid out on the column and Tx is laid out on the row. It can also be reversed, with Tx and Rx interchanged, so that the column is Tx and the row is Rx. The calculation of the corresponding differential data becomes row-row subtraction, which is similar. The description of this scheme takes capacitive touch as an example. It can also be extended to infrared. By scanning simultaneously in time and subtracting the light intensity of adjacent scans, the diff data can be obtained.
[0043] This solution proposes differential analysis of node signals with similar or identical scanning times to form a full-screen differential signal, thereby eliminating interference noise and retaining effective signals. It also proposes a unified threshold for determining the possible touch point range, and based on this, the concept of row touch area determination. Furthermore, it proposes a method for calculating point areas based on row touch areas, and a method for calculating point coordinates and width / height information using an circumscribed rectangle. These methods eliminate various interferences, significantly improve the accuracy of touch point positioning and contour information determination, and enhance the user's control and writing experience.
[0044] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the present invention. Various changes and modifications can be made to the present invention without departing from its spirit and scope. All such changes and modifications fall within the scope of the present invention as claimed, which is defined by the appended claims and their equivalents.
Claims
1. A touch anti-interference algorithm scheme, characterized in that, Includes the following steps: S1: The entire screen is designed with M driving channels and N sensing channels according to rows and columns. Based on the rectangular structure of a typical TV display, the long side column is designed as the sensing channel Rx and the short side row is designed as the driving channel Tx. S2: Perform one scan cycle to obtain the original signal strength of all nodes; S3: Convert the original signal data into differential data. Differential data is obtained by performing the following operations on the original data of all nodes scanned at the same or similar times: Differential data of the first column node = Original signal data of the second column node - Original signal data of the first column node, Differential data of the second column node = Original signal data of the third column node - Original signal data of the second column node, ..., Differential data of the (N-1)th column node = Original signal data of the Nth column node - Original signal data of the (N-1)th column node, and set the differential data of the Nth column node to 0; S4: Combine a threshold t to traverse rows and calculate and record the row touch area of each row: Set a threshold t, traverse the entire screen difference data row by row. If the absolute value of the difference data of the node in the j-th column (1≤j≤N) of the i-th row (1≤i≤M) is ≥t, it is determined to be the area where the touch point is located, that is, the (i,j) node belongs to the touch point range. Traverse the entire i-th row in this way. The first node with an absolute value ≥t from left to right in this row is called the starting node of the touch area of this row, and the last node with an absolute value ≥t is called the ending node of the touch area of this row. All nodes from the start to the end constitute the touch area of this row. S5: Obtain the touch point region by merging the touch areas of the current row: Start traversing from the 2nd row. If the range of the row touch area B in this row is [s2, e2], and there is an overlap with the range of the row touch area A in the previous row, which is [s1, e1], that is: s2≤e1 and e2≥s1, then it is determined that A and B belong to the same touch point region, and all rows contained in this touch point region, as well as the start and end of each row, are recorded. Continue traversing the remaining rows in this way until the row touch areas of all rows have been traversed, thus obtaining all touch point regions. S6: Calculate the coordinates and area information of each touch point; based on the row range [m1,m2] and column range [n1,n2] of the touch point area, determine the range of the circumscribed rectangle R, with rows from m1 to m2 and columns from n1 to n2. Based on the change X caused by the column ratio of the differential data to the column starting point of the original signal data, correct the range of the circumscribed rectangle R, with rows from m1 to m2 and columns from n1+X-n2. Based on the row and column range of R, the coordinates of the current touch point can be calculated as x = (n2+(n1+X)) / 2, y = (m2+m1) / 2, the width of the point is W = n2-(n1+X)+1, and the height of the point is H = m2-m1+1. S7: Smooth the execution trajectory, convert the coordinates of each trajectory contact point and upload them to the host computer; S8: Jump to step 2 and repeat.
2. The touch anti-interference algorithm scheme according to claim 1, characterized in that: In step S2, a scanning cycle refers to the voltage and current of a Tx channel being scanned. All Rx channels simultaneously and in a time-division manner collect this voltage and current, and so on until all Tx channels have scanned once and all Rx channels have received and recorded the voltage and current signals scanned by these Tx channels.
3. The touch anti-interference algorithm scheme according to claim 1, characterized in that: In step S6, the coordinate range of the circumscribed rectangle is calculated using the centroid formula: Taking x_c as an example: x_c represents the x-coordinate of the touch point obtained from the centroid calculation. After traversing the entire touch point area from the i-th node to the j-th node, x... k Let C be the x-coordinate of the k-th node. k is the signal strength value of the k-th node.