A method, device and computer equipment for generating dynamic verification code

By generating a verification slider image and randomly determining the slider start area and verification code display area, gradually displaying the verification code in response to the drag and drop operation, and judging the authenticity of the user's operations, the problem of easy cracking of the verification code and difficulty in user identification is solved, and efficient and safe verification code input is achieved.

CN115130086BActive Publication Date: 2025-08-29NETSUNION CLEARING CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110287847.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-17
Publication Date
2025-08-29
Estimated Expiration
2041-03-17

AI Technical Summary

Technical Problem

The verification codes in the prior art are easily cracked by robot programs, and the identification of real users is too difficult, which affects the user experience.

Method used

By generating a verification slider image and randomly determining the slider start area and verification code display area, generating an actual moving track in response to the drag and drop operation, gradually displaying the verification code image, judging the authenticity with the user operation, and generating a verification code input box and a confirmation button.

Benefits of technology

It improves the difficulty of robot program recognition, simplifies the user recognition process, and improves user experience and input efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115130086B_ABST
    Figure CN115130086B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, and computer device for generating a dynamic verification code. The method comprises: obtaining a verification trigger operation, generating a verification slider image, and determining a slider starting area and a verification code display area; generating an actual movement trajectory of the verification slider image in response to a drag operation on the verification slider image; and displaying the verification code image in the verification code display area when the actual movement trajectory matches a preset slider operation trajectory. By implementing the present invention, the slider starting area and the verification code display area are randomly determined in conjunction with the verification trigger operation. When the verification slider image is dragged to the designated verification code display area, the corresponding verification code image is gradually displayed, increasing the difficulty of robot program recognition. In combination with the gradual display of corresponding verification code images, the efficiency of verification code input is improved, and the output verification code does not need to be interfered with, reducing the number of user recognition failures and improving input efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security, and in particular to a method and device for generating a dynamic verification code, and a computer device. Background Art

[0002] A graphical verification code is a common verification process used to distinguish whether a system user is a bot or a real person. Related technologies typically generate an image based on a string of randomly generated numbers or symbols. Interference pixels are added to the image to prevent automatic recognition by OCR (Optical Character Recognition) programs. Users visually identify the verification code information in the image, enter it into a form, and submit it to the system for verification. Only after successful verification can they use certain system functions. This method prevents certain users from using bots to perform large numbers of concurrent automated registrations, logins, forum flooding, online ticket fraud, and product purchases on a specific system, affecting the use of other real users.

[0003] However, the above method is easily cracked by robot programs. In order to prevent robot programs from cracking the verification function, related technologies can add interference elements to the verification code image, such as interference points, interference lines or image backgrounds, so that characters are connected to each other or even partially overlapped, or the characters on the image are distorted. However, the verification code generated using the above processing method also has some problems: if there are too few interference elements, the computer cracking program may only need to perform denoising to recognize the characters, which has low security; if there are too many interference elements, such as too many connected or overlapping characters, or too much distortion, due to large edge interference or serious character deformation, it may cause real users to be unable to recognize it, and multiple identifications and retries are required to determine the correct verification code, which seriously affects the user experience. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a method, apparatus, and computer device for generating a dynamic verification code to solve the problems of low security and serious impact on user experience in related technologies.

[0005] According to a first aspect, an embodiment of the present invention provides a method for generating a dynamic verification code, comprising: obtaining a verification trigger operation; generating a verification slider image based on the verification trigger operation, and determining a slider starting area and a verification code display area; generating an actual movement trajectory of the verification slider image in response to a drag operation on the verification slider image; when the actual movement trajectory matches a preset slider operation trajectory, displaying at least a portion of the verification code image in the verification code display area based on the movement of the verification slider image, the verification code image including all or part of the dynamic verification code, and the preset slider operation trajectory corresponding one-to-one to the slider starting area.

[0006] In combination with the first aspect, in the first embodiment of the first aspect, displaying at least a portion of the verification code image in the verification code display area based on the movement of the verification slider image includes: gradually displaying the complete image of the verification code image in the verification code display area based on the movement of the verification slider image.

[0007] In combination with the first aspect, in the second implementation of the first aspect, the method further includes: when the drag operation is not recognized, moving the verification slider image to the slider starting area, and generating an overlay layer so that the overlay layer can cover the verification code image.

[0008] In combination with the second embodiment of the first aspect, in the third embodiment of the first aspect, the method also includes: determining whether the operation corresponding to the generation of the actual movement trajectory comes from a real user based on the information of the actual movement trajectory; when it is determined that the operation corresponding to the generation of the actual movement trajectory comes from a real user based on the information of the actual movement trajectory, generating a verification code input box and a confirmation button; when a click operation on the confirmation button is obtained, obtaining the input information received in the verification code input box; when the input information matches the dynamic verification code, the verification is passed.

