A touch screen anti-jump point method, system, device and storage medium
By performing pressure filtering and median value deviation filtering on the medical touch screen pressing signal, invalid values are identified and corrected, which solves the problem of jump points and inaccurate values of large-sized resistive touch screens in medical scenarios, and achieves accurate reporting of data and equipment. stable operation.
Patent Information
- Application Number
- CN202410811247.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-06-21
AI Technical Summary
In medical scenarios, especially in ICU wards, when large-size resistive touch screens are used, the uneven contact points caused by the fingertip pressure of medical staff are prone to jump point problems and inaccurate pressing position values, leading to a high risk of misoperation of the equipment. .
A touch screen anti-jump method is adopted to collect touch screen press signals, perform pressure filtering and median value deviation filtering, identify the validity of the data, and use arrays to store data and correct invalid values to ensure the accuracy of reported data. Avoid screen freezes caused by no reported events for a long time.
Effectively filter out inaccurate touch point values to ensure the accuracy of reported data, reduce the risk of misoperation of the device, and avoid screen freezes.
Smart Images

Figure CN118377396B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of touch screens for medical equipment, and in particular to a touch screen anti-jumping method, system, device and storage medium. Background Art
[0002] In medical environments, especially in ICU wards or operating rooms, medical staff are likely to use touch screens while wearing gloves. The advantages of resistive screens are obvious. For example, the screens may carry tiny liquid droplets due to frequent disinfection in wards. Resistive screens are not affected by small water droplets, which is beneficial to screen control. Glove operation is more convenient and the cost is lower. When using a capacitive touch screen, the touch signal is the electrical signal generated by the finger touching the touch screen. Since the common scene of ECMO equipment is the ICU ward, the electric knife in the ICU will interfere with the electrical signal of the capacitive touch screen, while the use of a resistive touch screen is basically not interfered by the electric knife.
[0003] At present, most of the resistive screens used in medical equipment are small in size. When the screen is small, it is easy for doctors to operate the resistive touch screen with one finger wearing gloves. However, when the screen is large in size, the large screen is more likely to produce large deformation, and often the point jump will occur more often after a period of use.
[0004] Conventional resistive touch screens require fingertips or stylus tips to click on the touch screen. In this scenario, there is a stable point of force on the touch screen surface, so that the upper and lower surfaces of the touch screen have contact points, thereby generating a stable touch resistance value. Under normal usage, the problem of point jumps in the data sampled by the resistive touch screen is relatively rare, and the conventional filtering solution can meet the requirements.
[0005] In medical scenarios, medical staff's nails are generally very smooth, so the general medical use of touch screens is to use the fingertips to press the touch screen. In this case, because pressing will cause the ITO layer of the touch screen to squeeze more points, resulting in uneven contact points inside the screen and prone to touch errors. Therefore, in this case, the use of conventional resistive touch screens will occasionally have relatively serious point jump problems, and pressing will result in a series of inaccurate sampling values. In this scenario, simply using common filtering solutions cannot filter out this series of inaccurate values.
[0006] ECMO equipment is a high-risk medical device used for extracorporeal life support. When using large-size resistive touch screens, especially ICU medical staff need to wear multi-layer gloves, which often result in larger fingertips. The large fingertips are used to press the large-size resistive screen for touch operation. Pressing the screen with the fingertips can easily cause point jump problems and inaccurate pressing position values, which may lead to high-risk problems of device misoperation. Summary of the invention
[0007] To this end, the embodiments of the present invention provide a touch screen anti-jump method, system, device and storage medium to solve the technical problem of unevenly pressing a resistive touch screen with a fingertip resulting in a series of inaccurate sampling values.
[0008] In order to achieve the above purpose, the embodiment of the present invention provides the following technical solutions:
[0009] According to a first aspect of an embodiment of the present invention, an embodiment of the present application provides a touch screen anti-jump point method, the method comprising:
[0010] Collecting touch screen pressing signals according to a preset sampling period;
[0011] Performing pressure filtering on each sampling value in the touch screen pressure signal to obtain first storage data;
[0012] Storing the first stored data in sequence into a first preset array and generating a first index;
[0013] When the first preset array is full, calculating the median value of the touch point coordinates of each first stored data and performing deviation filtering;
[0014] Based on the deviation filtering result, using the first identification value to identify the validity of the first stored data, to obtain second stored data;
[0015] Storing the second stored data in sequence into a second preset array and generating a second index;
[0016] Initialize the value of a pre-set flag bit to 1;
[0017] When the value of the flag bit is 1, the first several invalid values in the second preset array are respectively corrected to the first valid value in the array to obtain third stored data;
[0018] Storing the third stored data in sequence into a third preset array and generating a third index;
[0019] According to a preset reporting period that is the same as the preset sampling period, index values of the third index are sequentially obtained, and third stored data identified as valid by the corresponding first identification value is reported.
[0020] Furthermore, collecting the touch screen pressing signal according to a preset sampling period includes:
[0021] Receive the interrupt signal generated by touch screen pressing;
[0022] Collect the touch screen pressing signal according to the preset sampling period and record the sampling times;
[0023] Determine whether the current sampling number exceeds a first preset threshold;
[0024] If the current sampling number does not exceed the first preset threshold, the sampling value of the corresponding touch screen pressure signal is discarded, and the loop is executed to sample the touch screen pressure signal in the next preset sampling period;
[0025] If the current sampling times exceeds the first preset threshold, the sampling value of the corresponding touch screen pressure signal is retained, and the loop is executed to sample the touch screen pressure signal in the next preset sampling period.
[0026] Further, pressure filtering is performed on each sampling value in the touch screen pressure signal to obtain first storage data, including:
[0027] Determining whether the touch point pressure in the sampled value is within a valid pressure range;
[0028] If the touch point pressure in the sampled value is not within the valid pressure range, the corresponding sampled value is discarded, and the loop is executed to sample the touch screen pressure signal in the next preset sampling period;
[0029] If the touch point pressure in the sampled value is within the valid pressure range, the corresponding sampled value is determined as the first storage data, and a loop is executed to sample the touch screen pressure signal in the next preset sampling period.
[0030] Further, pressure filtering is performed on each sampling value in the touch screen pressure signal to obtain first storage data, including:
[0031] Dividing the resistive touch screen into two or more areas based on preset parameters;
[0032] Set effective pressure range for each area;
[0033] Determine the area where the touch point is located based on the touch point coordinates in the sampled values;
[0034] Determine whether the touch point pressure in the sampled value is within the valid pressure range corresponding to the area;
[0035] If the pressure of the touch point in the sampled value is not within the valid pressure range corresponding to the area where it is located, the sampled value is discarded, and the loop is executed to sample the touch screen pressure signal in the next preset sampling period;
[0036] If the touch point pressure in the sampling value is within the valid pressure range corresponding to the area, the corresponding sampling value is determined as the first storage data, and a loop is executed to sample the touch screen pressure signal in the next preset sampling period.
[0037] Furthermore, when the first preset array is full, the median value of the touch point coordinates of each first stored data is calculated and deviation filtering is performed, including:
[0038] Determining whether the first preset array is full;
[0039] If the first preset array is not full, sampling the touch screen pressing signal in the next preset sampling period according to the preset sampling period, and recording the number of sampling times;
[0040] If the first preset array is full, the horizontal coordinate values and the vertical coordinate values in each of the first stored data are sorted respectively to obtain a sorted first median value and a second median value;
[0041] Calculate a first difference between a horizontal coordinate value and a corresponding first median value and a second difference between a vertical coordinate value and a corresponding second median value in each first stored data;
[0042] Determine whether a first difference value and a second difference value corresponding to the first stored data are both less than or equal to a set first maximum deviation value and a set second maximum deviation value respectively;
[0043] If the first difference corresponding to the current first stored data is less than or equal to the set first maximum deviation value, and the second difference corresponding to the current first stored data is less than or equal to the set second maximum deviation value, then the first stored data is valid data;
[0044] If the first difference value corresponding to the current first stored data is greater than the set first maximum deviation value, or the second difference value corresponding to the current first stored data is greater than the set second maximum deviation value, the first stored data is invalid data.
[0045] Further, based on the deviation filtering result, the validity of the data is identified by using the first identification value to obtain the second stored data, including:
[0046] When the first stored data is valid data, the corresponding first identification value is set to 1;
[0047] When the first stored data is invalid data, the corresponding first identification value is set to 0.
[0048] Further, the first several invalid values in the second preset array are respectively corrected to the first valid value in the array to obtain third stored data, including:
[0049] Based on the first identification value, query the index value of the second index corresponding to the first valid value from the second preset array;
[0050] Assign the queried index value to the second identification value;
[0051] Perform cyclic shift on each second stored data in sequence according to the second index to obtain corresponding third stored data;
[0052] During the loop shift execution, determining whether the current loop count exceeds the second identification value;
[0053] If the current number of cycles does not exceed the second identification value, assigning the third stored data to the second stored data corresponding to the second identification value, and updating the first identification value of the third stored data to the first identification value of the second stored data corresponding to the second identification value;
[0054] If the current number of loops exceeds the second identification value, the third stored data is assigned to the second stored data indexed by the index value corresponding to the current number of loops, and the first identification value of the third stored data is determined as the first identification value of the second stored data indexed by the index value corresponding to the current number of loops.
[0055] Further, taking the index values of the third index in sequence, and reporting the third stored data corresponding to the first identification value identified as valid, including:
[0056] Based on a preset static variable, sequentially taking the index values of the third index as the reported index values;
[0057] Determine whether the first identification value of the third stored data corresponding to the current index value taken by the static variable is 1;
[0058] If the first identification value of the third stored data corresponding to the current index value taken by the static variable is 1, the third stored data corresponding to the current index value in the third preset array is reported, and the current index value taken by the static variable is accumulated by 1 to obtain the next index value taken by the static variable;
[0059] Determine whether the next index value is the last index value of the third index;
[0060] If the next index value is the last index value of the third index, the flag bit and the static variable are both set to 0;
[0061] If the next index value is not the last index value of the third index, the process loops to determine whether the first identification value of the third stored data corresponding to the next index value taken by the static variable is 1.
[0062] Further, taking the index values of the third index in sequence, and reporting the third stored data identified as valid by the corresponding first identification value, further comprising:
[0063] If the first identification value of the third stored data corresponding to the current index value taken by the static variable is 0, the third stored data corresponding to the current index value in the third preset array is discarded without being reported, and the current index value taken by the static variable is accumulated by 1 to obtain the next index value taken by the static variable;
[0064] Determine whether the next index value is the last index value of the third index;
[0065] If the next index value is the last index value of the third index, the flag bit and the static variable are both set to 0;
[0066] If the next index value is not the last index value of the third index, the process loops to determine whether the first identification value of the third stored data corresponding to the next index value taken by the static variable is 1.
[0067] Furthermore, the method further comprises:
[0068] When the value of the flag bit is 0, based on a preset static variable, according to a preset reporting period that is the same as the preset sampling period, the index values of the second index are sequentially taken as the reported index values;
[0069] Determine whether the first identification value of the second stored data corresponding to the current index value taken by the static variable is 1;
[0070] If the first identification value of the second stored data corresponding to the current index value taken by the static variable is 1, the second stored data corresponding to the current index value in the second preset array is reported, and the current index value taken by the static variable is accumulated by 1 to obtain the next index value taken by the static variable;
[0071] Determine whether the next index value is the last index value of the second index;
[0072] If the next index value is the last index value of the second index, setting the value of the static variable to 0;
[0073] If the next index value is not the last index value of the second index, the process loops to determine whether the first identification value of the second stored data corresponding to the next index value taken by the static variable is 1.
[0074] Furthermore, the method further comprises:
[0075] If the first identification value of the second stored data corresponding to the current index value taken by the static variable is 0, the second stored data corresponding to the current index value in the second preset array is discarded without being reported, and the current index value taken by the static variable is accumulated by 1 to obtain the next index value taken by the static variable;
[0076] Determine whether the next index value is the last index value of the second index;
[0077] If the next index value is the last index value of the second index, setting the value of the static variable to 0;
[0078] If the next index value is not the last index value of the second index, the process loops to determine whether the first identification value of the second stored data corresponding to the next index value taken by the static variable is 1.
[0079] According to a second aspect of an embodiment of the present invention, an embodiment of the present application provides a touch screen anti-jump point system, the system comprising:
[0080] A sampling module, used to collect touch screen pressing signals according to a preset sampling period;
[0081] A pressure filtering module, configured to perform pressure filtering on each sample value in the touch screen pressure signal to obtain first storage data; and sequentially store the first storage data into a first preset array and generate a first index;
[0082] a deviation filtering module, configured to calculate the median value of the touch point coordinates of each first stored data and perform deviation filtering when the first preset array is full; based on the deviation filtering result, identify the validity of the first stored data using the first identification value to obtain second stored data; and store the second stored data in the second preset array in sequence and generate a second index;
[0083] A correction module, used for initializing the value of a preset flag bit to 1; when the value of the flag bit is 1, correcting the first several invalid values in the second preset array to the first valid value in the array, respectively, to obtain third stored data; storing the third stored data in the third preset array in sequence and generating a third index;
[0084] The reporting module is used to sequentially obtain the index values of the third index according to a preset reporting period that is the same as the preset sampling period, and report the third stored data that is marked as valid by the corresponding first identification value.
[0085] According to a third aspect of an embodiment of the present invention, a touch screen anti-jump point device is provided, the device comprising: a processor and a memory;
[0086] The memory is used to store one or more program instructions;
[0087] The processor is used to run one or more program instructions to execute the steps of a touch screen anti-jump method as described in any one of the above items.
[0088] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of a touch screen anti-jumping method as described in any one of the above items are implemented.
[0089] Compared with the prior art, the touch screen anti-jump point method, system, device and storage medium provided by the embodiment of the present application collect the touch screen pressure signal, and then perform pressure filtering and median deviation filtering on each sample value in turn, identify the validity of the data and use the array to store the data, and then report the valid data in turn, effectively filter out the inaccurate touch point value, and ensure the accuracy of the reported data. At the same time, through the identification of the pre-set flag bit, when the value of the flag bit is the initialization value 1, the first few invalid values in the second preset array are respectively corrected to the first valid value in the array. In this way, when too many invalid values are encountered during the first report, it is corrected to report the first valid value of the filtered array, avoiding the screen freeze phenomenon caused by long-term no reporting events. BRIEF DESCRIPTION OF THE DRAWINGS
[0090] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.
[0091] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.
[0092] Figure 1 A schematic diagram of the logical structure of a touch screen anti-jump point system provided by an embodiment of the present invention;
[0093] Figure 2 A schematic diagram of a flow chart of a touch screen anti-jump method provided by an embodiment of the present invention;
[0094] Figure 3A schematic diagram of a process for collecting touch screen pressure signals according to a preset sampling period provided by an embodiment of the present invention;
[0095] Figure 4 A schematic diagram of a process of performing pressure filtering on each sample value in a touch screen pressure signal provided by an embodiment of the present invention;
[0096] Figure 5 A schematic diagram of a process of performing pressure filtering on each sample value in a touch screen pressure signal provided by another embodiment of the present invention;
[0097] Figure 6 A schematic diagram of a process for calculating the median value of the touch point coordinates of each first storage data and performing deviation filtering provided by an embodiment of the present invention;
[0098] Figure 7 A schematic diagram of a process for shifting a sample value when the value of a flag bit is 1 provided in an embodiment of the present invention;
[0099] Figure 8 According to the embodiment of the present invention Figure 7 The flowchart of reporting the sampled value after it is corrected is shown in FIG.
[0100] Fig. 9 A flowchart of directly reporting the sampling value without shifting it when the value of the flag bit is 0 is provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0101] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0102] In medical scenarios, medical staff need to use multi-layer gloves, which often form larger fingertips. When the large fingertips press the large-size resistive screen for touch operation, the static electricity caused by the increased contact surface or the friction of the gloves may cause the problem of touch point jumping. Therefore, the purpose of this application is to accurately filter the touch screen touch point jumping and inaccurate touch point values.
[0103] In order to solve the above technical problems, Figure 1 As shown, an embodiment of the present application provides a touch screen anti-jump point system, which is applied to medical equipment, especially ECMO (Extracorporeal Membrane Oxygenation) equipment.
[0104] Specifically, a touch screen anti-jump point system provided in an embodiment of the present application includes: a sampling module 1, a pressure filtering module 2, a deviation filtering module 3, a correction module 4 and a reporting module 5.
[0105] The sampling module 1 is used to collect the touch screen pressure signal according to a preset sampling period.
[0106] The pressure filtering module 2 is used to perform pressure filtering on each sampling value in the touch screen pressure signal to obtain first storage data; store the first storage data in a first preset array in sequence and generate a first index.
[0107] The deviation filtering module 3 is used to calculate the median value of the touch point coordinates of each first stored data and perform deviation filtering when the first preset array is full; based on the deviation filtering result, use the first identification value to identify the validity of the first stored data to obtain the second stored data; store the second stored data in the second preset array in sequence and generate a second index.
[0108] The correction module 4 is used to initialize the value of a preset flag bit to 1; when the value of the flag bit is 1, the first several invalid values in the second preset array are respectively corrected to the first valid value in the array to obtain third storage data; the third storage data is sequentially stored in the third preset array and a third index is generated;
[0109] The reporting module 5 is used to sequentially obtain the index values of the third index according to a preset reporting period that is the same as the preset sampling period, and report the third stored data identified as valid by the corresponding first identification value.
[0110] Compared with the prior art, the touch screen anti-jump point system provided by the embodiment of the present application collects the touch screen pressing signal, performs pressure filtering and median deviation filtering on each sampling value in turn, identifies the validity of the data and uses the array to store the data, and then reports the valid data in turn, effectively filtering out inaccurate touch point values, and ensuring the accuracy of the reported data. At the same time, through the identification of the pre-set flag bit, when the value of the flag bit is the initialization value 1, the first few invalid values in the second preset array are respectively corrected to the first valid value in the array. In this way, when too many invalid values are encountered during the first report, they are corrected to the first valid value of the array after reporting, avoiding the screen freeze phenomenon caused by long-term no reporting events.
[0111] Corresponding to the above disclosed touch screen anti-jumping point system, the embodiment of the present invention further discloses a touch screen anti-jumping point method. The following describes in detail the touch screen anti-jumping point method disclosed in the embodiment of the present invention in combination with the above described touch screen anti-jumping point system.
[0112] like Figure 2 As shown, the specific steps of a touch screen anti-jump point method provided in an embodiment of the present application are described in detail below.
[0113] A touch screen anti-jump point method provided in an embodiment of the present application is applied to medical equipment, especially ECMO (Extracorporeal Membrane Oxygenation) equipment.
[0114] The touch screen pressing signal is collected by the sampling module 1 according to a preset sampling period.
[0115] refer to Figure 3 When the sampling module 1 performs specific collection steps on the touch screen pressure signal, it first receives the interrupt signal generated by the touch screen pressure.
[0116] When the touch screen is pressed, the interrupt pin of the touch screen IC (Integrated Circuit) generates an interrupt signal, and the interrupt signal continues to be generated while the touch screen is pressed. When the interrupt signal is generated by pressing the touch screen, the sampling module 1 immediately receives the interrupt signal and immediately starts the interrupt program corresponding to the touch screen IC driver.
[0117] The sampling module 1 collects the touch screen pressure signal according to the preset sampling period and records the sampling times.
[0118] After the touch screen IC driver interrupt program is started, the sampling module 1 starts sampling the touch screen pressing signal and records the sampling times. Specifically, the tsorg_count parameter is used in the interrupt program as the number of times the sampling value is recorded. In an embodiment of the present invention, the preset sampling period is greater than or equal to 1ms and less than or equal to 3ms. For example, it is set to sample the original value of the touch screen pressing signal once every 1ms.
[0119] The sampling module 1 determines whether the current sampling times exceeds a first preset threshold.
[0120] If the current sampling number does not exceed the first preset threshold, the sampling value of the corresponding touch screen pressure signal is discarded, and the loop is executed to sample the touch screen pressure signal in the next preset sampling period.
[0121] If the current sampling number exceeds the first preset threshold, the sampling value of the corresponding touch screen pressure signal is retained, and the loop is executed to sample the touch screen pressure signal in the next preset sampling period.
[0122] Specifically, in the embodiment of the present invention, the specific setting of the first preset threshold value needs to be combined with the selected value of the preset sampling period. For example, when the preset sampling period is 1ms, the first preset threshold value can be selected to be greater than or equal to 4 and less than or equal to 6. If the first preset threshold value is selected as 4, when the parameter tsorg_count is less than or equal to 4, the sampling value of the corresponding touch screen press signal is discarded, and the loop is executed until the touch screen press signal is sampled in the next preset sampling period. When the parameter tsorg_count is greater than 4, the sampling value of the corresponding touch screen press signal is retained, and the loop is executed until the touch screen press signal is sampled in the next preset sampling period.
[0123] As described above, the above jitter removal scheme is: in combination with the preset sampling period, jitter filtering is performed by setting the first preset threshold, and after entering the interrupt program, a delay of 4ms to 6ms is used to start retaining the sampled touch screen value, which can effectively filter the jitter value when pressing.
[0124] In the embodiment of the present invention, after the preliminary pressing jitter filtering, the effective pressure value filtering is further performed on the touch point sampling value. A simple touch screen pressure value filtering algorithm usually gives a valid pressure value interval, and the touch point value sampled by the touch screen IC is within this valid pressure range, that is, the valid touch point value.
[0125] refer to Figure 2 The pressure filtering module 2 performs pressure filtering on each sampling value in the touch screen pressure signal to obtain first storage data.
[0126] refer to Figure 4 , the above steps specifically include: the pressure filter module 2 determines whether the touch point pressure in the sampled value is within the valid pressure range. If the touch point pressure in the sampled value is not within the valid pressure range, the corresponding sampled value is discarded, and a loop is executed to sample the touch screen pressure signal for the next preset sampling period. If the touch point pressure in the sampled value is within the valid pressure range, the corresponding sampled value is determined as the first storage data, and a loop is executed to sample the touch screen pressure signal for the next preset sampling period.
[0127] In the use scenario of large-size resistive touch screens, when pressing the touch screen with the fingertips, when the same effective pressure value range is limited within the entire touch screen, if the range is set too large, many touch point values will be inaccurate, and the purpose of filtering effective pressure cannot be fully achieved. However, if the pressure value range is set too small, the touch screen in some areas will be insensitive. In order to solve the above problems in the use scenario of large-size resistive touch screens, different effective pressure value ranges can be set for different positions of the corresponding screen in the embodiment of the present invention.
[0128] refer to Figure 5The above steps specifically include: the pressure filter module 2 divides the resistive touch screen into two or more areas based on preset parameters; and sets an effective pressure range for each area.
[0129] Specifically, the above steps specifically include: taking the maximum value of the original value of the horizontal axis of the touch screen as a preset parameter; dividing the preset parameter in equal proportion according to the number of divided areas to obtain the horizontal axis coordinate range of each area; and using the horizontal axis coordinate range of each area to evenly divide the resistive touch screen along the horizontal axis direction.
[0130] Alternatively, the maximum value of the original value of the vertical axis of the touch screen is used as a preset parameter; the preset parameter is divided proportionally according to the number of divided areas to obtain the vertical axis coordinate range of each area; and the vertical axis coordinate range of each area is used to evenly divide the resistive touch screen along the vertical axis direction.
[0131] Preferably, in the embodiment of the present invention, the resistive touch screen is divided into three areas along the longitudinal axis direction based on preset parameters.
[0132] For example, as mentioned above, the screen is evenly divided into three areas along the vertical axis (y axis), and the three divided areas correspond to Y1, Y2, and Y3 respectively. The y value coordinate ranges corresponding to these three partitioned areas are [0, y1], [y1, y2], and [y2, y3] respectively. Because the original value of the vertical axis of the touch screen is not the value corresponding to the resolution, the algorithm for the y1, y2, and y3 values is to be calculated according to the ratio of the maximum value maxy of the original value of the vertical axis, that is: y1=(1 / 3)·maxy, y2=(2 / 3)·maxy, y3=maxy.
[0133] When the resistive touch screen is divided into three areas along the horizontal axis direction based on preset parameters, it is the same as the above-mentioned case of dividing the resistive touch screen into three areas along the vertical axis direction, and will not be described in detail here.
[0134] The maximum value maxx of the original value on the horizontal axis and the maximum value maxy of the original value on the vertical axis are related to the selected touch chip. For example, the touch chip tsc2007 used for testing is configured as 12 bits, and the maximum value maxx of the original value on the horizontal axis and the maximum value maxy of the original value on the vertical axis are both 4096.
[0135] Further, the effective pressure range corresponding to the first partitioned area Y1 is set to be greater than 0 and less than or equal to the effective pressure experience value P1, and starting from the effective pressure range corresponding to the second partitioned area Y2, the following steps are executed in a loop: the sum of the maximum effective pressure value of the effective pressure range corresponding to the adjacent previous area and the preset pressure value is calculated to obtain the maximum effective pressure value corresponding to the effective pressure range corresponding to the adjacent next area, and the effective pressure range corresponding to the adjacent next area is set to be greater than 0.
[0136] In the embodiment of the present invention, the effective pressure experience value P1 is obtained by summarizing the effective value in the original data of the touch screen, and the effective pressure experience value is greater than or equal to 3600 and less than or equal to 3700. In addition, the preset pressure value can be 100.
[0137] As mentioned above, if the screen is evenly divided into three partitioned areas Y1, Y2, and Y3 along the y-axis, the effective pressure range corresponding to the first partitioned area Y1 is (0, P1], the effective pressure range corresponding to the second partitioned area Y2 is (0, P1+100], and the effective pressure range corresponding to the second partitioned area Y3 is (0, P1+200]).
[0138] So, reference Figure 5 , the above steps also include: the pressure filter module 2 determines the area where the touch point is located based on the touch point coordinates in the sampling value; the pressure filter module 2 determines whether the touch point pressure in the sampling value is within the valid pressure range corresponding to the area. If the touch point pressure in the sampling value is not within the valid pressure range corresponding to the area, the sampling value is discarded, and the loop is executed to sample the touch screen pressure signal for the next preset sampling period. If the touch point pressure in the sampling value is within the valid pressure range corresponding to the area, the corresponding sampling value is determined as the first storage data, and the loop is executed to sample the touch screen pressure signal for the next preset sampling period.
[0139] The pressure filter module 2 stores the first stored data in sequence into the first preset array ts_org and generates a first index.
[0140] Specifically, the valid sampling values corresponding to the first stored data are stored in sequence according to the sampling order.
[0141] In the embodiment of the present invention, in order to further filter out inaccurate touch point values, a median filtering algorithm is used to filter out value points with relatively large deviations.
[0142] refer to Figure 2 When the first preset array is full, the deviation filtering module 3 calculates the median value of the touch point coordinates of each first stored data and performs deviation filtering.
[0143] refer to Figure 6 In executing the above deviation filtering step, first determine whether the first preset array is full. If the first preset array is not full, sample the touch screen press signal in the next preset sampling period according to the preset sampling period, and record the number of sampling times; if the first preset array is full, execute the next step.
[0144] In the actual test process, the bounce process of pressing the touch screen with the fingertips is also very prone to jitter. Because the bounce is a user behavior, the software cannot predict when the user will bounce the touch screen, and it is even more impossible to limit the removal of the reported value within a few milliseconds before the bounce. Therefore, filtering the jitter before the bounce becomes one of the difficulties in accurately filtering the touch screen jump point.
[0145] In the embodiment of the present invention, the second preset threshold is set to determine whether the first preset array is full, specifically, to determine whether the number of stored sample values reaches the second preset threshold. If the number of stored sample values does not reach the second preset threshold, the first preset array is not full, and the execution loop is executed until the touch screen press signal is sampled in the next preset sampling period. If the number of stored sample values reaches the second preset threshold, the first preset array is full.
[0146] In an embodiment of the present invention, the second preset threshold is taken as the maximum storage value of the sampling values of the first preset array. The second preset threshold is used as a condition for the continued execution of the deviation filtering. Only the valid values that have passed the deviation filtering can be reported. At the same time, the preset reporting period is set to be the same as the preset sampling period. In this way, when the resistive touch screen is touched and pressed to bounce back, some of the stored sampling values are still not reported, so as to achieve the goal that the touch point values sampled within a period of time before the bounce are not reported, and the jitter points generated by the pressing and bouncing process are effectively filtered out.
[0147] In the embodiment of the present application, the sampling value generated by the jitter when pressing is directly filtered out by setting the first preset threshold value, and the sampling value of the corresponding touch screen pressing signal is stored in the order of sampling when the sampling number exceeds the first preset threshold value; at the same time, by setting the second preset threshold value, when the number of stored sampling values reaches the second preset threshold value, the deviation filtering is performed on the currently stored first storage data and reported, so that when the resistive touch screen is touched and pressed and bounced, some of the stored sampling values are still not reported, and the jitter points generated by the pressing and bouncing process are filtered out. For the operation of pressing the resistive touch screen with the fingertips, especially the large fingertips pressing the large-size resistive screen for touch operation, the problem of jumping points caused by static electricity caused by the increase of contact surface or friction of gloves when pressing and bouncing is effectively solved, and the accuracy of the reported data is ensured.
[0148] Specifically, when it is necessary to execute a loop to sample the touch screen press signal for the next preset sampling period, the specific steps include: monitoring whether the interrupt signal is canceled; if the interrupt signal is canceled, stopping sampling the touch screen press signal for the next preset sampling period; if the interrupt signal is not canceled, continuing sampling the touch screen press signal for the next preset sampling period.
[0149] refer to Figure 6, the step of performing median filtering on the sampling value by the deviation filtering module 3 also includes: when the first preset array is full, sorting the horizontal coordinate values and the vertical coordinate values in each first storage data stored, respectively, to obtain the sorted first median value and the second median value; calculating the first difference between the horizontal coordinate value and the corresponding first median value and the second difference between the vertical coordinate value and the corresponding second median value in each first storage data; judging whether the first difference and the second difference corresponding to the first storage data are respectively less than or equal to the set first maximum deviation value and the second maximum deviation value; if the first difference corresponding to the current first storage data is less than or equal to the set first maximum deviation value, and the second difference corresponding to the current first storage data is less than or equal to the set second maximum deviation value, then the first storage data is valid data; if the first difference corresponding to the current first storage data is greater than the set first maximum deviation value, or the second difference corresponding to the current first storage data is greater than the set second maximum deviation value, then the first storage data is invalid data.
[0150] Furthermore, the first formula for setting the first maximum deviation value is:
[0151] OFFSET_MAXX=(X resolution / X axis size of resistive touch screen)·(X original value maximum / X resolution)·X maximum deviation distance
[0152] Wherein, OFFSET_MAXX is the first maximum deviation value, X resolution is the horizontal resolution of the resistive touch screen, X original value maximum is the maximum value of the horizontal axis original value of the touch screen, and X maximum deviation distance is the empirical value of the horizontal maximum deviation of the fingertip pressing sampling point.
[0153] In addition, the second formula for setting the second maximum deviation value is:
[0154] OFFSET_MAXY=(Y resolution / Y axis size of resistive touch screen)·(maximum Y original value / Y resolution)·maximum Y deviation distance
[0155] Among them, OFFSET_MAXY is the second maximum deviation value, Y resolution is the vertical resolution of the resistive touch screen, Y original value maximum is the maximum value of the original value of the vertical axis of the touch screen, and Y maximum deviation distance is the empirical value of the vertical maximum deviation of the fingertip pressing sampling point.
[0156] The above-mentioned X maximum deviation distance and Y maximum deviation distance are maximum deviation empirical values taken according to the maximum empirical values of the fingertip range (7 mm, 6 mm). For example, the X maximum deviation distance and the Y maximum deviation distance can be taken as the median of the above-mentioned maximum empirical values of the horizontal direction of the fingertip range and the maximum empirical values of the vertical direction of the fingertip range, that is, the X maximum deviation distance and the Y maximum deviation distance can be taken as 3.5 mm and 3 mm respectively.
[0157] Conventional deviation filtering algorithms obtain the filtering range of jump points according to some empirical values. The above deviation value formula in this application can convert the actual deviation distance into a large range of the corresponding touch point original value, which more effectively limits the actual jump point deviation range scale.
[0158] In an embodiment of the present invention, the above median filtering step may be performed by a deviation filter function.
[0159] refer to Figure 2 , the deviation filtering module 3 identifies the validity of the first stored data using the first identification value based on the deviation filtering result to obtain the second stored data.
[0160] Specifically, the validity of the first stored data is identified by the first identification value filflag, and the first identification value filflag represents the valid position after the median value is filtered. When the corresponding value in the first preset array ts_org is a valid value, the corresponding first identification value filflag is set to 1; when the corresponding value in the first preset array ts_org is an invalid value, the corresponding first identification value filflag is set to 0.
[0161] refer to Figure 2 , the deviation filtering module 3 stores the second stored data into the second preset array in sequence and generates a second index.
[0162] As described above, the validity of the first stored data is identified by using the first identification value filflag to obtain the second stored data. When the corresponding value in the first preset array ts_org is a valid value, the first identification value filflag of the value in the second preset array ts_val of the corresponding index is set to 1, that is, ts_val[i].filflag = 1. When the corresponding value in the first preset array ts_org is an invalid value, the first identification value filflag of the value in the second preset array ts_val of the corresponding index is set to 0, that is, ts_val[i].filflag = 0. Further, a parameter val_count is defined in the deviation filter function to record the number of valid values after deviation filtering.
[0163] In the embodiment of the present invention, before the first reported sampling value is reported, the correction module 4 performs a correction step on the sampling value.
[0164] refer to Figure 2 When the correction module 4 performs the correction step on the sample value, the value of a preset flag is first initialized to 1. In this way, when the value of the flag is 1, the first several invalid values in the second preset array are respectively corrected to the first valid value in the array to obtain the third stored data.
[0165] refer to Figure 7, the above steps specifically include: based on the first identification value filflag, querying the index value of the second index corresponding to the first valid value from the second preset array ts_val; assigning the queried index value to the second identification value filflag_index; performing loop shifting on each second storage data in turn according to the second index to obtain the corresponding third storage data; judging whether the current loop number i exceeds the second identification value filflag_index during the loop shifting execution; if the current loop number i does not exceed the second identification value filflag_index, that is, i is less than or equal to filfiag_index, assigning the third storage data to the second storage data corresponding to the second identification value filflag_index, and updating the first identification value filflag of the third storage data to the first identification value filflag of the second storage data corresponding to the second identification value filflag_index; if the current loop number i exceeds the second identification value filflag_index, that is, i is greater than filfiag_index, assigning the third storage data to the second storage data indexed by the index value corresponding to the current loop number i, and determining the first identification value filflag of the third storage data to be the first identification value filflag of the second storage data indexed by the index value corresponding to the current loop number i.
[0166] refer to Figure 2 The step of performing the correction on the sample value by the correction module 4 also includes: storing the third stored data in sequence into the third preset array ts_fil2 and generating a third index.
[0167] In an embodiment of the present invention, the above correction step can be performed by a correction function, and the correction function records the input array as ts_fil, and records the third preset array after correction as ts_fil2. The purpose of the correction function is to correct the first few invalid values in the filtered array to the first valid value of the filtered array when the first few values are invalid. In this way, when too many invalid values are encountered during the first report, the first valid value of the filtered array is corrected to be reported, avoiding the screen freeze caused by a long period of no reporting events.
[0168] refer to Figure 2 The reporting module 5 sequentially takes the index values of the third index according to the preset reporting period which is the same as the preset sampling period, and reports the third stored data marked as valid by the corresponding first identification value.
[0169] refer to Figure 8, the specific steps of reporting after the sampling value is shifted as described above include: based on a preset static variable fil_index, according to the preset reporting period that is the same as the preset sampling period, sequentially taking the index value of the third index as the reported index value; judging whether the first identification value filflag of the third stored data corresponding to the current index value taken by the static variable fil_index is 1; if the first identification value filflag of the third stored data corresponding to the current index value taken by the static variable fil_index is 1, then reporting the third stored data corresponding to the current index value in the third preset array ts_fil2; if the first identification value filflag of the third stored data corresponding to the current index value taken by the static variable fil_index is 0, it indicates that the third stored data is invalid, and the third stored data corresponding to the current index value in the third preset array ts_fil2 is discarded and not reported. At this time, there is no reporting event in the corresponding reporting period, but the reporting display will still remain in the valid touch point position state reported last time.
[0170] Further, refer to Figure 8 , according to the above, the specific steps of shifting the remaining sampling values forward by one position for storage update after reporting the first currently stored sampling value include: after reporting or discarding the third storage data corresponding to the current index value in the third preset array ts_fil2, accumulating the current index value taken by the static variable fil_index by 1 to obtain the next index value taken by the static variable fil_index; judging whether the next index value is the last index value of the third index; if the next index value is the last index value of the third index, setting the flag bit and the value of the static variable fil_index to 0; if the next index value is not the last index value of the third index, looping to judge whether the first identification value filflag of the third storage data corresponding to the next index value taken by the static variable fil_index is 1.
[0171] In an embodiment of the present invention, before reporting the first currently stored sampling value, if the reported sampling value is not the first time reporting the value in the stored data group, there is no need to correct the sampling value, and the reporting module 3 directly executes the step of reporting the sampling value.
[0172] refer to Fig. 9The specific steps of directly reporting the sampling value without shifting include: when the value of the flag bit is 0, based on a preset static variable fil_index, according to a preset reporting period that is the same as the preset sampling period, the index values of the second index are taken in sequence as the reported index values; it is determined whether the first identification value filflag of the second stored data corresponding to the current index value taken by the static variable fil_index is 1; if the first identification value filflag of the second stored data corresponding to the current index value taken by the static variable fil_index is 1, the second stored data corresponding to the current index value in the second preset array ts_val is reported; if the first identification value filflag of the second stored data corresponding to the current index value taken by the static variable fil_index is 0, the second stored data corresponding to the current index value in the second preset array ts_val is discarded and not reported.
[0173] Further, refer to Fig. 9 , according to the above, the specific steps of shifting the remaining sampling values forward by one position for storage update after reporting the first currently stored sampling value include: after reporting or discarding the second storage data corresponding to the current index value in the second preset array ts_val, accumulating 1 into the current index value taken by the static variable fil_index to obtain the next index value taken by the static variable fil_index; judging whether the next index value is the last index value of the second index; if the next index value is the last index value of the second index, setting the value of the static variable to 0; if the next index value is not the last index value of the second index, looping to judge whether the first identification value filflag of the second storage data corresponding to the next index value taken by the static variable fil_index is 1.
[0174] In addition, an embodiment of the present invention further provides a touch screen anti-jumping device, the device comprising: a processor and a memory; the memory is used to store one or more program instructions; the processor is used to run one or more program instructions to execute the steps of a touch screen anti-jumping method as described in any of the above items.
[0175] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a touch screen anti-jumping method as described in any one of the above items are implemented.
[0176] In the embodiment of the present invention, the processor may be an integrated circuit chip having the signal processing capability. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0177] The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The processor reads the information in the storage medium and completes the steps of the above method in combination with its hardware.
[0178] The storage medium may be a memory, which may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.
[0179] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
[0180] The volatile memory may be a random access memory (RAM) which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM).
[0181] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.
[0182] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media can be any available media that can be accessed by general or special-purpose computers.
[0183] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.
Claims
1. A touch screen anti-jump method, characterized in that: The method comprises: Collecting touch screen pressing signals according to a preset sampling period; Performing pressure filtering on each sampling value in the touch screen pressure signal to obtain first storage data; Storing the first stored data in sequence into a first preset array and generating a first index; When the first preset array is full, calculating the median value of the touch point coordinates of each first stored data and performing deviation filtering; Based on the deviation filtering result, using the first identification value to identify the validity of the first stored data, to obtain second stored data; Storing the second stored data in sequence into a second preset array and generating a second index; Initialize the value of a pre-set flag bit to 1; When the value of the flag bit is 1, the first several invalid values in the second preset array are respectively corrected to the first valid value in the array to obtain third stored data; Storing the third stored data in sequence into a third preset array and generating a third index; According to a preset reporting period that is the same as the preset sampling period, index values of the third index are sequentially obtained, and third stored data identified as valid by the corresponding first identification value is reported.
2. A touch screen anti-jump method as claimed in claim 1, characterized in that: Based on the deviation filtering result, the validity of the first stored data is identified by using the first identification value to obtain the second stored data, including: When the first stored data is valid data, the corresponding first identification value is set to 1; When the first stored data is invalid data, the corresponding first identification value is set to 0.
3. A touch screen anti-jump method as claimed in claim 1, characterized in that: Correcting the first several invalid values in the second preset array to the first valid value in the array respectively, to obtain third stored data, including: Based on the first identification value, query the index value of the second index corresponding to the first valid value from the second preset array; Assign the queried index value to the second identification value; Perform cyclic shift on each second stored data in sequence according to the second index to obtain corresponding third stored data; During the loop shift execution, determining whether the current loop count exceeds the second identification value; If the current number of cycles does not exceed the second identification value, assigning the third stored data to the second stored data corresponding to the second identification value, and updating the first identification value of the third stored data to the first identification value of the second stored data corresponding to the second identification value; If the current number of loops exceeds the second identification value, the third stored data is assigned to the second stored data indexed by the index value corresponding to the current number of loops, and the first identification value of the third stored data is determined as the first identification value of the second stored data indexed by the index value corresponding to the current number of loops.
4. A touch screen anti-jump method as claimed in claim 3, characterized in that: Sequentially taking the index values of the third index and reporting the third stored data corresponding to the first identification value as valid, including: Based on a preset static variable, sequentially taking the index values of the third index as the reported index values; Determine whether the first identification value of the third stored data corresponding to the current index value taken by the static variable is 1; If the first identification value of the third stored data corresponding to the current index value taken by the static variable is 1, the third stored data corresponding to the current index value in the third preset array is reported, and the current index value taken by the static variable is accumulated by 1 to obtain the next index value taken by the static variable; Determine whether the next index value is the last index value of the third index; If the next index value is the last index value of the third index, the flag bit and the static variable are both set to 0; If the next index value is not the last index value of the third index, the process loops to determine whether the first identification value of the third stored data corresponding to the next index value taken by the static variable is 1.
5. A touch screen anti-jump method as claimed in claim 4, characterized in that: Sequentially taking the index values of the third index, and reporting the third stored data corresponding to the first identification value identified as valid, further comprising: If the first identification value of the third stored data corresponding to the current index value taken by the static variable is 0, the third stored data corresponding to the current index value in the third preset array is discarded without being reported, and the current index value taken by the static variable is accumulated by 1 to obtain the next index value taken by the static variable; Determine whether the next index value is the last index value of the third index; If the next index value is the last index value of the third index, the flag bit and the static variable are both set to 0; If the next index value is not the last index value of the third index, the process loops to determine whether the first identification value of the third stored data corresponding to the next index value taken by the static variable is 1.
6. A touch screen anti-jump method as claimed in claim 5, characterized in that: The method further comprises: When the value of the flag bit is 0, based on a preset static variable, according to a preset reporting period that is the same as the preset sampling period, the index values of the second index are sequentially taken as the reported index values; Determine whether the first identification value of the second stored data corresponding to the current index value taken by the static variable is 1; If the first identification value of the second stored data corresponding to the current index value taken by the static variable is 1, the second stored data corresponding to the current index value in the second preset array is reported, and the current index value taken by the static variable is accumulated by 1 to obtain the next index value taken by the static variable; Determine whether the next index value is the last index value of the second index; If the next index value is the last index value of the second index, setting the value of the static variable to 0; If the next index value is not the last index value of the second index, the process loops to determine whether the first identification value of the second stored data corresponding to the next index value taken by the static variable is 1.
7. A touch screen anti-jump method as claimed in claim 6, characterized in that: The method further comprises: If the first identification value of the second stored data corresponding to the current index value taken by the static variable is 0, the second stored data corresponding to the current index value in the second preset array is discarded without being reported, and the current index value taken by the static variable is accumulated by 1 to obtain the next index value taken by the static variable; Determine whether the next index value is the last index value of the second index; If the next index value is the last index value of the second index, setting the value of the static variable to 0; If the next index value is not the last index value of the second index, the process loops to determine whether the first identification value of the second stored data corresponding to the next index value taken by the static variable is 1.
8. A touch screen anti-jump point system, characterized in that: The system comprises: A sampling module, used to collect touch screen pressing signals according to a preset sampling period; A pressure filtering module, configured to perform pressure filtering on each sample value in the touch screen pressure signal to obtain first storage data; and sequentially store the first storage data into a first preset array and generate a first index; a deviation filtering module, configured to calculate the median value of the touch point coordinates of each first stored data and perform deviation filtering when the first preset array is full; based on the deviation filtering result, identify the validity of the first stored data using the first identification value to obtain second stored data; and store the second stored data in the second preset array in sequence and generate a second index; A correction module, used for initializing the value of a preset flag bit to 1; when the value of the flag bit is 1, correcting the first several invalid values in the second preset array to the first valid value in the array, respectively, to obtain third stored data; storing the third stored data in the third preset array in sequence and generating a third index; The reporting module is used to sequentially obtain the index values of the third index according to a preset reporting period that is the same as the preset sampling period, and report the third stored data that is marked as valid by the corresponding first identification value.
9. A touch screen anti-jump point device, characterized in that: The device comprises: a processor and a memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the steps of a touch screen anti-jump method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the touch screen anti-jump method as claimed in any one of claims 1 to 7 are implemented.
