Disclosure of Invention
The invention provides a simple verification method based on image movement, which is convenient and quick to use, in order to overcome the defects in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
a simple verification method based on image movement specifically comprises the following steps:
(1) randomly acquiring a picture from an existing picture library, taking a point at the lower left corner of the picture as an origin of an X axis and a Y axis, and randomly generating two numbers in the size range of the picture as coordinates of a comparison point;
(2) taking the coordinate point as a center, and digging a small drawing factor with a fixed size;
(3) when the user drags the floating small picture, the coordinate of the center position of the dragged small picture and the hand speed during dragging are judged whether to meet the conditions, and if the two conditions are met simultaneously, the verification is successful.
Compared with the traditional verification mode of manual input, the method is more friendly in interaction and more convenient and rapid in use by a user; in the verification process, the user can concentrate on the picture, so that the picture is a good advertisement space; the image dragging verification mode is not easy to crack.
Preferably, in step (2), the image is processed by using GraphcMagic precision algorithm on the position to be scratched and the scratched-out picture. The design makes the picture softer, and the user is more comfortable visually.
Preferably, the coordinates of the comparison points have the following requirements: the picture size can be any value, set to N1 × N2; the small scale factor is set at a, where a should be in the range of (20, min (N1, N2)/2); the coordinate value range of the X axis is (a/2, N1-a/2), and the coordinate value range of the Y axis is (a/2, N2-a/2). The value of a represents the size of the slider picture, the slider is a square, the theoretical size of the slider should be smaller than the size of the background picture to ensure that the slider slides in the background picture, but actually, in order to improve safety and usability, the size of the slider should not be too small or too large, the slider is too small to be easily operated, user experience is affected, and the slider too large affects the value range of the verification code random number. Therefore, according to the daily use habit of people, the size of the slider should not be less than 20px, but should not be more than half of the smaller one of the two sizes, i.e., width and height, of the background picture, and if the size of the background picture is N1 × N2, then the formula should be: a is max (20, min (N1, N2)/2), and the min function returns a smaller value of the parameters needing to be judged; the max function represents a larger value in the parameters to be judged, so that the size of the slider picture is ensured. The value of X should be equal to the background picture width and the value of Y should be equal to the background picture height, i.e.: the size of the background picture determines the size of the area in which the entire slider can slide.
Preferably, in step (3), satisfying the condition means: (a) whether the coordinate of the central position of the dragged small graph is consistent with the coordinate of the comparison point or not is judged, the coordinate of the central position is compared with the values of the X axis and the Y axis of the comparison point, errors within a certain range are allowed, and if the error value is lambda, the value range of the lambda is (0, 20); (b) if the hand speed is not uniform during dragging, the hand dragging always has slight speed change, but the robot does not. The smaller the value of lambda is, the more accurate the lambda is, but the user completion degree is relatively reduced, and the safety is higher; conversely, the larger the value of λ, the coarser the value, the higher the user completion, and the lower the security. The value of lambda represents an acceptable error value, the larger the error value is, the lower the precision is, the larger the acceptable error range is, but the operation convenience is higher; a smaller error value means a higher operation accuracy, a smaller acceptable error range, but a lower operation convenience.
The invention has the beneficial effects that: the interaction is more friendly, and the use by a user is more convenient and quick; in the verification process, the user can concentrate on the picture, so that the picture is a good advertisement space; the image dragging verification mode is not easy to crack.
Detailed Description
The invention is further described with reference to specific embodiments.
A simple verification method based on image movement specifically comprises the following steps:
(1) randomly acquiring a picture from an existing picture library, taking a point at the lower left corner of the picture as an origin of an X axis and a Y axis, and randomly generating two numbers in the size range of the picture as coordinates of a comparison point;
(2) taking the coordinate point as a center, and digging a small drawing factor with a fixed size; the scratched position and the scratched picture are processed by using a GraphsMagick precision algorithm, so that the picture is softer, and a user is more comfortable in vision;
the coordinates of the comparison points have the following requirements: the picture size can be any value, set to N1 × N2; the small scale factor is set at a, where a should be in the range of (20, min (N1, N2)/2); the coordinate value range of the X axis is (a/2, N1-a/2), and the coordinate value range of the Y axis is (a/2, N2-a/2); the value of a represents the size of the slider picture, the slider is a square, the theoretical size of the slider should be smaller than the size of the background picture to ensure that the slider slides in the background picture, but actually, in order to improve safety and usability, the size of the slider should not be too small or too large, the slider is too small to be easily operated, user experience is affected, and the slider too large affects the value range of the verification code random number. Therefore, according to the daily use habit of people, the size of the slider should not be less than 20px, but should not be more than half of the smaller one of the two sizes, i.e., width and height, of the background picture, and if the size of the background picture is N1 × N2, then the formula should be: a is max (20, min (N1, N2)/2), and the min function returns a smaller value of the parameters needing to be judged; the max function represents a larger value in the parameters to be judged, so that the size of the slider picture is ensured. The value of X should be equal to the background picture width and the value of Y should be equal to the background picture height, i.e.: the size of the background picture determines the size of the area in which the entire slider can slide.
(3) When the user drags the suspension small picture, the coordinate of the center position of the dragged small picture and the hand speed during dragging are judged whether to meet the conditions, and the meeting of the conditions refers to: (a) whether the coordinate of the central position of the dragged small graph is consistent with the coordinate of the comparison point or not is judged, the coordinate of the central position is compared with the values of the X axis and the Y axis of the comparison point, errors within a certain range are allowed, and if the error value is lambda, the value range of the lambda is (0, 20); the smaller the value of lambda is, the more accurate the lambda is, but the user completion degree is relatively reduced, and the safety is higher; on the contrary, the larger the value of λ is, the coarser the user completion is, and the security is reduced accordingly; (b) if the hand speed is not uniform during dragging, the hand speed always has slight change, but the robot does not; if the two conditions are simultaneously met, the verification is successful. The value of lambda represents an acceptable error value, the larger the error value is, the lower the precision is, the larger the acceptable error range is, but the operation convenience is higher; a smaller error value means a higher operation accuracy, a smaller acceptable error range, but a lower operation convenience. In general, λ is 3px, which is reasonable.
Compared with the traditional verification mode of manual input, the method is more friendly in interaction and more convenient and rapid in use by a user; in the verification process, the user can concentrate on the picture, so that the picture is a good advertisement space; the image dragging verification mode is not easy to crack.