[0009] In combination with the third embodiment of the first aspect, in the fourth embodiment of the first aspect, the information of the actual movement trajectory includes sliding time information and moving end point information; the step of determining whether the operation corresponding to the actual movement trajectory is from a real user based on the information of the actual movement trajectory includes: determining the sliding time information of the verification slider image corresponding to the preset distance and the moving end point information of the verification slider image based on the actual movement trajectory; obtaining the first distance between the moving end point and the first boundary of the preset slider operation trajectory and the second distance from the second boundary of the preset slider operation trajectory; obtaining the third distance between the moving end point and the first boundary of the verification code display area and the fourth distance from the second boundary of the verification code display area; when it is determined according to the preset scoring model that multiple sliding times, first distances, second distances, third distances and fourth distances meet their respective preset conditions, it is determined that the operation corresponding to the actual movement trajectory is from a real user.

[0010] In combination with the first aspect, in the fifth implementation of the first aspect, the number of characters in the dynamic verification code is a random number, and the characters include at least one of numbers and letters.

[0011] According to a second aspect, an embodiment of the present invention provides a device for generating a dynamic verification code, comprising: a verification trigger operation acquisition module for acquiring a verification trigger operation; a verification slider image generation module for generating a verification slider image based on the verification trigger operation and determining a slider starting area and a verification code display area; a slider operation module for generating an actual movement trajectory of the verification slider image in response to a drag operation on the verification slider image; and a verification code image display module for displaying at least a portion of the verification code image in the verification code display area based on the movement of the verification slider image when the actual movement trajectory matches a preset slider operation trajectory, the verification code image containing all or part of the dynamic verification code, and the preset slider operation trajectory corresponding one-to-one to the slider starting area.

[0012] In combination with the second aspect, in the first embodiment of the second aspect, the device also includes: an overlay layer generation module, which is used to move the verification slider image to the slider starting area when the drag operation is not recognized, and generate an overlay layer so that the overlay layer can cover the verification code image.

[0013] According to a third aspect, an embodiment of the present invention provides a computer device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method for generating a dynamic verification code described in the first aspect or any one embodiment of the first aspect.

[0014] According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for generating a dynamic verification code described in the second aspect or any one of the embodiments of the second aspect are implemented.

[0015] The technical solution of the present invention has the following advantages:

[0016] 1. An embodiment of the present invention provides a method, apparatus, and computer device for generating a dynamic verification code, wherein the generation method comprises: obtaining a verification trigger operation; generating a verification slider image based on the verification trigger operation, and determining a slider starting area and a verification code display area; generating an actual movement trajectory of the verification slider image in response to a drag operation on the verification slider image; and displaying a verification code image in the verification code display area based on the movement of the verification slider image when the actual movement trajectory matches a preset slider operation trajectory. The verification code image includes all or part of the dynamic verification code, and the preset slider operation trajectory corresponds to the slider starting area. By implementing the present invention, the corresponding verification code image is gradually displayed when the verification slider image is dragged to the designated verification code display area, combining the slider starting area and verification code display area randomly determined by the verification trigger operation. This increases the difficulty of robot recognition and makes it difficult for the robot to capture the verification code image for cracking. The gradual display of the corresponding verification code image improves the efficiency of verification code input. The output verification code is concise and clear, without the need for interference processing, greatly reducing the number of user recognition failures and improving input efficiency.

[0017] 2. The embodiments of the present invention provide a method, device, and computer device for generating dynamic verification codes. These methods combine random determination of the slider starting area and verification code display area, as well as generation of verification codes with random digits and random character verification codes, to further increase the difficulty of robot program recognition. Furthermore, the dynamic display of verification code images triggered by user verification can enhance user experience and increase interactivity and fun when used by users. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 This is a flowchart of a specific example of a method for generating a dynamic verification code in an embodiment of the present invention;

[0020] Figure 2 Schematic diagram of a verification interface in a method for generating a dynamic verification code according to an embodiment of the present invention;

[0021] Figure 3 This is a schematic diagram of the initialization of the verification slider image in the method for generating a dynamic verification code according to an embodiment of the present invention;

[0022] Figure 4This is a schematic diagram of the operation of a user dragging a verification slider image with a mouse or finger in a method for generating a dynamic verification code according to an embodiment of the present invention;

