Summary of the invention
In view of above-mentioned the deficiencies in the prior art, the object of the present invention is to provide a kind of mobile terminal touch screen unlock method and system, the release action that is intended to solve current unlock method immobilizes and causes user to experience to decline and problem that touch-screen reduces serviceable life.
Technical scheme of the present invention is as follows:
A kind of mobile terminal touch screen unlock method, wherein, said method comprising the steps of:
A, reception user instruction are lighted screen and are shown locking screen interface, detect that user touches touch-screen, obtain the sliding trace of user on touch-screen;
B, the touch point of sliding trace process is resolved, utilize the touch point parsing to calculate the triangle area that any three touch points form;
C, obtain the triangle area of numerical value maximum and itself and predetermined threshold value are compared, in the time that obtained triangle area is greater than threshold value, touch-screen being carried out to release.
Described mobile terminal touch screen unlock method, wherein, detects in described steps A that user touches touch-screen, obtains the sliding trace of user on touch-screen and is specially:
Detect that user touches after touch-screen, start to obtain the sliding trace of user on touch-screen until detect that user discharges touch-screen.
Described mobile terminal touch screen unlock method, wherein, also comprises before described steps A:
In advance touch-screen is set up to the coordinate system for the touch point of sliding trace process is resolved, described coordinate system is taking touch-screen top left corner apex as initial point, and taking screen top margin as X-axis, limit, screen left side is that Y-axis is set up
Described mobile terminal touch screen unlock method, wherein, in described step B, the touch point of sliding trace process is resolved and is specially:
Utilize the coordinate system of setting up in advance to parse the touch point coordinate of sliding trace process.
Described mobile terminal touch screen unlock method, wherein, the triangle area of utilizing the touch point parsing to calculate any three touch points formation in described step B is specially:
The touch point coordinate that utilization parses judges that any three touch points whether on same straight line, in the time judging that three touch points are not on same straight line, calculate and record this three triangle areas that touch point forms according to its coordinate.
Described mobile terminal touch screen unlock method, wherein, utilize the touch point coordinate that parses judge any three touch points whether the condition on same straight line be:
If the coordinate of three touch points that judge is respectively (x
i, y
i), (x
j, y
j), (x
k, y
k), as (y
i-y
j) × (x
j-x
k)=(y
j-y
k) × (x
i-x
j) time, judge that these three touch points are on same straight line; As (y
i-y
j) × (x
j-x
k) ≠ (y
j-y
k) × (x
i-x
j) time, judge that these three touch points are not on same straight line.
Described mobile terminal touch screen unlock method, wherein, when coordinate is respectively (x
i, y
i), (x
j, y
j), (x
k, y
k) three touch points not on same straight line time, utilize following formula to calculate the triangle area that these three touch points form through judgement:
wherein, in above formula
Described mobile terminal touch screen unlock method, wherein, described step C is specially:
C1, calculated triangle area is compared, obtain the wherein triangle area of numerical value maximum;
C2, obtained triangle area and predetermined threshold value are compared, if this triangle area is greater than threshold value, touch-screen is carried out to release.
A kind of mobile terminal touch screen system for unlocking, wherein, described system comprises:
Acquisition module, lights screen and shows locking screen interface for receiving user instruction, detects that user touches touch-screen and obtains the sliding trace of user on touch-screen;
Computing module, for the touch point of sliding trace process is resolved, utilizes the touch point parsing to calculate the triangle area that any three touch points form;
Module is set, for obtaining the triangle area of numerical value maximum and itself and predetermined threshold value being compared, in the time that obtained triangle area is greater than threshold value, touch-screen is carried out to release.
Described mobile terminal touch screen system for unlocking, wherein, described system also comprises:
Comparison module, compares for the triangle area that computing module is calculated, and draws the wherein triangle area of numerical value maximum.
Beneficial effect: the invention provides mobile terminal touch screen unlock method and a system, unlock method of the present invention adopts the method that judges touch point size to realize, thereby release interface is fully utilized, the problem of having avoided existing release fixedly to cause sensor accuracy to reduce due to release region.Meanwhile, the mobile terminal releasing process that at every turn slides can be selected sliding trace voluntarily by user, simple to operate, convenient, quick, has extended the serviceable life of touch-screen, has improved user's Product Experience degree.
Embodiment
The invention provides mobile terminal touch screen unlock method and a system, for making object of the present invention, technical scheme and effect clearer, clear and definite, below the present invention is described in more detail.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
A kind of mobile terminal touch screen unlock method specific embodiment as shown in Figure 1, wherein, said method comprising the steps of:
S100, reception user instruction are lighted screen and are shown locking screen interface, detect that user touches touch-screen, obtain the sliding trace of user on touch-screen.
Carrying out before release, in advance taking touch-screen top left corner apex as initial point, taking screen top margin as X-axis, limit, screen left side is that Y-axis is set up coordinate system, for the touch point of sliding trace process is resolved.
More specifically, obtaining user's sliding trace step on touch-screen is: detect that user touches after touch-screen, start to obtain the sliding trace of user on touch-screen until detect that user discharges touch-screen.User discharges touch-screen, determining that sliding trace completes can judge by the stand-by time of user's touch action, in this technological means, arrange and judge an effective time, for example, in the time detecting that user has discharged touch-screen, start timing, as user's the operation of touch again do not detected within effective time, just think that user has discharged touch-screen, obtain user's sliding trace, if user's slide on touch-screen again again detected within effective time, continue the sliding trace of recording user.Like this, can avoid user in the time carrying out unlock screen operation, because the careless of short duration touch-screen that leaves causes the false judgment to sliding trace, user friendly operation.Certainly, also can take other modes to realize the confirmation to sliding trace to user, for example, discharging after touch-screen, " whether complete " cue button in release interface display, and confirm by receiving user's click commands whether sliding trace operation completes.
S200, the touch point of sliding trace process is resolved, utilize the touch point parsing to calculate the triangle area that any three touch points form.
Further, above-mentioned parsing touch point, the step of the triangle area that calculating touch point forms as shown in Figure 2, is specially:
The coordinate system that S210, utilization are set up in advance parses the touch point coordinate of sliding trace process.
S220, utilize the touch point coordinate that parses to judge that any three touch points are whether on same straight line, judge three touch points whether the mode on same straight line be specially: the coordinate of establishing three touch points that judge is respectively (x
i, y
i), (x
j, y
j), (x
k, y
k), as (y
i-y
j) × (x
j-x
k)=(y
j-y
k) × (x
i-x
j) time, judge that these three touch points are on same straight line; As (y
i-y
j) × (x
j-x
k) ≠ (y
j-y
k) × (x
i-x
j) time, judge that these three touch points are not on same straight line.In the time judging that three touch points are not on same straight line, execution step S230, calculates and records this three triangle areas that touch point forms according to its coordinate.In the time judging that three touch points are on same straight line, again choose behind any touch point execution step S220.
S230, coordinate are respectively (x
i, y
i), (x
j, y
j), (x
k, y
k) three touch points, utilize following formula to calculate the triangle area that these three touch points form:
Wherein, in above formula
S300, obtain the triangle area of numerical value maximum and itself and predetermined threshold value are compared, whether the triangle area that judgement is obtained is greater than threshold value, if so, performs step S400, and touch-screen is carried out to release, if not, performs step S500.
Further, step S300 is specially:
S310, calculated triangle area is compared, obtain the wherein triangle area of numerical value maximum.The algorithm that has at present multiple maturation about obtaining the method for maximum triangle area is realized, and the present invention adopts general algorithm at present to realize this comparison procedure, this process is not repeated.
S320, obtained triangle area and predetermined threshold value are compared, if this triangle area is greater than threshold value, touch-screen is carried out to release.
Described threshold value for can being preset by user before release step is carried out in mobile terminal, preferably, mobile terminal can also be in unlock screen interface display the figure with the corresponding area of threshold value, the sliding trace that should complete on touch-screen when prompting user release.Because Threshold is numerical value, user is difficult to accurate judgement for the graphics area of this numerical value representative, may cause release time, needs repeatedly, and repeatable operation just can complete.Above-mentioned technological means, by giving threshold value corresponding graphical cues, can determine user rapidly, judges the needed size of release, finally reaches user-friendly effect.
In another embodiment, described threshold value can also be adjusted voluntarily according to user's operating habit.Particularly, the mobile terminal records multiple maximum triangle area numerical value that repeatedly touch screen unlocking process draws, utilize the multiple maximum triangle area numerical value value of averaging recording to calculate, and utilize this mean value and user predefined threshold value comparison in mobile terminal, and make adjustment voluntarily, make it more approach the mean value of maximum triangle area.Above-mentioned technological means has reached the object that releasing process is set according to user operation habits, due to the operating habit difference of different user releasing process, if threshold value is unalterable, for some less user of custom sliding trace scope, numerical value arranges the too high operating habit that will cause it need to repeatedly carry out unlocking operation or change oneself, this just may cause puzzlement to user, therefore, the maximum triangle area numerical value obtaining in the each unlocking operation process of unlock method meeting recording user of the present invention, adjusts default value voluntarily.
S400, touch-screen carry out release, execution step S600.
S500, within second schedule time, whether receive user's operational order, if so, return to step S100, if not, perform step S600.
In the time that the maximum triangle area drawing is less than threshold value, touch-screen shows the information of release failure.And wait for and again receive the unlocking operation of user at release interface within second schedule time.If receive user's operational order again within second schedule time, return to step S100, again obtain sliding trace.The second described schedule time can be arranged or default setting when mobile terminal dispatches from the factory voluntarily by user.
S600, end.
A kind of mobile terminal touch screen system for unlocking specific embodiment as shown in Figure 3, wherein, described system comprises the following steps:
Acquisition module 100, lights screen and shows locking screen interface for receiving user instruction, detects user and touches touch-screen and obtain the sliding trace of user on touch-screen;
Computing module 200, for the touch point of sliding trace process is resolved, utilizes the touch point parsing to calculate the triangle area that any three touch points form;
Module 300 is set, for obtaining the triangle area of numerical value maximum and itself and predetermined threshold value being compared, in the time that obtained triangle area is greater than threshold value, touch-screen is carried out to release.
Comparison module 400, compares for the triangle area that computing module is calculated, and draws the wherein triangle area of numerical value maximum.
Be illustrated in figure 4 utilize that the present invention's system described above realizes the specific embodiment of touch screen unlocking method, its step is as follows:
S1, user light screen and trigger unlocking program;
S2, acquisition module detect user and touch touch-screen, obtain the sliding trace of user on touch-screen;
S3, computing module, according to default coordinate system, are resolved the touch point of sliding trace process;
S4, computing module judge whether any three touch points are located along the same line, and if not, execution step S5, if so, chooses touch point again, re-executes step S4;
S5, computing module calculate the triangle area that any three touch points form, and export comparison module to;
The triangle area that S6, comparison module comparison computing module calculate, draws the wherein triangle area of numerical value maximum;
S7, arrange module comparison sliding trace process touch point form maximum triangle area whether be greater than threshold value, if so, perform step S8, if not, perform step S9;
S8, release success, carry out release to touch-screen;
S9, release unsuccessfully, show the user that is prompted to of release failure.
In sum, the invention provides mobile terminal touch screen unlock method and a system, unlock method of the present invention adopts the method that judges touch point size to realize, thereby release interface is fully utilized, the problem of having avoided existing release fixedly to cause sensor accuracy to reduce due to release region.Meanwhile, the mobile terminal releasing process that at every turn slides can be selected sliding trace voluntarily by user, simple to operate, convenient, quick, has extended the serviceable life of touch-screen, has improved user's Product Experience degree.
Should be understood that, application of the present invention is not limited to above-mentioned giving an example, and for those of ordinary skills, can be improved according to the above description or convert, and all these improvement and conversion all should belong to the protection domain of claims of the present invention.