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 is obtained 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, this 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;
S103, set number, then report to application layer according to the difference of respectively sampling between the numerical value in the described buffer queue if the sampling numerical value in the described buffer queue reaches first.
The detection method of the resistive touch screen that the embodiment of the invention provides is applicable to various types of terminal devices such as the mobile phone that adopts resistive touch screen, MP3, MP4, computing machine, can also be the various network communication equipment etc. with resistive touch screen.
When the resistive touch screen that detects equipment is pressed, then sampled in the zone that is pressed, sampling specifically is that the detected analog voltage of sampled point is converted to sampling numerical value, and sampling numerical value can be represented 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 handled, 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 handled and reported to application layer.This be because, in the process of sampling numerical value being handled and being reported, the sampling numerical value change that common current sampling numerical value is compared previous moment is bigger, tend to be considered to invalid flying spot and be filtered, and when the user on touch-screen during quick line drawing, the variation of the sampling numerical value between the often adjacent sampled point is all bigger, 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, for example: the situation of change of sampling numerical value between sampled point when clicking operation, normal speed setting-out or quick line drawing etc. are operated fast, and the time-delay situation that reports is comprehensively chosen.As a kind of preferred implementation, 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 influence the sensitivity of resistive touch screen.
What relate in the embodiment of the invention sets number if the sampling numerical value in the described buffer queue reaches first, 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 once more, 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 bigger 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 another kind of preferred implementation, because in beginning a period of time that touch-screen is pressed (normally very short a period of time), and touch-screen in a period of time before lifting (also be usually very short a period of time in), relatively be easy to generate 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 the difference situation between several sampling numerical value of being stored at first in the buffer queue (be beginning a period of time stored of being pressed of touch-screen to the buffer queue some sampling numerical value) respectively, and be stored to difference situation between several sampling numerical value in the buffer queue (being that touch-screen lifts the some sampling numerical value to the buffer queue of stored for the previous period) at last, for example: can judge whether the difference between the neighbouring sample numerical value surpasses second setting threshold in 5 sampling numerical value of storage at first; Sample whether surpass second setting threshold between the numerical value for 5 that also can judge last storage.If Cun Chu several sampling numerical value or several sampling numerical value of storage at first at last, difference between its neighbouring sample numerical value surpasses second setting threshold, then can filter out several sampling numerical value that (promptly not reporting) formerly store or filter out several sampling numerical value, unfiltered sampling numerical value in the buffer queue is reported application layer in the back storage.
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 handled 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, this 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 very short a period of time, and the effect of timer is, treats to carry out sampling operation again after the stable operation that touch-screen is pressed.
S203, repeatedly continuous sampling is carried out in the zone that touch-screen is pressed at each point in sampling time;
Sample specifically: the detected analog voltage of sampled point is converted to sampling numerical value, and sampling numerical value can be represented 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 smaller 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 bigger flying spot for filtering sampling numerical value and actual numerical value.
S205, the sampling numerical value that continuous sampling is repeatedly obtained are handled, 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, for example: the situation of change of sampling numerical value between sampled point when clicking operation, normal speed setting-out or quick line drawing etc. are operated 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 influence 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 storage formerly and/or last storage according to described timestamp information, whether the difference between the neighbouring sample numerical value is greater than 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 storage formerly 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 possible implementation.
As another kind of possible implementation, among S209 and the S210, can also judge all the sampling numerical value in the buffer queue, specifically be to judge that 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 bigger 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, promptly directly returns and carries out S208.If the difference in the buffer queue between each neighbouring sample numerical value is smaller or equal to described the 3rd setting threshold, then can according to the time order and function order each neighbouring sample numerical value in the buffer queue be reported to application layer according to the timestamp information of each neighbouring sample numerical value in the buffer queue.
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 and since the sampling numerical value in the buffer queue be with the coordinate figure in the touch-screen (x, y) form is represented, 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, (x4, y4) in " 4 " 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, (x5 y5) can not replace with ((x4+x5)/2, (y4+y5)/2) by the sampling numerical value 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 handled, in the present embodiment, what the process that S211 handles sampled data adopted is the method for running mean value filtering, this only is a kind of possible implementation, but, in fact can also adopt other disposal routes that the data in the buffer queue are handled not with this restriction as the embodiment of the invention.
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, can help the subsequent treatment of application layer, the sensitivity that can more effectively improve touch-screen sampling numerical value according to the time sequencing numerical value of will sampling.
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 this 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, then carry out S303a less than described first to described application layer; If report sampling numerical value to described application layer, the sampling numerical value in the perhaps described buffer queue reaches described first and sets 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 (promptly 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 in the present embodiment, then further carry out the method for S304a more than or equal to described second.
As another kind of possible implementation,, then can directly the sampling numerical value in the described buffer queue be reported to described application layer 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.
S304a, judge that the difference of respectively sampling in the described buffer queue between the numerical value whether smaller or equal to first setting threshold, is, then carry out S305a, otherwise flow process finishes (promptly 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 possible implementation.Be understandable that,, then can directly the numerical value of respectively sampling in the buffer queue be reported to described application layer if judge the difference of respectively sampling in the buffer queue between the numerical value among the S304a smaller or equal to first setting threshold.
If judging, S302 reports operation as yet, 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 does not reach first as yet and sets number and just detect touch-screen and be lifted, then might be that the user is carrying out quick clicking operation, the sampled point number that can gather in the clicking operation process is less usually fast, 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, be flying spot probably, 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 smaller or equal to first setting threshold, if 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 the sampled point quantity that can collect in the usually quick clicking operation 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 storage formerly and/or last storage according to described timestamp information, whether the difference between the neighbouring sample numerical value is greater than 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 storage formerly 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, sampling numerical value in the perhaps described buffer queue reaches described first and sets number, what illustrate then that the user carries out may be normal line operation, perhaps line operation fast, 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 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 report operation as yet, 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 the foregoing description method, be to instruct relevant hardware to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
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 of each sampled point that is used for sampling is obtained is stored to buffer queue;
Report unit 13, be used for setting number, then report to application layer according to the difference of respectively sampling between the numerical value in the described buffer queue if the sampling numerical value of described buffer queue reaches first.
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 used to detect 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, the sampling numerical value in the perhaps described buffer queue reaches described first and sets 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 smaller or equal to first setting threshold, difference between the numerical value then reports to described application layer with the sampling numerical value in the described buffer queue smaller or equal to first setting threshold if respectively sample in the described buffer queue.
This pick-up unit can also comprise:
Timestamp unit 16 is used to write down the timestamp information that 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 m of storage sample numerical value and/or last storage formerly in the described buffer queue, whether the difference between the neighbouring sample numerical value is greater than 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 second setting threshold in m the sampling numerical value of described storage formerly, then m sampling numerical value of the described storage formerly of filtering; If described in n sampling numerical value of back storage the difference of neighbouring sample numerical value greater than described 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 according to the time order and function order with described by the sampling numerical value of filtering.
Concrete, report unit 13 to be used for: behind n sampling numerical value of m 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 smaller or equal to described the 3rd setting threshold, then, each neighbouring sample numerical value in the described buffer queue is reported to described application layer according to the time order and function order according to the timestamp information of each neighbouring sample numerical value in the described buffer queue.
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 smaller or equal to the 4th setting threshold, then the sampling numerical value that described repeatedly continuous sampling is obtained is handled, 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 repeat no more referring to method embodiment.
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 handled 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 put 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.