[0023] Figure 5 Schematic diagram of initialization of the verification slider image in the method for generating a dynamic verification code according to an embodiment of the present invention;

[0024] Figure 6 This is a schematic diagram of displaying a portion of a verification code image after the slider reaches the verification code display area in the method for generating a dynamic verification code in an embodiment of the present invention;

[0025] Figure 7 This is a schematic diagram of displaying a complete verification code image after the slider reaches the verification code display area in the method for generating a dynamic verification code in an embodiment of the present invention;

[0026] Figure 8 A schematic diagram of a real user inputting a correct verification code in a method for generating a dynamic verification code according to an embodiment of the present invention;

[0027] Figure 9 This is a flow chart of determining that the operation corresponding to the actual movement trajectory is a real user's operation according to the actual movement trajectory in the method for generating a dynamic verification code in an embodiment of the present invention;

[0028] Figure 10 This is a principle block diagram of a specific example of a device for generating a dynamic verification code in an embodiment of the present invention;

[0029] Figure 11 FIG. 4 is a diagram showing a specific example of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0031] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0032] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "installed," "connected," and "connected" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; internal connections between two components; wireless connections or wired connections. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0033] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0034] In the related art, in order to solve the problem of robot programs cracking verification code characters through denoising methods, and the problem of characters being too distorted and affecting the recognition of real users, an embodiment of the present invention provides a method, device and computer equipment for generating a dynamic verification code, the purpose of which is to generate a verification code image that is easy for real users to recognize and cannot be cracked by robot programs.

[0035] The embodiment of the present invention provides a method for generating a dynamic verification code, such as Figure 1 Shown, including:

[0036] Step S11: Obtain a verification trigger operation. In this embodiment, the verification trigger operation can be a user requesting the server to display a verification code, i.e., the user's verification code acquisition request. For example, when a user performs a certain operation (e.g., logging into an account or downloading a file), the user first performs identity authentication, and then performs a verification code verification after identity authentication. The verification trigger operation can also be a verification code verification request that automatically pops up when the user browses a webpage. Specifically, when the server obtains the verification trigger operation, it indicates that a verification code verification is required at this time.

[0037] Step S12: Generate a verification slider image according to the verification trigger operation, and determine the slider starting area and the verification code display area; in this embodiment, Figure 2 It can be a schematic diagram of the verification interface, such as Figure 2 As shown, the verification slider image A can be an operation slider that can be moved accordingly according to the user's drag operation, area 1, area 2, area 3, area 4 and area 5 are multiple slider starting areas pre-set on the verification interface, and E is the background image of the verification interface, which can be a blank image or an image with various patterns, etc.

[0038] Based on the verification trigger operation, a region is randomly determined from among the pre-set plurality of slider starting regions as the slider starting region. The operation trajectory corresponding to the slider starting region is the preset slider operation trajectory. This can be based on the horizontal region of the slider starting region, and then a region is randomly determined on the preset slider operation trajectory as the verification code display region. For example, after generating a verification slider image based on the verification trigger operation, if region 2 is randomly determined as the slider starting region, the verification slider image is generated on region 2. The slider operation trajectory D corresponding to the slider starting region is the preset slider operation trajectory, i.e., the horizontal region at the left and right boundaries of region 2. At this point, a region C can be arbitrarily selected on the slider operation trajectory D to be determined as the verification code display region. The process of the above embodiment can be considered as the initialization process of the verification slider image.

[0039] Specifically, the verification slider image has been generated according to the verification trigger operation, and the verification interface of the slider starting area and the verification code display area has been determined. Figure 3 As shown, that is, Figure 3 The schematic diagram of the verification interface after the verification slider image initialization has been completed can be displayed on the display screen for user operation.

[0040] Step S13: In response to the drag operation on the verification slider image, generate the actual movement trajectory of the verification slider image; in this embodiment, the drag operation on the verification slider image may be user input, such as the user dragging the verification slider image from left to right along the preset slider operation trajectory from the starting area of ​​the slider with a finger or a mouse. The actual movement trajectory may be the actual movement path of the verification slider image on the verification interface based on the user's drag operation. When the method of this embodiment is applied to a touch screen, the drag operation may be generated by the user directly dragging the verification slider image with a finger or the like; when the method of this embodiment is applied to a non-touch screen, the drag operation may be generated by the user selecting the verification slider image with a mouse and then dragging it. The actual movement trajectory of the verification slider image may be the actual movement trajectory of the user's finger or mouse generated by the processor in response to the user's drag operation, specifically, Figure 4 , which is a schematic diagram of the operation of a user dragging the verification slider image by using a mouse or finger to slide.

