Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Fig. 1 is the process flow diagram of an embodiment of detection method of resistive touch screen provided by the invention, and as shown in Figure 1, the method comprises:
Sample in S101, the zone that resistive touch screen is pressed;
The sampling numerical value of S102, each sampled point that sampling is obtained is stored to buffer queue;
Set number if the sampling numerical value in the described buffer queue of S103 reaches first, then report to application layer according to the difference of respectively sampling between the numerical value in the described buffer queue.
The detection method of the resistive touch screen that the embodiment of the invention provides is applicable to adopt various types of terminal devices such as mobile phone, MP3, MP4, computing machine of resistive touch screen, can also be various network communication equipment that has resistive touch screen etc.
When the resistive touch screen that detects equipment is pressed, then sampled in the zone that is pressed, the analog voltage that sampling specifically detects sampled point is converted to sampling numerical value, and sampling numerical value can represent with the coordinate figure of sampled point in resistive touch screen usually.Can repeatedly sample at each sampling time point, obtain a plurality of sampling numerical value, can adopt various existing computing method that a plurality of sampling numerical value that obtain are processed, obtain an effective sampling numerical value and be stored to buffer queue, the buffer queue that relates in the embodiment of the invention, can be the buffer memory that has in the equipment of resistive touch screen, also can be the buffer memory of carrying out on the pick-up unit of detection method of resistive touch screen.
Can set in advance first and set number, the number of the sampling numerical value of storing in buffer queue reaches first and sets number, then carries out the operation of once the sampling numerical value of storing in the buffer queue being processed and reported to application layer.This be because, in the process of sampling numerical value being processed and being reported, the sampling numerical value change that common current sampling numerical value is compared previous moment is larger, tend to be considered to invalid flying spot and be filtered, and when the user on touch-screen during quick line drawing, often the variation of the sampling numerical value between the adjacent sampled point is all larger, therefore, the sampling numerical value of sampled point can be stored in the buffer queue, when the sampling numerical value number in the buffer queue reaches some, judge whether to exist flying spot according to the difference between each sampling numerical value of buffer memory centering again, thereby can avoid filtering out the sampling numerical value of effective sampling points.
Wherein, first sets number can be according to the sample frequency size, the various operations that the user carries out touch-screen, such as: the situation of change of sampling numerical value between sampled point when clicking operation, normal speed setting-out or quick line drawing etc. operate fast, and the time-delay situation that reports is comprehensively chosen.As a kind of better embodiment, first sets number can choose 16, can either effectively avoid the sampling numerical value of the effective sampling points that filters out, guarantees that again the time-delay that reports is shorter, does not affect the sensitivity of resistive touch screen.
If reaching first, the sampling numerical value in the described buffer queue that relates in the embodiment of the invention sets number, then report to application layer according to the difference of respectively sampling between the numerical value in the described buffer queue, refer to: the sampling numerical value in buffer queue reaches first and sets number, then once reports.After once reporting, when the sampling numerical value in the buffer queue reaches the first setting number again, then report next time.
When the sampling numerical value number in the buffer queue satisfies the first setting number, report specifically to application layer according to the difference between the numerical value of respectively sampling in the buffer queue and can be: judge that whether the difference between each adjacent sampling numerical value (being adjacent coordinate) is less than the 3rd setting threshold in the buffer queue, if the difference of certain two adjacent sampling numerical value is greater than the 3rd setting threshold in the buffer queue, it is larger to illustrate that then sampling numerical value is compared other sampling numerical value change, then can not report the numerical value of respectively sampling in the current buffer queue.
As the better embodiment of another kind, because in beginning a period of time that touch-screen is pressed (normally very short a period of time), and touch-screen lifts (also being in a period of time of lacking very much usually) in front a period of time, than being easier to produce flying spot, and in the time period between a period of time before beginning a period of time that touch-screen is pressed and touch-screen lift, usually be not easy to produce flying spot, therefore, can also judge respectively the difference situation between several sampling numerical value (being that touch-screen is stored to the some sampling numerical value in the buffer queue in beginning a period of time of being pressed) that are stored at first in the buffer queue, and be stored at last difference situation between several samplings numerical value (being the some sampling numerical value that are stored in touch-screen lifts for the previous period in the buffer queue) in the buffer queue, for example: can judge whether the difference between the neighbouring sample numerical value surpasses the second setting threshold in 5 sampling numerical value of at first storage; Sample whether surpass the second setting threshold between the numerical value for 5 that also can judge last storage.If at first several sampling numerical value of storage or at last several sampling numerical value of storage, difference between its neighbouring sample numerical value surpasses the second setting threshold, then can filter out several sampling numerical value that (namely not reporting) formerly store or filter out several sampling numerical value in rear storage, unfiltered sampling numerical value in the buffer queue is reported application layer.
The detection method of the resistive touch screen that the embodiment of the invention provides, the sampling numerical value of sampled point is stored to buffer queue, sampling numerical value in buffer queue reaches some, again the numerical value of respectively sampling in the buffer queue is processed and reported, avoid effective sampling numerical value to be filtered, improved the sensitivity of resistive touch screen.
Fig. 2 is the process flow diagram of another embodiment of detection method of resistive touch screen provided by the invention, as shown in Figure 2, in the method that present embodiment provides, when providing the sampling numerical value in the buffer queue to satisfy the first setting number at every turn, to application layer report the sampling numerical value detailed process, the method comprises:
S201, detect touch-screen and be pressed;
S202, startup timer; Timing arrives, and then carries out S203, otherwise continues to carry out S202;
Wherein, the timing of timer can be a period of time of lacking very much, and the effect of timer is, treats to carry out sampling operation after the stable operation that touch-screen is pressed again.
S203, at each point repeatedly continuous sampling is carried out in the zone that touch-screen is pressed in sampling time;
Sample specifically: the analog voltage that sampled point is detected is converted to sampling numerical value, and sampling numerical value can represent with the coordinate figure of sampled point in resistive touch screen usually.
S204, judge that whether difference between the sampling numerical value that the repeatedly continuous sampling of each point obtains in sampling time is less than or equal to the 4th setting threshold; Be, then carry out S205, otherwise carry out S203, next sampled point is carried out repeatedly continuous sampling;
The step of S204 is to differ larger flying spot for filtering sampling numerical value and actual numerical value.
S205, the sampling numerical value that continuous sampling is repeatedly obtained are processed, and obtain an effectively sampling numerical value;
Wherein, the processing that the sampling numerical value that among the S205 continuous sampling is repeatedly obtained carries out obtains an effectively process of sampling numerical value, can adopt existing various algorithm to realize.For example: the mean value algorithm, interpolation algorithm etc. are not enumerated one by one at this.
S206, described effective sampling numerical value is stored to described buffer queue;
S207, record sampling numerical value are stored to the timestamp information of described buffer queue;
S208, judge whether sampling numerical value in the buffer queue reaches first and set number; Be, then carry out S209, otherwise carry out S203, next sampling time point is carried out repeatedly continuous sampling;
Wherein, first sets number can be according to the sample frequency size, the various operations that the user carries out touch-screen, such as: the situation of change of sampling numerical value between sampled point when clicking operation, normal speed setting-out or quick line drawing etc. operate fast, and the time-delay situation that reports is comprehensively chosen.In the present embodiment, first sets number can choose 16, can either effectively avoid the sampling numerical value of the effective sampling points that filters out, guarantees that again the time-delay that reports is shorter, does not affect the sensitivity of resistive touch screen.
S209, judge in the described buffer queue in n the numerical value of sampling of m sampling numerical value of formerly storage and/or last storage according to described timestamp information, whether the difference between the neighbouring sample numerical value is greater than the second setting threshold, wherein, m>0, n>0, and m and n be all less than sampling numerical value number current in the described buffer queue, m and n's and set number less than described first; Be, then carry out S210, otherwise carry out S211;
M sampling numerical value of S210, the described formerly storage of filtering, and/or the n of the described last storage of filtering sampling numerical value;
S209 and S210 be for judging the part in buffer queue sampling numerical value, partly the sample process of numerical value of filtering, and this only is a kind of feasible embodiment.
As the feasible embodiment of another kind, among S209 and the S210, can also judge all the sampling numerical value in the buffer queue, judge that specifically whether difference between each adjacent sampling numerical value is less than the 3rd setting threshold.If the difference of certain two adjacent sampling numerical value is greater than the 3rd setting threshold in the buffer queue, it is larger to illustrate that then sampling numerical value is compared other sampling numerical value change, then can not report the numerical value of respectively sampling in the current buffer queue, namely directly returns and carries out S208.If the difference in the buffer queue between each neighbouring sample numerical value is less than or equal to described the 3rd setting threshold, then can according to the timestamp information of each neighbouring sample numerical value in the buffer queue, according to the time order and function order each neighbouring sample numerical value in the buffer queue be reported to application layer.
S211, not by the sampling numerical value of filtering, adopt the sampling numerical value of self and adjacent half replacement that formerly is stored to the sampling numerical value sum in the described buffer queue;
Concrete, because the sampling numerical value in the buffer queue is with the coordinate figure (x in the touch-screen, y) form represents, if a certain is not (x5 by the sampling numerical value of filtering, y5), the sampling numerical value that formerly is stored in the buffer queue that then is adjacent can be with (x4, y4) expression, wherein, " 4 " in (x4, y4) represent that the 4th is stored to buffering to the sampling numerical value the row, (x5 on time sequencing, y5) " 5 " expression in, the 5th is stored to buffering to the sampling numerical value in the row.Then adopt the method for S211, can not replaced with ((x4+x5)/2, (y4+y5)/2) by the sampling numerical value (x5, y5) of filtering.
S212, according to not by the timestamp information of the sampling numerical value of filtering, the sampling numerical value after will replacing according to the time order and function order reports to described application layer, execution S208.
The process of S211 for the sampled data in the buffer queue is processed, in the present embodiment, what the process that S211 processes sampled data adopted is the method for running mean value filtering, this only is a kind of feasible embodiment, but not with this restriction as the embodiment of the invention, in fact can also adopt other disposal routes that the data in the buffer queue are processed.
In addition, timestamp among the S207 in the record sampling numerical value storing value buffer queue, can sample the storage time of numerical value by clearer and more definite each, begin interior flying spot of a period of time thereby more help the filtering touch-screen to be pressed, and the filtering touch-screen is lifted interior for the previous period flying spot.In addition, report to application layer according to the time sequencing numerical value of will sampling, can help application layer to the subsequent treatment of sampling numerical value, the sensitivity that can more effectively improve touch-screen.
This enforcement has provided when the sampling numerical value in the buffer queue is each to satisfy the first setting number, reports the detailed process of sampling numerical value to application layer.Fig. 3 is the process flow diagram of another embodiment of detection method of resistive touch screen provided by the invention, among the embodiment as shown in Figure 3, provides after detecting touch-screen and being lifted, and reports the detailed process of sampling numerical value to application layer, and the method comprises:
S301, detect touch-screen and be lifted;
S302, judge whether to report sampling numerical value to application layer; If do not report the sampling numerical value in sampling numerical value and the described buffer queue to set number less than described first to described application layer, then carry out S303a; If report sampling numerical value to described application layer, perhaps the sampling numerical value in the described buffer queue reaches described the first setting number, then carries out S303b;
S303a, judge that whether the sampling numerical value number in the described buffer queue set number more than or equal to second; Be, then carry out S304a, otherwise flow process finishes (namely do not carry out and report operation);
If after providing the sampling numerical value number of judging among the S303a in the buffer queue to set number more than or equal to described second in the present embodiment, then further carry out the method for S304a.
As the feasible embodiment of another kind, if the sampling numerical value number of judging among the S303a in the buffer queue is set number more than or equal to described second, then can directly the sampling numerical value in the described buffer queue be reported to described application layer.
S304a, judge that the difference of respectively sampling in the described buffer queue between the numerical value whether less than or equal to the first setting threshold, is, then carry out S305a, otherwise flow process finishes (namely do not carry out and report operation);
S305a, the mean value of the numerical value of respectively sampling in the described buffer queue is reported to described application layer.
The mean value with the numerical value of respectively sampling in the buffer queue that S305a provides reports to described application layer, only is a kind of feasible embodiment.Be understandable that, if judge the difference of respectively sampling in the buffer queue between the numerical value among the S304a less than or equal to the first setting threshold, then can directly the numerical value of respectively sampling in the buffer queue be reported to described application layer.
If judging, S302 not yet reports operation, and the sampling numerical value in the buffer queue is set number less than first, represent that then sampling numerical value in the buffer queue not yet reaches first and sets number and just detect touch-screen and be lifted, then might be that the user is carrying out quick clicking operation, it is usually less to click fast the sampled point number that can gather in the operating process, in this case, if in S303a, judge sampling numerical value number in the buffer queue less than some, sampled point then is described very little, it probably is flying spot, then flow process finishes, do not carry out and report operation, if the sampling numerical value number in the buffer queue is set number more than or equal to second, can judge further that then whether the difference of respectively sampling between the numerical value is less than or equal to the first setting threshold, if so, then there is not flying spot in explanation, then can report operation.In addition, because fast normally user's operation of (being similar to a sampled point) carrying out in a certain very zonule of clicking operation, therefore, the mean value that can get the numerical value of respectively sampling reports to application layer.
Wherein, the second setting number can be set according to usually clicking fast the sampled point quantity that can collect in the operating process.
S303b, record sampling numerical value are stored to the timestamp information of described buffer queue;
S304b, judge in the described buffer queue in n the numerical value of sampling of m sampling numerical value of formerly storage and/or last storage according to described timestamp information, whether the difference between the neighbouring sample numerical value is greater than the second setting threshold, wherein, m>0, n>0, and m and n be all less than sampling numerical value number current in the described buffer queue, m and n's and set number less than described first; Be, then carry out 305b, otherwise carry out 306b;
M sampling numerical value of 305b, the described formerly storage of filtering, and/or the n of the described last storage of filtering sampling numerical value;
306b, adopt current sampling numerical value and adjacent half replacement that formerly is stored to the sampling numerical value sum in the described buffer queue described not by the sampling numerical value of filtering;
307b, according to not by the timestamp information of the sampling numerical value of filtering, the sampling numerical value after will replacing according to the time order and function order reports to described application layer.
Wherein, S302 judges and reports sampling numerical value to described application layer, perhaps the sampling numerical value in the described buffer queue reaches described the first setting number, what illustrate then that the user carries out may be normal line operation, perhaps fast scribing operation, in this case, the number of the sampled point that can collect is set number greater than first, therefore, the S304b-307b step of follow-up execution, can be referring to the process of S209-S212 among the last embodiment, its difference only is to need not to judge whether the sampling numerical value in the buffer queue has reached the first setting number again.
Be understandable that, report sampling numerical value to application layer, refer to that touch-screen is pressed and the process lifted in the number of the sampled point that can collect greater than the first situation of setting number, in this case, give the correct time on last, sampling numerical value number in the buffer queue is set number less than first, but still can adopt the method for S210 and S211 to report.Sampling numerical value in the buffer queue reaches described first and sets number, refer to and not yet report operation, sampling numerical value in the buffer queue reaches the situation of the first setting numerical value for the first time, in this case, the operation of carrying out can be referring to the process of S207-S211, and its difference only is to need not to judge whether the sampling numerical value in the buffer queue has reached the first setting number again.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in above-described embodiment method, to come the relevant hardware of instruction to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process such as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or store-memory body (Random Access Memory, RAM) etc. at random.
Fig. 4 is the structural representation of an embodiment of pick-up unit of resistive touch screen provided by the invention, and as shown in Figure 4, this device comprises: sampling unit 11, storage unit 12 and report unit 13;
Wherein, sampling unit 11 is used for being sampled in the zone that resistive touch screen is pressed;
Storage unit 12, the sampling numerical value that is used for each sampled point that sampling is obtained is stored to buffer queue;
Report unit 13, reach the first setting number if be used for the sampling numerical value of described buffer queue, then report to application layer according to the difference of respectively sampling between the numerical value in the described buffer queue.
Fig. 5 is the structural representation of another embodiment of pick-up unit of resistive touch screen provided by the invention, and as shown in Figure 5, this device comprises: sampling unit 11, storage unit 12 and report unit 13;
Further, this pick-up unit can also comprise:
Detecting unit 14 is for detection of described touch-screen pressed state;
Judging unit 15 is used for being lifted when described detecting unit 14 detects described touch-screen, judges then whether the described unit that reports reports sampling numerical value to application layer;
The described unit 13 that reports also is used for: if do not report the sampling numerical value of sampling numerical value and described buffer queue to set number less than described first to described application layer, then report to application layer according to the sampling numerical value number in the described buffer queue; If report sampling numerical value to described application layer, perhaps the sampling numerical value in the described buffer queue reaches described the first setting number, then reports to application layer according to the difference of respectively sampling between the numerical value in the described buffer queue.
Further, report unit 13 specifically to be used for: to set number when the sampling numerical value number of described buffer queue more than or equal to described second, then the sampling numerical value in the described buffer queue is reported to described application layer.
Report unit 13 to be used for: when the sampling numerical value number of described buffer queue is set number more than or equal to described second, judge that then whether the difference of respectively sampling in the described buffer queue between the numerical value is less than or equal to the first setting threshold, difference between the numerical value then reports to described application layer with the sampling numerical value in the described buffer queue less than or equal to the first setting threshold if respectively sample in the described buffer queue.
This pick-up unit can also comprise:
Timestamp unit 16 is used for the timestamp information that record sampling numerical value is stored to described buffer queue.
Report unit 13 specifically to be used for: to set number when the sampling numerical value of described buffer queue reaches described first, judge according to described timestamp information in n the sampling numerical value of formerly m of storage sample numerical value and/or last storage in the described buffer queue, whether the difference between the neighbouring sample numerical value is greater than the second setting threshold, wherein, m>0, n>0, and m and n be all less than sampling numerical value number current in the described buffer queue, m and n's and set number less than described first; If the difference of neighbouring sample numerical value is greater than described the second setting threshold in m the sampling numerical value of described formerly storage, then m sampling numerical value of the described formerly storage of filtering; If described in n of rear storage sampling numerical value the difference of neighbouring sample numerical value greater than described the second setting threshold, the n of the described last storage of filtering numerical value of sampling then; According in the described buffer queue not by the timestamp information of the sampling numerical value of filtering, do not reported to described application layer by the sampling numerical value of filtering according to the time order and function order with described.
Concrete, report unit 13 to be used for: behind n sampling numerical value of m the sampling numerical value of formerly storing from described buffer queue filtering and/or last storage, described not by the sampling numerical value of filtering, adopt the sampling numerical value of self and adjacent half replacement that formerly is stored to the sampling numerical value sum in the described buffer queue; Not by the timestamp information of the sampling numerical value of filtering, the sampling numerical value after will replacing according to the time order and function order reports to described application layer according to described.
The described unit 13 that reports specifically is used for: set number when the sampling numerical value of described buffer queue reaches described first, judge that then whether the difference between each neighbouring sample numerical value is less than the 3rd setting threshold in the described buffer queue; If the difference in the described buffer queue between each neighbouring sample numerical value is less than or equal to described the 3rd setting threshold, then according to the timestamp information of each neighbouring sample numerical value in the described buffer queue, according to the time order and function order each neighbouring sample numerical value in the described buffer queue is reported to described application layer.
Further, this pick-up unit can also comprise:
Timer 17 is used for detecting described touch-screen at described detecting unit 14 and is pressed, and then starts;
Described sampling unit 11 specifically is used for: if reach the timing of described timer, then at each sampling time point repeatedly continuous sampling is carried out in the zone that described touch-screen is pressed.
Storage unit 12 can specifically be used for: the difference between the sampling numerical value that the repeatedly continuous sampling of putting when each sampling time obtains is less than or equal to the 4th setting threshold, the sampling numerical value that then described repeatedly continuous sampling is obtained is processed, obtain an effectively sampling numerical value, and described effective sampling numerical value is stored to described buffer queue.
The pick-up unit of the resistive touch screen that the embodiment of the invention provides, its function can adopt software mode to realize, also can be integrated into digital signal processing (Digital Signal Processing; Be called for short; DSP) chip or field programmable gate array (Field-Programmable Gate Array; Be called for short: FPGA) carry out software development on the chip and realize, also can pass through special IC (Application Specific Integrated CirCuit; Be called for short: mode ASIC) is solidified realization.
The pick-up unit of the resistive touch screen that the embodiment of the invention provides, the actuating unit of the detection method of the resistive touch screen that provides for the embodiment of the invention, the detection method of the resistive touch screen that provides with the embodiment of the invention is corresponding, its concrete detection method implementation can referring to embodiment of the method, repeat no more.
The pick-up unit of the resistive touch screen that the embodiment of the invention provides, the sampling numerical value of sampled point is stored to buffer queue, sampling numerical value in buffer queue reaches some, again the numerical value of respectively sampling in the buffer queue is processed and reported, avoid effective sampling numerical value to be filtered, improved the sensitivity of resistive touch screen.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment puts down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.