Abnormal dragging detection method, device and equipment for verification code
By calculating the speed ratio between the verification code slider and the graph to detect abnormal drag behavior, the problem that existing verification codes are difficult to identify abnormal drag is solved, and the security of verification codes is effectively improved.
Patent Information
- Application Number
- CN202510230992.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-06-17
AI Technical Summary
When faced with attacks from automated programs, existing verification codes are difficult to effectively detect and prevent abnormal drag behavior, resulting in impaired security.
By responding to the trigger command of the cursor, the movement information of the slider and the graph are obtained and the speed ratio is calculated. If the speed ratio does not meet the preset conditions, it is judged that the verification code is dragged abnormally.
It quickly determines whether the verification code is dragged abnormally, effectively prevents machine automatic attacks and improves the security of the verification code.
Smart Images

Figure CN120162772A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network security technology, and in particular, to a method, device, and equipment for detecting abnormal dragging of verification codes. Background Art
[0002] With the rapid development of Internet technology, network security issues have become increasingly prominent, especially in the user authentication process. As a commonly used security mechanism, verification codes are widely used in various websites and applications to distinguish human users from automated programs (such as crawlers or data software). Although traditional static text verification codes can prevent automated attacks to a certain extent, with the progress of image recognition technology and artificial intelligence, the security of these verification codes has been challenged. To improve security, more complex verification methods such as dynamic verification codes and behavior verification codes have emerged.
[0003] In dynamic verification codes, users need to complete some specific actions, such as dragging a slider to a specified position, to prove that they are human users. However, this type of verification code may also be attacked by automated programs. Attackers may use machine vision and automation technology to simulate human operations and achieve automatic cracking of verification codes.
[0004] Therefore, how to effectively detect and prevent such abnormal dragging behaviors has become a key issue in improving the security of verification codes, and there is an urgent need for a simple and effective method for detecting abnormal dragging. Summary of the Invention
[0005] Embodiments of this application provide a method, device, and equipment for detecting abnormal dragging of verification codes, so as to quickly determine whether a verification code has been abnormally dragged.
[0006] In a first aspect, embodiments of this application provide a method for detecting abnormal dragging of a verification code, including: in response to a trigger instruction of a cursor, obtaining first movement information during the movement of a slider of the verification code displayed by the cursor dragging, and obtaining second movement information during the movement of a graph of the verification code; determining a speed ratio between the slider and the graph according to the first movement information and the second movement information; where the speed ratio represents the ratio of the movement speed of the slider to the movement speed of the graph; if it is determined that the speed ratio does not meet a preset condition, it is determined that the verification code has been abnormally dragged; where the abnormally dragged verification code is a verification code automatically dragged by a machine.
[0007] In a possible implementation, according to the position points of the slider at each moment, determine the displacement of the slider at each moment; and according to the position points of the graphic at each moment, determine the displacement of the graphic at each moment; determine the speed ratio according to the displacement of the slider at each moment and the displacement of the graphic at each moment.
[0008] In a possible implementation, perform fitting processing on the displacement of the slider at each moment and the displacement of the graphic at each moment to generate a fitting line; wherein, the horizontal axis of the fitting line represents the displacement of the slider, and the vertical axis of the fitting line represents the displacement of the graphic; determine the slope of the fitting line as the speed ratio.
[0009] In a possible implementation, determine the average value of the moving speed of the slider at each moment as the first average speed; and determine the average value of the moving speed of the graphic at each moment as the second average speed; determine the ratio of the first average speed to the second average speed as the speed ratio.
[0010] In a possible implementation, if it is determined that the speed ratio does not belong to the preset value range, it is determined that the verification code is abnormally dragged; wherein, different speed ratios are included in the preset value range.
[0011] In a possible implementation, obtain the third movement information and the fourth movement information when the user manually drags the slider of the verification code through the cursor; wherein, the third movement information is the movement information of the slider, and the fourth movement information is the movement information of the graphic of the verification code; generate the speed ratio in the preset value range according to the third movement information and the fourth movement information.
[0012] In a possible implementation, obtain the third movement information and the fourth movement information when the user manually drags the slider of the verification code through the cursor; wherein, the third movement information includes the moving speed and acceleration at each moment, and the fourth movement information includes the moving speed and acceleration of the graphic at each moment; calculate the similarity between the moving speed in the first movement information and the moving speed in the third movement information to obtain the first similarity; and calculate the similarity between the acceleration in the first movement information and the acceleration in the third movement information to obtain the second similarity; determine the average value of the first similarity and the second similarity as the third similarity; if the third similarity is less than the preset threshold, it is determined that the verification code is abnormally dragged.
[0013] In a possible implementation manner, in response to the release instruction of the cursor, if it is determined that the center point of the graphic at the current moment matches the center point of the target notch in the verification code at the current moment, it is determined that the graphic correctly enters the target notch, and the step of determining the speed ratio between the slider and the graphic according to the first movement information and the second movement information is executed; wherein, the release instruction indicates that the cursor is released.
[0014] In a second aspect, an abnormal dragging detection device for a verification code provided by an embodiment of the present application includes: a response module, configured to obtain first movement information during the movement of the slider of the verification code displayed by the cursor dragging in response to a trigger instruction of the cursor, and obtain second movement information during the movement of the graphic of the verification code; a first determination module, configured to determine a speed ratio between the slider and the graphic according to the first movement information and the second movement information; wherein, the speed ratio represents the ratio between the movement speed of the slider and the movement speed of the graphic; a second determination module, configured to determine that the verification code is abnormally dragged if it is determined that the speed ratio does not meet a preset condition; wherein, the abnormally dragged verification code is a verification code automatically dragged by a machine.
[0015] In a third aspect, an abnormal dragging detection device for a verification code provided by an embodiment of the present application includes: a memory, a processor;
[0016] The memory stores computer execution instructions;
[0017] The processor executes the computer execution instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementation manners of the first aspect.
[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored, and when the computer execution instructions are executed by a processor, they are used to implement the above first aspect and / or various possible implementation manners of the first aspect.
[0019] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the above first aspect and / or various possible implementation manners of the first aspect.
[0020] The abnormal dragging detection method, device, and device for a verification code provided by the embodiments of the present application determine whether the verification code is abnormally dragged by determining the speed ratio between the slider and the graphic in response to the trigger instruction of the cursor, achieving the effect of quickly determining whether the verification code is abnormally dragged. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings here are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0022] Figure 1 It is a schematic diagram of the scenario of the method for detecting abnormal dragging of verification codes provided by the present application;
[0023] Figure 2 It is a flowchart of the method for detecting abnormal dragging of verification codes provided by the present application Figure 1 ;
[0024] Figure 3 It is a page schematic diagram of the method for detecting abnormal dragging of verification codes provided by the present application;
[0025] Figure 4 It is a flowchart of the method for detecting abnormal dragging of verification codes provided by the present application Figure 2 ;
[0026] Figure 5 It is a schematic structural diagram of the device for detecting abnormal dragging of verification codes provided by the present application;
[0027] Figure 6 It is a schematic structural diagram of the device for detecting abnormal dragging of verification codes provided by the present application.
[0028] Through the above accompanying drawings, specific embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and textual descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Specific Embodiments
[0029] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0030] First, the terms involved in the present application are explained:
[0031] Figure 1 It is a schematic diagram of the scenario of the method for detecting abnormal dragging of verification codes provided by the present application. As Figure 1 shown, the specific application scenario of the present application is as follows:
[0032] S101. The machine script quickly passes the website verification in batches by simulating click and drag actions;
[0033] S102. The verification website cannot identify whether it is a machine script and provides data.
[0034] When users register, log in, or perform other critical operations on many websites, various verification mechanisms are adopted to prevent malicious attacks and the abuse of automated scripts. One common protective measure is "human-machine verification", which requires users to prove that they are human rather than machine scripts through specific graphic recognition or simple interactive operations (such as clicking, dragging, etc.).
[0035] In order to bypass these protection mechanisms, attackers have developed various automated tools and technologies. One effective means is to write machine scripts to simulate the operation behaviors of real users in the browser. These scripts can automatically perform actions such as clicking and dragging, so as to quickly pass the website's verification process in batches. Since these scripts can highly simulate human behavior patterns, it is difficult for the verification system to distinguish whether the operator is a real user or a machine script.
[0036] Combined with the above scenarios, in the prior art, it is difficult to distinguish whether the operator is a real user or a machine script, and it is impossible to identify which drags are abnormal drags.
[0037] The abnormal drag detection method provided by this application determines whether the verification code is abnormally dragged by determining the speed ratio between the slider and the graphic, achieving the effect of quickly judging whether the verification code is abnormally dragged.
[0038] The following uses specific embodiments to detail the technical solutions of this application and how the technical solutions of this application solve the above technical problems. These several specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this application will be described below in conjunction with the drawings.
[0039] Figure 2 It is a flow diagram of the abnormal drag detection method for the verification code provided by this application Figure 1 , as Figure 2 shown, this method includes:
[0040] S201. In response to the trigger instruction of the cursor, obtain the first movement information during the movement of the slider of the verification code displayed by the cursor drag, and obtain the second movement information during the movement of the graphic of the verification code;
[0041] The cursor trigger instruction means that when the user operates the cursor 301 on the computer screen through an input device such as a mouse, such as clicking, dragging and other actions, the system will receive the corresponding instruction signal. This is a way for users to interact with the computer interface, used to inform the computer of the operation intention of the user.
[0042] When the user drags the slider 302 as required by the verification code, the cursor will move on the screen. As Figure 3 shown, Figure 3 is a page schematic diagram of the abnormal drag detection method for the verification code provided by this application. The system will track the position change of the cursor and record the starting position and ending position of the slider on the screen. For example, if the slider is dragged from a position 100 pixels away from the left edge of the screen to a position 300 pixels away from the left edge, the system records this displacement information (a moving distance of 200 pixels).
[0043] At the same time, the system will also record the time taken during this process. Suppose the user takes 2 seconds to drag the slider from the starting position to the ending position, then this time information will also be recorded. These information about the moving distance and time of the slider constitute the first movement information, which can reflect dynamic characteristics such as the moving speed of the slider.
[0044] For the graphic 303 in the verification code, it will also move on the screen as the slider is dragged or according to a preset rule. The system also needs to record the starting position, ending position, and the time taken during the moving process of the graphic. For example, the graphic may move from a place 50 pixels away from the top of the screen to a place 150 pixels away from the top, and the moving time is 1.8 seconds. These recorded displacement and time information of the graphic are the second movement information, which is used for subsequent comparison and analysis with the movement information of the slider.
[0045] For the graphic in the verification code, it will also move on the screen as the slider is dragged or according to a preset rule. The system also needs to record the starting position, ending position, and the time taken during the moving process of the graphic. For example, the graphic may move from a place 50 pixels away from the top of the screen to a place 150 pixels away from the top, and the moving time is 1.8 seconds. These recorded displacement and time information of the graphic are the second movement information, which is used for subsequent comparison and analysis with the movement information of the slider.
[0046] S202. Determine the speed ratio between the slider and the graphic according to the first movement information and the second movement information; wherein, the speed ratio represents the ratio between the moving speed of the slider and the moving speed of the graphic;
[0047] The first movement information records the starting position, ending position, and the time taken during the moving process of the slider. For example, the slider starts moving from a position with coordinates (100, 200) and moves to a position with coordinates (400, 200), and the moving time is 2 seconds. These information can calculate the speed of the slider, and the speed is equal to the distance divided by the time. In this example, the moving distance of the slider is 400 - 100 = 300 pixels (assuming a horizontal movement), and the time is 2 seconds, so the speed of the slider:
[0048]
[0049] The second movement information records the starting position, ending position of the verification code graphic and the time taken during the movement process. For example, the verification code graphic moves from the position of coordinates (300, 150) to the position of coordinates (300, 450), and the movement time is 1.5 seconds. Similarly, the speed of the graphic can be calculated. Here, the distance the graphic moves is 450 - 150 = 300 pixels (assuming vertical movement), and the time is 1.5 seconds. So the speed of the graphic:
[0050]
[0051] The speed ratio is obtained by dividing the speed of the slider by the speed of the graphic. In the above example, the speed ratio:
[0052]
[0053] This speed ratio characterizes the relationship between the moving speed of the slider and the moving speed of the graphic. Under normal circumstances, the moving speeds of the slider and the graphic by a human user should have a certain degree of coordination and relevance. If the speed ratio deviates from the normal range, it means that there may be an abnormal situation. For example, if the slider is automatically dragged by a machine, it may cause the moving speeds of the slider and the graphic not to conform to the normal user operation logic. By calculating this speed ratio and determining whether it is reasonable, it is possible to detect S203. If it is determined that the speed ratio does not meet the preset conditions, it is determined that the verification code has been abnormally dragged; wherein, the abnormally dragged verification code is the verification code automatically dragged by the machine.
[0054] The system will preset a reasonable speed ratio range in advance. This range is determined by analyzing factors such as the habits and speeds of normal human users operating the slider and the graphic. When the speed ratio calculated based on the previously obtained first movement information and second movement information is not within this preset range, it means that the current moving state of the slider and the graphic does not conform to the situation of normal user operation.
[0055] If the speed ratio exceeds the preset range, the system will determine that the verification code has been abnormally dragged. This kind of abnormality is very likely caused by the machine automatically dragging the slider. Because the behavior pattern and speed of the machine automatically dragging are different from those of human users. For example, the machine may drag the slider at a very fast and irregular speed, or operate in a fixed speed mode, which will cause the speed ratio to be abnormal.
[0056] Through such determination, the system can distinguish between normal human operations and machine automatic operations. If it is determined as an abnormal drag, the system can take corresponding measures, such as requiring the user to re-verify the verification code, etc., to prevent machine automatic attacks or cheating behaviors and ensure the security and effectiveness of the verification code mechanism.
[0057] The method, electronic device, storage medium, and program product for detecting abnormal drag of a verification code provided by the embodiments of the present application determine whether the verification code is abnormally dragged by determining the speed ratio between the slider and the graphic in response to a trigger instruction of the cursor, achieving the effect of quickly determining whether the verification code is abnormally dragged.
[0058] Figure 4 is a schematic flow chart of the method for detecting abnormal drag of a verification code provided by the present application Figure 2 , as Figure 4 shown, on the basis of the Figure 2 embodiment, the method for detecting abnormal drag of a verification code is described in detail. The method includes:
[0059] S401. In response to a trigger instruction of the cursor, obtain first movement information during the movement of the slider of the verification code displayed by the cursor dragging, and obtain second movement information during the movement of the graphic of the verification code;
[0060] S402. Determine the displacement of the slider at each moment according to the position points of the slider at each moment; and determine the displacement of the graphic at each moment according to the position points of the graphic at each moment; determine the speed ratio according to the displacement of the slider at each moment and the displacement of the graphic at each moment.
[0061] The first movement information includes the position points of the slider at each moment, and the second movement information includes the position points of the graphic at each moment.
[0062] Exemplarily, the system will monitor the movement of the slider on the screen in real time. By obtaining the position points of the slider at each moment, the displacement of the slider can be calculated. For example, at time point t1, the position coordinates of the slider are (x1, y1), and at time point t2, the position coordinates of the slider become (x2, y2). Then the displacement of the slider during this period is the distance between the two points, which can be calculated using the distance formula in plane geometry, that is:
[0063]
[0064] In this way, as time goes by, the system can continuously obtain new position points of the slider, so as to determine the displacement of the slider in different time periods.
[0065] For the graphics in the verification code, the system will also obtain their position points at each moment in the same way, and then determine the displacement of the graphics. For example, at time point t1, the position coordinates of the graphic are (a1, b1), and at time point t2, the position coordinates of the graphic become (a2, b2). The displacement of the graphic can also be calculated by the distance formula:
[0066]
[0067] By continuously tracking the position of the graphic, the system can accurately grasp the displacement change of the graphic.
[0068] With the displacements of the slider and the graphic at each moment, their speed ratio can be calculated. For the slider, its speed can be obtained by dividing its displacement by the time interval. For example, within a period of time Δt = t2 - t1, the displacement of the slider is:
[0069]
[0070] Then the speed of the slider:
[0071]
[0072] Similarly, for the graphic, within the same time interval Δt, the displacement of the graphic is:
[0073]
[0074] The speed of the graphic:
[0075]
[0076] Finally, the speed ratio
[0077]
[0078] This ratio can reflect the relative relationship between the movement speeds of the slider and the graphic, providing an important basis for subsequent judgment on whether the verification code is abnormally dragged.
[0079] Exemplarily, perform fitting processing on the displacements of the slider at each moment and the displacements of the graphic at each moment to generate a fitting line; wherein, the horizontal axis of the fitting line represents the displacement of the slider, and the vertical axis of the fitting line represents the displacement of the graphic; determine the slope of the fitting line as the speed ratio.
[0080] First, during the process of dragging the slider, the position information of the slider and the graphic at each moment is recorded in real time. For example, at time points t1, t2, …, tn, the positions of the slider (x1, x2, …, xn) and the graphic (y1, y2, …, yn) are recorded. These collected data points are used for fitting processing. The purpose of fitting is to find a straight line that can represent the trend of these data points. The commonly used fitting method is the least squares method, which can minimize the sum of the squares of the errors between the fitting straight line and the data points.
[0081] Assume the equation of the fitting straight line is y = mx + b, where m is the slope and b is the intercept. Through the least squares method, we can solve for the values of m and b.
[0082] According to the fitting result, we obtain a straight line y = mx + b. The horizontal axis (x-axis) of this straight line represents the displacement of the slider, and the vertical axis (y-axis) represents the displacement of the graphic.
[0083] The slope m of the fitting straight line reflects the rate of change of the graphic displacement relative to the slider displacement. Since we are concerned with the ratio of their speeds, and speed is the derivative of displacement with respect to time, the slope m of the fitting straight line is actually the ratio of the graphic speed to the slider speed.
[0084] Specifically, if within a time interval Δt, the slider moves a distance of Δx, and the graphic moves a corresponding distance of Δy, then when Δt → 0, this slope m is the speed ratio.
[0085] S403. Determine the mean value of the moving speed of the slider at each moment as the first speed mean value; and determine the mean value of the moving speed of the graphic at each moment as the second speed mean value; determine the ratio of the first speed mean value to the second speed mean value as the speed ratio.
[0086] The first movement information includes the moving speed of the slider at each moment, and the second movement information includes the moving speed of the graphic at each moment.
[0087] During the process of the user operating the slider, the system will record the moving speed of the slider at each moment in real time. For example, at time point t1, the moving speed of the slider is υ 滑块1 , at time point t2, the moving speed of the slider is υ 滑块2 , and so on. A series of moving speed values of the slider are recorded at different moments.
[0088] Then add up the moving speeds of the slider at these different moments and divide by the number of recorded speeds (i.e., the number of moments), and the mean value of the moving speed of the slider can be obtained, which is the first speed mean value. Assume that the moving speeds of the slider at n moments are recorded, which are υ滑块1 , υ 滑块2 , …, υ 滑块n , then the first speed average value:
[0089]
[0090] This average value can more comprehensively reflect the average moving speed of the slider during the entire operation process.
[0091] Calculate the average moving speed of the graphic (the second speed average value):
[0092] For the graphic in the verification code, use the same method as the slider to determine its average moving speed. Record the moving speed of the graphic at different times. For example, at time point t1, the moving speed of the graphic is υ 图形1 , and at time point t2, the moving speed of the graphic is υ 图形2 and so on.
[0093] Similarly, add the moving speeds of the graphic at these different times, and then divide by the number of recorded speeds to obtain the average value of the moving speed of the graphic, that is, the second speed average value. Assume that the moving speeds of the graphic at n time points are recorded, which are υ 图形1 , υ 图形2 , …, v 图形n , then the second speed average value:
[0094]
[0095] The second speed average value obtained in this way can accurately reflect the average moving speed of the graphic during the entire process.
[0096] After determining the first speed average value of the slider and the second speed average value of the graphic, divide the first speed average value by the second speed average value to obtain the speed ratio k, that is:
[0097]
[0098] This speed ratio can reflect the relative relationship between the average moving speeds of the slider and the graphic, and compared with directly using the speed ratio at a certain moment, this speed ratio obtained through average value calculation can more stably reflect the speed correlation between the slider and the graphic during the entire operation process.
[0099] S404. If it is determined that the speed ratio does not belong to the preset value range, then determine that the verification code is abnormally dragged; wherein, different speed ratios are included in the preset value range.
[0100] Exemplarily, obtain third movement information and fourth movement information when the user manually drags the slider of the verification code through the cursor; wherein, the third movement information is the movement information of the slider, and the fourth movement information is the movement information of the graphic of the verification code;
[0101] Generate the speed ratio within the preset value range according to the third movement information and the fourth movement information.
[0102] Exemplarily, obtain third movement information and fourth movement information when the user manually drags the slider of the verification code through the cursor; wherein, the third movement information includes the movement speed and acceleration at each moment, and the fourth movement information includes the movement speed and acceleration of the graphic at each moment; calculate the similarity between the movement speed in the first movement information and the movement speed in the third movement information to obtain a first similarity; and calculate the similarity between the acceleration in the first movement information and the acceleration in the third movement information to obtain a second similarity;
[0103] Determine the average value of the first similarity and the second similarity as the third similarity;
[0104] If the third similarity is less than the preset threshold, it is determined that the verification code is abnormally dragged.
[0105] During the verification code verification process, the system will calculate the speed ratio of the slider and the graphic. When it is determined that this speed ratio does not belong to the preset value range, it is determined that the verification code is abnormally dragged. The preset value range contains different speed ratios, and these value ranges are determined based on the behavior patterns of normal users when manually operating the slider and the graphic. For example, under normal circumstances, when a user manually operates the slider and the graphic, their speed ratio will be within a reasonable range, such as between 0.8 and 1.2 (the specific values are determined according to the actual situation). If the speed ratio exceeds this range, such as being less than 0.8 or greater than 1.2, it may indicate an abnormal situation.
[0106] The system will obtain the third movement information (the movement information of the slider) and the fourth movement information (the movement information of the verification code graphic) when the user manually drags the verification code slider through the cursor. These two sets of information are the key data sources for judging whether the user's operation is abnormal.
[0107] Use the similarity of movement speed and acceleration to judge abnormalities. First, calculate the similarity between the movement speed in the first movement information (which may be the movement information of the slider or the graphic mentioned before) and the movement speed in the third movement information (the movement information of the slider) to obtain a first similarity. For example, some mathematical methods can be used to calculate the similarity, such as calculating the cosine value of the angle between two speed vectors, etc. Assume that the speed in the first movement information is v1=(v 1x ,v1y ), the speed in the third movement information is v3 = (v 3x , v 3y ), then their similarity:
[0108]
[0109] Similarly, calculate the similarity between the acceleration in the first movement information and the acceleration in the third movement information to obtain the second similarity.
[0110] Then determine the average value of the first similarity and the second similarity as the third similarity. For example, if the first similarity is 0.8 and the second similarity is 0.7, then the third similarity is (0.8 + 0.7) / 2 = 0.75.
[0111] Finally, if the third similarity is less than a preset threshold (such as 0.6), it is determined that the verification code is abnormally dragged. This is because if the similarity is too low, it indicates that the current operation is quite different from the normal operation, and there may be situations such as machine simulation or other abnormal operations.
[0112] Exemplarily, in response to the release instruction of the cursor, if it is determined that the center point of the graphic at the current moment matches the center point of the target notch in the verification code at the current moment, it is determined that the graphic correctly enters the target notch, and the step of determining the speed ratio between the slider and the graphic according to the first movement information and the second movement information is executed;
[0113] wherein, the release instruction indicates that the cursor is released.
[0114] The system first determines whether the center point of the graphic 303 at the current moment matches the center point of the target notch 304 in the verification code at the current moment. This judgment is an accurate comparison based on the position information of the graphic and the position information of the target notch. For example, if the graphic is a circle, the system will obtain the center coordinates of the circle; if the target notch is a square, the system will obtain the center coordinates of the square. Then compare these two coordinates, and if they are equal within a certain error range (considering factors such as display accuracy), it is considered that they match.
[0115] If, after judgment, the graphic correctly enters the target notch (i.e., the center point is matched), then the system will execute the step of determining the speed ratio between the slider and the graphic according to the first movement information (the movement information of the slider) and the second movement information (the movement information of the verification code graphic). This step is to further verify the authenticity and normality of the user's operation. For example, under normal circumstances, the speed ratio between the slider and the graphic should be within a reasonable range, such as between 0.8 and 1.2 mentioned above. If the speed ratio exceeds this range, even if the graphic correctly enters the target notch, it may mean that there are abnormal operations, such as machine simulation, etc.
[0116] The abnormal drag detection method of the verification code provided by the embodiment of the present application determines whether the verification code is abnormally dragged by determining the speed ratio between the slider and the graphic in response to the trigger instruction of the cursor, achieving the effect of quickly judging whether the verification code is abnormally dragged.
[0117] Figure 5 The structural schematic diagram detected by the abnormal drag detection device of the verification code provided by the present application is as Figure 5 shown. The abnormal drag detection device 50 of the verification code provided in this embodiment includes:
[0118] A response module 501, configured to obtain the first movement information during the movement of the slider of the verification code displayed by the cursor drag in response to the trigger instruction of the cursor, and obtain the second movement information during the movement of the graphic of the verification code;
[0119] A first determination module 502, configured to determine the speed ratio between the slider and the graphic according to the first movement information and the second movement information; wherein, the speed ratio represents the ratio between the movement speed of the slider and the movement speed of the graphic;
[0120] A second determination module 503, configured to determine that the verification code is abnormally dragged if it is determined that the speed ratio does not meet the preset condition; wherein, the abnormally dragged verification code is the verification code automatically dragged by the machine.
[0121] In a possible implementation manner, the first determination module 502 is configured to determine the displacement of the slider at each moment according to the position points of the slider at each moment; and determine the displacement of the graphic at each moment according to the position points of the graphic at each moment; and determine the speed ratio according to the displacement of the slider at each moment and the displacement of the graphic at each moment.
[0122] In a possible implementation, a first determination module 502 is configured to perform fitting processing on the displacement of the slider at each moment and the displacement of the graphic at each moment to generate a fitting straight line; wherein, the horizontal axis of the fitting straight line represents the displacement of the slider, and the vertical axis of the fitting straight line represents the displacement of the graphic; determine the slope of the fitting straight line as the speed ratio.
[0123] In a possible implementation, a first determination module 502 is configured to determine the average value of the moving speed of the slider at each moment as a first average speed; and determine the average value of the moving speed of the graphic at each moment as a second average speed; determine the ratio of the first average speed to the second average speed as the speed ratio.
[0124] In a possible implementation, a second determination module 503 is configured to determine that the verification code is abnormally dragged if it is determined that the speed ratio does not belong to a preset value range; wherein, different speed ratios are included in the preset value range.
[0125] In a possible implementation, a second determination module 503 is configured to obtain third movement information and fourth movement information when the user manually drags the slider of the verification code through the cursor; wherein, the third movement information is the movement information of the slider, and the fourth movement information is the movement information of the graphic of the verification code; generate the speed ratio in the preset value range according to the third movement information and the fourth movement information.
[0126] In a possible implementation, the device further includes: a third determination module (not shown in the figure) configured to obtain third movement information and fourth movement information when the user manually drags the slider of the verification code through the cursor; wherein, the third movement information includes the moving speed and acceleration at each moment, and the fourth movement information includes the moving speed and acceleration of the graphic at each moment; calculate the similarity between the moving speed in the first movement information and the moving speed in the third movement information to obtain a first similarity; and calculate the similarity between the acceleration in the first movement information and the acceleration in the third movement information to obtain a second similarity; determine the average value of the first similarity and the second similarity as a third similarity; if the third similarity is less than a preset threshold, determine that the verification code is abnormally dragged.
[0127] In a possible implementation, the device further includes: a fourth determination module (not shown in the figure), configured to, in response to a release instruction of the cursor, if it is determined that the center point of the graphic at the current moment matches the center point of the target notch in the verification code at the current moment, determine that the graphic correctly enters the target notch, and perform the step of determining the speed ratio between the slider and the graphic according to the first movement information and the second movement information; wherein, the release instruction indicates that the cursor is released.
[0128] The abnormal drag detection device for verification codes provided in this embodiment can execute the method provided in the above method embodiment, and its implementation principle and technical effects are similar, and will not be elaborated here in this embodiment.
[0129] Figure 6 It is a schematic structural diagram of the abnormal drag detection device for verification codes provided in this application. As Figure 6 shown, the electronic device 60 provided in this embodiment includes: at least one processor 601 and a memory 602. Optionally, the device 60 further includes a communication component 603. Among them, the processor 601, the memory 602, and the communication component 603 are connected through a bus 604.
[0130] In the specific implementation process, at least one processor 601 executes the computer execution instructions stored in the memory 602, so that at least one processor 601 executes the above method.
[0131] The specific implementation process of the processor 601 can be referred to in the above method embodiment, and its implementation principle and technical effects are similar, and will not be elaborated here in this embodiment.
[0132] In the above embodiment, it should be understood that the processor may be a central processing unit (English: Central Processing Unit, abbreviated: CPU), or other general-purpose processors, digital signal processors (English: Digital Signal Processor, abbreviated: DSP), application specific integrated circuits (English: Application Specific Integrated Circuit, abbreviated: ASIC), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the invention can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0133] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0134] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, the buses in the drawings of the present application are not limited to only one bus or one type of bus.
[0135] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0136] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the above method is implemented.
[0137] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk. The readable storage medium can be any available medium accessible by a general-purpose or special-purpose computer.
[0138] An exemplary readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an Application Specific Integrated Circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in a device.
[0139] The division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces, and the indirect coupling or communication connection of devices or units can be in an electrical, mechanical or other form.
[0140] The unit described as a separation component may or may not be physically separated. The component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or distributed across multiple network units. Some or all of these units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0141] In addition, in each embodiment of the present invention, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0142] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0143] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When this program is executed, it executes the steps including the above method embodiments; and the foregoing storage medium includes: various media such as ROMs, RAMs, magnetic disks, or optical discs that can store program codes.
[0144] Finally, it should be noted that: After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily think of other implementation schemes of the present invention. The present invention is intended to cover any variations, uses, or adaptive changes of the present invention. These variations, uses, or adaptive changes follow the general principles of the present invention and include the common general knowledge or conventional technical means in the technical field not disclosed in the present invention. It is not limited to the precise structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present invention is only limited by the appended claims.
Claims
1. A verification code abnormal drag detection method, characterized in that: include: In response to a trigger instruction of the cursor, first movement information of a slider of the verification code displayed by the cursor is obtained during a movement process, and second movement information of a graphic of the verification code is obtained during a movement process; Determine a speed ratio between the slider and the graphic according to the first movement information and the second movement information; wherein the speed ratio represents a ratio between a movement speed of the slider and a movement speed of the graphic; If it is determined that the speed ratio does not meet the preset condition, it is determined that the verification code is abnormally dragged; wherein the abnormally dragged verification code is a verification code automatically dragged by a machine.
2. The method according to claim 1, characterized in that: The first movement information includes the position point of the slider at each moment, and the second movement information includes the position point of the graphic at each moment; Determining a speed ratio between the slider and the graphic according to the first movement information and the second movement information includes: Determine the displacement of the slider at each moment according to the position of the slider at each moment; and determine the displacement of the graphic at each moment according to the position of the graphic at each moment; The speed ratio is determined according to the displacement of the slider at each moment and the displacement of the graph at each moment.
3. The method according to claim 2, characterized in that Determining the speed ratio according to the displacement of the slider at each moment and the displacement of the graph at each moment includes: Performing fitting processing on the displacement of the slider at each moment and the displacement of the graph at each moment to generate a fitting straight line; wherein the horizontal axis of the fitting straight line represents the displacement of the slider, and the vertical axis of the fitting straight line represents the displacement of the graph; The slope of the fitting straight line is determined as the speed ratio.
4. The method according to claim 1, characterized in that The first movement information includes the movement speed of the slider at each moment, and the second movement information includes the movement speed of the graphic at each moment; Determining a speed ratio between the slider and the graphic according to the first movement information and the second movement information includes: Determine the average value of the moving speed of the slider at each moment, which is the first speed average value; and determine the average value of the moving speed of the graphic at each moment, which is the second speed average value; A ratio of the first speed average to the second speed average is determined as the speed ratio.
5. The method according to claim 1, characterized in that If it is determined that the speed ratio does not meet the preset condition, determining that the verification code is abnormally dragged includes: If it is determined that the speed ratio does not belong to a preset value range, it is determined that the verification code is abnormally dragged; wherein the preset value range includes different speed ratios.
6. The method according to claim 5, characterized in that The method further comprises: Acquire third movement information and fourth movement information when the user manually drags the slider of the verification code through the cursor; wherein the third movement information is the movement information of the slider, and the fourth movement information is the movement information of the graphic of the verification code; A speed ratio within the preset value range is generated according to the third movement information and the fourth movement information.
7. The method according to any one of claims 1 to 6, characterized in that The first movement information includes the movement speed and acceleration of the slider at each moment, and the second movement information includes the movement speed and acceleration of the graphic at each moment; the method further includes: Acquire third movement information and fourth movement information when the user manually drags the slider of the verification code through the cursor; wherein the third movement information includes the movement speed and acceleration at each moment, and the fourth movement information includes the movement speed and acceleration of the graphic at each moment; calculate the similarity between the movement speed in the first movement information and the movement speed in the third movement information to obtain a first similarity; and calculate the similarity between the acceleration in the first movement information and the acceleration in the third movement information to obtain a second similarity; Determine an average of the first similarity and the second similarity as a third similarity; If the third similarity is less than a preset threshold, it is determined that the verification code is abnormally dragged.
8. The method according to any one of claims 1 to 6, characterized in that Before determining the speed ratio between the slider and the graphic according to the first movement information and the second movement information, the method further includes: In response to the cursor release instruction, if it is determined that the center point of the graphic at the current moment matches the center point of the target gap in the verification code at the current moment, and the two match, then it is determined that the graphic correctly enters the target gap, and a step of determining a speed ratio between the slider and the graphic is performed according to the first movement information and the second movement information; The released instruction indicates that the cursor is released.
9. A verification code abnormal drag detection device, characterized in that: include: A response module, configured to respond to a trigger instruction of a cursor, obtain first movement information during a movement of a slider of a verification code displayed by dragging the cursor, and obtain second movement information during a movement of a graphic of the verification code; A first determining module, configured to determine a speed ratio between the slider and the graphic according to the first movement information and the second movement information; wherein the speed ratio represents a ratio between a movement speed of the slider and a movement speed of the graphic; The second determination module is used to determine that the verification code is abnormally dragged if it is determined that the speed ratio does not meet the preset condition; wherein the abnormally dragged verification code is a verification code automatically dragged by a machine.
10. A verification code abnormal drag detection device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.
12. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.