[0041] Step S14: When the actual movement trajectory matches the preset slider operation trajectory, based on the movement of the verification slider image, at least a portion of the verification code image is displayed in the verification code display area, where the verification code image includes all or part of the dynamic verification code, and the preset slider operation trajectory corresponds one-to-one to the slider starting area.

[0042] In this embodiment, the actual movement trajectory may be the actual movement trajectory of the verification slider image based on the drag operation, and the preset slider operation trajectory may be the movement trajectory of the verification slider image corresponding to the slider starting area. Specifically, when the actual movement trajectory of the verification slider image corresponds to the preset slider operation trajectory, and the verification slider image has moved to the verification code display area, as the verification slider image moves, at least a portion of the verification code image is displayed in the verification code display area, such as Figure 5 As shown, when the verification slider image A has moved to the verification code display area, part of the verification code 12 is displayed as the verification slider image A moves. Here, "the actual movement trajectory of the verification slider image corresponds to the preset slider operation trajectory" can mean that the user's drag operation on the verification slider image is performed within the preset slider operation trajectory, and the sliding direction of the moving verification slider image corresponds to the direction of the preset slider operation trajectory. Specifically, the preset slider operation trajectory corresponds to the slider starting area one-to-one. When the slider starting area has been determined, the corresponding preset slider operation trajectory has also been determined, such as Figure 2 As shown, area 1, area 2, area 3, area 4 and area 5 are multiple slider starting areas pre-set on the verification interface. For example, the preset slider operation track corresponding to area 2 is area D.

[0043] The present invention provides a method for generating a dynamic verification code, comprising: obtaining a verification trigger operation; generating a verification slider image based on the verification trigger operation, and determining a slider starting area and a verification code display area; generating an actual movement trajectory of the verification slider image in response to a drag operation on the verification slider image; and displaying a verification code image in the verification code display area based on the movement of the verification slider image when the actual movement trajectory matches a preset slider operation trajectory. The verification code image includes all or part of the dynamic verification code, and the preset slider operation trajectory corresponds to the slider starting area. By implementing the present invention, the slider starting area and the verification code display area randomly determined by the verification trigger operation are combined. When the verification slider image is dragged to the designated verification code display area, the corresponding verification code image is gradually displayed, which increases the difficulty of robot program recognition and makes it difficult for the robot program to capture the verification code image for cracking. In combination with the gradual display of the corresponding verification code image, the efficiency of verification code input is improved. The output verification code is concise and clear, and does not require interference processing, which greatly reduces the number of user recognition failures and improves input efficiency.

[0044] As an optional embodiment of the present invention, the above step S14, based on the movement of the verification slider image, displays at least a portion of the verification code image in the verification code display area, includes: based on the movement of the verification slider image, gradually displaying the entire verification code image in the verification code display area. In this embodiment, the verification slider image moves with the user's drag operation, based on the movement of the verification slider image, such as Figure 5 as well as Figure 6 As shown, the verification code image is gradually displayed in the randomly selected verification code display area until the complete verification code image is displayed. For example, as the verification slider image A moves, the partial verification code 12 is first displayed in the verification code display area until the complete verification code 1234 is displayed.

[0045] In an optional embodiment, the process of gradually displaying the complete image of the verification code image in the verification code display area may include displaying verification codes 1, 2, 3, and 4 one by one based on the movement of the verification slider image; or jumping to display the verification code based on the movement of the verification slider image.

[0046] In an alternative embodiment, the timing or time for generating the verification code image may include the following: First, when the verification slider image reaches the verification code display area, a verification code image generation request is generated. Subsequently, the background processor generates a verification code image consisting of random digits and random characters based on the verification code image generation request and displays the corresponding dynamic verification code image in the area where the verification slider image passes. Generating the verification code image only when the verification slider image reaches the verification code display area can allow it to be displayed immediately after generation, making it more difficult for robots to capture the verification code image and increasing the difficulty of cracking the verification code image. Second, the timing for generating the verification code image may also be based on a verification trigger operation. When the processor receives the verification trigger operation, it generates a verification code image consisting of random digits and random characters and displays the corresponding dynamic verification code image in the area where the verification slider image passes. The verification code image may also be generated at any time before the verification slider image reaches the verification code display area. This is not specifically limited in the present embodiment and can be determined by those skilled in the art based on actual circumstances.

