Signal filtering method, system and equipment based on annular queue array and medium
By using a ring queue array on the resistive touch screen to store the sample value of the touch point and calculate the sum of the squares of the deviation values, the problem of inaccurate signal filtering when pressed by medical staff is solved, and accurate filtering and accurate reporting of touch screen jump points is achieved, reducing the The risk of equipment misoperation.
Patent Information
- Application Number
- CN202411977394.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-12-31
AI Technical Summary
When medical staff presses large-sized resistive touch screens with their fingertips, it is easy to cause inaccurate signal filtering, resulting in high risk of misoperation of equipment.
The signal filtering method based on the ring queue array is adopted. By storing the touch point sample value and calculating the sum of squares of the deviation values between the median sample value and the reference point sample value, jump points and jitter are automatically filtered to ensure the accuracy of the pressing position value.
It effectively eliminates the jitter when the touch screen is pressed and bounced, reduces error filtering caused by position changes, and realizes accurate reporting of touch-press position values, reducing the risk of equipment misoperation.
Smart Images

Figure CN119400383A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of touch screens for medical devices, and in particular to a signal filtering method, system, device and medium based on a ring queue array. 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] Especially when users press the screen with their fingertips, they often encounter situations where the touch screen click position moves and changes rapidly. In this case, the touch screen click position changes more easily and many valid touch point sampling values are filtered out due to recognition errors. Summary of the invention
[0004] To this end, embodiments of the present invention provide a signal filtering method, system, device and medium based on a circular queue array to solve the technical problem that inaccurate signal filtering is easily caused by medical staff pressing a large-sized resistive touch screen with their fingertips.
[0005] In order to achieve the above purpose, the embodiment of the present invention provides the following technical solutions: According to a first aspect of an embodiment of the present invention, an embodiment of the present application provides a signal filtering method based on a ring queue array, the method comprising: Setting a storage identification value for the circular queue array and initializing the storage identification value to a first initial value; Obtaining sampling values of each touch point and storing them in the circular queue array in sequence; Establishing corresponding first index values for each touch point sampling value in sequence and initializing the corresponding first valid point number to a second initial value; Determine whether a first index value corresponding to the current touch point sampling value satisfies a first preset condition; If the first index value corresponding to the current touch point sampling value meets the first preset condition, the storage identification value is set to the update value; Determine the first median sampling value corresponding to the values stored in the current ring queue array and take the remaining stored values as the first reference point sampling values; Calculate the sum of squares of first deviations between the current first median sampling value and each first reference point sampling value; Determine one by one whether the sum of squares of the first deviation values is less than a first preset threshold; If the sum of the squares of the first deviation values is less than the first preset threshold, the first valid point number corresponding to the current first median sampling value is increased by 1; otherwise, the first valid point number corresponding to the current first median sampling value remains unchanged; Obtaining a first final value of a first valid number of points corresponding to the current first median sampling value, and determining whether the first final value is less than a second preset threshold; If the first final value is greater than or equal to the second preset threshold, determine the current first median sampling value as a valid value and report it; If the first final value is less than the second preset threshold, the current first median sampling value is determined to be an invalid value.
[0006] Furthermore, corresponding first index values are sequentially established for each touch point sampling value, including: The first index value corresponding to the first touch point sampling value is determined to be 0 and is sequentially increased by 1 as the first index value corresponding to the subsequent touch point sampling values; Determine whether the first index value corresponding to the current touch point sampling 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 first index value corresponding to the current touch point sampling value reaches the maximum index value, the first index value corresponding to the next touch point sampling value is updated to 0; If the first index value corresponding to the current touch point sampling value does not reach the maximum index value, the current first index value is increased by 1 and updated to the first index value corresponding to the next touch point sampling value.
[0007] Further, determining the first median sampling value corresponding to the value stored in the current ring queue array includes: Calculate a second index value of the first median sampling value based on a first index value corresponding to the current touch point sampling value; Selecting the stored touch point sampling value corresponding to the second index value as the first median sampling value; The calculation formula of the second index value is: middleIdx1=(filterIdx1+[MAX_P / 2])%MAX_P Among them, middleIdx1 is the second index value, filterIdx1 is the first index value corresponding to the current touch point sampling value, MAX_P is the length of the circular queue array, "[]" is a rounding operation, and "%" is a remainder operation.
[0008] Furthermore, the signal filtering method based on the ring queue array also includes: After entering the interrupt function, the reported identification value is assigned to an invalid value; When a valid value is reported for the first time, the reported identification value assignment is set as a valid assignment; After the first index value corresponding to the next touch point sampling value is updated, 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 next touch point sampling value continues to be received.
[0009] Further, the touch screen pop-up processing is performed, including: 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 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, determining that the touch point sampling value has not been reported before, and determining whether the currently stored identification value is the first initial value; If the current storage identification value is not the first initial value, directly exit the interrupt function; If the current storage identification value is the first initial value, determine the second median sampling value corresponding to the value stored in the current circular queue array and take the remaining stored values as the second reference point sampling value; Calculate the sum of squares of second deviations between the current second median sampling value and each second reference point sampling value; Determine one by one whether the sum of squares of the second deviation values is less than a first preset threshold; If the sum of the squares of the second deviation values is less than the first preset threshold, the first valid point number corresponding to the current second median sampling value is increased by 1; otherwise, the first valid point number corresponding to the current second median sampling value remains unchanged; Obtaining a second final value corresponding to the current second median sampling value, and determining whether the second final value is less than or equal to a third preset threshold; If the second final value is less than or equal to a third preset threshold, directly exit the interrupt function; If the second final value is greater than the third preset threshold, the current second median sampling value is reported and the interrupt function is exited.
[0010] Furthermore, the first formula of the first deviation value square sum is: Among them, DV 1 is the sum of squares of the first deviation values, middleIdx.x 1 is the horizontal coordinate value in the first median sampling value, middleIdx.y 1is the ordinate value in the first median sample value, preIdx.x 1 is the horizontal coordinate value of the current first reference point sampling value, preIdx.y 1 is the ordinate value of the current first reference point sampling value; The second formula for the second deviation value square sum is: Among them, DV 2 is the sum of squares of the second deviation values, middleIdx.x 2 is the horizontal coordinate value of the second median sampling value, middleIdx.y 2 is the ordinate value in the second median sample value, preIdx.x 2 is the horizontal coordinate value of the current second reference point sampling value, preIdx.y 2 It is the ordinate value of the current second reference point sampling value.
[0011] Further, determining the second median sampling value corresponding to the value stored in the current ring queue array includes: Calculate a third index value of the second median sampling value based on the first index value corresponding to the last stored touch point sampling value; Selecting the stored touch point sampling value corresponding to the third index value as the second median sampling value; The calculation formula of the third index value is: middleIdx2=[filterIdx2 / 2] Among them, middleIdx2 is the third index value, filterIdx2 is the first index value corresponding to the last stored touch point sampling value, and "[]" is a rounding operation.
[0012] According to a second aspect of an embodiment of the present invention, an embodiment of the present application provides a signal filtering system based on a ring queue array, the system comprising: An initialization module, used for setting a storage identification value for the circular queue array and initializing the storage identification value to a first initial value; A storage module, used for acquiring sampling values of each touch point and storing them in the circular queue array in sequence; establishing a corresponding first index value for each sampling value of the touch point in sequence and initializing the corresponding first valid point number as a second initial value; The filter module performs the following steps: Determine whether a first index value corresponding to the current touch point sampling value satisfies a first preset condition; If the first index value corresponding to the current touch point sampling value meets the first preset condition, the storage identification value is set to the update value; Determine the first median sampling value corresponding to the values stored in the current ring queue array and take the remaining stored values as the first reference point sampling values; Calculate the sum of squares of first deviations between the current first median sampling value and each first reference point sampling value; Determine one by one whether the sum of squares of the first deviation values is less than a first preset threshold; If the sum of the squares of the first deviation values is less than the first preset threshold, the first valid point number corresponding to the current first median sampling value is increased by 1; otherwise, the first valid point number corresponding to the current first median sampling value remains unchanged; Obtaining a first final value of a first valid number of points corresponding to the current first median sampling value, and determining whether the first final value is less than a second preset threshold; If the first final value is greater than or equal to the second preset threshold, determine the current first median sampling value as a valid value and report it; If the first final value is less than the second preset threshold, the current first median sampling value is determined to be an invalid value.
[0013] According to a third aspect of an embodiment of the present invention, a signal filtering device based on a ring queue array is provided, 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 the signal filtering method based on the ring queue array as described in any one of the above items.
[0014] 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 the signal filtering method based on a circular queue array as described in any one of the above items are implemented.
[0015] Compared with the prior art, the signal filtering method, system, device and medium based on the circular queue array provided in the embodiments of the present application use the circular queue array to store the received touch point sampling values, and take the middle value to compare with the other previous and next values in the circular queue array. On the one hand, the first few touch point sampling values when the touch screen is pressed and the first few touch point sampling values before the touch screen pops up are automatically filtered, effectively removing the jitter when pressing and popping up. On the other hand, the selected point is located in the middle of the circular queue array, and the comparison is made between the adjacent points before and after, which is suitable for the situation where the touch screen click position moves and changes rapidly, reducing the occurrence of erroneous filtering due to position changes. The embodiments of the present invention are 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] 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.
[0017] 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.
[0018] Figure 1 A schematic diagram of the logical structure of a signal filtering system based on a ring queue array provided by an embodiment of the present invention; Figure 2 A schematic diagram of a flow chart of a signal filtering method based on a ring queue array provided in an embodiment of the present invention; Figure 3 A schematic diagram of a process for obtaining sampling values of each touch point provided by an embodiment of the present invention; Figure 4 A schematic diagram of a process for sequentially establishing corresponding first index values for each touch point sampling value provided by an embodiment of the present invention; Figure 5 A schematic diagram of a process for executing a touch screen pop-up process provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0019] 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.
[0020] 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.
[0021] In order to solve the above technical problems, Figure 1As shown, an embodiment of the present application provides a signal filtering system based on a ring queue array, which is applied to medical equipment, especially ECMO (Extracorporeal Membrane Oxygenation) equipment.
[0022] Specifically, the signal filtering system based on the ring queue array provided in the embodiment of the present application includes: an initialization module 1, a storage module 2 and a filtering module 3.
[0023] The sampling module 1 is used to set a storage identification value for the circular queue array and initialize the storage identification value to a first initial value.
[0024] The storage module 2 is used to receive each touch point sampling value and store them in the circular queue array in sequence; establish a corresponding first index value for each touch point sampling value in sequence and initialize the corresponding first valid point number to a second initial value.
[0025] The filtering module 3 is used to perform the following steps: determine whether the first index value corresponding to the current touch point sampling value meets the first preset condition; if the first index value corresponding to the current touch point sampling value meets the first preset condition, set the storage identification value to the update value; determine the first median sampling value corresponding to the stored value of the current circular queue array and take the remaining stored values as the first reference point sampling value; calculate the first square sum of the deviation values between the current first median sampling value and each first reference point sampling value; determine one by one whether the square sum of each first deviation value is less than the first preset threshold; if the square sum of the first deviation value is less than the first preset threshold, increase the first valid point number corresponding to the current first median sampling value by 1, otherwise, keep the first valid point number corresponding to the current first median sampling value unchanged; obtain the first final value of the first valid point number corresponding to the current first median sampling value, and determine whether the first final value is less than the second preset threshold; if the first final value is greater than or equal to the second preset threshold, determine that the current first median sampling value is a valid value and report it; if the first final value is less than the second preset threshold, determine that the current first median sampling value is an invalid value.
[0026] Compared with the prior art, the signal filtering system based on the circular queue array provided in the embodiment of the present application uses a circular queue array to store the received touch point sampling values, and takes the middle value to compare with the other previous and next values in the circular queue array. On the one hand, it automatically filters the first few touch point sampling values when the touch screen is pressed and the first few touch point sampling values before the touch screen pops up, effectively removing the jitter when pressing and popping up. On the other hand, the selected point is located in the middle of the circular queue array, and the comparison is made between the adjacent points in front and behind, which is suitable for the situation where the touch screen click position moves and changes rapidly, reducing the occurrence of erroneous filtering due to position changes. 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 pressing position values, and reduce the risk of equipment misoperation.
[0027] Corresponding to the above-disclosed signal filtering system based on a circular queue array, an embodiment of the present invention further discloses a signal filtering method based on a circular queue array. The following describes in detail the signal filtering method based on a circular queue array disclosed in an embodiment of the present invention in combination with the above-described signal filtering system based on a circular queue array.
[0028] In the embodiment of the present application, a circular queue array of a specific length is mainly used to store the received touch point sampling values. If the sum of the squares of the deviations of the median sampling value in the circular queue array compared to the other touch point sampling values is less than a first preset threshold, the valid point value of the median sampling value is increased by 1, otherwise the valid point value of the median sampling value is not increased. When all the values in the circular queue array are compared, if the valid point number of the median sampling value is greater than the second preset threshold, the median sampling value is regarded as a valid value and reported to the operating system. Otherwise, it is an invalid value and is not reported.
[0029] like Figure 2 As shown, the specific steps of the signal filtering method based on the ring queue array provided in the embodiment of the present application are described in detail below.
[0030] The embodiment of the present application provides a signal filtering method based on a ring queue array, which is applied to medical equipment, especially ECMO (Extracorporeal Membrane Oxygenation) equipment.
[0031] The initialization module 1 sets a storage identification value for the circular queue array and initializes the storage identification value to a first initial value.
[0032] In the embodiment of the present application, a storage identification value is used as a sign that the first ring of the circular queue array is full. The storage identification value is recorded as bFirst, and the above-mentioned first initial value is 1.
[0033] The sampling values of each touch point are acquired through the storage module 2 and stored in the circular queue array in sequence.
[0034] refer to Figure 3 In an embodiment of the present application, the above-mentioned step of obtaining the sampling value of each touch point specifically includes: real-time monitoring of the interrupt signal generated by the touch screen pressing; if no interrupt signal is detected, continuing to monitor the interrupt signal generated by the touch screen pressing in real time; if an interrupt signal is detected, entering a pre-set interrupt function, and collecting the touch point sampling value according to the preset sampling period to obtain a touch screen pressing signal.
[0035] 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.
[0036] 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.
[0037] 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 touch screen is pressed and an interrupt signal is generated, the storage module 2 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.
[0038] In an embodiment of the present application, a circular queue array is used to store touch point sampling values, and the specific steps include: 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.
[0039] In the embodiment of the present invention, the tscFilterArray array is specifically used as a circular queue array 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 6 and less than or equal to 10, that is, the value range of MAX_P can be set to be greater than or equal to 6 and less than or equal to 10.
[0040] If the preset array length of the circular queue array is too short, the number of comparison sampling values 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 will be too long. In this case, the large deviation in the comparison result is not necessarily caused by the jump point. 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 6 and less than or equal to 10.
[0041] The storage module 2 sequentially establishes corresponding first index values for each touch point sampling value.
[0042] refer to Figure 4 In an embodiment of the present application, the step of receiving each touch point sampling value specifically includes: determining the first index value corresponding to the first touch point sampling value as 0 and increasing it by 1 in sequence as the first index value corresponding to the subsequent touch point sampling value; judging whether the first index value corresponding to the current touch point sampling value reaches the maximum index value; if the first index value corresponding to the current touch point sampling value reaches the maximum index value, updating the first index value corresponding to the next touch point sampling value to 0; if the first index value corresponding to the current touch point sampling value does not reach the maximum index value, increasing the current first index value by 1 and updating it to the first index value corresponding to the next touch point sampling value.
[0043] In the embodiment of the present application, the maximum index value is the preset array length of the circular queue array minus 1. The first index value of the current touch point sampling value is filterIdx1. In the initial stage of sampling the touch point sampling value, each time a touch point sampling value is sampled, the current touch point sampling value is saved in the position corresponding to the first index value filterIdx1 in the circular queue array tscFilterArray, and then the first index value filterIdx1 is incremented by 1.
[0044] 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 first index value decreases in sequence. When the index is 0, the next first index value forward is the maximum index value in the circular queue array (i.e., the first index value of MAX_P minus 1). The backward direction of the circular queue array is the direction in which the first index value increases in sequence. When the index is the maximum index value in the circular queue array (i.e., the first index value of MAX_P minus 1), the next first index value backward is the first index value 0 of the head in the circular queue array. The first index values of the circular queue array are 0, 1, 2, ..., MAX_P-1.
[0045] The corresponding first valid point number is initialized to a second initial value through the storage module 2.
[0046] In the embodiment of the present application, slidecount is used as the valid slide count, that is, the first valid count is recorded as slidecount, and before the first median sampling value is compared with the remaining stored touch point sampling values in the circular queue array, slidecout is initialized to the second initial value, and the second initial value is 0.
[0047] The filtering module 3 determines whether the first index value corresponding to the current touch point sampling value meets the first preset condition.
[0048] In the embodiment of the present application, the first preset condition is that the first index value corresponding to the current touch point sampling value is equal to the index maximum value for the first time. If the first index value corresponding to the current touch point sampling value does not meet the first preset condition, the storage identification value is kept at 1, and the next touch point sampling value is received. If the first index value corresponding to the current touch point sampling value meets the first preset condition, the storage identification value is set to the updated value, and further, the updated value is 0, that is, when filterIdx1 is equal to MAX_P minus 1 for the first time, bFirst is set to 0.
[0049] The first median sampling value corresponding to the stored values in the current circular queue array is determined by the filtering module 3, and the remaining stored values are taken as the first reference point sampling values.
[0050] In an embodiment of the present application, the specific steps of determining the first median sampling value corresponding to the stored value in the current circular queue array include: calculating the second index value of the first median sampling value based on the first index value corresponding to the current touch point sampling value; and selecting the stored touch point sampling value corresponding to the second index value as the first median sampling value.
[0051] Furthermore, the calculation formula of the second index value is: middleIdx1=(filterIdx1+[MAX_P / 2])%MAX_P Among them, middleIdx1 is the second index value, filterIdx1 is the first index value corresponding to the current touch point sampling value, MAX_P is the length of the circular queue array, "[]" is a rounding operation, and "%" is a remainder operation.
[0052] Specifically, in the embodiment of the present application, the rounding operation can be rounded up, for example, MAX_P is 7, when the first index value filterIdx1 corresponding to the current touch point sampling value is 0, the calculation result of the second index value middleIdx1 is 4. The rounding operation can also be rounded down, for example, MAX_P is 7, when the first index value filterIdx1 corresponding to the current touch point sampling value is 0, the calculation result of the second index value middleIdx1 is 3.
[0053] The first square sum of deviations between the current first median sampling value and each first reference point sampling value is calculated by the filtering module 3 .
[0054] Specifically, the first formula for the first deviation value square sum is:
[0055] Among them, DV 1 is the sum of squares of the first deviation values, middleIdx.x 1 is the horizontal coordinate value in the first median sampling value, middleIdx.y 1 is the ordinate value in the first median sample value, preIdx.x 1 is the horizontal coordinate value of the current first reference point sampling value, preIdx.y 1 It is the ordinate value of the current first reference point sampling value.
[0056] The filtering module 3 determines one by one whether the sum of squares of the first deviation values is less than the first preset threshold.
[0057] Furthermore, the algorithm formula for determining the value of the first preset threshold is: OFFSET_LIMIT=N 2 Among them, OFFSET_LIMIT is the value of the first preset threshold, and N is the number of deviation pixels.
[0058] For example, in one embodiment of the present application, the number of deviation pixels N is 15, that is, OFFSET_LIMIT=15 2 =225.
[0059] Specifically, the algorithm for calculating the number of deviation pixels N is as follows: The diameter of each pixel = the length of the display screen X axis / LCD X axis resolution = the length of the display screen Y axis / LCD Y axis resolution The size of a 10-inch display screen is 245.76cm×184.32cm, and the corresponding resolution is 1024×768. In the horizontal direction: 245.76cm / 1024=0.24cm, in the vertical direction: 184.32cm / 768=0.24cm, that is, the diameter of each pixel is 0.24cm. The deviation distance is greater than or equal to 3cm and less than or equal to 5cm (approximately the range of a fingertip). At this time, the number of deviation pixels = deviation distance / diameter of each pixel, that is, the number of deviation pixels is greater than or equal to 13 and less than or equal to 21, and the first preset threshold (deviation square limit value) is greater than or equal to 169 and less than or equal to 441.
[0060] If the sum of squares of the first deviation values is less than the first preset threshold, the first valid point number corresponding to the current first median sampling value is increased by 1; otherwise, the first valid point number corresponding to the current first median sampling value remains unchanged.
[0061] Specifically, slidecount is used as the first valid point number, which may also be called the valid sliding point number. Before the current first median sampling value is compared with the first reference point sampling value in the circular queue array, slidecount is initialized to 0.
[0062] The first final value of the first valid point number corresponding to the current first median sampling value is obtained through the filtering module 3.
[0063] Preferably, in an embodiment of the present application, based on the second index value, the corresponding touch point sampling value is taken in sequence from the previous position as the current first reference point sampling value; until the first index value corresponding to the taken touch point sampling value is equal to the second index value, the first final value of the first valid point number corresponding to the current first median sampling value is obtained.
[0064] The filtering module 3 determines whether the first final value is less than the second preset threshold.
[0065] In an embodiment of the present invention, the second preset threshold is denoted as VALID_P. If the value of VALID_P is too small, the reported jump point rate will still be too high; if the value of 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 second preset threshold VALID_P of the valid point limit value is greater than or equal to the first difference (MAX_P minus 4) and less than or equal to the second difference (MAX_P minus 2). For example, in one embodiment of the present application, the preset array length MAX_P of the circular queue array is 6, and the corresponding second preset threshold VALID_P is 3.
[0066] If the first final value is greater than or equal to the second preset threshold, the current first median sampling value is determined to be a valid value and reported; if the first final value is less than the second preset threshold, the current first median sampling value is determined to be an invalid value.
[0067] In addition, after entering the interrupt function, the reported identification value is assigned to an invalid value; when a valid value is reported for the first time, the reported identification value is set to a valid value.
[0068] Preferably, in an embodiment of the present application, after the first index value corresponding to the next touch point sampling value is updated, it is monitored whether the interrupt signal is cancelled; if the interrupt signal is cancelled, the touch screen pop-up processing is executed, the interrupt function is exited, and the interrupt signal generated by the touch screen press continues to be monitored in real time; if the interrupt signal is not cancelled, the next touch point sampling value continues to be received.
[0069] refer to Figure 5 In an embodiment of the present application, the specific steps of executing the above-mentioned touch screen pop-up processing are described in detail below.
[0070] First, based on the reported identification value, determine whether the touch point sampling value has been reported before; if the reported identification value is a valid assignment, determine that the touch point sampling value has been reported before, and exit the interrupt function directly; if the reported identification value is an invalid assignment, determine that the touch point sampling value has not been reported before, and determine whether the currently stored identification value is the first initial value; if the currently stored identification value is not the first initial value, exit the interrupt function directly; if the currently stored identification value is the first initial value, determine the second median sampling value corresponding to the stored value in the current circular queue array and take the remaining stored values as the second reference point sampling value.
[0071] In the embodiment of the present application, the specific steps of determining the second median sampling value corresponding to the stored value of the current circular queue array include: calculating the third index value of the second median sampling value based on the first index value corresponding to the last stored touch point sampling value; selecting the stored touch point sampling value corresponding to the third index value as the second median sampling value; Furthermore, the calculation formula of the third index value is: middleIdx2=[filterIdx2 / 2] Among them, middleIdx2 is the third index value, filterIdx2 is the first index value corresponding to the last stored touch point sampling value, and "[]" is a rounding operation.
[0072] Specifically, in the embodiment of the present application, the rounding operation can be rounded up. For example, when the first index value filterIdx2 corresponding to the last stored touch point sampling value is 7, the calculation result of the third index value middleIdx2 is 4. The rounding operation can also be rounded down. For example, when the first index value filterIdx2 corresponding to the last stored touch point sampling value is 7, the calculation result of the third index value middleIdx2 is 3. It should be noted that the rounding operation in the calculation formula of the second index value and the third index value needs to be consistent, that is, when the rounding operation in the calculation formula of the second index value is rounded up, the rounding operation in the calculation formula of the third index value also uses rounding up, and when the rounding operation in the calculation formula of the second index value is rounded down, the rounding operation in the calculation formula of the third index value also uses rounding down.
[0073] Then, the sum of squares of the second deviation values between the current second median sampling value and each second reference point sampling value is calculated.
[0074] Specifically, the second formula for the second deviation value square sum is:
[0075] Among them, DV 2 is the sum of squares of the second deviation values, middleIdx.x 2 is the horizontal coordinate value of the second median sampling value, middleIdx.y 2 is the ordinate value in the second median sample value, preIdx.x 2 is the horizontal coordinate value of the current second reference point sampling value, preIdx.y 2 It is the ordinate value of the current second reference point sampling value.
[0076] Next, determine one by one whether the sum of the squares of each second deviation value is less than the first preset threshold; if the sum of the squares of the second deviation values is less than the first preset threshold, increase the first valid point number corresponding to the current second median sampling value by 1, otherwise keep the first valid point number corresponding to the current second median sampling value unchanged; obtain the second final value corresponding to the current second median sampling value, and determine whether the second final value is less than or equal to the third preset threshold. In an embodiment of the present invention, the third preset threshold can be 2; if the second final value is less than or equal to the third preset threshold, exit the interrupt function directly; if the second final value is greater than the third preset threshold, report the current second median sampling value and exit the interrupt function.
[0077] Compared with the prior art, the signal filtering method based on the circular queue array provided in the embodiment of the present application uses a circular queue array to store the received touch point sampling values, and takes the middle value to compare with the other previous and next values in the circular queue array. On the one hand, the first few touch point sampling values when the touch screen is pressed and the first few touch point sampling values before the touch screen pops up are automatically filtered, effectively removing the jitter when pressing and popping up. On the other hand, the selected point is located in the middle of the circular queue array, and the comparison is made between the adjacent points in front and behind, which is suitable for the situation where the touch screen click position moves and changes rapidly, reducing the occurrence of erroneous filtering due to position changes. 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 pressing position values, and reduce the risk of equipment misoperation.
[0078] In addition, an embodiment of the present invention also provides a signal filtering device based on a circular queue array, 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 the signal filtering method based on the circular queue array as described in any of the above items.
[0079] 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 signal filtering method based on the ring queue array as described in any of the above items are implemented.
[0080] 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.
[0081] 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.
[0082] 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.
[0083] 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.
[0084] 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).
[0085] 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.
[0086] 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.
[0087] 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 on the basis of the present invention. Therefore, these modifications or improvements made on the basis of not departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.
Claims
1. A signal filtering method based on a ring queue array, characterized in that: The method comprises: Setting a storage identification value for the circular queue array and initializing the storage identification value to a first initial value; Obtaining sampling values of each touch point and storing them in the circular queue array in sequence; Establishing corresponding first index values for each touch point sampling value in sequence and initializing the corresponding first valid point number to a second initial value; Determine whether a first index value corresponding to the current touch point sampling value satisfies a first preset condition; If the first index value corresponding to the current touch point sampling value meets the first preset condition, the storage identification value is set to the update value; Determine the first median sampling value corresponding to the values stored in the current ring queue array and take the remaining stored values as the first reference point sampling values; Calculate the sum of squares of first deviations between the current first median sampling value and each first reference point sampling value; Determine one by one whether the sum of squares of the first deviation values is less than a first preset threshold; If the sum of the squares of the first deviation values is less than the first preset threshold, the first valid point number corresponding to the current first median sampling value is increased by 1; otherwise, the first valid point number corresponding to the current first median sampling value remains unchanged; Obtaining a first final value of a first valid number of points corresponding to the current first median sampling value, and determining whether the first final value is less than a second preset threshold; If the first final value is greater than or equal to the second preset threshold, determine the current first median sampling value as a valid value and report it; If the first final value is less than the second preset threshold, the current first median sampling value is determined to be an invalid value.
2. The signal filtering method based on the ring queue array according to claim 1, characterized in that: The corresponding first index values are sequentially established for each touch point sampling value, including: The first index value corresponding to the first touch point sampling value is determined to be 0 and is successively increased by 1 as the first index value corresponding to the subsequent touch point sampling values; Determine whether the first index value corresponding to the current touch point sampling 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 first index value corresponding to the current touch point sampling value reaches the maximum index value, the first index value corresponding to the next touch point sampling value is updated to 0; If the first index value corresponding to the current touch point sampling value does not reach the maximum index value, the current first index value is increased by 1 and updated to the first index value corresponding to the next touch point sampling value.
3. The signal filtering method based on the ring queue array as claimed in claim 2, characterized in that: Determining the first median sampling value corresponding to the value stored in the current ring queue array includes: Calculate a second index value of the first median sampling value based on a first index value corresponding to the current touch point sampling value; Selecting the stored touch point sampling value corresponding to the second index value as the first median sampling value; The calculation formula of the second index value is: middleIdx1=(filterIdx1+[MAX_P / 2])%MAX_P Among them, middleIdx1 is the second index value, filterIdx1 is the first index value corresponding to the current touch point sampling value, MAX_P is the length of the circular queue array, "[]" is a rounding operation, and "%" is a remainder operation.
4. The signal filtering method based on the ring queue array as claimed in claim 3, characterized in that: The method further comprises: After entering the interrupt function, the reported identification value is assigned to an invalid value; When a valid value is reported for the first time, the reported identification value assignment is set as a valid assignment; After the first index value corresponding to the next touch point sampling value is updated, 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 next touch point sampling value continues to be received.
5. The signal filtering method based on the ring queue array as claimed in claim 4, characterized in that: Perform touch screen pop-up processing, including: 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 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, determining that the touch point sampling value has not been reported before, and determining whether the currently stored identification value is the first initial value; If the current storage identification value is not the first initial value, directly exit the interrupt function; If the current storage identification value is the first initial value, determine the second median sampling value corresponding to the value stored in the current circular queue array and take the remaining stored values as the second reference point sampling value; Calculate the sum of squares of second deviations between the current second median sampling value and each second reference point sampling value; Determine one by one whether the sum of squares of the second deviation values is less than a first preset threshold; If the sum of the squares of the second deviation values is less than the first preset threshold, the first valid point number corresponding to the current second median sampling value is increased by 1; otherwise, the first valid point number corresponding to the current second median sampling value remains unchanged; Obtaining a second final value corresponding to the current second median sampling value, and determining whether the second final value is less than or equal to a third preset threshold; If the second final value is less than or equal to a third preset threshold, directly exit the interrupt function; If the second final value is greater than the third preset threshold, the current second median sampling value is reported and the interrupt function is exited.
6. The signal filtering method based on the ring queue array as claimed in claim 5, characterized in that: The first formula for the first deviation value square sum is: Wherein, DV1 is the first deviation value square sum, middleIdx.x1 is the abscissa value in the first median sampling value, middleIdx.y1 is the ordinate value in the first median sampling value, preIdx.x1 is the abscissa value in the current first reference point sampling value, and preIdx.y1 is the ordinate value in the current first reference point sampling value; The second formula for the second deviation value square sum is: Among them, DV2 is the sum of squares of the second deviation values, middleIdx.x2 is the horizontal coordinate value in the second median sampling value, middleIdx.y2 is the vertical coordinate value in the second median sampling value, preIdx.x2 is the horizontal coordinate value in the current second reference point sampling value, and preIdx.y2 is the vertical coordinate value in the current second reference point sampling value.
7. The signal filtering method based on the ring queue array according to claim 6, characterized in that: Determining the second median sampling value corresponding to the value stored in the current ring queue array includes: Calculate a third index value of the second median sampling value based on the first index value corresponding to the last stored touch point sampling value; Selecting the stored touch point sampling value corresponding to the third index value as the second median sampling value; The calculation formula of the third index value is: middleIdx2=[filterIdx2 / 2] Among them, middleIdx2 is the third index value, filterIdx2 is the first index value corresponding to the last stored touch point sampling value, and "[]" is a rounding operation.
8. A signal filtering system based on a ring queue array, characterized in that: The system comprises: An initialization module, used for setting a storage identification value for the circular queue array and initializing the storage identification value to a first initial value; A storage module, used for acquiring sampling values of each touch point and storing them in the circular queue array in sequence; establishing a corresponding first index value for each sampling value of the touch point in sequence and initializing the corresponding first valid point number as a second initial value; The filter module performs the following steps: Determine whether a first index value corresponding to the current touch point sampling value satisfies a first preset condition; If the first index value corresponding to the current touch point sampling value meets the first preset condition, the storage identification value is set to the update value; Determine the first median sampling value corresponding to the values stored in the current ring queue array and take the remaining stored values as the first reference point sampling values; Calculate the sum of squares of first deviations between the current first median sampling value and each first reference point sampling value; Determine one by one whether the sum of squares of the first deviation values is less than a first preset threshold; If the sum of the squares of the first deviation values is less than the first preset threshold, the first valid point number corresponding to the current first median sampling value is increased by 1; otherwise, the first valid point number corresponding to the current first median sampling value remains unchanged; Obtaining a first final value of a first valid number of points corresponding to the current first median sampling value, and determining whether the first final value is less than a second preset threshold; If the first final value is greater than or equal to the second preset threshold, determine the current first median sampling value as a valid value and report it; If the first final value is less than the second preset threshold, the current first median sampling value is determined to be an invalid value.
9. A signal filtering device based on a ring queue array, 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 signal filtering method based on the ring queue array 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 signal filtering method based on a ring queue array as claimed in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Identifying and tracking method and device for point locations of capacitance screen
CN106155433A
System and method capable of dynamically adjusting pressure triggering threshold
CN116719429A
Anti-jitter control method and device, equipment and storage medium
CN118170277A
Touch screen point jumping prevention method, system and equipment and storage medium
CN118377396A
Method for reducing computational time for calculating a noise-filtered average approximation of throttle position
US20060015243A1