CN112819693B - Sliding verification code generation method and device, electronic equipment and computer readable medium - Google Patents

Sliding verification code generation method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN112819693B
CN112819693B CN202110416636.4A CN202110416636A CN112819693B CN 112819693 B CN112819693 B CN 112819693B CN 202110416636 A CN202110416636 A CN 202110416636A CN 112819693 B CN112819693 B CN 112819693B
Authority
CN
China
Prior art keywords
candidate
candidate pixel
pixel point
background image
pixel information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110416636.4A
Other languages
Chinese (zh)
Other versions
CN112819693A (en
Inventor
张玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yongsheng Intellectual Property Service Co ltd
Original Assignee
Beijing Missfresh Ecommerce Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Missfresh Ecommerce Co Ltd filed Critical Beijing Missfresh Ecommerce Co Ltd
Priority to CN202110416636.4A priority Critical patent/CN112819693B/en
Publication of CN112819693A publication Critical patent/CN112819693A/en
Application granted granted Critical
Publication of CN112819693B publication Critical patent/CN112819693B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/36User authentication by graphic or iconic representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2133Verifying human interaction, e.g., Captcha

Abstract

The embodiment of the disclosure discloses a sliding verification code generation method and device, electronic equipment and a computer readable medium. One embodiment of the method comprises: in response to the detection of the access operation of a target user to a target page, selecting a background image from a background image library as a candidate background image; performing pixelization processing on the candidate background image to generate a pixelized candidate background image; generating a sliding track according to a candidate pixel point set in the candidate background image after the pixelation processing; determining a target position in the sliding track; and generating a sliding verification code based on the candidate background image after the pixelation processing, the sliding track and the target position. The embodiment reduces the time for the user to pass the verification, and simultaneously improves the identity verification capability of the verification code.

Description

Sliding verification code generation method and device, electronic equipment and computer readable medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a sliding verification code generation method and device, electronic equipment and a computer readable medium.
Background
The verification code technology can effectively prevent the problem that the user account is cracked in a brute force cracking mode, and meanwhile, the server breakdown caused by malicious frequent access can be avoided. Currently, the types of commonly used authentication codes are generally character type authentication codes and sliding type authentication codes. Character type verification codes first often require a user to enter characters in the verification code in a text box and then verify the characters entered by the user. The sliding type verification code is usually that a user drags a sliding block, and the computer verifies the identity of the user by detecting the position relation of the sliding block and a groove in the sliding verification code.
However, when the above character type captcha and slide type captcha are employed, there are often technical problems as follows:
firstly, for a character type verification code, when more characters exist in the verification code and more interference items exist, a user is easy to input an incorrect verification code, and the time for the user to pass the verification is increased;
secondly, for a common sliding type verification code, because the groove in the sliding verification code has an obvious boundary, the boundary of the groove is easily identified through a boundary detection algorithm, so that the groove is positioned, and the verification code loses effect;
thirdly, for a common sliding verification code, since the positions of the grooves are randomly generated, it may happen that the positions of the randomly generated grooves are closer to the initial position of the slider, so that the verification code loses the effect of verifying the identity of the user.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose a sliding verification code generation method, apparatus, electronic device and computer readable medium to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a sliding verification code generation method, including: in response to the detection of the access operation of a target user to a target page, selecting a background image from a background image library as a candidate background image; performing pixelization processing on the candidate background image to generate a pixelized candidate background image; generating a sliding track according to a candidate pixel point set in the candidate background image after the pixelation processing; determining a target position in the sliding track; and generating a sliding verification code based on the candidate background image after the pixelization processing, the sliding track and the target position.
In some embodiments, the generating a sliding trajectory according to the candidate pixel point set in the candidate background image after the pixelation processing includes:
generating the sliding track according to the candidate pixel point set by the following formula:
Figure 187008DEST_PATH_IMAGE001
wherein the content of the first and second substances,
Figure 697624DEST_PATH_IMAGE002
a track equation corresponding to the sliding track is expressed,
Figure 211782DEST_PATH_IMAGE003
representing the pixel point coordinates included in the candidate pixel information corresponding to the candidate pixel point in the candidate pixel point set,
Figure 934887DEST_PATH_IMAGE004
representing the pixel point coordinates included in the candidate pixel information corresponding to the 1 st candidate pixel point in the candidate pixel point set,
Figure 483680DEST_PATH_IMAGE005
representing the pixel point coordinate included in the candidate pixel information corresponding to the 2 nd candidate pixel point in the candidate pixel point set,
Figure 774984DEST_PATH_IMAGE006
representing the pixel point coordinates included in the candidate pixel information corresponding to the 3 rd candidate pixel point in the candidate pixel point set,
Figure 402537DEST_PATH_IMAGE007
representing the pixel point coordinates included in the candidate pixel information corresponding to the 4 th candidate pixel point in the candidate pixel point set,
Figure 70279DEST_PATH_IMAGE008
representing the pixel point coordinates included in the candidate pixel information corresponding to the 5 th candidate pixel point in the candidate pixel point set,
Figure 473578DEST_PATH_IMAGE009
represents an independent variable with a value range of
Figure 325997DEST_PATH_IMAGE010
In some embodiments, the determining the target position in the sliding trajectory includes:
determining candidate variable values by the following formula:
Figure 549167DEST_PATH_IMAGE011
wherein the content of the first and second substances,
Figure 20600DEST_PATH_IMAGE012
representing the value of the candidate variable,
Figure 137461DEST_PATH_IMAGE002
a track equation corresponding to the sliding track is expressed,
Figure 301726DEST_PATH_IMAGE013
the sequence number is shown to indicate that,
Figure 277772DEST_PATH_IMAGE014
representing the number of candidate pixels in the set of candidate pixels,
Figure 146371DEST_PATH_IMAGE015
representing the abscissa of the pixel point coordinate included in the candidate pixel information corresponding to the candidate pixel point in the candidate pixel point set,
Figure 524263DEST_PATH_IMAGE016
representing the first of the candidate pixel point set
Figure 593850DEST_PATH_IMAGE017
The candidate pixel information corresponding to each candidate pixel point includes the abscissa in the pixel point coordinates,
Figure 177233DEST_PATH_IMAGE018
the representation of the random function is such that,
Figure 52785DEST_PATH_IMAGE019
indicating random selection
Figure 144238DEST_PATH_IMAGE020
To
Figure 384726DEST_PATH_IMAGE021
The random integer of (a) is (b),
Figure 928840DEST_PATH_IMAGE022
the intermediate variable is represented by a number of variables,
Figure 280187DEST_PATH_IMAGE023
representing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 1 st candidate pixel point in the candidate pixel point set,
Figure 727611DEST_PATH_IMAGE024
representing the abscissa of the pixel point coordinate included in the candidate pixel information corresponding to the 2 nd candidate pixel point in the candidate pixel point set,
Figure 139001DEST_PATH_IMAGE025
representing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 3 rd candidate pixel point in the candidate pixel point set,
Figure 311356DEST_PATH_IMAGE026
representing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 4 th candidate pixel point in the candidate pixel point set,
Figure 591028DEST_PATH_IMAGE027
representing an abscissa in pixel point coordinates included in candidate pixel information corresponding to a 5 th candidate pixel point in the candidate pixel point set;
and determining the target position according to the candidate variable value and a track equation corresponding to the sliding track.
In a second aspect, some embodiments of the present disclosure provide a sliding verification code generation apparatus, including: the selecting unit is configured to select a background image from a background image library as a candidate background image in response to detecting an access operation of a target user to a target page; a pixelation processing unit configured to perform pixelation processing on the candidate background image to generate a pixelation-processed candidate background image; a first generating unit configured to generate a sliding track according to a candidate pixel point set in the candidate background image after the pixelation processing; a determination unit configured to determine a target position in the slide trajectory; a second generating unit configured to generate a slide verification code based on the candidate background image after the pixelization processing, the slide trajectory, and the target position.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following beneficial effects: the sliding verification code obtained by the verification code generation method of some embodiments of the present disclosure reduces the time consumed by the user to pass the verification, and increases the verification capability of the verification code. Specifically, the user passes the verification for a long time, and the verification of the verification code is disabled because: the character type verification code is often provided with more characters and more interference items (such as interference lines), and the grooves in the existing sliding type verification code have obvious boundaries. Based on this, the sliding verification code generation method of some embodiments of the present disclosure first selects a background image from a background image library as a candidate background image in response to detecting an access operation of a target user to a target page. In practical situations, the identity of the user often only needs to be verified through the verification code when the user accesses the application or the website. Accordingly, the present disclosure reacquires a candidate background image for generating a slide validation code in response to detecting an access operation by a user. Then, the candidate background image is subjected to pixelization processing to generate a pixelized candidate background image. In practical situations, because the groove in the sliding type verification code has an obvious boundary, the boundary of the groove is easily identified through a boundary detection algorithm, so that the positioning of the groove is realized. Therefore, the difference between the color value of the pixel on the boundary of the groove and the color value of the pixel around the boundary is reduced by performing the pixelization process on the candidate background image, thereby increasing the difficulty in identifying the boundary of the groove. Further, a sliding track is generated according to the candidate pixel point set in the candidate background image after the pixelation processing. Further, a target position in the sliding trajectory is determined. In practical situations, the moving track of the slider in the commonly used sliding-type verification code is often fixed, that is, the slider can be easily controlled to move into the groove only by determining the position of the groove, so that the verification is passed. Therefore, the random sliding track and the random target position (the position of the center of the groove) are generated, so that the cracking difficulty of the verification code is improved. And finally, generating a sliding verification code based on the candidate background image after the pixelation processing, the sliding track and the target position. The sliding verification code generated by the mode avoids the problems that the character type verification code exists, and when more characters exist in the verification code and more interference items exist, a user is easy to input the wrong verification code. Meanwhile, the time for the user to pass the verification can be reduced, and the problem of the existing sliding type verification code is solved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
FIG. 1 is a schematic diagram of one application scenario of a sliding verification code generation method of some embodiments of the present disclosure;
FIG. 2 is a flow diagram of some embodiments of a sliding verification code generation method according to the present disclosure;
FIG. 3 is a schematic illustration of a candidate background image;
FIG. 4 is a schematic diagram of a set of sub-images;
FIG. 5 is a schematic view of a sliding track;
FIG. 6 is a flow diagram of further embodiments of a sliding verification code generation method according to the present disclosure;
FIG. 7 is a schematic diagram of a generation process of a target pixel point;
FIG. 8 is a schematic illustration of a sliding authentication code;
FIG. 9 is a schematic block diagram of some embodiments of a sliding verification code generation apparatus according to the present disclosure;
FIG. 10 is a schematic block diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of an application scenario of a sliding verification code generation method according to some embodiments of the present disclosure.
In the application scenario of fig. 1, first, the computing device 101 may select a background image from the background image library 102 as a candidate background image 103 in response to detecting an access operation of a target user to a target page; secondly, the computing device 101 may perform a pixelation process on the candidate background image 103 to generate a pixelation processed candidate background image 104; in addition, the computing device 101 may generate a sliding track 106 according to the candidate pixel point set 105 in the candidate background image 104 after the pixelation processing; further, the computing device 101 may determine the target position 107 in the sliding trajectory 106; finally, the computing device 101 may generate a sliding verification code 108 based on the pixilated candidate background image 104, the sliding trajectory 106, and the target position 107.
The computing device 101 may be hardware or software. When the computing device is hardware, it may be implemented as a distributed cluster composed of multiple servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be installed in the hardware devices enumerated above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computing devices in FIG. 1 is merely illustrative. There may be any number of computing devices, as implementation needs dictate.
With continued reference to fig. 2, a flow 200 of some embodiments of a sliding verification code generation method according to the present disclosure is shown. The sliding verification code generation method comprises the following steps:
step 201, in response to detecting the access operation of the target user to the target page, selecting a background image from a background image library as a candidate background image.
In some embodiments, an executing subject of the sliding verification code generation method (e.g., the computing device 101 shown in fig. 1) may select a background image from a background image library as a candidate background image in response to detecting an access operation of a target user to a target page. The target user may be a user needing authentication. The target page may be a page containing a verification code. The background image library may be a database for storing background images of the slide validation codes. The access operation may be a click operation. The access operation may also be a page jump operation. The execution subject may randomly select a background image from the background image library as a candidate background image.
For example, when the user clicks the link address corresponding to the target page, it may be assumed that the target user performs an access operation on the target page.
As another example, when the user accesses the link address corresponding to the target page, it may be assumed that the target user performs an access operation on the target page.
As still another example, the candidate background image may be as shown in fig. 3.
Step 202, performing pixelization processing on the candidate background image to generate a pixelized candidate background image.
In some embodiments, the performing step of performing pixelization processing on the candidate background image by the performing subject to generate a pixelized candidate background image may include the following steps:
the first step, the candidate background image is segmented to generate a sub-image set.
As an example, the sub-image set may be as shown in fig. 4. Wherein, the resolution of the sub-images 401 in the sub-image set is the same.
And secondly, determining the average value of the maximum color value and the minimum color value in the color values corresponding to all the pixel points included in each sub-image in the sub-image set as the color value of the sub-image. Thereby realizing the pixelization processing of the candidate background image.
Step 203, generating a sliding track according to the candidate pixel point set in the candidate background image after the pixelation processing.
In some embodiments, the executing body may generate the sliding trajectory according to the candidate pixel point set in the candidate background image after the pixelation processing, including the following steps:
the method comprises the following steps of firstly, randomly selecting a non-repeated preset number of sub-images from each sub-image set in the sub-image sets to generate candidate sub-images, and obtaining the candidate sub-image sets.
As an example, the preset number may be 4.
And secondly, randomly selecting a pixel point from each candidate sub-image in the candidate sub-image set as a candidate pixel point to obtain the candidate pixel point set.
And thirdly, generating the sliding track by a least square method according to the candidate pixel point set.
As an example, the above-described slide trajectory may be as shown in fig. 5. Wherein, fig. 5 includes: 4 candidate subimages 501, 4 candidate pixel points 502 and a sliding track 503.
In some optional implementation manners of some embodiments, the executing body may generate the sliding trajectory according to a candidate pixel point set in the candidate background image after the pixelation processing, and may include the following steps:
firstly, generating a fitting curve according to the candidate pixel point set in the candidate background image after the pixelation processing.
And secondly, determining the fitted curve as the sliding track.
Step 204, determining a target position in the sliding track.
In some embodiments, the determining of the target position in the sliding trajectory by the execution subject may include:
the method comprises the steps of firstly, sorting candidate pixel points in a candidate pixel point set according to the size of an abscissa of a pixel coordinate of each candidate pixel point in the candidate pixel point set and the sequence from small to large to obtain a candidate pixel point sequence.
And secondly, removing the first candidate pixel point in the candidate pixel point sequence from the candidate pixel point sequence to generate a removed candidate pixel point sequence.
And thirdly, generating a candidate curve by a least square method according to the candidate pixel point sequence after the elimination.
And fourthly, randomly selecting the pixel coordinate of a pixel point from the candidate curve as the target position.
In some optional implementations of some embodiments, the determining, by the execution subject, a target position in the sliding trajectory may include:
firstly, determining a candidate variable value according to each candidate pixel point in the candidate pixel point set.
And secondly, determining the target position according to the candidate variable value and a track equation corresponding to the sliding track.
And step 205, generating a sliding verification code based on the candidate background image after the pixelation processing, the sliding track and the target position.
In some embodiments, the execution subject may generate the sliding verification code based on the candidate background image after the pixelation process, the sliding trajectory, and the target position. The execution body may generate the sliding verification code by JavaScript code based on the candidate background image, the sliding trajectory, and the target position after the pixelation processing.
Optionally, the sliding verification code further includes: a slide block.
The above embodiments of the present disclosure have the following beneficial effects: the sliding verification code obtained by the verification code generation method of some embodiments of the present disclosure reduces the time consumed by the user to pass the verification, and increases the verification capability of the verification code. Specifically, the user passes the verification for a long time, and the verification of the verification code is disabled because: the character type verification code is often provided with more characters and more interference items (such as interference lines), and the grooves in the existing sliding type verification code have obvious boundaries. Based on this, the sliding verification code generation method of some embodiments of the present disclosure first selects a background image from a background image library as a candidate background image in response to detecting an access operation of a target user to a target page. In practical situations, the identity of the user often only needs to be verified through the verification code when the user accesses the application or the website. Accordingly, the present disclosure reacquires a candidate background image for generating a slide validation code in response to detecting an access operation by a user. Then, the candidate background image is subjected to pixelization processing to generate a pixelized candidate background image. In practical situations, because the groove in the sliding type verification code has an obvious boundary, the boundary of the groove is easily identified through a boundary detection algorithm, so that the positioning of the groove is realized. Therefore, the difference between the color value of the pixel on the boundary of the groove and the color value of the pixel around the boundary is reduced by performing the pixelization process on the candidate background image, thereby increasing the difficulty in identifying the boundary of the groove. Further, a sliding track is generated according to the candidate pixel point set in the candidate background image after the pixelation processing. Further, a target position in the sliding trajectory is determined. In practical situations, the moving track of the slider in the commonly used sliding-type verification code is often fixed, that is, the slider can be easily controlled to move into the groove only by determining the position of the groove, so that the verification is passed. Therefore, the random sliding track and the random target position (the position of the center of the groove) are generated, so that the cracking difficulty of the verification code is improved. And finally, generating a sliding verification code based on the candidate background image after the pixelation processing, the sliding track and the target position. The sliding verification code generated by the mode avoids the problems that the character type verification code exists, and when more characters exist in the verification code and more interference items exist, a user is easy to input the wrong verification code. Meanwhile, the time for the user to pass the verification can be reduced, and the problem of the existing sliding type verification code is solved.
With further reference to FIG. 6, a flow 600 of further embodiments of a sliding verification code generation method is illustrated. The flow 600 of the sliding verification code generation method includes the following steps:
step 601, in response to detecting the access operation of the target user to the target page, selecting a background image from a background image library as a candidate background image.
In some embodiments, the specific implementation of step 601 and the technical effect thereof may refer to step 201 in those embodiments corresponding to fig. 2, and are not described herein again.
Step 602, determining the size of the sliding window according to the resolution of the candidate background image.
In some embodiments, the determining, by the execution subject, the size of the sliding window according to the resolution of the candidate background image may include:
first, a first divisor sequence is determined according to a long-edge resolution included in the resolution of the candidate background image.
As an example, the long-side resolution may be 9. The first divisor sequence can be [1, 3, 3, 9 ].
And secondly, determining a second divisor sequence according to the broadside resolution included by the resolution of the candidate background image.
As an example, the long-side resolution may be 6. The second divisor sequence can be [1, 2, 3, 6 ].
And thirdly, selecting a 2 nd first divisor and a 2 nd second divisor from the first divisor sequence and the second divisor sequence respectively to determine the size of the sliding window.
As an example, the size of the sliding window may be 3 × 2.
Step 603, controlling the sliding window to move line by line on the candidate background image with a fixed step length.
In some embodiments, the execution body may control the sliding window to move line by line in fixed steps on the candidate background image. Wherein the fixed step length may be the same as the length of the sliding window.
As an example, the size of the sliding window may be 3 × 2. The fixed step size may be 3.
And step 604, merging all the pixel points in the sliding window to generate a target pixel point.
In some embodiments, the execution subject may combine the pixels in the sliding window to generate the target pixel. And the target pixel points are pixel points in the candidate background image after the pixelation processing.
As an example, fig. 7 may be referred to, which illustrates a process of merging the pixels in the sliding window to generate the target pixel. The size of the sliding window may be 3 × 3. That is, the sliding window includes 9 pixels 701. The 9 pixels 701 are merged to generate a target pixel 702.
Step 605, determining the average value of the color values of the pixels in the sliding window as the color value of the target pixel.
In some embodiments, the execution body may determine an average value of color values of the pixels in the sliding window as the color value of the target pixel.
As an example, the color values of the 9 pixels 701 shown in fig. 7 may be [ [1, 2, 3], [2, 4, 6], [6, 12, 18], [2, 4, 6], [2, 4, 6], [2, 4, 6], [1, 2, 3], [1, 2, 3] ]. The color value of the target pixel point may be [2, 4, 6 ].
And 606, generating a sliding track according to the candidate pixel point set in the candidate background image after the pixelation processing.
In some embodiments, the execution subject may generate a sliding track according to a candidate pixel point set in the candidate background image after the pixelation processing. The candidate pixel point set can be generated through the following steps:
firstly, screening out pixel points meeting screening conditions from the candidate background image to generate a candidate pixel information group and obtain a candidate pixel information group set.
Wherein, the screening condition is that the color values of the pixel points are the same. The candidate pixel information in the set of candidate pixel information groups includes: pixel coordinates and pixel color values. The pixel point coordinates may be coordinates of a pixel point corresponding to the candidate pixel information in an image coordinate system. The image coordinate system may be a coordinate system in which the long side of the candidate background image is the horizontal axis, the short side is the vertical axis, and the vertex at the upper left corner is the origin.
As an example, the candidate pixel information may be [ pixel point coordinates: (2, 6), pixel color value: (12, 12, 12)].
And secondly, sorting the candidate pixel information groups in the candidate pixel information group set according to the number of the candidate pixel information in each candidate pixel information group in the candidate pixel information group set from large to small so as to generate a candidate pixel information group sequence.
As an example, the set of candidate pixel information groups may be [ (candidate pixel information a, candidate pixel information B), (candidate pixel information C, candidate pixel information D, candidate pixel information E), (candidate pixel information F), (candidate pixel information G, candidate pixel information H, candidate pixel information I, candidate pixel information J) ]. The generated sequence of sets of candidate pixel information may be [ (candidate pixel information G, candidate pixel information H, candidate pixel information I, candidate pixel information J), (candidate pixel information C, candidate pixel information D, candidate pixel information E), (candidate pixel information a, candidate pixel information B), (candidate pixel information F) ].
And thirdly, selecting a first preset number of candidate pixel information groups from the candidate pixel information group sequence to obtain a first candidate pixel information group, a second candidate pixel information group and a third candidate pixel information group.
Wherein the first predetermined number is 3.
As an example, the first candidate pixel information group may be (candidate pixel information G, candidate pixel information H, candidate pixel information I, candidate pixel information J). The second candidate pixel information group may be (candidate pixel information C, candidate pixel information D, candidate pixel information E). The third set of candidate pixel information may be (candidate pixel information a, candidate pixel information B).
And fourthly, determining pixel points corresponding to a first preset number of first candidate pixel information randomly selected from the first candidate pixel information group as candidate pixel points.
And fifthly, determining pixel points corresponding to a second preset number of second candidate pixel information randomly selected from the second candidate pixel information group as candidate pixel points.
And sixthly, determining pixel points corresponding to a third preset number of third candidate pixel information randomly selected from the third candidate pixel information group as candidate pixel points.
Wherein the sum of the first predetermined number, the second predetermined number, and the third predetermined number is equal to the target quantity value. The first predetermined number is greater than the second predetermined number. The second predetermined number is greater than the third predetermined number. The above target quantity value may be determined by the following formula:
Figure 532439DEST_PATH_IMAGE028
wherein the content of the first and second substances,
Figure 380309DEST_PATH_IMAGE029
representing the target quantity value.
Figure 899015DEST_PATH_IMAGE030
Represents a preset proportional value with a value range of
Figure 857744DEST_PATH_IMAGE031
Figure 512716DEST_PATH_IMAGE032
Representing the number of first candidate pixel information in the first set of candidate pixel information.
Figure 531488DEST_PATH_IMAGE033
Indicating the number of second candidate pixel information in the second candidate pixel information set.
Figure 412856DEST_PATH_IMAGE034
Indicating the number of third candidate pixel information in the third set of candidate pixel information.
The executing body can generate a sliding track according to a candidate pixel point set in the candidate background image after the pixelation processing through the following formula:
generating the sliding track according to the candidate pixel point set by the following formula:
Figure 801375DEST_PATH_IMAGE035
wherein the content of the first and second substances,
Figure 451799DEST_PATH_IMAGE002
and expressing a track equation corresponding to the sliding track.
Figure 234947DEST_PATH_IMAGE003
And expressing the pixel point coordinates included in the candidate pixel information corresponding to the candidate pixel point in the candidate pixel point set.
Figure 869191DEST_PATH_IMAGE004
And expressing the pixel point coordinates included in the candidate pixel information corresponding to the 1 st candidate pixel point in the candidate pixel point set.
Figure 904143DEST_PATH_IMAGE005
And expressing the pixel point coordinates included in the candidate pixel information corresponding to the 2 nd candidate pixel point in the candidate pixel point set.
Figure 64866DEST_PATH_IMAGE006
And expressing the pixel point coordinates included in the candidate pixel information corresponding to the 3 rd candidate pixel point in the candidate pixel point set.
Figure 894282DEST_PATH_IMAGE007
And expressing the pixel point coordinates included in the candidate pixel information corresponding to the 4 th candidate pixel point in the candidate pixel point set.
Figure 15821DEST_PATH_IMAGE008
And expressing the pixel point coordinates included in the candidate pixel information corresponding to the 5 th candidate pixel point in the candidate pixel point set.
Figure 979098DEST_PATH_IMAGE009
Represents an independent variable with a value range of
Figure 604114DEST_PATH_IMAGE010
Compared with the prior sliding type verification code, the sliding block can only move on a fixed track. The present disclosure generates a sliding trajectory by the above formula. First, the randomness of the sliding trajectory is increased. That is, the user needs to control the randomly generated slider to move into the groove according to the randomly generated sliding track. This increases the randomness of the authentication. In addition, the sliding track generated by the method is smooth in track, namely, a user can easily control the mouse to move the sliding block, and the use difficulty of the user is reduced.
607, the target position in the sliding trajectory is determined.
In some embodiments, the determining the target position in the sliding track by the executing body may include:
in a first step, candidate variable values are determined by the following formula:
Figure 490250DEST_PATH_IMAGE036
wherein the content of the first and second substances,
Figure 833507DEST_PATH_IMAGE037
representing the candidate variable values.
Figure 475841DEST_PATH_IMAGE002
And expressing a track equation corresponding to the sliding track.
Figure 345576DEST_PATH_IMAGE017
Indicating a serial number.
Figure 782374DEST_PATH_IMAGE038
And expressing the number of the candidate pixel points in the candidate pixel point set.
Figure 612927DEST_PATH_IMAGE015
And representing the abscissa in the pixel point coordinates included in the candidate pixel information corresponding to the candidate pixel point in the candidate pixel point set.
Figure 918006DEST_PATH_IMAGE016
Representing the first of the candidate pixel point set
Figure 517615DEST_PATH_IMAGE017
And the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to each candidate pixel point.
Figure 249947DEST_PATH_IMAGE018
Representing a random function.
Figure 302217DEST_PATH_IMAGE019
Indicating random selection
Figure 286354DEST_PATH_IMAGE020
To
Figure 366567DEST_PATH_IMAGE021
Is a random integer of (1).
Figure 410747DEST_PATH_IMAGE022
Representing an intermediate variable.
Figure 74946DEST_PATH_IMAGE023
And (3) representing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 1 st candidate pixel point in the candidate pixel point set.
Figure 862774DEST_PATH_IMAGE024
And (3) expressing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 2 nd candidate pixel point in the candidate pixel point set.
Figure 171395DEST_PATH_IMAGE025
And (3) representing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 3 rd candidate pixel point in the candidate pixel point set.
Figure 511110DEST_PATH_IMAGE026
And (3) representing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 4 th candidate pixel point in the candidate pixel point set.
Figure 537972DEST_PATH_IMAGE027
And the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 5 th candidate pixel point in the candidate pixel point set is represented.
And secondly, determining the target position according to the candidate variable value and a track equation corresponding to the sliding track.
In some embodiments, the execution subject may input a trajectory equation corresponding to the sliding trajectory using the candidate variable value as an argument to determine the target position.
The above formula and the corresponding content serve as an invention point of the embodiment of the disclosure, and the technical problem mentioned in the background art is solved, namely, for a common sliding verification code, since the position of the groove is randomly generated, the situation that the position of the randomly generated groove is closer to the initial position of the slider may occur, so that the verification code loses the effect on the user identity verification. The reason why the verification code loses the effect on the user identity verification is that the random generation of the grooves may cause the position of the slider to be closer to the position of the grooves. If the technical problem is solved, the effect of the verification code on the user identity verification can be ensured. To achieve this effect: firstly, the present disclosure introduces an abscissa in pixel coordinates included in candidate pixel point information corresponding to a candidate pixel point in a candidate pixel point set. The selection of the candidate pixel points in the candidate pixel point set has randomness, so that the randomness of the generated target position can be increased. In addition, due to the fact that pixel coordinates corresponding to the candidate pixel points in the candidate pixel point set are different, the mean value of the abscissa in the pixel point coordinates included by the candidate pixel point information corresponding to the candidate pixel points in the candidate pixel point set is determined, and therefore the obtained candidate variable value can be located in the middle section of the sliding track, and the situation that the initial position of the sliding block is close to the position of the groove is avoided. In addition, considering that the randomness of the target position generation is weakened when the candidate pixel point set is determined, a random function is added, and the randomness of the generated target position is further increased. By the mode, on the premise of ensuring the randomness of the generated target position, the problem that the verification code loses the user identity verification due to the fact that the generated sliding block is close to the groove is solved.
And step 608, scratching out the target area in the candidate background image to generate a target background image.
In some embodiments, the executing entity may scratch out the target region in the candidate background image to generate the target background image. The target area is an area which is centered at the target position and has the same size as the slider.
As an example, as shown in fig. 8. Therein, FIG. 8 includes a slider 802 and a target area 804. The target area 804 is an area centered on the target position 803.
And step 609, generating a sliding verification code based on the target background image and the sliding track.
In some embodiments, the execution subject may generate the sliding verification code by JavaScript code based on the target background image and the sliding track.
As an example, as shown in fig. 8, a schematic diagram of the sliding verification code is shown. Wherein, the sliding verification code comprises: a slide trajectory 801, a slider 802, a target position 803, a target area 804, and a target background image 805.
And step 610, in response to the fact that the target user control slider is determined to move to the target position along the sliding track, sending a verification passing request to the target terminal.
In some embodiments, the execution body may send a verification pass request to the target terminal in response to determining that the target user controls the slider to move to the target position along the sliding track. Wherein, the check passing request can represent that the user passes the check. The target terminal may be a terminal used by the target user to access the target page. The execution main body can determine whether the target user controls the slider to move to the target position along the sliding track by monitoring mouse operation.
The above embodiments of the present disclosure have the following beneficial effects: firstly, the present disclosure introduces an abscissa in pixel coordinates included in candidate pixel point information corresponding to a candidate pixel point in a candidate pixel point set. The selection of the candidate pixel points in the candidate pixel point set has randomness, so that the randomness of the generated target position can be increased. In addition, due to the fact that pixel coordinates corresponding to the candidate pixel points in the candidate pixel point set are different, the mean value of the abscissa in the pixel point coordinates included by the candidate pixel point information corresponding to the candidate pixel points in the candidate pixel point set is determined, and therefore the obtained candidate variable value can be located at the front section of the sliding track, and the situation that the generated target position is overlapped with the position of the groove is avoided. In addition, considering that the randomness of the target position generation is weakened when the candidate pixel point set is determined, a random function is added, and the randomness of the generated target position is further increased. By the mode, on the premise of ensuring the randomness of the generated target position, the problem that the verification code loses the user identity verification caused by the superposition of the position of the generated sliding block and the position of the groove is avoided.
With further reference to fig. 9, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a sliding verification code generation apparatus, which correspond to those shown in fig. 2, and which may be applied in various electronic devices.
As shown in fig. 9, the sliding verification code generation apparatus 900 of some embodiments includes: a selecting unit 901, a pixelation processing unit 902, a first generating unit 903, a determining unit 904, and a second generating unit 905. The selecting unit 901 is configured to select a background image from a background image library as a candidate background image in response to detecting an access operation of a target user to a target page; a pixelation processing unit 902 configured to perform pixelation processing on the candidate background image to generate a pixelation-processed candidate background image; a first generating unit 903, configured to generate a sliding track according to the candidate pixel point set in the candidate background image after the pixelation processing; a determination unit 904 configured to determine a target position in the sliding trajectory; a second generating unit 905 configured to generate a sliding verification code based on the candidate background image after the pixelization processing, the sliding trajectory, and the target position.
It will be understood that the elements described in the apparatus 900 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features, and advantages described above with respect to the method are also applicable to the apparatus 900 and the units included therein, and are not described herein again.
Referring now to FIG. 10, a block diagram of an electronic device (such as computing device 101 shown in FIG. 1) 1000 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 10 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 10, the electronic device 1000 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 1001 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 1002 or a program loaded from a storage means 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data necessary for the operation of the electronic apparatus 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
Generally, the following devices may be connected to the I/O interface 1005: input devices 1006 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 1007 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 1008 including, for example, magnetic tape, hard disk, and the like; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. While fig. 10 illustrates an electronic device 1000 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 10 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. The computer program, when executed by the processing apparatus 1001, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: in response to the detection of the access operation of a target user to a target page, selecting a background image from a background image library as a candidate background image; performing pixelization processing on the candidate background image to generate a pixelized candidate background image; generating a sliding track according to a candidate pixel point set in the candidate background image after the pixelation processing; determining a target position in the sliding track; and generating a sliding verification code based on the candidate background image after the pixelization processing, the sliding track and the target position.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes a selecting unit, a pixelation processing unit, a first generating unit, a determining unit, and a second generating unit. The names of the cells do not form a limitation on the cells themselves in some cases, for example, the selecting unit may also be described as a "selecting a background image from a background image library as a candidate background image in response to detecting an access operation of a target user to a target page".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (8)

1. A sliding verification code generation method comprises the following steps:
in response to the detection of the access operation of a target user to a target page, selecting a background image from a background image library as a candidate background image;
performing pixelization processing on the candidate background image to generate a pixelized candidate background image;
generating a sliding track according to a candidate pixel point set in the candidate background image after the pixelation processing;
determining a target position in the sliding track;
generating a sliding verification code based on the candidate background image after the pixelation processing, the sliding track and the target position, wherein the sliding track is generated according to a candidate pixel point set in the candidate background image after the pixelation processing, and the sliding track comprises:
generating a fitting curve according to a candidate pixel point set in the candidate background image after the pixelation processing;
determining the fitted curve as the sliding track, wherein the sliding track is obtained by the following formula:
Figure DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE004
a track equation corresponding to the sliding track is expressed,
Figure DEST_PATH_IMAGE006
representing the pixel point coordinates included in the candidate pixel information corresponding to the candidate pixel point in the candidate pixel point set,
Figure DEST_PATH_IMAGE008
representing the pixel point coordinates included in the candidate pixel information corresponding to the 1 st candidate pixel point in the candidate pixel point set,
Figure DEST_PATH_IMAGE010
representing the pixel point coordinate included in the candidate pixel information corresponding to the 2 nd candidate pixel point in the candidate pixel point set,
Figure DEST_PATH_IMAGE012
representing the pixel point coordinates included in the candidate pixel information corresponding to the 3 rd candidate pixel point in the candidate pixel point set,
Figure DEST_PATH_IMAGE014
representing the pixel point coordinates included in the candidate pixel information corresponding to the 4 th candidate pixel point in the candidate pixel point set,
Figure DEST_PATH_IMAGE016
representing the pixel point coordinates included in the candidate pixel information corresponding to the 5 th candidate pixel point in the candidate pixel point set,
Figure DEST_PATH_IMAGE018
represents an independent variable with a value range of
Figure DEST_PATH_IMAGE020
Wherein the candidate pixel point set is generated by the following steps:
screening out pixel points meeting screening conditions from the candidate background image to generate a candidate pixel information group to obtain a candidate pixel information group set, wherein the screening conditions are that color values of the pixel points are the same, and candidate pixel information in the candidate pixel information group set comprises: pixel point coordinates and pixel point color values;
sorting the candidate pixel information groups in the candidate pixel information group set according to the number of the candidate pixel information in each candidate pixel information group in the candidate pixel information group set to generate a candidate pixel information group sequence;
selecting a first preset number of candidate pixel information groups from the candidate pixel information group sequence to obtain a first candidate pixel information group, a second candidate pixel information group and a third candidate pixel information group, wherein the first preset number is 3;
determining pixel points corresponding to a first preset number of first candidate pixel information randomly selected from the first candidate pixel information group as candidate pixel points;
determining pixel points corresponding to a second preset number of second candidate pixel information randomly selected from the second candidate pixel information group as candidate pixel points;
determining pixel points corresponding to a third preset number of third candidate pixel information randomly selected from the third candidate pixel information group as candidate pixel points, wherein the determining of the target position in the sliding track includes:
determining candidate variable values by the following formula:
Figure DEST_PATH_IMAGE022
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE024
representing the value of the candidate variable,
Figure 270779DEST_PATH_IMAGE004
a track equation corresponding to the sliding track is expressed,
Figure DEST_PATH_IMAGE026
the sequence number is shown to indicate that,
Figure DEST_PATH_IMAGE028
representing the number of candidate pixels in the set of candidate pixels,
Figure DEST_PATH_IMAGE030
representing the abscissa of the pixel point coordinate included in the candidate pixel information corresponding to the candidate pixel point in the candidate pixel point set,
Figure DEST_PATH_IMAGE032
representing the first of the candidate pixel point set
Figure 969DEST_PATH_IMAGE026
The candidate pixel information corresponding to each candidate pixel point includes the abscissa in the pixel point coordinates,
Figure DEST_PATH_IMAGE034
the representation of the random function is such that,
Figure DEST_PATH_IMAGE036
indicating random selection
Figure DEST_PATH_IMAGE038
To
Figure DEST_PATH_IMAGE040
The random integer of (a) is (b),
Figure DEST_PATH_IMAGE042
the intermediate variable is represented by a number of variables,
Figure DEST_PATH_IMAGE044
representing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 1 st candidate pixel point in the candidate pixel point set,
Figure DEST_PATH_IMAGE046
representing the abscissa of the pixel point coordinate included in the candidate pixel information corresponding to the 2 nd candidate pixel point in the candidate pixel point set,
Figure DEST_PATH_IMAGE048
representing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 3 rd candidate pixel point in the candidate pixel point set,
Figure DEST_PATH_IMAGE050
representing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 4 th candidate pixel point in the candidate pixel point set,
Figure DEST_PATH_IMAGE052
and expressing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 5 th candidate pixel point in the candidate pixel point set.
2. The method of claim 1, wherein the sliding authentication code further comprises: a slider; and
the method further comprises the following steps:
and in response to the fact that the target user controls the slider to move to the target position along the sliding track, sending a verification passing request to a target terminal, wherein the target terminal is a terminal used by the target user for accessing the target page.
3. The method of claim 1, wherein the pixelating the candidate background image to generate a pixelated candidate background image comprises:
determining the size of a sliding window according to the resolution of the candidate background image;
controlling the sliding window to move line by line on the candidate background image in a fixed step length;
merging all pixel points in the sliding window to generate target pixel points, wherein the target pixel points are pixel points in the candidate background image after the pixelation processing;
and determining the average value of the color values of all the pixel points in the sliding window as the color value of the target pixel point.
4. The method of claim 2, wherein the generating a sliding validation code based on the pixilated candidate background image, the sliding trajectory, and the target location comprises:
scratching out a target area in the candidate background image to generate a target background image, wherein the target area is an area which is centered on the target position and has the same size as the sliding block;
and generating the sliding verification code based on the target background image and the sliding track.
5. The method of claim 4, wherein the determining a target position in the sliding trajectory comprises:
determining a candidate variable value according to each candidate pixel point in the candidate pixel point set;
and determining the target position according to the candidate variable value and a track equation corresponding to the sliding track.
6. A sliding authentication code generation apparatus comprising:
the selecting unit is configured to select a background image from a background image library as a candidate background image in response to detecting an access operation of a target user to a target page;
a pixelation processing unit configured to perform pixelation processing on the candidate background image to generate a pixelation-processed candidate background image;
a first generating unit configured to generate a sliding track according to a candidate pixel point set in the candidate background image after the pixelation processing;
a determination unit configured to determine a target position in the sliding trajectory;
a second generating unit configured to generate a sliding verification code based on the candidate background image after the pixelation processing, the sliding track and the target position, wherein the generating of the sliding track according to the candidate pixel point set in the candidate background image after the pixelation processing includes: generating a fitting curve according to a candidate pixel point set in the candidate background image after the pixelation processing; determining the fitted curve as the sliding track, wherein the sliding track is obtained by the following formula:
Figure 144155DEST_PATH_IMAGE002
wherein the content of the first and second substances,
Figure 945889DEST_PATH_IMAGE004
a track equation corresponding to the sliding track is expressed,
Figure 963523DEST_PATH_IMAGE006
representing the pixel point coordinates included in the candidate pixel information corresponding to the candidate pixel point in the candidate pixel point set,
Figure 317144DEST_PATH_IMAGE008
representing the pixel point coordinates included in the candidate pixel information corresponding to the 1 st candidate pixel point in the candidate pixel point set,
Figure 489237DEST_PATH_IMAGE010
representing the pixel point coordinate included in the candidate pixel information corresponding to the 2 nd candidate pixel point in the candidate pixel point set,
Figure 219296DEST_PATH_IMAGE012
representing the pixel point coordinates included in the candidate pixel information corresponding to the 3 rd candidate pixel point in the candidate pixel point set,
Figure 29120DEST_PATH_IMAGE014
representing the pixel point coordinates included in the candidate pixel information corresponding to the 4 th candidate pixel point in the candidate pixel point set,
Figure 553642DEST_PATH_IMAGE016
representing the pixel point coordinates included in the candidate pixel information corresponding to the 5 th candidate pixel point in the candidate pixel point set,
Figure 714496DEST_PATH_IMAGE018
represents an independent variable with a value range of
Figure 982667DEST_PATH_IMAGE020
The candidate pixel point set is generated through the following steps: screening out pixel points meeting screening conditions from the candidate background image to generate a candidate pixel information group to obtain a candidate pixel information group set, wherein the screening conditions are that color values of the pixel points are the same, and candidate pixel information in the candidate pixel information group set comprises: pixel point coordinates and pixel point color values; sorting the candidate pixel information groups in the candidate pixel information group set according to the number of the candidate pixel information in each candidate pixel information group in the candidate pixel information group set to generate a candidate pixel information group sequence; selecting a first preset number of candidate pixel information groups from the candidate pixel information group sequence to obtain a first candidate pixel information group, a second candidate pixel information group and a third candidate pixel information group, wherein the first preset number is 3; determining pixel points corresponding to a first preset number of first candidate pixel information randomly selected from the first candidate pixel information group as candidate pixel points; determining pixel points corresponding to a second preset number of second candidate pixel information randomly selected from the second candidate pixel information group as candidate pixel points; selecting pixels corresponding to a third preset number of third candidate pixel information randomly selected from the third candidate pixel information groupAnd determining the point as a candidate pixel point, wherein the determining the target position in the sliding track comprises:
determining candidate variable values by the following formula:
Figure DEST_PATH_IMAGE053
wherein the content of the first and second substances,
Figure 614374DEST_PATH_IMAGE024
representing the value of the candidate variable,
Figure 575377DEST_PATH_IMAGE004
a track equation corresponding to the sliding track is expressed,
Figure 223527DEST_PATH_IMAGE026
the sequence number is shown to indicate that,
Figure 29809DEST_PATH_IMAGE028
representing the number of candidate pixels in the set of candidate pixels,
Figure 814225DEST_PATH_IMAGE030
representing the abscissa of the pixel point coordinate included in the candidate pixel information corresponding to the candidate pixel point in the candidate pixel point set,
Figure 680550DEST_PATH_IMAGE032
representing the first of the candidate pixel point set
Figure 815996DEST_PATH_IMAGE026
The candidate pixel information corresponding to each candidate pixel point includes the abscissa in the pixel point coordinates,
Figure 425969DEST_PATH_IMAGE034
the representation of the random function is such that,
Figure 625744DEST_PATH_IMAGE036
indicating random selection
Figure 538337DEST_PATH_IMAGE038
To
Figure 20134DEST_PATH_IMAGE040
The random integer of (a) is (b),
Figure 309164DEST_PATH_IMAGE042
the intermediate variable is represented by a number of variables,
Figure 864910DEST_PATH_IMAGE044
representing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 1 st candidate pixel point in the candidate pixel point set,
Figure 338616DEST_PATH_IMAGE046
representing the abscissa of the pixel point coordinate included in the candidate pixel information corresponding to the 2 nd candidate pixel point in the candidate pixel point set,
Figure 675752DEST_PATH_IMAGE048
representing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 3 rd candidate pixel point in the candidate pixel point set,
Figure 627527DEST_PATH_IMAGE050
representing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 4 th candidate pixel point in the candidate pixel point set,
Figure 241042DEST_PATH_IMAGE052
and expressing the abscissa in the pixel point coordinate included in the candidate pixel information corresponding to the 5 th candidate pixel point in the candidate pixel point set.
7. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
8. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-5.
CN202110416636.4A 2021-04-19 2021-04-19 Sliding verification code generation method and device, electronic equipment and computer readable medium Active CN112819693B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110416636.4A CN112819693B (en) 2021-04-19 2021-04-19 Sliding verification code generation method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110416636.4A CN112819693B (en) 2021-04-19 2021-04-19 Sliding verification code generation method and device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN112819693A CN112819693A (en) 2021-05-18
CN112819693B true CN112819693B (en) 2022-04-22

Family

ID=75863681

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110416636.4A Active CN112819693B (en) 2021-04-19 2021-04-19 Sliding verification code generation method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN112819693B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543374A (en) * 2018-11-28 2019-03-29 江苏三口井信息科技有限公司 A kind of slidingtype identifying code of confrontation deep neural network identification
CN109902474A (en) * 2019-03-01 2019-06-18 北京奇艺世纪科技有限公司 The determination method and device of the motion track of mobile object in a kind of sliding identifying code
CN111309222A (en) * 2019-11-28 2020-06-19 苏宁金融科技(南京)有限公司 Sliding block notch positioning and dragging track generation method for sliding block verification code
CN112528264A (en) * 2020-11-30 2021-03-19 中冶华天南京工程技术有限公司 Behavior verification code generation and verification method for random position of random contour

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109782989B (en) * 2017-11-14 2021-08-03 腾讯科技(深圳)有限公司 Security verification method and related device
CN112150491B (en) * 2020-09-30 2023-08-18 北京小狗吸尘器集团股份有限公司 Image detection method, device, electronic equipment and computer readable medium
CN112651010A (en) * 2020-12-28 2021-04-13 深圳赛安特技术服务有限公司 Method and device for verifying sliding verification code, computer equipment and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543374A (en) * 2018-11-28 2019-03-29 江苏三口井信息科技有限公司 A kind of slidingtype identifying code of confrontation deep neural network identification
CN109902474A (en) * 2019-03-01 2019-06-18 北京奇艺世纪科技有限公司 The determination method and device of the motion track of mobile object in a kind of sliding identifying code
CN111309222A (en) * 2019-11-28 2020-06-19 苏宁金融科技(南京)有限公司 Sliding block notch positioning and dragging track generation method for sliding block verification code
CN112528264A (en) * 2020-11-30 2021-03-19 中冶华天南京工程技术有限公司 Behavior verification code generation and verification method for random position of random contour

Also Published As

Publication number Publication date
CN112819693A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
US11283833B2 (en) Methods and apparatus for detecting a presence of a malicious application
US10740411B2 (en) Determining repeat website users via browser uniqueness tracking
US10460114B1 (en) Identifying visually similar text
CN112015314B (en) Information display method and device, electronic equipment and medium
CN111459364B (en) Icon updating method and device and electronic equipment
US8856958B1 (en) Personalized content access prompt
CN113255619B (en) Lane line recognition and positioning method, electronic device, and computer-readable medium
CN114399589A (en) Three-dimensional lane line generation method and device, electronic device and computer readable medium
CN111695107A (en) Verification method and device and electronic equipment
CN112819693B (en) Sliding verification code generation method and device, electronic equipment and computer readable medium
US10715539B1 (en) Request header anomaly detection
US20190057206A1 (en) Generation of a captcha on a handheld touch screen device
CN110619597A (en) Semitransparent watermark removing method and device, electronic equipment and storage medium
CN111461964B (en) Picture processing method, device, electronic equipment and computer readable medium
CN115567937A (en) Short message verification method and device, storage medium and electronic equipment
CN111680754B (en) Image classification method, device, electronic equipment and computer readable storage medium
CN112751799B (en) Verification method and device based on picture verification code
EP2758889B1 (en) Methods and apparatus for validating communications in an open architecture system
CN113468487B (en) Interface watermark rendering method and device, electronic equipment and computer readable medium
CN113379019B (en) Verification code generation method and device, storage medium and electronic equipment
CN112215774B (en) Model training and image defogging methods, apparatus, devices and computer readable media
CN112215789B (en) Image defogging method, device, equipment and computer readable medium
CN113744259B (en) Forest fire smoke detection method and equipment based on gray value increasing number sequence
US20210240856A1 (en) Methods, systems, and media for detecting alteration of a web page
CN115858964A (en) Page access method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20231103

Address after: 518000, Building 702, Building A, No. 4545 Songbai Road, Heshuikou Community, Matian Street, Guangming District, Shenzhen, Guangdong Province

Patentee after: Shenzhen Yongsheng Intellectual Property Service Co.,Ltd.

Address before: 100102 room 076, no.1-302, 3 / F, commercial building, No.9 Wangjing street, Chaoyang District, Beijing

Patentee before: BEIJING MISSFRESH E-COMMERCE Co.,Ltd.

TR01 Transfer of patent right