[0047] As an optional embodiment of the present invention, the generation method further includes: when a drag operation is not recognized, moving the verification slider image to the slider's starting area and generating an overlay layer so that the overlay layer covers the verification code image. In this embodiment, the drag operation can be a user dragging the verification slider image; the overlay layer can be the background image of the verification interface, a newly generated blank layer, or another patterned layer. When the processor fails to detect the drag operation, the verification slider image automatically returns to the slider's starting area, and simultaneously generates an overlay layer or calls the verification interface's background image, both of which are used to cover the verification code image, further increasing the difficulty of robot program cracking.

[0048] Specifically, the drag operation cannot be obtained when the user releases the verification slider image while dragging the verification slider image along the preset slider operation trajectory. At this time, the verification slider image will directly return to the slider starting area along the preset slider operation trajectory; the user releases the verification slider image at any time during the process of the user dragging the verification slider image along the preset slider operation trajectory, which can be before the verification slider image reaches the verification code display area, when the verification slider image reaches the verification code display area, or when the verification slider image leaves the verification code display area.

[0049] The present invention provides a method for generating a dynamic verification code. The generated dynamic verification code image is not displayed on the webpage after it is loaded. Instead, the user manually drags a slider to a specified position, which retrieves the dynamic verification code image from the backend and gradually displays it on the verification page. The code disappears immediately after the user releases the mouse or finger, making it difficult for robots to capture the verification code image for identification and decryption, further ensuring the security of verification code recognition.

[0050] As an optional embodiment of the present invention, the generation method further includes:

[0051] First, based on the information of the actual movement trajectory, determine whether the operation corresponding to the generation of the actual movement trajectory comes from a real user; when it is determined based on the information of the actual movement trajectory that the operation corresponding to the generation of the actual movement trajectory comes from a real user, generate a verification code input box and a confirmation button; in this embodiment, the information of the actual movement trajectory is information associated with the generated actual movement trajectory; the verification code input box can be an area generated by the processor for the user to input the verification code; the confirmation button is a virtual button; specifically, the information of the actual movement trajectory is obtained, and when the obtained information meets the preset conditions, it can be determined that the operation corresponding to the generation of the actual movement trajectory comes from a real user, at this time, the background processor generates a verification code input box and a confirmation button.

[0052] Specifically, if Figure 7As shown, when the verification slider image reaches the verification code display area based on the user's drag operation and the dynamic verification code image is fully displayed, the user can now see the verification code that needs to be filled in. When the user releases the mouse or finger, the verification slider image automatically returns to the slider's starting area, and an overlay layer is generated to cover the generated dynamic verification code image, so that the dynamic verification code image is no longer displayed on the verification interface. When the slider returns to the slider's starting area, the actual movement trajectory of the slider (the actual movement path of the verification slider image on the verification interface based on the user's drag operation, from the slider's starting area to the user releasing the verification slider image) is used to determine whether it is a real user operation. If it is determined to be a real user operation, the verification code input box and verification code confirmation button will be displayed; if it is determined to be a robot operation, the verification code input box and verification code confirmation button will not be displayed.

[0053] Secondly, when a click operation on the confirmation button is obtained, the input information received in the verification code input box is obtained; in this embodiment, since the verification code display area will be covered by the overlay layer after the user releases the verification slider image, the real user needs to fill in the verification code 1234 in the verification code input box according to memory. The input information is the verification code entered by the real user in the verification code input box, and the verification code confirmation button is clicked to request the processor to perform verification code verification. Specifically, when the background processor obtains the click operation of the confirmation button, the verification code entered by the user is obtained in the verification code input box. Figure 8 As shown, this is a schematic diagram of a real user entering a correct verification code.

[0054] Secondly, if the input information matches the dynamic verification code, the verification is successful. In this embodiment, the background processor determines whether the generated verification code image and the verification code obtained in the verification code input box are consistent. If the input information matches the dynamic verification code, the verification is determined to be successful. The background processor can generate a verification success prompt message. After the verification is successful, the user can proceed to the next step, such as logging into an account, browsing the web, and downloading files.

[0055] As an optional embodiment of the present invention, the information of the actual movement trajectory includes sliding time information and movement destination information.

[0056] In the above steps, if Figure 9 As shown, in the above embodiment, the step of determining whether the operation corresponding to the generated actual movement trajectory is from a real user based on the information of the actual movement trajectory includes:

[0057] Step S21: Based on the actual movement trajectory, determine the sliding time information of the verification slider image corresponding to the preset distance and the movement end point information of the verification slider image. In this embodiment, the preset distance can be a fixed distance, for example, one millimeter or 0.1 millimeter. The movement end point of the verification slider image can be the position where the user releases the verification slider image. Specifically, based on the actual movement trajectory of the verification slider image, obtain the sliding time data of the verification slider image for each millimeter of movement, and determine the position data where the user releases the verification slider image.

