A resistive touch screen signal filtering method, system, device and storage medium
By using a ring queue array and preset condition judgment method in the resistive touch screen, the jump points and position inaccurate during operation of medical staff are solved, efficient signal filtering and accurate position reporting are achieved, and the risk of equipment misoperation is reduced.
Patent Information
- Application Number
- CN202411977341.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-12-31
AI Technical Summary
When medical staff use large-size resistive touch screens, they are prone to problems such as jumping points and inaccurate pressing position values, resulting in high risk of misoperation of equipment.
The ring queue array is used to store the touch point sample value. When each sample value is stored, the absolute value difference of the horizontal coordinate and the absolute value difference of the vertical coordinate between the current touch point and the stored touch point are calculated, the number of valid points is judged based on the preset conditions, and the validity of the sample value is determined.
Accurately filter the touch screen jump points to accurately report the touch press position value, reducing the risk of equipment misoperation, reducing filtering delay, and improving real-time.
Smart Images

Figure CN119376577B_ABST
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 resistive touch screen signal filtering method, system, device and storage medium. Background Art
[0002] Extracorporeal Membrane Oxygenation (ECMO) equipment is a high-risk medical device used for extracorporeal life support. When using a large-size resistive touch screen, medical staff pressing the screen with their fingertips is prone to cause point jumps and inaccurate pressing position values, leading to a high risk of device misoperation, which can easily cause psychological pressure on medical staff and doubts about the safety and stability of the equipment.
[0003] There are two common effective point filtering methods in the market: one is to use the average value for filtering, and the other is to compare the deviations of several adjacent sampling points for filtering. In the case of serious touch screen point jumps, both of these filtering methods will cause inaccurate filtering. Summary of the invention
[0004] To this end, the embodiments of the present invention provide a resistive touch screen signal filtering method, system, device and storage medium to solve the technical problem that medical staff easily cause point jumps and inaccurate pressing position values when pressing a large-sized resistive touch screen with their fingertips.
[0005] In order to achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] According to a first aspect of an embodiment of the present invention, an embodiment of the present application provides a resistive touch screen signal filtering method, the method comprising:
[0007] Collecting touch screen pressing signals according to a preset sampling period;
[0008] The touch point sampling values in the touch screen pressing signal are sequentially stored in a circular queue array;
[0009] Taking the touch point sampling value stored before the current touch point sampling value as the first reference point sampling value;
[0010] Using the current touch point sampling value and each first reference point sampling value, calculate the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate one by one;
[0011] Determine whether the current first horizontal coordinate absolute value difference and the corresponding first vertical coordinate absolute value difference meet a first preset condition;
[0012] If the absolute value difference of the current first horizontal coordinate and the absolute value difference of the corresponding first vertical coordinate meet the first preset condition, the number of valid points corresponding to the current touch point is increased by 1, otherwise the number of valid points corresponding to the current touch point remains unchanged;
[0013] Determine whether there is an uncalculated first reference point sampling value in the circular queue array;
[0014] If there is an uncalculated first reference point sampling value in the circular queue array, using the current touch point sampling value and the next first reference point sampling value to calculate the first horizontal coordinate absolute value difference and the first vertical coordinate absolute value difference;
[0015] If there is no uncalculated first reference point sampling value in the circular queue array, obtaining the final valid point number corresponding to the current touch point sampling value, and determining whether the final valid point number is less than the first preset parameter;
[0016] If the final number of valid points is greater than or equal to the first preset parameter, determining the current touch point sampling value as a valid value;
[0017] If the final number of valid points is less than the first preset parameter, it is determined that the current touch point sampling value is an invalid value.
[0018] Furthermore, the first preset condition is that the absolute value difference of the first horizontal coordinate is less than or equal to a first preset threshold and the corresponding absolute value difference of the first vertical coordinate is less than or equal to a second preset threshold.
[0019] Furthermore, collecting the touch screen pressing signal according to a preset sampling period includes:
[0020] Real-time monitoring of interrupt signals generated by touch screen pressing;
[0021] If no interrupt signal is detected, continue to monitor the interrupt signal generated by the touch screen pressing in real time;
[0022] If an interrupt signal is detected, a preset interrupt function is entered to collect touch point sampling values according to a preset sampling period to obtain a touch screen pressing signal.
[0023] Furthermore, each touch point sampling value in the touch screen pressure signal is sequentially stored in a circular queue array, including:
[0024] Initializing the circular queue array;
[0025] Each time a touch point sampling value is sampled, the current touch point sampling value is stored in the storage bit corresponding to the current index value of the initialized circular queue array;
[0026] Determine whether the current index value reaches the maximum index value; wherein the maximum index value is the value of the preset array length of the circular queue array minus 1;
[0027] If the current index value reaches the maximum index value, the current index value is set to 0 and updated to the next index value;
[0028] If the current index value does not reach the maximum index value, the current index value is increased by 1 and updated to the next index value.
[0029] Furthermore, the touch point sampling values in the touch screen pressure signal are sequentially stored in a circular queue array, further comprising:
[0030] After the current index value is updated to the next index value, monitoring whether the interrupt signal is cancelled;
[0031] If the interrupt signal is cancelled, the touch screen pop-up process is executed, the interrupt function is exited, and the interrupt signal generated by the touch screen pressing is continued to be monitored in real time;
[0032] If the interrupt signal is not cancelled, the touch screen pressing signal continues to be sampled in the next preset sampling period.
[0033] Furthermore, the preset array length of the circular queue array is greater than or equal to 5 and less than or equal to 9, and the first preset parameter is greater than or equal to a first difference and less than or equal to a second difference; wherein, the first difference is the value of the preset array length minus 3, and the second difference is the value of the preset array length minus 1.
[0034] Furthermore, the method further comprises:
[0035] Using the current touch point sampling value and each first reference point sampling value, the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate are calculated one by one, including:
[0036] Initialize the valid points to 0;
[0037] Obtaining a first horizontal coordinate and a first vertical coordinate from the current touch point sampling value;
[0038] Taking the index value corresponding to the current touch point sampling value in the circular queue array as the target point index value;
[0039] Taking the index value corresponding to the previous index value of the target point in the circular queue array as the first reference point index value;
[0040] Determine whether the first reference point index value has a corresponding touch point sampling value in the circular queue array;
[0041] If there is no corresponding touch point sampling value for the first reference point index value in the circular queue array, exiting the loop calculation of the first horizontal coordinate absolute value difference and the first vertical coordinate absolute value difference;
[0042] If there is a corresponding touch point sampling value for the first reference point index value in the circular queue array, determining whether the current first reference point index value is equal to the target point index value;
[0043] If the current first reference point index value is equal to the target point index value, then exiting the loop calculation of the first horizontal coordinate absolute value difference and the first vertical coordinate absolute value difference;
[0044] If the current first reference point index value is not equal to the target point index value, taking the touch point sampling value corresponding to the current first reference point index value as the current first reference point sampling value, and obtaining the second abscissa and the second ordinate from the current first reference point sampling value;
[0045] The first abscissa absolute value difference is calculated using the first abscissa and the second abscissa, and the first ordinate absolute value difference is calculated using the first ordinate and the second ordinate.
[0046] Furthermore, the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate are calculated using the current touch point sampling value and the next first reference point sampling value, including: taking the corresponding index value before the current first reference point index value in the circular queue array as the updated first reference point index value, and looping to determine whether there is a corresponding touch point sampling value in the circular queue array after the updated first reference point index value.
[0047] Furthermore, a resistive touch screen signal filtering method disclosed in an embodiment of the present invention further includes:
[0048] After entering the interrupt function, assigning the reported identification value to an invalid value;
[0049] When the current touch point sampling value is determined to be an invalid value, no reporting event is triggered;
[0050] When the current touch point sampling value is determined to be a valid value, a reporting event is triggered;
[0051] Determining whether a touch point sampling value has been reported before based on the reported identification value;
[0052] If the reported identification value is a valid assignment, it means that the touch point sampling value has been reported before, and the current touch point sampling value is directly reported, and the touch screen pressing signal is collected according to the preset sampling period in a cycle;
[0053] If the reported identification value is an invalid value, it means that the touch point sampling value has not been reported before, and all valid values in the circular queue array are reported, and the touch screen pressing signal is collected according to the preset sampling period in a loop;
[0054] Set the reported identification value assignment to a valid assignment.
[0055] Furthermore, a resistive touch screen signal filtering method disclosed in an embodiment of the present invention further includes:
[0056] When performing touch screen pop-up processing, judging whether the touch point sampling value has been reported before based on the reported identification value;
[0057] If the reported identification value is a valid assignment, it is determined that the touch point sampling value has been reported before, and the interrupt function is directly exited;
[0058] If the reported identification value is an invalid assignment, it is determined that the touch point sampling value has not been reported before, the final maximum value of the valid points of the valid values in the current circular queue array is obtained, and the touch point sampling value corresponding to the final maximum value of the valid points is determined as the second reference point sampling value;
[0059] Determine whether the maximum value of the final valid points is greater than a second preset parameter;
[0060] If the final maximum value of the valid points is less than or equal to the second preset parameter, directly exit the interrupt function;
[0061] If the final maximum value of the number of valid points is greater than the second preset parameter, taking the stored touch point sampling values except the second reference point sampling value as the third reference point sampling value;
[0062] Using the second reference point sampling value and each third reference point sampling value, calculate the absolute value difference of the second horizontal coordinate and the absolute value difference of the second vertical coordinate one by one;
[0063] Determine whether the current second horizontal coordinate absolute value difference and the corresponding second vertical coordinate absolute value difference meet the second preset condition;
[0064] If the current second horizontal coordinate absolute value difference and the corresponding second vertical coordinate absolute value difference meet the second preset condition, the corresponding touch point sampling value and the second reference point sampling value are reported; otherwise, the corresponding touch point sampling value is not reported.
[0065] Furthermore, the second preset condition is that the absolute value difference of the second horizontal coordinate is less than or equal to the first preset threshold and the corresponding absolute value difference of the second vertical coordinate is less than or equal to the second preset threshold.
[0066] According to a second aspect of an embodiment of the present invention, an embodiment of the present application provides a resistive touch screen signal filtering system, the system comprising:
[0067] A sampling module, used to collect touch screen pressing signals according to a preset sampling period;
[0068] A storage module, used for storing the touch point sampling values in the touch screen pressure signal into a circular queue array in sequence;
[0069] The filter module performs the following steps:
[0070] Taking the touch point sampling value stored before the current touch point sampling value as the first reference point sampling value;
[0071] Using the current touch point sampling value and each first reference point sampling value, calculate the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate one by one;
[0072] Determine whether the current first horizontal coordinate absolute value difference and the corresponding first vertical coordinate absolute value difference meet a first preset condition;
[0073] If the absolute value difference of the current first horizontal coordinate and the absolute value difference of the corresponding first vertical coordinate meet the first preset condition, the number of valid points corresponding to the current touch point is increased by 1, otherwise the number of valid points corresponding to the current touch point remains unchanged;
[0074] Determine whether there is an uncalculated first reference point sampling value in the circular queue array;
[0075] If there is an uncalculated first reference point sampling value in the circular queue array, using the current touch point sampling value and the next first reference point sampling value to calculate the first horizontal coordinate absolute value difference and the first vertical coordinate absolute value difference;
[0076] If there is no uncalculated first reference point sampling value in the circular queue array, obtaining the final valid point number corresponding to the current touch point sampling value, and determining whether the final valid point number is less than the first preset parameter;
[0077] If the final number of valid points is greater than or equal to the first preset parameter, determining the current touch point sampling value as a valid value;
[0078] If the final number of valid points is less than the first preset parameter, it is determined that the current touch point sampling value is an invalid value.
[0079] According to a third aspect of an embodiment of the present invention, a resistive touch screen signal filtering device is provided, the device comprising: a processor and a memory;
[0080] The memory is used to store one or more program instructions;
[0081] The processor is used to run one or more program instructions to execute the steps of the resistive touch screen signal filtering method as described in any one of the above items.
[0082] 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 resistive touch screen signal filtering method as described in any one of the above items are implemented.
[0083] Compared with the prior art, the resistive touch screen signal filtering method, system, device and storage medium provided by the embodiment of the present application use a circular queue array to store each touch point sampling value. When storing each touch point sampling value, the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate between the current touch point and the stored touch points are calculated; if the current absolute value difference of the first horizontal coordinate and the corresponding absolute value difference of the first vertical coordinate meet the first preset condition, the number of valid points corresponding to the current touch point is increased by 1, otherwise the number of valid points remains unchanged; after the comparison of all touch point sampling values in the queue is completed, if the final number of valid points reaches the first preset parameter, the current touch point sampling value is a valid value. The embodiment of the present invention is applicable to the field of medical equipment, can accurately filter touch screen jump points, accurately report the touch press position value, and reduce the risk of equipment misoperation. By pre-setting the effective point limit value for comparison and filtering, more jump points can be filtered out when the touch screen jump point problem is more serious; compared with the filtering algorithm with delay in the industry, the filtering effect of the embodiment of the present invention can reduce delay and has high real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] 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.
[0085] 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.
[0086] Figure 1 A schematic diagram of the logical structure of a resistive touch screen signal filtering system provided by an embodiment of the present invention;
[0087] Figure 2 A schematic flow chart of a resistive touch screen signal filtering method provided by an embodiment of the present invention;
[0088] Figure 3 A 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;
[0089] Figure 4 A schematic diagram of a process for sequentially storing the touch point sampling values in the touch screen pressure signal into a circular queue array provided by an embodiment of the present invention;
[0090] Figure 5 A schematic diagram of a flow chart of calculating the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate one by one by using the current touch point sampling value and each first reference point sampling value provided by an embodiment of the present invention;
[0091] Figure 6 A schematic flow chart of a resistive touch screen signal filtering method when performing touch screen pop-up processing is provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0092] 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.
[0093] The purpose of the embodiment of the present invention is to use a storage method of a circular queue array to filter out jump points with relatively large deviations and sampling values with inaccurate pressing position values when a large-sized resistive touch screen is pressed with a fingertip.
[0094] In order to solve the above technical problems, Figure 1 As shown, an embodiment of the present application provides a resistive touch screen signal filtering system, which is applied to medical equipment, especially ECMO (Extracorporeal Membrane Oxygenation) equipment.
[0095] Specifically, a resistive touch screen signal filtering system provided in an embodiment of the present application includes: a sampling module 1 , a storage module 2 and a filtering module 3 .
[0096] The sampling module 1 is used to collect the touch screen pressure signal according to a preset sampling period.
[0097] The storage module 2 is used to store the touch point sampling values in the touch screen pressure signal into the circular queue array in sequence.
[0098] The filtering module 3 is used to perform the following steps:
[0099] Taking the touch point sampling value stored before the current touch point sampling value as the first reference point sampling value;
[0100] Using the current touch point sampling value and each first reference point sampling value, calculate the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate one by one;
[0101] Determine whether the current first horizontal coordinate absolute value difference and the corresponding first vertical coordinate absolute value difference meet a first preset condition;
[0102] If the absolute value difference of the current first horizontal coordinate and the absolute value difference of the corresponding first vertical coordinate meet the first preset condition, the number of valid points corresponding to the current touch point is increased by 1, otherwise the number of valid points corresponding to the current touch point remains unchanged;
[0103] Determine whether there is an uncalculated first reference point sampling value in the circular queue array;
[0104] If there is an uncalculated first reference point sampling value in the circular queue array, the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate are calculated using the current touch point sampling value and the next first reference point sampling value;
[0105] If there is no uncalculated first reference point sampling value in the circular queue array, obtaining the final valid point number corresponding to the current touch point sampling value, and determining whether the final valid point number is less than the first preset parameter;
[0106] If the final number of valid points is greater than or equal to the first preset parameter, determining the current touch point sampling value as a valid value;
[0107] If the final number of valid points is less than the first preset parameter, it is determined that the current touch point sampling value is an invalid value.
[0108] Compared with the prior art, the resistive touch screen signal filtering system provided by the embodiment of the present application uses a circular queue array to store the sampling values of each touch point. When storing each touch point sampling value, the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate between the current touch point and the stored touch points are calculated; if the current absolute value difference of the first horizontal coordinate and the corresponding absolute value difference of the first vertical coordinate meet the first preset condition, the number of valid points corresponding to the current touch point is increased by 1, otherwise the number of valid points remains unchanged; after the comparison of all touch point sampling values in the queue is completed, if the final number of valid points reaches the first preset parameter, the current touch point sampling value is a valid value. The embodiment of the present invention is applicable to the field of medical equipment, can accurately filter touch screen jump points, realize accurate reporting of touch press position values, and reduce the risk of equipment misoperation.
[0109] Corresponding to the resistive touch screen signal filtering system disclosed above, the embodiment of the present invention further discloses a resistive touch screen signal filtering method. The resistive touch screen signal filtering method disclosed in the embodiment of the present invention is described in detail below in combination with the resistive touch screen signal filtering system described above.
[0110] like Figure 2 As shown, the specific steps of a resistive touch screen signal filtering method provided by an embodiment of the present application are described in detail below.
[0111] An embodiment of the present application provides a resistive touch screen signal filtering method, which is applied to medical equipment, especially ECMO (Extracorporeal Membrane Oxygenation) equipment.
[0112] The touch screen pressing signal is collected by the sampling module 1 according to a preset sampling period.
[0113] In one embodiment of the present invention, the preset sampling period can be set to 1 ms, so that after entering the touch screen interrupt function, the touch screen original value is sampled every 1 ms, and the touch screen original value is the touch point sampling value.
[0114] refer to Figure 3 The above-mentioned step of sampling the touch screen pressure signal specifically includes: real-time monitoring of the interrupt signal generated by the touch screen pressure; if no interrupt signal is detected, continuing to monitor the interrupt signal generated by the touch screen pressure in real time; if an interrupt signal is detected, entering a pre-set interrupt function, and collecting touch point sampling values according to a preset sampling period to obtain a touch screen pressure signal.
[0115] Furthermore, the interrupt signal generated by pressing the touch screen is monitored in real time, including: real-time detection of the touch screen interrupt pin level; if the touch screen interrupt pin level is high, it is determined that the interrupt signal is not detected, and the touch screen interrupt pin level continues to be detected in real time; if the touch screen interrupt pin level is low, it is determined that the interrupt signal is detected, and the preset interrupt function is entered.
[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 and enters the pre-set interrupt function.
[0117] The storage module 2 stores the sampling values of each touch point in the touch screen pressure signal into the circular queue array in sequence.
[0118] refer to Figure 4 The above-mentioned step of using the circular queue array to store the touch point sampling values specifically includes: initializing the circular queue array; each time a touch point sampling value is sampled, the current touch point sampling value is stored in the storage bit corresponding to the current index value of the initialized circular queue array.
[0119] In the embodiment of the present invention, the tscFilterArray array is specifically used as a circular queue for storing the sampled touch point sample values. The length of the tscFilterArray array is set to MAX_P. Preferably, the preset array length of the circular queue array is greater than or equal to 5 and less than or equal to 9, that is, the value range of MAX_P can be set to be greater than or equal to 5 and less than or equal to 9. More preferably, the preset array length of the circular queue array is 6.
[0120] If the preset array length of the circular queue array is too short, the number of first reference point sampling values for comparison will be too small, so too many jump points will be missed in filtering, and the screen jump rate will still be high. If the preset array length of the circular queue array is too long, the storage time interval between the current touch point sampling value and the last touch point sampling value in the circular queue array that is farthest from the current touch point sampling value will be too long. In this case, the large deviation in the comparison result is not necessarily caused by jump points. Therefore, considering the above situation, it is more appropriate to set the preset array length MAX_P of the circular queue array to be greater than or equal to 5 and less than or equal to 9.
[0121] Next, determine whether the current index value reaches the maximum index value; where the maximum index value is the preset array length of the circular queue array minus 1; if the current index value reaches the maximum index value, set the current index value to 0 and update it to the next index value; if the current index value does not reach the maximum index value, increase the current index value by 1 and update it to the next index value.
[0122] Specifically, for example, filterIdx is taken as the current index value of the circular queue array. When entering the interrupt function, filterIdx is initialized to 0. Each time a touch point sampling value is sampled, the value of filterIdx is updated to the next index. If filterIdx is less than MAX_P minus 1, filterIdx is updated to filterIdx + 1. If filterIdx is greater than or equal to MAX_P minus 1, filterIdx is set to 0.
[0123] As mentioned above, the touch point sampling values are stored in the circular queue array tscFilterArray. The preset array length of the circular queue array is set to MAX_P. The index value of the current touch point sampling value is filterIdx. In the initial stage of sampling the touch point sampling values, each time a touch point sampling value is sampled, the current touch point sampling value is saved in the circular queue array tscFilterArray at the position corresponding to the index value filterIdx, and then the index value filterIdx is incremented by 1.
[0124] The direction of the circular queue array is bidirectional. The forward direction of the circular queue array described in the embodiment of the present invention is the direction in which the index value decreases in sequence. When the index is 0, the next forward index value is the maximum index value in the circular queue array (i.e., the index value of MAX_P minus 1). The backward direction of the circular queue array is the direction in which the index value increases in sequence. When the index is the maximum index value in the circular queue array (i.e., the index value of MAX_P minus 1), the next backward index value is the index value 0 of the head in the circular queue array. The index values of the circular queue array are 0, 1, 2, ..., MAX_P-1.
[0125] In addition, the above-mentioned step of using a circular queue array to store touch point sampling values also includes: after updating the current index value to the next index value, monitoring whether the interrupt signal is canceled; if the interrupt signal is canceled, executing the touch screen pop-up processing, exiting the interrupt function, and continuing to monitor the interrupt signal generated by the touch screen press in real time; if the interrupt signal is not canceled, continuing to sample the touch screen press signal for the next preset sampling period.
[0126] The filtering module 3 takes the touch point sampling value stored before the current touch point sampling value as the first reference point sampling value.
[0127] The filtering module 3 uses the current touch point sampling value and each first reference point sampling value to calculate the first horizontal coordinate absolute value difference and the first vertical coordinate absolute value difference one by one.
[0128] refer to Figure 5 The above-mentioned loop calculation steps of the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate specifically include: initializing the number of valid points to 0; obtaining the first horizontal coordinate and the first vertical coordinate from the current touch point sampling value; taking the index value corresponding to the current touch point sampling value in the circular queue array as the target point index value; taking the index value corresponding to the previous target point index value in the circular queue array as the first reference point index value; judging whether there is a corresponding touch point sampling value in the circular queue array for the first reference point index value; if there is no corresponding touch point sampling value in the circular queue array for the first reference point index value, then exiting the loop calculation of the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate; if there is no corresponding touch point sampling value in the circular queue array for the first reference point index value, then exiting the loop calculation of the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate; if there is no corresponding touch point sampling value in the circular queue array If there is a corresponding touch point sampling value for the first reference point index value in the column array, determine whether the current first reference point index value is equal to the target point index value; if the current first reference point index value is equal to the target point index value, exit the loop calculation of the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate; if the current first reference point index value is not equal to the target point index value, use the touch point sampling value corresponding to the current first reference point index value as the current first reference point sampling value, and obtain the second horizontal coordinate and the second vertical coordinate from the current first reference point sampling value; use the first horizontal coordinate and the second horizontal coordinate to calculate the absolute value difference of the first horizontal coordinate, and use the first vertical coordinate and the second vertical coordinate to calculate the absolute value difference of the first vertical coordinate.
[0129] Thus, as described above, in an embodiment of the present invention, the above-mentioned use of the current touch point sampling value and the next first reference point sampling value to calculate the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate specifically includes: taking the corresponding index value before the current first reference point index value in the circular queue array as the updated first reference point index value, and looping to determine whether there is a corresponding touch point sampling value in the updated first reference point index value in the circular queue array.
[0130] The filtering module 3 determines whether the current first horizontal coordinate absolute value difference and the corresponding first vertical coordinate absolute value difference meet the first preset condition.
[0131] Specifically, in the embodiment of the present invention, the first preset condition is that the absolute value difference of the first horizontal coordinate is less than or equal to the first preset threshold and the corresponding absolute value difference of the first vertical coordinate is less than or equal to the second preset threshold.
[0132] If the absolute value difference of the current first horizontal coordinate and the absolute value difference of the corresponding first vertical coordinate meet the first preset condition, the number of valid points corresponding to the current touch point is increased by 1.
[0133] If the current first horizontal coordinate absolute value difference and the corresponding first vertical coordinate absolute value difference do not meet the first preset condition, the number of valid points corresponding to the current touch point remains unchanged.
[0134] The filtering module 3 determines whether there is any uncalculated first reference point sampling value in the circular queue array.
[0135] If there are uncalculated first reference point sampling values in the circular queue array, the first horizontal coordinate absolute value difference and the first vertical coordinate absolute value difference are calculated using the current touch point sampling value and the next first reference point sampling value.
[0136] If there is no uncalculated first reference point sampling value in the circular queue array, the final valid point number corresponding to the current touch point sampling value is obtained.
[0137] The filtering module 3 determines whether the final number of valid points is less than the first preset parameter.
[0138] In an embodiment of the present invention, the first preset parameter is greater than or equal to the first difference and less than or equal to the second difference, wherein the first difference is the value of the preset array length minus 3, and the second difference is the value of the preset array length minus 1.
[0139] If the final number of valid points is greater than or equal to the first preset parameter, it is determined that the current touch point sampling value is a valid value.
[0140] If the final number of valid points is less than the first preset parameter, it is determined that the current touch point sampling value is an invalid value.
[0141] Specifically, slidecount is used as the valid number of points, which can also be called the valid sliding number. Before comparing the current touch point sampling value with the first reference point sampling value in the circular queue array, slidecount is initialized to 0. Take preIdx as the first reference point index value corresponding to the first reference point sampling value in the circular queue array, and initialize slidecount to 0 while initializing preIdx to the previous index value filterIdx corresponding to the current touch point sampling value, that is, when filterIdx is not 0, preIdx = filterIdx–1, and when filterIdx is equal to 0, preIdx=MAX_P–1.
[0142] Next, determine whether there is a corresponding touch point sampling value at the preIdx index position in the circular queue array; if there is no corresponding touch point sampling value with index preIdx in the circular queue array, or the horizontal coordinate x and vertical coordinate y of the touch point with index preIdx in the circular queue array are both 0, then exit the current loop comparison and jump to the step of using the final valid point number to determine the validity of the current touch point sampling value. If there is a corresponding touch point sampling value with index preIdx in the circular queue array, continue to execute the steps below.
[0143] Then, determine whether the first reference point index value preIdx is equal to the index value filterIdx corresponding to the current touch point sampling value. If preIdx is equal to filterIdx, exit the current loop comparison and jump to the step of using the final valid point number to determine the validity of the current touch point sampling value. If preIdx is not equal to filterIdx, continue to execute the next step.
[0144] Compare the horizontal coordinate x and vertical coordinate y of the currently sampled touch point sampling value with the horizontal coordinate X and vertical coordinate Y of the first reference point sampling value indexed as preIdx in the circular queue array. If the absolute value difference of the first horizontal coordinate |xX| in the comparison result is within the limited distance (the first preset threshold OFFSET_LIMIT_X), and the absolute value difference of the first vertical coordinate |yY| is also within the limited distance (the second preset threshold OFFSET_LIMIT_Y), then the effective slide count value is increased by 1, otherwise the effective slide count value is not modified.
[0145] Furthermore, the first formula for setting the first preset threshold is:
[0146] OFFSET_LIMIT_X = (maximum original value of X / X-axis resolution) · number of deviation pixels
[0147] Wherein, OFFSET_LIMIT_X is a first preset threshold, the maximum value of the X original value is the maximum value of the horizontal axis original value of the touch screen, and the X axis resolution is the horizontal resolution of the display screen of the resistive touch screen.
[0148] In addition, the second formula for setting the second preset threshold is:
[0149] OFFSET_LIMIT_Y = (maximum original Y value / Y axis resolution) · number of deviation pixels
[0150] OFFSET_LIMIT_Y is a second preset threshold, the maximum Y original value is the maximum value of the original value of the vertical axis of the touch screen, and the Y axis resolution is the vertical resolution of the display screen of the resistive touch screen.
[0151] The calculation formula for the above-mentioned number of deviation pixels is: number of deviation pixels = deviation distance / diameter of each pixel. Taking a 10-inch display screen as an example, the size of the display screen is 245.76cm×184.32cm, and the corresponding resolution is 1024×768. In the horizontal direction, 245.76cm / 1024=0.24cm, and in the vertical direction, 184.32cm / 768=0.24cm, that is, the diameter of each pixel is 0.24cm, and the deviation distance is greater than or equal to 3cm and less than or equal to 5cm (approximately the range of a fingertip). According to the calculation result of the above-mentioned calculation formula for the number of deviation pixels, in an embodiment of the present invention, the number of deviation pixels is greater than or equal to 13 and less than or equal to 21.
[0152] In the test embodiment of the present invention, the maximum value of the original X value is 4096, the X-axis resolution is 1024, and the number of deviation pixels is 15. Thus, OFFSET_LIMIT_X=(4096 / 1024)·15=60.
[0153] Similarly, in the test embodiment of the present invention, the maximum value of the Y original value is 4096, the Y axis resolution is 768, and the number of deviation pixels is 15, so OFFSET_LIMIT_Y=4096 / 768·15=70.
[0154] Determine whether there is an uncalculated first reference point sampling value in the circular queue array; if there is an uncalculated first reference point sampling value in the circular queue array, preIdx is updated forward to the previous index value in the circular queue array, that is, when preIdx is not 0, preIdx = preIdx -1; and when preIdx is equal to 0, preIdx = MAX_P -1; then the loop continues to execute using the current touch point sampling value and the next first reference point sampling value to calculate the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate.
[0155] If there is no uncalculated first reference point sampling value in the circular queue array, it means that all the first reference point sampling values in the circular queue array have been compared with the current touch point sampling value. The valid point count slidecount value obtained at this time is the final valid point count. If the valid point count slidecount value at this time is greater than or equal to the first preset parameter VALID_P, the current touch point sampling value is determined to be a valid value; otherwise, the current touch point sampling value is determined to be an invalid value.
[0156] In the embodiment of the present invention, if the value of the first preset parameter VALID_P is too small, the reported jump point rate will still be too high; if the value of the first preset parameter VALID_P is too high, too many touch point sampling values will be filtered out, resulting in too few touch point sampling values being reported. Taking all factors into consideration, as described above, the range of the first preset parameter VALID_P, the valid point limit value, is greater than or equal to the first difference MAX_P-3 and less than or equal to the second difference MAX_P-1. For example, in the software test example of the above embodiment, the preset array length MAX_P of the circular queue array is 6, and the corresponding first preset parameter VALID_P is 4.
[0157] In an embodiment of the present invention, a circular queue array of a specific length is used to store the sampled touch point sampling values. If the abscissa x and the ordinate y of the current touch point sampling value are both smaller than the first abscissa absolute value difference and the first ordinate absolute value difference of the abscissa X and the ordinate Y of the previous touch point sampling value in the circular queue array within a set range, the number of valid points of the touch point sampling value is increased by 1, otherwise the number of valid points of the touch point sampling value is not increased, and then the index in the queue is moved forward by one position to continue to be compared with the touch point sampling value. When all the value comparisons in the circular queue array are completed, if the number of valid points corresponding to the touch point sampling value is greater than the limited value, the current touch point sampling value is a valid value, otherwise the current touch point sampling value is an invalid value.
[0158] Compared with the prior art, the resistive touch screen signal filtering method provided by the embodiment of the present application uses a circular queue array to store the sampling values of each touch point. When storing each touch point sampling value, the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate between the current touch point and the stored touch points are calculated; if the current absolute value difference of the first horizontal coordinate and the corresponding absolute value difference of the first vertical coordinate meet the first preset condition, the number of valid points corresponding to the current touch point is increased by 1, otherwise the number of valid points remains unchanged; after the comparison of all touch point sampling values in the queue is completed, if the final number of valid points reaches the first preset parameter, the current touch point sampling value is a valid value. The embodiment of the present invention is applicable to the field of medical equipment, can accurately filter touch screen jump points, realize accurate reporting of touch press position values, and reduce the risk of equipment misoperation.
[0159] In an embodiment of the present invention, a resistive touch screen signal filtering method further includes: after entering the interrupt function, the sampling module 1 assigns the reported identification value to an invalid value.
[0160] In this way, when it is determined that the current touch point sampling value is an invalid value, the reporting event is not triggered. When it is determined that the current touch point sampling value is a valid value, the reporting event is triggered. After the reporting event is triggered, it is determined whether the touch point sampling value has been reported before based on the reporting identification value; if the reporting identification value is a valid assignment, it means that the touch point sampling value has been reported before, and the current touch point sampling value is directly reported, and the touch screen pressing signal is collected according to the preset sampling period. If the reporting identification value is an invalid assignment, it means that the touch point sampling value has not been reported before, and all valid values in the circular queue array are reported; then the reporting identification value assignment is set to a valid assignment, and the touch screen pressing signal is collected according to the preset sampling period.
[0161] In an embodiment of the present invention, the interrupt function uses the bDown variable as a flag for whether it is the first report, and the bDown variable is the above-mentioned report identification value. After entering the interrupt function, bDown is initialized to 0, which is an invalid value assignment for the report identification value. When it is necessary to report a touch point, first check whether the value of the bDown variable is 0. If it is 0, it is the first time to report a touch event. When reporting for the first time, all valid values in the circular queue array need to be reported. The judgment logic of all valid values in the circular queue array is to compare the previously stored touch point sampling values in the circular queue array with the current touch point sampling values in turn. If the calculation result deviation range is within the set range, it is valid, otherwise it is invalid, that is, when the absolute value difference of the first horizontal coordinate is less than or equal to the first preset threshold and the corresponding absolute value difference of the first vertical coordinate is less than or equal to the second preset threshold, the number of valid points corresponding to the current touch point is increased by 1, otherwise the number of valid points corresponding to the current touch point remains unchanged. After reporting the touch point sampling value for the first time, the value of the bDown variable needs to be set to 1, which is a valid value assignment for the report identification value, indicating that the pressed touch point sampling value has been reported.
[0162] In addition, refer to Figure 5 In an embodiment of the present invention, a resistive touch screen signal filtering method further includes the following steps by the filtering module 3: when executing the touch screen pop-up processing, judging whether the touch point sampling value has been reported before based on the reported identification value; if the reported identification value is a valid assignment, it is determined that the touch point sampling value has been reported before, and the interrupt function is directly exited. If the reported identification value is an invalid assignment, it is determined that the touch point sampling value has not been reported before, and the final maximum value of the valid points in the current ring queue array is obtained, and the touch point sampling value corresponding to the final maximum value of the valid points is determined as the second reference point sampling value.
[0163] Then, it is determined whether the final maximum value of the effective points is greater than the second preset parameter. If the final maximum value of the effective points is less than or equal to the second preset parameter, the interrupt function is directly exited. If the final maximum value of the effective points is greater than the second preset parameter, the stored touch point sampling values other than the second reference point sampling values are taken as the third reference point sampling values.
[0164] Then, the second reference point sampling value and each third reference point sampling value are used to calculate the second horizontal coordinate absolute value difference and the second vertical coordinate absolute value difference one by one; and it is determined whether the current second horizontal coordinate absolute value difference and the corresponding second vertical coordinate absolute value difference meet the second preset condition.
[0165] Furthermore, the second preset condition is that the absolute value difference of the second horizontal coordinate is less than or equal to the first preset threshold and the corresponding absolute value difference of the second vertical coordinate is less than or equal to the second preset threshold.
[0166] If the current second horizontal coordinate absolute value difference and the corresponding second vertical coordinate absolute value difference meet the second preset condition, the corresponding touch point sampling value and the second reference point sampling value are reported. If the current second horizontal coordinate absolute value difference and the corresponding second vertical coordinate absolute value difference do not meet the second preset condition, the corresponding touch point sampling value is not reported.
[0167] As mentioned above, when the interrupt signal is detected to be cancelled, check whether the value of the bDown variable is 1. If the value of the bDown variable is 1, it is determined that the touch point sampling value has been reported before. At this time, the interrupt function can be directly exited and the touch pop-up event can be reported. If the value of the bDown variable is 0, no press event has been reported in this touch interrupt. First, it is necessary to obtain the touch point sampling value with the maximum value of the final valid point number of the valid value from the circular queue array. Taking the second preset parameter as 2 as an example, if the maximum value of the final valid point number is less than or equal to 2, it means that there is no valid value in the touch screen press signal this time. No processing is done at this time, and the interrupt function is exited. If the final maximum number of valid points is greater than 2, then compare the horizontal coordinate x and vertical coordinate y of each remaining touch point sampling value in the circular queue array with the horizontal coordinate x and vertical coordinate y of the touch point sampling value corresponding to the final maximum number of valid points. If the absolute value difference of the second horizontal coordinate and the absolute value difference of the second vertical coordinate are within the specified range after comparison, then the touch point sampling value in the queue is a valid value, and the touch point sampling value is reported. After all the remaining touch point sampling values in the circular queue array are compared and reported, the touch pop-up event is reported.
[0168] As described above, in one embodiment of the present invention, assuming that the preset array length MAX_P of the circular queue array is 6, the first preset parameter VALID_P is 4, and the preset sampling period is 1ms. Assuming that a total of 6 touch point sampling values are sampled in one touch screen, and all 6 touch point sampling values are valid values, the first reporting time is the 5th touch point sampling value, and the final valid point number is 4. When reporting for the first time, all valid values in the circular queue will be reported, and the 1st touch point sampling value, the 2nd touch point sampling value, the 3rd touch point sampling value, and the 4th touch point sampling value will be reported, and then the 5th touch point sampling value will be reported. Then, after the 6th touch point sampling value comes, the position deviation of the 6th touch point sampling value is compared with the 1st touch point sampling value, the 2nd touch point sampling value, the 3rd touch point sampling value, the 4th touch point sampling value, and the 5th touch point sampling value in the circular queue array. The comparison result is that the final valid point number is 5, and the 6th touch point sampling value is reported. When the next cycle comes, the interrupt signal is detected to be cancelled. After the touch screen pop-up processing is executed, the interrupt function is directly exited because the touch point sampling value has been reported.
[0169] As described above, in one embodiment of the present invention, assuming that the preset array length MAX_P of the circular queue array is 6, the first preset parameter VALID_P is 4, and the preset sampling period is 1ms. Assuming that a total of 6 touch point sampling values are sampled in one touch screen, the second touch point sampling value and the seventh touch point sampling value are invalid values, and the remaining touch point sampling values are all valid values, then the first reporting time is the sixth touch point sampling value, and the final valid point number is 4. When reporting for the first time, all valid values in the circular queue array will be reported, then The first touch point sampling value, the third touch point sampling value, the fourth touch point sampling value, and the fifth touch point sampling value will be reported, and then the sixth touch point sampling value will be reported. Then, when the seventh touch point sampling value comes, the seventh touch point sampling value is compared with the first touch point sampling value, the second touch point sampling value, the third touch point sampling value, the fourth touch point sampling value, the fifth touch point sampling value, and the sixth touch point sampling value in the circular queue array. The comparison result is that the final valid point number is 0, and the seventh touch point sampling value is not reported. When the next cycle comes, the interrupt signal cancellation is detected, and after the touch screen pop-up processing is executed, the interrupt function is directly exited because the touch point sampling value has been reported.
[0170] As described above, in one embodiment of the present invention, assuming that the preset array length MAX_P of the circular queue array is 6, the first preset parameter VALID_P is 4, the preset sampling period is 1ms, and the second preset parameter is 2, assuming that a total of 4 touch point sampling values are sampled in one touch screen, and all are valid values, then when the fifth touch point sampling value is sampled, the touch screen pops up, and the interrupt signal cancellation is detected. If the touch point sampling value has not been reported yet, the touch point sampling value corresponding to the final maximum value of the valid point number in the circular queue array will be obtained first. Assuming that the final maximum value of the valid point number corresponds to the fourth touch point sampling value, assuming that the final maximum value of the valid point number of the fourth touch point sampling value is 3, at this time the final maximum value of the valid point number is greater than the second preset parameter, then all touch point sampling values in the circular queue array that are within the limited deviation range compared with the position of the fourth touch point sampling value will be reported, and finally the fourth touch point sampling value will be reported, and then the pop-up event will be reported.
[0171] In addition, when the touch screen is quickly and briefly tapped, the number of touch point sampling values that may be sampled is relatively small and does not reach the preset array length. The embodiment of the present invention sets the execution logic of the touch screen pop-up processing for this kind of quick and short tap on the touch screen, thereby reducing the occurrence of touch point sampling values generated by invalid clicks on the touch screen.
[0172] In addition, an embodiment of the present invention further provides a resistive touch screen signal filtering 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 resistive touch screen signal filtering method as described in any one of the above items.
[0173] 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 the resistive touch screen signal filtering method as described in any one of the above items are implemented.
[0174] 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.
[0175] 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.
[0176] 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.
[0177] 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.
[0178] 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).
[0179] 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.
[0180] 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.
[0181] 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 resistive touch screen signal filtering method, characterized in that: The method comprises: Collecting touch screen pressing signals according to a preset sampling period; The touch point sampling values in the touch screen pressing signal are sequentially stored in a circular queue array; Taking the touch point sampling value stored before the current touch point sampling value as the first reference point sampling value; Using the current touch point sampling value and each first reference point sampling value, calculate the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate one by one; Determine whether the current first horizontal coordinate absolute value difference and the corresponding first vertical coordinate absolute value difference meet a first preset condition; If the absolute value difference of the current first horizontal coordinate and the absolute value difference of the corresponding first vertical coordinate meet the first preset condition, the number of valid points corresponding to the current touch point is increased by 1, otherwise the number of valid points corresponding to the current touch point remains unchanged; Determine whether there is an uncalculated first reference point sampling value in the circular queue array; If there is an uncalculated first reference point sampling value in the circular queue array, using the current touch point sampling value and the next first reference point sampling value to calculate the first horizontal coordinate absolute value difference and the first vertical coordinate absolute value difference; If there is no uncalculated first reference point sampling value in the circular queue array, obtaining the final valid point number corresponding to the current touch point sampling value, and determining whether the final valid point number is less than the first preset parameter; If the final number of valid points is greater than or equal to the first preset parameter, determining the current touch point sampling value as a valid value; If the final number of valid points is less than the first preset parameter, it is determined that the current touch point sampling value is an invalid value.
2. A resistive touch screen signal filtering method as claimed in claim 1, characterized in that: The touch screen pressing signal is collected according to the preset sampling period, including: Real-time monitoring of interrupt signals generated by touch screen pressing; If no interrupt signal is detected, continue to monitor the interrupt signal generated by the touch screen pressing in real time; If an interrupt signal is detected, a preset interrupt function is entered to collect touch point sampling values according to a preset sampling period to obtain a touch screen pressing signal.
3. A resistive touch screen signal filtering method as claimed in claim 2, characterized in that: The touch point sampling values in the touch screen pressing signal are sequentially stored in a circular queue array, including: Initializing the circular queue array; Each time a touch point sampling value is sampled, the current touch point sampling value is stored in the storage bit corresponding to the current index value of the initialized circular queue array; Determine whether the current index value reaches the maximum index value; wherein the maximum index value is the value of the preset array length of the circular queue array minus 1; If the current index value reaches the maximum index value, the current index value is set to 0 and updated to the next index value; If the current index value does not reach the maximum index value, the current index value is increased by 1 and updated to the next index value.
4. A resistive touch screen signal filtering method as claimed in claim 3, characterized in that: The touch point sampling values in the touch screen pressing signal are sequentially stored in a circular queue array, further comprising: After the current index value is updated to the next index value, monitoring whether the interrupt signal is cancelled; If the interrupt signal is cancelled, the touch screen pop-up process is executed, the interrupt function is exited, and the interrupt signal generated by the touch screen pressing is continued to be monitored in real time; If the interrupt signal is not cancelled, the touch screen pressing signal continues to be sampled in the next preset sampling period.
5. A resistive touch screen signal filtering method as claimed in claim 4, characterized in that: Using the current touch point sampling value and each first reference point sampling value, the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate are calculated one by one, including: Initialize the valid points to 0; Obtaining a first horizontal coordinate and a first vertical coordinate from the current touch point sampling value; Taking the index value corresponding to the current touch point sampling value in the circular queue array as the target point index value; Taking the index value corresponding to the previous index value of the target point in the circular queue array as the first reference point index value; Determine whether the first reference point index value has a corresponding touch point sampling value in the circular queue array; If there is no corresponding touch point sampling value for the first reference point index value in the circular queue array, exiting the loop calculation of the first horizontal coordinate absolute value difference and the first vertical coordinate absolute value difference; If there is a corresponding touch point sampling value for the first reference point index value in the circular queue array, determining whether the current first reference point index value is equal to the target point index value; If the current first reference point index value is equal to the target point index value, then exiting the loop calculation of the first horizontal coordinate absolute value difference and the first vertical coordinate absolute value difference; If the current first reference point index value is not equal to the target point index value, taking the touch point sampling value corresponding to the current first reference point index value as the current first reference point sampling value, and obtaining the second abscissa and the second ordinate from the current first reference point sampling value; The first abscissa absolute value difference is calculated using the first abscissa and the second abscissa, and the first ordinate absolute value difference is calculated using the first ordinate and the second ordinate.
6. A resistive touch screen signal filtering method as claimed in claim 5, characterized in that: The method further comprises: After entering the interrupt function, assigning the reported identification value to an invalid value; When the current touch point sampling value is determined to be an invalid value, no reporting event is triggered; When the current touch point sampling value is determined to be a valid value, a reporting event is triggered; Determining whether a touch point sampling value has been reported before based on the reported identification value; If the reported identification value is a valid assignment, it means that the touch point sampling value has been reported before, and the current touch point sampling value is directly reported, and the touch screen pressing signal is collected according to the preset sampling period in a cycle; If the reported identification value is an invalid value, it means that the touch point sampling value has not been reported before, and all valid values in the circular queue array are reported; The reported identification value assignment is set to a valid assignment, and a loop is performed to collect the touch screen pressing signal according to a preset sampling period.
7. A resistive touch screen signal filtering method as claimed in claim 6, characterized in that: The method further comprises: When performing touch screen pop-up processing, judging whether the touch point sampling value has been reported before based on the reported identification value; If the reported identification value is a valid assignment, it is determined that the touch point sampling value has been reported before, and the interrupt function is directly exited; If the reported identification value is an invalid assignment, it is determined that the touch point sampling value has not been reported before, the final maximum value of the valid points of the valid values in the current circular queue array is obtained, and the touch point sampling value corresponding to the final maximum value of the valid points is determined as the second reference point sampling value; Determine whether the maximum value of the final valid points is greater than a second preset parameter; If the final maximum value of the valid points is less than or equal to the second preset parameter, directly exit the interrupt function; If the final maximum value of the number of valid points is greater than the second preset parameter, taking the stored touch point sampling values except the second reference point sampling value as the third reference point sampling value; Using the second reference point sampling value and each third reference point sampling value, calculate the absolute value difference of the second horizontal coordinate and the absolute value difference of the second vertical coordinate one by one; Determine whether the current second horizontal coordinate absolute value difference and the corresponding second vertical coordinate absolute value difference meet the second preset condition; If the current second horizontal coordinate absolute value difference and the corresponding second vertical coordinate absolute value difference meet the second preset condition, the corresponding touch point sampling value and the second reference point sampling value are reported; otherwise, the corresponding touch point sampling value is not reported.
8. A resistive touch screen signal filtering system, characterized in that: The system comprises: A sampling module, used to collect touch screen pressing signals according to a preset sampling period; A storage module, used for storing the touch point sampling values in the touch screen pressure signal into a circular queue array in sequence; The filter module performs the following steps: Taking the touch point sampling value stored before the current touch point sampling value as the first reference point sampling value; Using the current touch point sampling value and each first reference point sampling value, calculate the absolute value difference of the first horizontal coordinate and the absolute value difference of the first vertical coordinate one by one; Determine whether the current first horizontal coordinate absolute value difference and the corresponding first vertical coordinate absolute value difference meet a first preset condition; If the absolute value difference of the current first horizontal coordinate and the absolute value difference of the corresponding first vertical coordinate meet the first preset condition, the number of valid points corresponding to the current touch point is increased by 1, otherwise the number of valid points corresponding to the current touch point remains unchanged; Determine whether there is an uncalculated first reference point sampling value in the circular queue array; If there is an uncalculated first reference point sampling value in the circular queue array, using the current touch point sampling value and the next first reference point sampling value to calculate the first horizontal coordinate absolute value difference and the first vertical coordinate absolute value difference; If there is no uncalculated first reference point sampling value in the circular queue array, obtaining the final valid point number corresponding to the current touch point sampling value, and determining whether the final valid point number is less than the first preset parameter; If the final number of valid points is greater than or equal to the first preset parameter, determining the current touch point sampling value as a valid value; If the final number of valid points is less than the first preset parameter, it is determined that the current touch point sampling value is an invalid value.
9. A resistive touch screen signal filtering 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 the resistive touch screen signal filtering method according to 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 resistive touch screen signal filtering method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method of measuring parameters set by measuring instrument for the purpose of supporting multi-touch screen
CN102981673A
Multi-touch pressure testing method for capacitive screen
CN103902129A