[0058] Step S22: Obtain a first distance between the moving end point and a first boundary of the preset slider operation track, and a second distance between the moving end point and a second boundary of the preset slider operation track. In this embodiment, the first boundary of the preset slider operation track may be the left boundary of the preset slider operation track, and the second boundary of the preset slider operation track may be the right boundary of the preset slider operation track. Specifically, obtain distance data between the position where the user releases the verification slider image and the left boundary and the right boundary of the preset slider operation track. The distance between the position where the user releases the verification slider image and the left boundary of the preset slider operation track is the first distance, and the distance between the position where the user releases the verification slider image and the right boundary of the preset slider operation track is the second distance.

[0059] Step S23: Obtain a third distance between the moving end point and the first boundary of the verification code display area and a fourth distance from the second boundary of the verification code display area; in this embodiment, the first boundary of the verification code display area may be the left boundary of the verification code display area, and the second boundary of the verification code display area may be the right boundary of the verification code display area. Specifically, obtain distance data from the position where the user releases the verification slider image to the left boundary and the right boundary of the verification code display area; the distance from the position where the user releases the verification slider image to the left boundary of the verification code display area is the third distance, and the distance from the position where the user releases the verification slider image to the right boundary of the verification code display area is the fourth distance.

[0060] Step S24: When the sliding times, first distance, second distance, third distance, and fourth distance are determined to meet the respective preset conditions according to the preset scoring model, the operation corresponding to the actual movement trajectory is determined to be a real user. In this embodiment, the sliding time of the verification slider image at each fixed distance can be determined to determine whether it is approximately equal, thereby determining the total sliding time of the verification slider image; and determining whether the verification slider image has approximately reached the right boundary of the preset slider operation trajectory, whether the verification slider image has reached the right boundary of the verification code display area, or whether the verification slider image has excessively exceeded the right boundary of the verification code display area.

[0061] Specifically, the process of determining whether the operation corresponding to the actual movement trajectory is from a real user may include: when it is determined according to the scoring model that the sliding time of the verification slider image at each fixed distance is within a floating range of 2%, it is considered to be an inauthentic user operation, that is, when the sliding time of the verification slider image at each fixed distance is approximately equal, it can be considered to be an inauthentic user operation; at this time, the input information of the preset scoring model is the sliding time data of the verification slider image at each fixed distance, and the output information is the floating range information of the sliding time of the verification slider image, that is, the result of whether the operation is from a real user or an inauthentic user is given.

[0062] The average historical sliding time is obtained based on the distance between the moving end point and the left border of the verification code display area. When the total sliding time is less than or greater than 15% of the average value, it is considered to be an inauthentic user operation. At this time, the input information of the preset scoring model is the average historical sliding time of the verification slider image, and the output information is the judgment result of whether the operation is from a real user or an inauthentic user.

[0063] If the verification slider image does not reach the right edge of the verification code display area, it is considered an inauthentic user operation. If the verification slider image exceeds 10% of the right edge of the verification code display area, it is considered an inauthentic user operation, meaning that the actual movement trajectory corresponds to an inauthentic user. Otherwise, the actual movement trajectory is considered to correspond to an authentic user. In this case, the input information of the preset scoring model is the movement endpoint information of the verification slider image, and the output information is the judgment result of whether the operation is from an authentic user or an inauthentic user.

[0064] As an optional embodiment of the present invention, the generation method further includes: the number of characters in the dynamic verification code is a random number, and the characters include at least one of numbers and letters. In this embodiment, when the verification slider image reaches the verification code display area, the processor randomly generates a verification code image and displays the dynamic verification code image where the slider passes. The processor calculates the dynamic verification code of random digits and random characters. The number of digits in the verification code is generally controlled to 4 to 8 to facilitate the real user's memorization. Specifically, the characters in the dynamic verification code can include numbers, letters, Chinese characters, special symbols, etc.

[0065] A method for generating a dynamic verification code, provided by an embodiment of the present invention, randomly determines a slider starting area in the left area of ​​the verification interface background image during slider initialization and a verification code display area along the corresponding slider operation trajectory, thereby increasing the difficulty of cracking by most bots. During the verification code generation process, the processor generates a dual-random verification code image (random digits and random characters). Simultaneously, during the verification code display process, the verification code image is gradually displayed on the verification page as the verification slider image slides, improving the user experience and increasing the difficulty of cracking by bots. During the verification code display process, the dynamic verification code image is only visible when the slider is continuously dragged with a mouse or finger, and does not appear on the page for a long time, thus preventing the verification code image from appearing on the page for a long time and potentially causing cracking. During the human-computer operation judgment process, the actual user operation trajectory and operation duration of the slider are used to determine whether the operation is a real user operation. Only if the module determines that it is a real human operation will the verification code input box and verification code confirmation button be displayed, further reducing the risk of being cracked by bots. In this embodiment of the present invention, no interference processing is performed on the dynamic verification code image itself, resulting in high dynamic verification code recognition, convenient user recognition of dynamic verification codes, and further optimizing the user experience.

[0066] The embodiment of the present invention provides a device for generating a dynamic verification code, such as Figure 10 Shown, including:

[0067] The verification trigger operation acquisition module 31 is used to obtain the verification trigger operation; for detailed implementation, please refer to the relevant description of step S11 in the above method embodiment.

[0068] The verification slider image generation module 32 is used to generate a verification slider image according to the verification trigger operation and determine the slider starting area and the verification code display area; the detailed implementation content can be found in the relevant description of step S12 in the above method embodiment.

[0069] The slider operation module 33 is used to generate an actual movement trajectory of the verification slider image in response to a drag operation on the verification slider image. For detailed implementation, please refer to the description of step S13 in the above method embodiment.

[0070] The verification code image display module 34 is configured to display at least a portion of the verification code image in the verification code display area based on the movement of the verification slider image when the actual movement trajectory matches the preset slider operation trajectory. The verification code image includes all or part of the dynamic verification code, and the preset slider operation trajectory corresponds one-to-one with the slider starting area. For detailed implementation details, please refer to the description of step S14 in the above method embodiment.

[0071] The present invention provides a device for generating a dynamic verification code, comprising: a verification trigger operation acquisition module 31 for acquiring a verification trigger operation; a verification slider image generation module 32 for generating a verification slider image based on the verification trigger operation and determining a slider starting area and a verification code display area; a slider operation module 33 for generating an actual movement trajectory of the verification slider image in response to a drag operation on the verification slider image; and a verification code image display module 34 for displaying at least a portion of a verification code image in the verification code display area based on the movement of the verification slider image when the actual movement trajectory matches a preset slider operation trajectory. The verification code image includes all or part of a dynamic verification code, and the preset slider operation trajectory corresponds one-to-one with the slider starting area. By implementing the present invention, combined with the slider starting area and the verification code display area randomly determined by the verification trigger operation, when the verification slider image is dragged to the designated verification code display area, the corresponding verification code image is gradually displayed, which increases the difficulty of robot program recognition and makes it difficult for the robot program to capture the verification code image for cracking; combined with the gradual display of the corresponding verification code image, the efficiency of verification code input is improved, the output verification code is concise and clear, and no interference processing is required, which greatly reduces the situation of user recognition failure and improves input efficiency.

[0072] As an optional embodiment of the present invention, the generating device further includes:

[0073] The overlay layer generation module is used to move the verification slider to the slider starting area when the drag operation cannot be obtained, and generate an overlay layer so that the overlay layer can cover the verification code image. Detailed implementation content can be found in the description of step S11 in the above method embodiment.

[0074] The embodiment of the present invention also provides a computer device, such as Figure 11 As shown, the computer device may include a processor 41 and a memory 42, wherein the processor 41 and the memory 42 may be connected via a bus 40 or other means. Figure 11 The connection via bus 40 is taken as an example.

[0075] The processor 41 may be a central processing unit (CPU). The processor 41 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0076] Memory 42, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as the program instructions / modules corresponding to the method for generating a dynamic verification code in the embodiments of the present invention. Processor 41 executes the non-transitory software programs, instructions, and modules stored in memory 42 to perform various processor functions and data processing, thereby implementing the method for generating a dynamic verification code in the above-mentioned method embodiment.

[0077] The memory 42 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created by the processor 41, etc. In addition, the memory 42 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 42 may optionally include a memory remotely located relative to the processor 41, and these remote memories may be connected to the processor 41 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0078] The one or more modules are stored in the memory 42 and when executed by the processor 41, perform the following steps: Figure 1 The method for generating a dynamic verification code in the illustrated embodiment.

[0079] For details of the above computer equipment, please refer to Figure 1 The corresponding descriptions and effects in the embodiments shown can be understood and will not be repeated here.

[0080] An embodiment of the present invention further provides a non-transitory computer-readable medium, which stores computer instructions. The computer instructions are used to enable a computer to execute the method for generating a dynamic verification code as described in any one of the above embodiments, wherein the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium may also include a combination of the above types of memory.

[0081] Obviously, the above embodiments are merely examples for clarity of explanation and are not intended to limit the implementation methods. Those skilled in the art will readily appreciate that other variations or modifications based on the above descriptions are possible. It is not necessary and impossible to enumerate all implementation methods here. Obvious variations or modifications arising therefrom remain within the scope of protection of the present invention.

Claims

1. A method for generating a dynamic verification code, characterized in that: include: Get the verification trigger operation; Generate a verification slider image according to the verification trigger operation, and determine the slider starting area and the verification code display area; In response to a drag operation on the verification slider image, generating an actual movement trajectory of the verification slider image; When the actual movement trajectory matches the preset slider operation trajectory, at least a portion of the verification code image is displayed in the verification code display area based on the movement of the verification slider image, the verification code image including all or part of the dynamic verification code, and the preset slider operation trajectory corresponds one-to-one with the slider starting area; The step of generating a verification slider image according to the verification trigger operation and determining a slider starting area and a verification code display area includes: According to the verification trigger operation, an area is randomly determined in the pre-set multiple slider starting areas as the slider starting area, the operation track corresponding to the slider starting area is the preset slider operation track, and based on the horizontal area of ​​the slider starting area, an area is randomly determined on the preset slider operation track as the verification code display area.

2. The method according to claim 1, characterized in that The step of displaying at least a portion of the verification code image in the verification code display area based on the movement of the verification slider image includes: Based on the movement of the verification slider image, a complete image of the verification code image is gradually displayed in the verification code display area.

3. The method according to claim 1, characterized in that Also includes: When the drag operation is not recognized, the verification slider image is moved to the slider starting area, and an overlay layer is generated so that the overlay layer can cover the verification code image.

4. The method according to claim 1, wherein Also includes: Determining, based on the information of the actual movement trajectory, whether the operation corresponding to generating the actual movement trajectory is from a real user; When it is determined that the operation corresponding to generating the actual movement trajectory is from a real user, a verification code input box and a confirmation button are generated; When a click operation on the confirmation button is obtained, the input information received in the verification code input box is obtained; When the input information matches the dynamic verification code, the verification is successful.

5. The method according to claim 4, characterized in that The actual movement trajectory information includes sliding time information and movement destination information; The step of determining, based on the information of the actual movement trajectory, whether the operation corresponding to generating the actual movement trajectory is from a real user comprises: Determining, based on the actual movement trajectory, sliding time information of the verification slider image corresponding to a preset distance and movement end point information of the verification slider image; Acquire a first distance between the movement end point and a first boundary of the preset slider operation track and a second distance between the movement end point and a second boundary of the preset slider operation track; Obtaining a third distance between the moving end point and the first boundary of the verification code display area and a fourth distance between the moving end point and the second boundary of the verification code display area; When it is determined according to the preset scoring model that the plurality of sliding times, the first distance, the second distance, the third distance, and the fourth distance meet respective preset conditions, it is determined that the operation corresponding to the actual movement trajectory is a real user operation.

6. The method according to claim 1, characterized in that The number of characters in the dynamic verification code is a random number, and the characters include at least one of numbers and letters.

7. A device for generating a dynamic verification code, characterized in that: include: Verification trigger operation acquisition module, used to obtain verification trigger operation; A verification slider image generation module is used to generate a verification slider image according to the verification trigger operation and determine the slider starting area and the verification code display area; a slider operation module, configured to generate an actual movement trajectory of the verification slider image in response to a drag operation on the verification slider image; a verification code image display module, configured to display at least a portion of a verification code image in the verification code display area based on the movement of the verification slider image when the actual movement trajectory matches a preset slider operation trajectory, wherein the verification code image includes all or part of the dynamic verification code, and the preset slider operation trajectory corresponds one-to-one with the slider starting area; The verification slider image generation module is specifically used to: According to the verification trigger operation, an area is randomly determined in the pre-set multiple slider starting areas as the slider starting area, the operation track corresponding to the slider starting area is the preset slider operation track, and based on the horizontal area of ​​the slider starting area, an area is randomly determined on the preset slider operation track as the verification code display area.

8. The device according to claim 7, characterized in that Also includes: The overlay layer generating module is used to move the verification slider image to the slider starting area and generate an overlay layer when the drag operation is not recognized, so that the overlay layer can cover the verification code image.

9. A computer device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method for generating a dynamic verification code according to any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for generating a dynamic verification code according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Picture identifying code creation method and device

    CN101339666A

  • Verification information display method and mobile terminal

    CN108446083A