WO2021003916A1 - Dynamic verification method and apparatus, and computer device and storage medium - Google Patents

Dynamic verification method and apparatus, and computer device and storage medium Download PDF

Info

Publication number
WO2021003916A1
WO2021003916A1 PCT/CN2019/116433 CN2019116433W WO2021003916A1 WO 2021003916 A1 WO2021003916 A1 WO 2021003916A1 CN 2019116433 W CN2019116433 W CN 2019116433W WO 2021003916 A1 WO2021003916 A1 WO 2021003916A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
verification
character
recognized
preset
Prior art date
Application number
PCT/CN2019/116433
Other languages
French (fr)
Chinese (zh)
Inventor
莫鹏程
Original Assignee
平安普惠企业管理有限公司
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 平安普惠企业管理有限公司 filed Critical 平安普惠企业管理有限公司
Publication of WO2021003916A1 publication Critical patent/WO2021003916A1/en

Links

Images

Classifications

    • 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
    • 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/2119Authenticating web pages, e.g. with suspicious links

Definitions

  • This application relates to the field of cryptographic technology, in particular to a dynamic verification method, device, computer equipment and storage medium.
  • the verification code technology increases the difficulty of frequent injection of illegal robot programs
  • the mainstream verification code technology is usually generated according to this format after the verification code format is set by the verification code generator.
  • the verification code format is used in several ways. After the second time, it is easy to be understood by machine learning, thereby reducing its anti-leakage effect. Therefore, finding a technical solution that can increase the difficulty of the robot program cracking and verification process has become an urgent problem for those skilled in the art.
  • a dynamic verification method including:
  • a verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
  • the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
  • a dynamic verification device includes:
  • the selection module is used to receive a verification request, and select a random number of characters to be recognized from a preset character library according to a preset selection rule;
  • a generating module configured to generate a verification picture according to the random number of the characters to be recognized, the verification picture contains image content corresponding to multiple picture positions, and each of the image content corresponding to the picture position Contains at least one character to be recognized;
  • the adding module is configured to randomly select the picture positions from all the picture positions in the verification picture, and add all the selected picture positions to the display queue in the order of selection;
  • the display module is configured to offset the preset display frame to the picture position in the selection sequence first in the display queue, and display the verification picture and the picture position in the preset display frame Corresponding image content;
  • the first judgment module is configured to receive the verification character input by the user for the image content displayed in the display frame, and determine whether the verification character is the same as the pending character contained in the image content displayed in the display frame. Whether the recognized characters are consistent;
  • a prompting module for prompting that the verification failed this time when the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame;
  • the confirmation module is used for adding one to the number of successful character verification when the verification character is consistent with the character to be recognized contained in the image content displayed in the display box, and the number of successful character verification When it is greater than or equal to the preset verification times threshold, the verification is confirmed to be successful.
  • a computer device includes a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor, and the processor implements the following steps when the processor executes the computer-readable instructions:
  • a verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
  • the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
  • One or more non-volatile readable storage media storing computer readable instructions.
  • the computer readable instructions execute the following steps:
  • a verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
  • the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
  • FIG. 1 is a schematic diagram of an application environment of a dynamic verification method in an embodiment of the present application
  • Fig. 2 is a flowchart of a dynamic verification method in an embodiment of the present application
  • step S20 of the dynamic verification method in an embodiment of the present application is a schematic flowchart of step S20 of the dynamic verification method in an embodiment of the present application
  • step S40 of the dynamic verification method in an embodiment of the present application is a schematic flowchart of step S40 of the dynamic verification method in an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of step S50 of the dynamic verification method in an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of step S70 of the dynamic verification method in an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a dynamic verification device in an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a generating module in an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a dynamic verification device according to another embodiment of the present application.
  • Fig. 10 is a schematic diagram of a computer device in an embodiment of the present application.
  • the dynamic verification method provided by this application can be applied in the application environment as shown in Figure 1, where the client communicates with the server through the network.
  • the client can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
  • the server can be implemented as an independent server or a server cluster composed of multiple servers.
  • a dynamic verification method is provided, and the method is applied to the server in FIG. 1 as an example for description, including the following steps:
  • the characters to be recognized are pre-stored in the preset character library, and the characters to be recognized include but are not limited to English letters (such as a to z, etc.), Arabic numerals (such as 0 to 9, etc.), Chinese characters (such as a To nine) and punctuation marks (such as! etc.); in this embodiment, the characters to be recognized need to be selected from the preset character library according to the preset selection rules; the preset selection rules can be random selection of random numbers The characters to be recognized can also be selected by a selector according to a preset selection rule; for example, after a random number is randomly determined in the preset number range, the characters to be recognized are randomly selected according to the random number.
  • the characters to be recognized selected from the preset character library may not be repeated at all, but they may also be selected repeatedly. For example, corresponding to a verification request, the characters to be recognized may be randomly selected twice from the preset character library. Recognize the character "s".
  • the preset selection rules, random numbers, and various characters to be recognized all belong to a variable factor, so it can increase the difficulty of the robot program to crack the verification process.
  • S20 Generate a verification picture according to the random number of the characters to be recognized, the verification picture includes image content corresponding to multiple picture positions, and each of the image content corresponding to the picture position includes At least one character to be recognized.
  • the verification picture is located in the picture area, and the entire picture area can be divided into a coordinate system (the verification picture in the coordinate system is divided into multiple picture positions, and a pair of verification pictures is in each picture position All have corresponding image content, and each image content contains at least one character to be recognized, that is, the number of picture positions in a verification picture is less than or equal to the random number of selected characters to be recognized), and the verification picture contains Multiple characters to be recognized, that is, each character to be recognized is located in the coordinate system, and each character to be recognized corresponds to a unique picture position (but the image content corresponding to a picture position may contain more than two Recognized characters), each picture position can be described by the coordinate value in the coordinate system; the character form of the character to be recognized in the verification picture can be set according to preset rules, and its deformation can be set in the verification The picture is displayed with a certain amount of deformation.
  • the center position of the character to be recognized can be used to describe the coordinate value of the character to be recognized in the coordinate system, and then the deformation amount can be set according to the coordinate value of the character to be recognized; and the generated verification
  • the characters to be recognized in the picture should not affect the recognition of normal people.
  • the step S20 includes:
  • Acquire picture parameters used to generate a picture format of the verification picture where the picture parameters include the number of the picture positions of the character to be recognized in the verification picture, the arrangement manner of each picture position, One or more of display font, display size, display background, display color, and interference elements.
  • the picture format includes the integration of all picture parameters, including but not limited to the number of picture positions of the character to be recognized in the verification picture, and the arrangement of each picture position (for example, each picture position is according to each The five behaviors are arranged from left to right), verify the display font in the picture (such as Song Ti, Kai Ti, etc.), display size (such as font size 3, size 4, etc.), display background (multiple preset background colors) Select from the board), display color, and interference elements (some interference elements used to interfere with the recognition of the robot program, such as interference points and interference lines floating on the display background of the verification picture).
  • verify the display font in the picture such as Song Ti, Kai Ti, etc.
  • display size such as font size 3, size 4, etc.
  • display background multiple preset background colors
  • interference elements some interference elements used to interfere with the recognition of the robot program, such as interference points and interference lines floating on the display background of the verification picture.
  • the generation rules can be set in advance, and the number can also be set according to demand.
  • the number of generation rules corresponding to each picture parameter can be set to 10, 15, and 20 Wait.
  • one of the generation rules corresponding to each picture parameter can be randomly selected from the multiple generation rules corresponding to each picture parameter mentioned in step S202; understandably, although the picture position There are multiple generation rules corresponding to the number of, but the user must randomly select one of the multiple generation rules that is less than or equal to the random number (because the number of image positions must be less than or equal to the number of characters to be recognized, Ensure that each picture position must contain at least one character to be recognized); for example, the number of picture positions (corresponding generation rules) can be any natural number from 2 to 100, that is, the number of picture positions corresponds to a total of 99 generation rules At this time, if the random number is 8, you can only randomly select one from the natural numbers 2-8 (if greater than 8, it is already greater than the random number of characters to be recognized) as the generation rule for verifying the number corresponding to the position of the picture in the picture ; Understandably, for the arrangement of each picture position, an example is as follows: if the number of selected picture positions is 10, the arrangement of picture positions is 5 in
  • S204 Determine the correspondence between each character to be recognized and the picture position according to the random number and the number of the picture positions in the picture format.
  • the random number of characters to be recognized has been determined, and the number of picture positions for generating the picture format has also been determined.
  • the server After randomly associating a random number of characters to be recognized with the position of each picture, the correspondence between each character to be recognized and the position of the picture can be determined.
  • the random number is 10 and the number of picture positions is 8.
  • the range of the picture area is self-preset, and the range of the picture area is not limited to any shape, for example, the shape can be square, circle, ellipse, etc.
  • the verification image can only be generated within the area of the image.
  • S206 Generate the verification picture including all the characters to be recognized within the picture area according to the picture format, and each of the characters to be recognized in the verification picture is based on the characters to be recognized. The corresponding relationship with the picture position is placed in each picture position in the verification picture.
  • the server can generate a verification picture containing various picture parameters according to the picture format, and at the same time, each character to be recognized in the verification picture will be based on each character to be recognized and the position of the picture. The corresponding relationship is placed in each picture position in the verification picture.
  • the position of the picture selected here cannot be repeated, because the content displayed in the display box of the repeatedly selected picture position will be consistent, so the verification effect will be reduced, and the reselection of the non-repetitive picture position can obviously improve The verification effect; understandably, the display order of each picture position in the display queue is arranged according to the selection order.
  • the width and height of the preset display box can be specified by setting the code in the cascading style sheet (ie css) (each verification request can correspond to a display box format), but the preset display box must Completely display the image content corresponding to a picture position in the verification picture (that is, the image content corresponding to the picture position includes the characters to be recognized and their background, etc.), and will not display the image content in other picture positions; the picture position corresponds to The image content not only includes the characters to be recognized, but may also include one or more of the number, background, and color of the characters to be recognized.
  • the offsetting the preset display frame to before the picture position in the display queue that is selected in the first order further includes:
  • S401 Establish a coordinate system within the range of the picture area, and determine the coordinate value of each picture position in the coordinate system.
  • the server can establish a coordinate system according to the shape of the picture area range (this coordinate system can only take the first quadrant), for example, when the picture area range is regular
  • this coordinate system can only take the first quadrant
  • the shape is like a rectangle
  • one side of the rectangle can be used as the abscissa
  • the side at right angles to the abscissa is the ordinate. That is, each picture position can be described by the coordinate value in the coordinate system.
  • S402 Determine, according to each of the coordinate values, an offset of the display frame in the cascading style sheet between each of the picture positions.
  • the cascading style sheet (ie css) has code to change the offset of the display box, and the offset only depends on the change of the coordinate value, for example, the coordinates of the first picture position in the coordinate system The value is (10, 10), and the coordinate value of the second picture position in the coordinate system is (20, 10), that is, the display box only needs to be offset by 10 units to the right (the unit can be px).
  • shifting the preset display frame to the first picture position in the selection sequence in the display queue includes:
  • S403 Offset the display frame to the first picture position in the selection sequence in the display queue according to the offset of the display frame between the picture positions.
  • the display frame when the display frame is shifted to the position of the picture for the first time, the display frame may be located at a position outside the first quadrant.
  • the position outside the first quadrant may be a pole coordinate value in the coordinate system.
  • the server will first follow the first picture position in the selection order in the display queue, and offset the display frame to the picture position according to the offset between the picture position and the display frame.
  • S50 Receive a verification character input by a user for the image content displayed in the display frame, and determine whether the verification character is consistent with the character to be recognized included in the image content displayed in the display frame.
  • the user must input the verification characters in sequence according to the image content to which the characters to be recognized in the display queue belong; and input errors or redundant verification characters can be regarded as inconsistent with the recognized characters displayed in the display box; and the input If the verification character is consistent with the character to be recognized displayed in the display box, it can be considered that the correct verification character has been entered.
  • the method further includes:
  • S501 Acquire a first time when the image content corresponding to the picture position is displayed in the display box, and a second time when the user inputs the verification character for the image content displayed in the display box.
  • the second time should be after the first time.
  • S502 Determine whether the time difference between the second time and the first time is greater than a preset time threshold.
  • this step is to provide a prescribed time (that is, a preset time threshold for the user to enter verification characters), the purpose is to prevent the robot program from cracking and getting through the preset display frame through a certain period of operation The displayed characters to be recognized.
  • a prescribed time that is, a preset time threshold for the user to enter verification characters
  • time difference when the time difference is greater than the preset time threshold, it can indicate that the user inputs the verification character at the specified time. In another embodiment, when the time difference is less than or equal to the preset time threshold, it may indicate that the user inputs the verification character at the specified time.
  • S504 Acquire the number of invalid times of the verification character input by the user after receiving the verification request, and determine whether the number of invalid times of the verification character is greater than a preset invalid times threshold.
  • the server can prompt the background preset recipient to verify that the status is abnormal by email or SMS.
  • the number of times the verification character is invalid is less than or equal to the preset invalid times threshold, it can be explained that the user accidentally misses the specified time and the verification character is invalid.
  • the verification corresponding to the verification request will be considered as a failure, and the verification request will be rejected.
  • the user still wants to continue the verification, it will proceed to step S10 to send the next verification request.
  • the number of character verification failures for each verification request can be recorded, and the number of character verification failures for the same account on the same platform in a certain period of time (such as one hour) exceeds the preset verification failure threshold; or different
  • the number of character verification failures of the account through the same Internet Protocol address exceeds the preset verification failure threshold, it can be considered that there may be a user or robot program currently performing malicious operations.
  • the personnel verification status is abnormal.
  • step S70 after adding one to the number of successful character verifications, the method further includes:
  • S701 Acquire the number of the picture positions in the verification picture.
  • the number of picture positions can be obtained from the above step S201.
  • the number of successful character verifications is less than the preset verification times threshold, it can indicate that the user has not yet reached the requirement for successful verification. At this time, it is necessary to determine in the subsequent steps whether the number of successful character verifications reaches the number of image positions, and then determine whether the verification image needs to be updated corresponding to this verification request (when the number of successful character verifications reaches the number of image positions, the previous first The image content corresponding to all the picture positions in a verification picture has been displayed in the display box).
  • the number of successful character verifications when the number of successful character verifications reaches the number of picture positions, that is, the number of successful character verifications is equal to the number of picture positions, and the number of successful character verifications is less than the preset verification times threshold. For example, when the number of picture positions is 5, if the preset threshold of verification times is 8, at this time, when the number of successful character verifications is 5, it means that the number of successful character verifications has reached the number of picture positions, and The 5 successful character verification times correspond to the image content in each unique image position of the verification image respectively displayed in the display boxes.
  • step S10 the server must enter step S10 to re-update the characters to be recognized in the verification picture, that is, to return to step S10 from the preset character library according to the preset selection rules to select the characters from the preset character library. Recognize the characters and execute the subsequent steps to generate a new verification picture (including the new character to be recognized and the new picture position in the verification picture). It is understandable that the number of characters to be recognized selected in this step is also random.
  • step S40 it is understandable that when the number of successful character verifications does not reach the preset update times, there is no need to update the characters to be recognized in the verification picture. It is only necessary to return to step S40 to verify the next picture position in the picture with the display frame offset value to display its corresponding image content.
  • the above provides a dynamic verification method, receiving a verification request, selecting a random number of characters to be recognized from a preset character library according to a preset selection rule; generating according to the random number of characters to be recognized A verification picture, where the verification picture includes image content corresponding to multiple picture positions, and each of the image content corresponding to the picture position includes at least one character to be recognized; from the verification picture After randomly selecting the picture position from all the picture positions in, add all the selected picture positions to the display queue in the order of selection; offset the preset display frame to the first in the selection order in the display queue The picture position, and the image content corresponding to the picture position in the verification picture is displayed in the preset display box; and the verification input by the user for the image content displayed in the display box is received Character, and determine whether the verification character is consistent with the character to be recognized contained in the image content displayed in the display frame; the verification character and the image content displayed in the display frame include When the characters to be recognized are not consistent, the verification fails; when the verified characters are consistent with the characters to
  • This proposal selects a random number of characters to be recognized from the preset character library according to preset selection rules, and randomly selects the picture position from all picture positions in the self-verified picture, and the number of successful character verification is greater than or equal to the preset Confirm that the verification is successful only when the verification times threshold is reached.
  • at least one verification picture can be randomly generated, and the picture format in each verification picture and the selection rule of the characters to be recognized are different, and they are selected for display during the verification process
  • the selection order of the image content in the verification picture is also random.
  • the verification of different verification requests through the image content in the above verification pictures with differences can greatly increase the difficulty of the robot program to crack the verification process, thereby reducing data information The possibility of leaking secrets and improve the security performance in the verification process.
  • a dynamic verification device is provided, and the dynamic verification device corresponds to the dynamic verification method in the above-mentioned embodiment one-to-one.
  • the dynamic verification device includes a selection module 11, a generation module 12, an addition module 13, a display module 14, a first judgment module 15, a prompt module 16 and a confirmation module 17.
  • the detailed description of each functional module is as follows:
  • the selection module 11 is configured to receive a verification request, and select a random number of characters to be recognized from a preset character library according to a preset selection rule;
  • the generating module 12 is configured to generate a verification picture according to the random number of the characters to be recognized, the verification picture contains image content corresponding to a plurality of picture positions, and each of the images corresponding to the picture position The content includes at least one character to be recognized;
  • the adding module 13 is configured to randomly select the picture positions from all the picture positions in the verification picture, and then add all the selected picture positions to the display queue in the order of selection;
  • the display module 14 is configured to offset the preset display frame to the position of the picture in the selection sequence first in the display queue, and display the verification picture and the picture in the preset display frame The image content corresponding to the location;
  • the first judging module 15 is configured to receive the verification characters input by the user for the image content displayed in the display frame, and determine whether the verification characters and the image content contained in the image content displayed in the display frame Whether the characters to be recognized are consistent;
  • the prompting module 16 is used for prompting that the verification failed this time when the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame;
  • the confirmation module 17 is configured to increase the number of successful character verifications by one when the verification character is consistent with the character to be recognized contained in the image content displayed in the display frame, and when the character verification is successful When the number of times is greater than or equal to the preset verification times threshold, the verification is confirmed to be successful.
  • the generating module includes:
  • the first acquisition sub-module is configured to acquire picture parameters of a picture format used to generate the verification picture, the picture parameters including the number of the picture positions of the character to be recognized in the verification picture, and each One or more of the arrangement of the picture position, display font, display size, display background, display color and interference elements;
  • the selection sub-module is configured to randomly select one of the generation rules from the multiple generation rules corresponding to each of the picture parameters, and then generate the verification picture according to all the randomly selected generation rules
  • the determining sub-module is configured to determine the correspondence between each of the characters to be recognized and the picture position according to the random number and the number of the picture positions in the picture format;
  • the second obtaining submodule is used to obtain the range of the picture area available for generating the verification picture
  • a generating submodule is used to generate the verification picture including all the characters to be recognized within the picture area according to the picture format, and each of the characters to be recognized in the verification picture is in accordance with each The corresponding relationship between the character to be recognized and the position of the picture is placed in each position of the picture in the verification picture.
  • the dynamic verification device further includes:
  • a first determining module configured to establish a coordinate system within the picture area, and determine the coordinate value of each picture position in the coordinate system
  • the second determining module is configured to determine the offset of the display frame in the cascading style sheet between each of the picture positions according to each of the coordinate values;
  • the first offset module is configured to offset the display frame to the first in the selection order in the display queue according to the offset of the display frame between each of the picture positions The location of the picture.
  • the dynamic verification device further includes:
  • the first acquiring module is configured to acquire the first time when the image content corresponding to the position of the picture is displayed in the display box, and the user inputs the verification characters for the image content displayed in the display box Second time
  • the second judgment module is configured to judge whether the time difference between the second time and the first time is greater than a preset time threshold
  • the third determining module is configured to determine that the verification character input by the user corresponding to the second time is invalid if the time difference is greater than the preset time threshold, and prompt the user to have timed out ;
  • the second acquiring module is configured to determine the number of times the verification character input by the user is invalid since receiving the verification request, and determine whether the number of times the verification character is invalid is greater than a preset invalidity times threshold;
  • the prohibition module is configured to prohibit input of the verification character through the Internet Protocol address corresponding to the user within a preset time period if the number of invalid times of the verification character is greater than the preset invalid number threshold.
  • the dynamic verification device further includes:
  • the third acquiring module is configured to acquire the number of the picture positions in the verification picture
  • the third judgment module is configured to judge whether the number of successful character verifications reaches the number of positions in the picture when the number of successful character verifications is less than the preset verification times threshold;
  • the selection module is configured to continue to select the random number of the characters to be recognized from the self-preset character library according to the preset selection rule if the number of successful character verifications reaches the number of positions in the picture , And generate the verification picture according to the random number of the characters to be recognized;
  • the second offset module is configured to continue to offset the preset display frame to the first selection order in the display queue if the number of successful character verifications does not reach the number of image positions The location of the picture.
  • Each module in the above-mentioned dynamic verification device can be implemented in whole or in part by software, hardware, and combinations thereof.
  • the foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 10.
  • the computer equipment includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, a computer program, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the database of the computer equipment is used to store the data involved in the dynamic verification method.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by the processor to realize a dynamic verification method.
  • a computer device including a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor, and the processor implements the following steps when the processor executes the computer-readable instructions:
  • a verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
  • the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
  • one or more non-volatile readable storage media storing computer readable instructions are provided, the non-volatile readable storage medium storing computer readable instructions, and the computer readable instructions When executed by one or more processors, one or more processors are caused to implement the following steps:
  • a verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
  • the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • ROM read only memory
  • PROM programmable ROM
  • EPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A dynamic verification method and apparatus, and a computer device and a storage medium. The method comprises: selecting, according to a pre-set selection rule, a random number of characters to be recognized; generating a verification picture according to the selected characters to be recognized; after a picture position is randomly selected from all picture positions in the verification picture, adding the selected picture position to a display queue according to a selection sequence (S30); offsetting a pre-set display box to a picture position ranking first in the selection sequence in the display queue, and displaying, in the pre-set display box, image content, corresponding to the picture position, in the verification picture (S40); determining whether a verification character input by a user is consistent with a character to be recognized that is contained in the image content; if same is inconsistent, providing a prompt that this verification has failed; and if same is consistent, adding one to the number of character verification successes, and when the number of character verification successes is greater than or equal to a pre-set threshold value of the number of verifications, determining that verification is successful. The method can increase the difficulty of cracking the verification of a robot program, such that the security performance during a verification process is improved.

Description

动态验证方法、装置、计算机设备及存储介质Dynamic verification method, device, computer equipment and storage medium
本申请以2019年7月11日提交的申请号为201910625910.1,名称为“动态验证方法、装置、计算机设备及存储介质”的中国申请专利申请为基础,并要求其优先权。This application is based on the Chinese patent application filed on July 11, 2019 with the application number 201910625910.1 and titled "dynamic verification method, device, computer equipment and storage medium", and claims its priority.
技术领域Technical field
本申请涉及密码技术领域,尤其涉及一种动态验证方法、装置、计算机设备及存储介质。This application relates to the field of cryptographic technology, in particular to a dynamic verification method, device, computer equipment and storage medium.
背景技术Background technique
随着科学技术的发展,网络爬虫技术的发展处于一个越来越成熟的地步,但是由于部分的信息或数据涉及到个人隐私及行业的利益,此时,为了避免被网络爬虫技术爬取到涉及个人隐私及行业的利益信息或数据,可以采用验证码的方式区分用户是机器还是人,以防止用户在知晓他人账号的情况下,利用非法机器人程序进行自动爬取。目前,如果进行恶意使用非法机器人程序对信息或数据进行爬取,每一次爬取过程中输入密码之后都会要求通过验证码成功验证之后,才能继续进行后续操作,增加了机器人程序自动爬取等行为的难度。但是,在现有技术中,虽然验证码技术增加了非法机器人程序频繁注入的难度,但主流验证码技术通常通过验证码生成器设置验证码格式之后按照这个格式生成,该验证码格式在使用若干次之后就容易被机器学习摸透规律,从而降低其防泄密效果。因此,寻找一种能够提高机器人程序破解验证过程的难度的技术方案成为本领域技术人员亟需解决的问题。With the development of science and technology, the development of web crawler technology is at an increasingly mature stage, but because part of the information or data involves personal privacy and the interests of the industry, at this time, in order to avoid being crawled by the web crawler technology. For personal privacy and industry interest information or data, verification codes can be used to distinguish whether a user is a machine or a human, so as to prevent users from using illegal robot programs to automatically crawl when they know the accounts of others. At present, if malicious use of illegal robot programs is used to crawl information or data, after each password is entered in the crawling process, the verification code will be required to be successfully verified before subsequent operations can be continued, and automatic crawling of robot programs has been added. The difficulty. However, in the prior art, although the verification code technology increases the difficulty of frequent injection of illegal robot programs, the mainstream verification code technology is usually generated according to this format after the verification code format is set by the verification code generator. The verification code format is used in several ways. After the second time, it is easy to be understood by machine learning, thereby reducing its anti-leakage effect. Therefore, finding a technical solution that can increase the difficulty of the robot program cracking and verification process has become an urgent problem for those skilled in the art.
发明内容Summary of the invention
基于此,有必要针对上述技术问题,提供一种动态验证方法、装置、计算机设备及存储介质,用于提高机器人程序破解验证过程的难度,进而提高验证过程中的安全性能。Based on this, it is necessary to provide a dynamic verification method, device, computer equipment, and storage medium for the above technical problems, which are used to increase the difficulty of the robot program cracking verification process, thereby improving the safety performance in the verification process.
一种动态验证方法,包括:A dynamic verification method, including:
接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符;Receive a verification request, and select a random number of characters to be recognized from the preset character library according to preset selection rules;
根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符;A verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中;After randomly selecting the picture positions from all the picture positions in the verification picture, adding all the picture positions selected to the display queue in the order of selection;
将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容;Offset the preset display frame to the picture position in the selection order first in the display queue, and display the image corresponding to the picture position in the verification picture in the preset display frame content;
接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致;Receiving a verification character input by a user for the image content displayed in the display frame, and determining whether the verification character is consistent with the character to be recognized included in the image content displayed in the display frame;
在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败;When the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame, it is prompted that the verification fails;
在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。When the verification character is consistent with the character to be recognized contained in the image content displayed in the display box, the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
一种动态验证装置,包括:A dynamic verification device includes:
选取模块,用于接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符;The selection module is used to receive a verification request, and select a random number of characters to be recognized from a preset character library according to a preset selection rule;
生成模块,用于根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符;A generating module, configured to generate a verification picture according to the random number of the characters to be recognized, the verification picture contains image content corresponding to multiple picture positions, and each of the image content corresponding to the picture position Contains at least one character to be recognized;
加入模块,用于自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中;The adding module is configured to randomly select the picture positions from all the picture positions in the verification picture, and add all the selected picture positions to the display queue in the order of selection;
展示模块,用于将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述 预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容;The display module is configured to offset the preset display frame to the picture position in the selection sequence first in the display queue, and display the verification picture and the picture position in the preset display frame Corresponding image content;
第一判断模块,用于接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致;The first judgment module is configured to receive the verification character input by the user for the image content displayed in the display frame, and determine whether the verification character is the same as the pending character contained in the image content displayed in the display frame. Whether the recognized characters are consistent;
提示模块,用于在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败;A prompting module for prompting that the verification failed this time when the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame;
确认模块,用于在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。The confirmation module is used for adding one to the number of successful character verification when the verification character is consistent with the character to be recognized contained in the image content displayed in the display box, and the number of successful character verification When it is greater than or equal to the preset verification times threshold, the verification is confirmed to be successful.
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor, and the processor implements the following steps when the processor executes the computer-readable instructions:
接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符;Receive a verification request, and select a random number of characters to be recognized from the preset character library according to preset selection rules;
根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符;A verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中;After randomly selecting the picture positions from all the picture positions in the verification picture, adding all the picture positions selected to the display queue in the order of selection;
将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容;Offset the preset display frame to the picture position in the selection order first in the display queue, and display the image corresponding to the picture position in the verification picture in the preset display frame content;
接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致;Receiving a verification character input by a user for the image content displayed in the display frame, and determining whether the verification character is consistent with the character to be recognized included in the image content displayed in the display frame;
在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败;When the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame, it is prompted that the verification fails;
在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。When the verification character is consistent with the character to be recognized contained in the image content displayed in the display box, the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:One or more non-volatile readable storage media storing computer readable instructions. When the computer readable instructions are executed by one or more processors, the one or more processors execute the following steps:
接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符;Receive a verification request, and select a random number of characters to be recognized from the preset character library according to preset selection rules;
根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符;A verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中;After randomly selecting the picture positions from all the picture positions in the verification picture, adding all the picture positions selected to the display queue in the order of selection;
将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容;Offset the preset display frame to the picture position in the selection order first in the display queue, and display the image corresponding to the picture position in the verification picture in the preset display frame content;
接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致;Receiving a verification character input by a user for the image content displayed in the display frame, and determining whether the verification character is consistent with the character to be recognized included in the image content displayed in the display frame;
在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败;When the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame, it is prompted that the verification fails;
在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。When the verification character is consistent with the character to be recognized contained in the image content displayed in the display box, the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显The details of one or more embodiments of the present application are presented in the following drawings and descriptions. Other features and advantages of the present application will become apparent from the description, drawings and claims.
附图说明Description of the drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.
图1是本申请一实施例中动态验证方法的一应用环境示意图;FIG. 1 is a schematic diagram of an application environment of a dynamic verification method in an embodiment of the present application;
图2是本申请一实施例中动态验证方法的一流程图;Fig. 2 is a flowchart of a dynamic verification method in an embodiment of the present application;
图3是本申请一实施例中动态验证方法的步骤S20的流程示意图;3 is a schematic flowchart of step S20 of the dynamic verification method in an embodiment of the present application;
图4是本申请一实施例中动态验证方法的步骤S40的流程示意图;4 is a schematic flowchart of step S40 of the dynamic verification method in an embodiment of the present application;
图5是本申请一实施例中动态验证方法的步骤S50的流程示意图;FIG. 5 is a schematic flowchart of step S50 of the dynamic verification method in an embodiment of the present application;
图6是本申请一实施例中动态验证方法的步骤S70的流程示意图;FIG. 6 is a schematic flowchart of step S70 of the dynamic verification method in an embodiment of the present application;
图7是本申请一实施例中动态验证装置的结构示意图;FIG. 7 is a schematic structural diagram of a dynamic verification device in an embodiment of the present application;
图8是本申请一实施例中生成模块的结构示意图;FIG. 8 is a schematic structural diagram of a generating module in an embodiment of the present application;
图9是本申请另一实施例动态验证装置的结构示意图;9 is a schematic structural diagram of a dynamic verification device according to another embodiment of the present application;
图10是本申请一实施例中计算机设备的一示意图。Fig. 10 is a schematic diagram of a computer device in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of this application.
本申请提供的动态验证方法,可应用在如图1的应用环境中,其中,客户端通过网络与服务器进行通信。其中,客户端可以但不限于各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The dynamic verification method provided by this application can be applied in the application environment as shown in Figure 1, where the client communicates with the server through the network. Among them, the client can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server can be implemented as an independent server or a server cluster composed of multiple servers.
在一实施例中,如图2所示,提供一种动态验证方法,以该方法应用在图1中的服务器为例进行说明,包括如下步骤:In an embodiment, as shown in FIG. 2, a dynamic verification method is provided, and the method is applied to the server in FIG. 1 as an example for description, including the following steps:
S10,接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符。S10, receiving a verification request, and selecting a random number of characters to be recognized from a preset character library according to a preset selection rule.
可以理解的是,待识别字符预先被存储在预设字符库中,且待识别字符包括但不限于英语字母(如a到z等)、阿拉伯数字(如0到9等)、中文汉字(如一到九等)和标点符号(如!等)等字符;在本实施例中,需要根据预设的选取规则从预设字符库中选取待识别字符;预设的选取规则可以为随机选择随机数量的待识别字符,也可以通过选择器按照预先设置的选择规则来进行选择;比如,在预设的数量范围中随机确定一个随机数量之后,根据随机数量随机选取待识别字符。可理解地,自预设字符库中选取的待识别字符可以是完全不重复,但也可以被重复进行选取,比如,对应于一次验证请求,可能自预设字符库中随机选取了两次待识别字符“s”。It is understandable that the characters to be recognized are pre-stored in the preset character library, and the characters to be recognized include but are not limited to English letters (such as a to z, etc.), Arabic numerals (such as 0 to 9, etc.), Chinese characters (such as a To nine) and punctuation marks (such as! etc.); in this embodiment, the characters to be recognized need to be selected from the preset character library according to the preset selection rules; the preset selection rules can be random selection of random numbers The characters to be recognized can also be selected by a selector according to a preset selection rule; for example, after a random number is randomly determined in the preset number range, the characters to be recognized are randomly selected according to the random number. Understandably, the characters to be recognized selected from the preset character library may not be repeated at all, but they may also be selected repeatedly. For example, corresponding to a verification request, the characters to be recognized may be randomly selected twice from the preset character library. Recognize the character "s".
在本实施例中,预设的选取规则、随机数量和多种待识别字符都属于一种变化的因素,因此可以增加机器人程序破解验证过程的难度。In this embodiment, the preset selection rules, random numbers, and various characters to be recognized all belong to a variable factor, so it can increase the difficulty of the robot program to crack the verification process.
S20,根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符。S20: Generate a verification picture according to the random number of the characters to be recognized, the verification picture includes image content corresponding to multiple picture positions, and each of the image content corresponding to the picture position includes At least one character to be recognized.
可以理解的是,验证图片是位于图片区域范围内,整个图片区域范围可以被划分成一个坐标系(坐标系中的验证图片被划分为多个图片位置,且验证图片对一个于每一个图片位置均有对应的图像内容,且每一个图像内容中至少包含一个待识别字符,也即,一个验证图片中的图片位置的数量小于或等于选取的待识别字符的随机数量),且验证图片中包含了多个待识别字符,即每个待识别字符都位于该坐标系中,且每个待识别字符又对应于一个唯一图片位置(但一个图片位置对应的图像内容中可能包含两个以上的待识别字符),每个图片位置都可以用在该坐标系中的坐标值来进行描述;验证图片中的待识别字符的字符形式可以根据预设规则被设定其变形量,可以使其在验证图片中以一定变形量进行展示,可以用待识别字符的中心位置描述该待识别字符在坐标系中的坐标值,进而可以根据该待识别字符的坐标值设定其变形量;且生成的验证图片中的待识别字符要不影响到正常人的辨识度。It is understandable that the verification picture is located in the picture area, and the entire picture area can be divided into a coordinate system (the verification picture in the coordinate system is divided into multiple picture positions, and a pair of verification pictures is in each picture position All have corresponding image content, and each image content contains at least one character to be recognized, that is, the number of picture positions in a verification picture is less than or equal to the random number of selected characters to be recognized), and the verification picture contains Multiple characters to be recognized, that is, each character to be recognized is located in the coordinate system, and each character to be recognized corresponds to a unique picture position (but the image content corresponding to a picture position may contain more than two Recognized characters), each picture position can be described by the coordinate value in the coordinate system; the character form of the character to be recognized in the verification picture can be set according to preset rules, and its deformation can be set in the verification The picture is displayed with a certain amount of deformation. The center position of the character to be recognized can be used to describe the coordinate value of the character to be recognized in the coordinate system, and then the deformation amount can be set according to the coordinate value of the character to be recognized; and the generated verification The characters to be recognized in the picture should not affect the recognition of normal people.
进一步地,如图3所示,所述步骤S20,包括:Further, as shown in FIG. 3, the step S20 includes:
S201,获取用于生成所述验证图片的图片格式的图片参数,所述图片参数包括所述待识别字符在所述验证图片中的所述图片位置的数量、各所述图片位置的排列方式、显示字体、显示大小、显示背景、显示颜色和干扰元素中的一种或多种。S201. Acquire picture parameters used to generate a picture format of the verification picture, where the picture parameters include the number of the picture positions of the character to be recognized in the verification picture, the arrangement manner of each picture position, One or more of display font, display size, display background, display color, and interference elements.
在此步骤中,图片格式包含了所有的图片参数的整合,包括但不限定于为待识别字符在验证图片中的图片位置的数量、各图片位置的排列方式(比如,各图片位置按照每一行为5个的方式从左至右进 行排列)、验证图片中的显示字体(比如宋体、楷体等)、显示大小(比如三号、四号字体等)、显示背景(预设的多种背景色板中选取)、显示颜色和干扰元素(用于干扰机器人程序识别的一些干扰元素,比如悬浮在验证图片的显示背景上的干扰点、干扰线条等)中的一种或多种。In this step, the picture format includes the integration of all picture parameters, including but not limited to the number of picture positions of the character to be recognized in the verification picture, and the arrangement of each picture position (for example, each picture position is according to each The five behaviors are arranged from left to right), verify the display font in the picture (such as Song Ti, Kai Ti, etc.), display size (such as font size 3, size 4, etc.), display background (multiple preset background colors) Select from the board), display color, and interference elements (some interference elements used to interfere with the recognition of the robot program, such as interference points and interference lines floating on the display background of the verification picture).
S202,为每一项所述图片参数设置与其对应的多种生成规则。S202: Set multiple generation rules corresponding to each of the picture parameters.
在此步骤中,生成规则是可以被提前设置的,其数量也可以根据需求量被进行设定,比如,各图片参数对应的生成规则的数量可以被设定为10个、15个和20个等。In this step, the generation rules can be set in advance, and the number can also be set according to demand. For example, the number of generation rules corresponding to each picture parameter can be set to 10, 15, and 20 Wait.
S203,从与每一项所述图片参数对应的多种所述生成规则中各自随机选取一种所述生成规则之后,根据随机选取的所有所述生成规则生成所述验证图片的所述图片格式。S203: After randomly selecting one of the generation rules from the multiple generation rules corresponding to each of the picture parameters, generate the picture format of the verification picture according to all the randomly selected generation rules .
在此步骤中,可以从上述步骤S202中提到的与每一项图片参数对应的多种生成规则中,随机选取每一项图片参数对应的其中一种生成规则;可理解地,虽然图片位置的数量对应的生成规则为多种,但是用户必须从多种生成规则中的小于或等于随机数量的生成规则中随机选取一种(因为图片位置的数量必须小于或等于待识别字符的数量,以保证每一个图片位置中必须包含至少一个待识别字符);比如,图片位置的数量(对应的生成规则)可以为2-100中任意一个自然数,也即图片位置的数量对应了一共99种生成规则,此时,若随机数量为8个,则只能从自然数2-8中随机选取一个(若大于8,已经大于待识别字符的随机数量)作为验证图片中对应于图片位置的数量的生成规则;可理解地,对于各图片位置的排列方式来说,举例如下:若选取的图片位置的数量为10个,图片位置的排列方式为每行5个且从左至右排列,此时,若图片区域范围为边长是20mm的正方形,那么后续步骤S206中在图片区域范围中图片位置的排列方式将为按照2*5的方式排列。在本实施例中,需要将被随机选取到的每一项图片参数对应的其中一种生成规则整合到一起,就可以得到包含多种生成规则的组合规则。可以根据此组合规则生成验证图片的图片格式。In this step, one of the generation rules corresponding to each picture parameter can be randomly selected from the multiple generation rules corresponding to each picture parameter mentioned in step S202; understandably, although the picture position There are multiple generation rules corresponding to the number of, but the user must randomly select one of the multiple generation rules that is less than or equal to the random number (because the number of image positions must be less than or equal to the number of characters to be recognized, Ensure that each picture position must contain at least one character to be recognized); for example, the number of picture positions (corresponding generation rules) can be any natural number from 2 to 100, that is, the number of picture positions corresponds to a total of 99 generation rules At this time, if the random number is 8, you can only randomly select one from the natural numbers 2-8 (if greater than 8, it is already greater than the random number of characters to be recognized) as the generation rule for verifying the number corresponding to the position of the picture in the picture ; Understandably, for the arrangement of each picture position, an example is as follows: if the number of selected picture positions is 10, the arrangement of picture positions is 5 in each row and arranged from left to right, at this time, if The picture area range is a square with a side length of 20 mm, so the arrangement of the picture positions in the picture area range in the subsequent step S206 will be arranged in a 2*5 manner. In this embodiment, it is necessary to integrate one of the generation rules corresponding to each of the randomly selected picture parameters, and a combination rule containing multiple generation rules can be obtained. The image format of the verification image can be generated according to this combination rule.
S204,根据所述随机数量以及所述图片格式中所述图片位置的数量确定各所述待识别字符与所述图片位置的对应关系。S204: Determine the correspondence between each character to be recognized and the picture position according to the random number and the number of the picture positions in the picture format.
在此步骤中,待识别字符的随机数量已被确定,生成图片格式的图片位置的数量也已被确定,此时,由于一个图片位置中必须包含至少一个待识别字符,根据该项原则,服务器可以将随机数量的待识别字符与各图片位置随机进行关联之后,确定各待识别字符与图片位置的对应关系。比如,随机数量为10,图片位置的数量为8,此时,首先从选取的10个待识别字符中随机选取8个,并将其一一随机对应至8个图片位置,再将剩余的两个待识别字符随机放置(两个一起放置或者将两个分开放置均可)至任意的图片位置中并与该图片位置关联。In this step, the random number of characters to be recognized has been determined, and the number of picture positions for generating the picture format has also been determined. At this time, since a picture position must contain at least one character to be recognized, according to this principle, the server After randomly associating a random number of characters to be recognized with the position of each picture, the correspondence between each character to be recognized and the position of the picture can be determined. For example, the random number is 10 and the number of picture positions is 8. At this time, first select 8 randomly from the 10 selected characters to be recognized, and randomly correspond to the 8 picture positions one by one, and then the remaining two The characters to be recognized are randomly placed (two together or separated) to any picture position and associated with the picture position.
S205,获取可供生成所述验证图片的图片区域范围。S205: Acquire a picture area range available for generating the verification picture.
在此步骤中,图片区域范围为自预设的,且图片区域范围不局限于任何形状,比如形状可以为正方形、圆形和椭圆形等。验证图片仅能在该图片区域范围内生成。In this step, the range of the picture area is self-preset, and the range of the picture area is not limited to any shape, for example, the shape can be square, circle, ellipse, etc. The verification image can only be generated within the area of the image.
S206,按照所述图片格式在所述图片区域范围内生成包含所有所述待识别字符的所述验证图片,且所述验证图片中的每一个所述待识别字符均按照各所述待识别字符与所述图片位置的对应关系被放置于所述验证图片中的各所述图片位置中。S206: Generate the verification picture including all the characters to be recognized within the picture area according to the picture format, and each of the characters to be recognized in the verification picture is based on the characters to be recognized. The corresponding relationship with the picture position is placed in each picture position in the verification picture.
在此步骤中,从上述步骤S203确定出来的图片格式,服务器可以根据此图片格式生成包含各项图片参数的验证图片,同时验证图片中的每一个待识别字符会按照各待识别字符与图片位置的对应关系被放置于验证图片中的各图片位置中。In this step, from the picture format determined in step S203 above, the server can generate a verification picture containing various picture parameters according to the picture format, and at the same time, each character to be recognized in the verification picture will be based on each character to be recognized and the position of the picture. The corresponding relationship is placed in each picture position in the verification picture.
S30,自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中。S30: After randomly selecting the picture positions from all the picture positions in the verification picture, all the selected picture positions are added to the display queue in the order of selection.
可以理解的是,此处选择的图片位置不可重复,因为重复进行选取的图片位置在展示框中展示的内容将会一致,因此会降低验证效果,且重新进行选择不重复的图片位置显然可以提升其验证效果;可理解地,展示队列中各个图片位置的展示顺序是根据选取顺序被进行排列。It is understandable that the position of the picture selected here cannot be repeated, because the content displayed in the display box of the repeatedly selected picture position will be consistent, so the verification effect will be reduced, and the reselection of the non-repetitive picture position can obviously improve The verification effect; understandably, the display order of each picture position in the display queue is arranged according to the selection order.
S40,将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容。S40. Offset a preset display frame to the picture position in the selection sequence first in the display queue, and display all of the verification pictures corresponding to the picture position in the preset display frame. Description of the image content.
可以理解的是,可以通过设置层叠样式表(即css)中的代码去规定预设的展示框的宽度和高度(每一个验证请求可以对应于一个展示框格式),但预设的展示框要完整展示验证图片中的一个图片位 置对应的图像内容(也即该图片位置对应的图像内容包括待识别字符及其背景等),又不会展示到其它图片位置中的图像内容;图片位置对应的图像内容不仅包括待识别字符,而且还可能包括待识别字符的数量、背景和颜色中的一种或多种。It is understandable that the width and height of the preset display box can be specified by setting the code in the cascading style sheet (ie css) (each verification request can correspond to a display box format), but the preset display box must Completely display the image content corresponding to a picture position in the verification picture (that is, the image content corresponding to the picture position includes the characters to be recognized and their background, etc.), and will not display the image content in other picture positions; the picture position corresponds to The image content not only includes the characters to be recognized, but may also include one or more of the number, background, and color of the characters to be recognized.
进一步地,如图4所示,为了准确对所述展示框进行偏移,所述将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置之前,还包括:Further, as shown in FIG. 4, in order to accurately offset the display frame, the offsetting the preset display frame to before the picture position in the display queue that is selected in the first order, further includes:
S401,在所述图片区域范围内设立坐标系,并确定每一个所述图片位置在所述坐标系中的坐标值。S401: Establish a coordinate system within the range of the picture area, and determine the coordinate value of each picture position in the coordinate system.
可以理解的是,由于图片区域范围不局限于任何形状,此时服务器可以根据图片区域范围的形状来建立一个坐标系(此坐标系可以只取第一象限),比如,当图片区域范围为规则形状时,如长方形,此时可以用长方形的其中一边为横坐标,与横坐标成直角的一边为纵坐标,即每一个图片位置都可以用坐标系中的坐标值来进行描述。It is understandable that since the picture area range is not limited to any shape, the server can establish a coordinate system according to the shape of the picture area range (this coordinate system can only take the first quadrant), for example, when the picture area range is regular When the shape is like a rectangle, one side of the rectangle can be used as the abscissa, and the side at right angles to the abscissa is the ordinate. That is, each picture position can be described by the coordinate value in the coordinate system.
S402,根据各所述坐标值,确定层叠样式表中的所述展示框在各所述图片位置之间偏移的偏移量。S402: Determine, according to each of the coordinate values, an offset of the display frame in the cascading style sheet between each of the picture positions.
可以理解的是,层叠样式表(即css)存在改变展示框偏移多少偏移量的代码,而偏移量只需取决坐标值的变化,比如,第一个图片位置在坐标系中的坐标值为(10,10),第二个图片位置在坐标系中的坐标值为(20,10),即展示框只需向右偏移10个单位(单位可以为px)。It is understandable that the cascading style sheet (ie css) has code to change the offset of the display box, and the offset only depends on the change of the coordinate value, for example, the coordinates of the first picture position in the coordinate system The value is (10, 10), and the coordinate value of the second picture position in the coordinate system is (20, 10), that is, the display box only needs to be offset by 10 units to the right (the unit can be px).
所述步骤S40中,将预设的展示框偏移至展示队列中选取顺序最先的图片位置,包括:In the step S40, shifting the preset display frame to the first picture position in the selection sequence in the display queue includes:
S403,根据所述展示框在各所述图片位置之间偏移的所述偏移量,将所述展示框偏移至所述展示队列中所述选取顺序最先的所述图片位置。S403: Offset the display frame to the first picture position in the selection sequence in the display queue according to the offset of the display frame between the picture positions.
在此步骤中,在第一次将展示框偏移至图片位置时,该展示框可以先位于第一象限以外的位置,如第一象限以外的位置可以为坐标系中的极点坐标值。具体地,服务器会先按照展示队列中选取顺序最先的图片位置,并将展示框根据该图片位置与展示框之间的偏移量偏移至该图片位置。In this step, when the display frame is shifted to the position of the picture for the first time, the display frame may be located at a position outside the first quadrant. For example, the position outside the first quadrant may be a pole coordinate value in the coordinate system. Specifically, the server will first follow the first picture position in the selection order in the display queue, and offset the display frame to the picture position according to the offset between the picture position and the display frame.
S50,接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致。S50: Receive a verification character input by a user for the image content displayed in the display frame, and determine whether the verification character is consistent with the character to be recognized included in the image content displayed in the display frame.
具体地,用户必须按照展示队列中的待识别字符所属的图像内容去依次输入验证字符;且输入错误或者多余的验证字符都可以被认为验证字符与展示框中展示的识别字符不一致;且输入的验证字符与展示框中展示的待识别字符一致,则可以被认为输入了正确的验证字符。Specifically, the user must input the verification characters in sequence according to the image content to which the characters to be recognized in the display queue belong; and input errors or redundant verification characters can be regarded as inconsistent with the recognized characters displayed in the display box; and the input If the verification character is consistent with the character to be recognized displayed in the display box, it can be considered that the correct verification character has been entered.
进一步地,如图5所示,为了防止机器人程序通过一定时间的运转,从而摸透所述预设的展示框展示的所述待识别字符,并且为了防止所述用户或者所述机器人程序进行恶意操作去输入验证字符;所述接收用户针对所述展示框中展示的所述图像内容输入的验证字符之后,还包括:Further, as shown in FIG. 5, in order to prevent the robot program from running for a certain period of time, so as to get through the characters to be recognized displayed in the preset display box, and to prevent the user or the robot program from maliciously Operate to input verification characters; after receiving the verification characters input by the user for the image content displayed in the display box, the method further includes:
S501,获取所述展示框中展示所述图片位置对应的所述图像内容的第一时间,以及所述用户针对所述展示框中展示的所述图像内容输入所述验证字符的第二时间。S501: Acquire a first time when the image content corresponding to the picture position is displayed in the display box, and a second time when the user inputs the verification character for the image content displayed in the display box.
可以理解的是,第二时间应位于第一时间之后。It is understandable that the second time should be after the first time.
S502,判断所述第二时间与所述第一时间之间的时间差值是否大于预设的时间阈值。S502: Determine whether the time difference between the second time and the first time is greater than a preset time threshold.
可以理解的是,此步骤中是提供一个规定的时间(即预设的时间阈值给用户去输入验证字符),目的是为了防止机器人程序通过一定时间的运转去破解和摸透预设的展示框展示的待识别字符。It is understandable that this step is to provide a prescribed time (that is, a preset time threshold for the user to enter verification characters), the purpose is to prevent the robot program from cracking and getting through the preset display frame through a certain period of operation The displayed characters to be recognized.
S503,若所述时间差值大于所述预设的时间阈值,则确定所述用户输入的与所述第二时间对应的所述验证字符无效,并提示所述用户已超时。S503: If the time difference is greater than the preset time threshold, determine that the verification character corresponding to the second time input by the user is invalid, and prompt the user that the time has expired.
可以理解的是,当时间差值大于预设的时间阈值时,则可以说明用户在规定的时间输入验证字符。在另外一实施例中,当时间差值小于或等于预设的时间阈值时,则可以说明用户在规定的时间输入验证字符。It is understandable that when the time difference is greater than the preset time threshold, it can indicate that the user inputs the verification character at the specified time. In another embodiment, when the time difference is less than or equal to the preset time threshold, it may indicate that the user inputs the verification character at the specified time.
S504,获取自接收到所述验证请求之后所述用户输入的所述验证字符无效的次数,并判断所述验证字符无效的次数是否大于预设的无效次数阈值。S504: Acquire the number of invalid times of the verification character input by the user after receiving the verification request, and determine whether the number of invalid times of the verification character is greater than a preset invalid times threshold.
可以理解的是,验证字符无效的次数也有一个限制次数。It is understandable that there is also a limit on the number of invalid verification characters.
S505,若所述验证字符无效的次数大于所述预设的无效次数阈值,则在预设时长内禁止通过与所述用户对应的网际协议地址输入所述验证字符。S505: If the number of times the verification character is invalid is greater than the preset threshold of the number of invalid times, it is forbidden to input the verification character through the Internet Protocol address corresponding to the user within the preset time period.
可以理解的是,当验证字符无效的次数大于预设的无效次数阈值,则可以说明用户或者机器人程序在进行恶意操作,用户的恶意操作可能是基于无聊,但机器人程序的恶意操作可能是为了破解验证中 有关的程序代码;此时服务器可以通过邮件或者短信的方式提示后台预设接收人员验证状态异常。在另外一实施例中,当验证字符无效的次数小于等于预设的无效次数阈值,则可以说明只是用户无意错过规定的时间从而造成验证字符无效。It is understandable that when the number of invalid verification characters is greater than the preset invalid number threshold, it can indicate that the user or the robot program is performing a malicious operation. The malicious operation of the user may be based on boring, but the malicious operation of the robot program may be for cracking The program code related to the verification; at this time, the server can prompt the background preset recipient to verify that the status is abnormal by email or SMS. In another embodiment, when the number of times the verification character is invalid is less than or equal to the preset invalid times threshold, it can be explained that the user accidentally misses the specified time and the verification character is invalid.
S60,在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败。S60: When the verification character is not consistent with the character to be recognized included in the image content displayed in the display frame, a prompt is prompted that the verification fails.
可以理解的是,在存在一次验证字符与展示框中展示的待识别字符不一致时,此时会认为本次验证请求对应的验证失败,并拒绝本次验证请求。此时,若用户还想继续进行验证,将会进入步骤S10中发送下一次验证请求。可理解地,可以记录每一次验证请求的字符验证失败次数,在同一个平台的同一个账户在某个时段(比如一个小时内)的字符验证失败次数超过预设的验证失败次数阈值;或者不同账户通过同一个网际协议地址的字符验证失败次数超过预设的验证失败次数阈值时,可以认为当前可能存在用户或者机器人程序在进行恶意操作,此时可以通过邮件或者短信的方式提示后台预设接收人员验证状态异常。It is understandable that when there is a verification character that is inconsistent with the character to be recognized displayed in the display box, the verification corresponding to the verification request will be considered as a failure, and the verification request will be rejected. At this time, if the user still wants to continue the verification, it will proceed to step S10 to send the next verification request. Understandably, the number of character verification failures for each verification request can be recorded, and the number of character verification failures for the same account on the same platform in a certain period of time (such as one hour) exceeds the preset verification failure threshold; or different When the number of character verification failures of the account through the same Internet Protocol address exceeds the preset verification failure threshold, it can be considered that there may be a user or robot program currently performing malicious operations. At this time, you can prompt the background to receive presets by email or SMS. The personnel verification status is abnormal.
S70,在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。S70. When the verification character is consistent with the character to be recognized contained in the image content displayed in the display frame, the number of successful character verifications is increased by one, and the number of successful character verifications is greater than or equal to When the preset verification times threshold, the verification is confirmed to be successful.
可以理解的是,在验证字符与展示框中展示的待识别字符一致时,并在字符验证成功次数大于或等于预设的验证次数阈值时,说明用户达到验证成功的要求。It is understandable that when the verification characters are consistent with the characters to be recognized displayed in the display box, and when the number of successful character verifications is greater than or equal to the preset verification times threshold, it indicates that the user meets the requirements for successful verification.
在另外一实施例中,如图6所示,所述步骤S70中,所述将字符验证成功次数加一之后,还包括:In another embodiment, as shown in FIG. 6, in step S70, after adding one to the number of successful character verifications, the method further includes:
S701,获取所述验证图片中的所述图片位置的数量。S701: Acquire the number of the picture positions in the verification picture.
在此步骤中,可以从上述步骤S201获取到图片位置的数量。In this step, the number of picture positions can be obtained from the above step S201.
S702,在所述字符验证成功次数小于所述预设的验证次数阈值时,则判断所述字符验证成功次数是否达到所述图片位置的数量。S702: When the number of successful character verifications is less than the preset verification number threshold, determine whether the number of successful character verifications reaches the number of picture positions.
可以理解的是,在字符验证成功次数小于预设的验证次数阈值时,则可以说明用户尚未达到验证成功的要求。此时需要在后续步骤中确定字符验证成功次数是否达到图片位置的数量,进而确定是否需要对应于该次验证请求是否需要更新验证图片(字符验证成功次数达到图片位置的数量时,说明此前的第一个验证图片中的所有图片位置对应的图像内容均已在展示框中展示完毕)。It is understandable that when the number of successful character verifications is less than the preset verification times threshold, it can indicate that the user has not yet reached the requirement for successful verification. At this time, it is necessary to determine in the subsequent steps whether the number of successful character verifications reaches the number of image positions, and then determine whether the verification image needs to be updated corresponding to this verification request (when the number of successful character verifications reaches the number of image positions, the previous first The image content corresponding to all the picture positions in a verification picture has been displayed in the display box).
S703,若所述字符验证成功次数达到所述图片位置的数量,则继续从所述自预设字符库中根据所述预设的选取规则选取所述随机数量的所述待识别字符,并根据所述随机数量的所述待识别字符生成所述验证图片。S703: If the number of successful character verifications reaches the number of positions in the picture, continue to select the random number of the characters to be recognized from the self-preset character library according to the preset selection rule, and The random number of the characters to be recognized generates the verification picture.
在本实施例中,在字符验证成功次数达到图片位置的数量时,即字符验证成功次数等于图片位置的数量,且字符验证成功次数小于预设的验证次数阈值。比如,当图片位置的数量为5个时,若预设的验证次数阈值为8次,此时,当字符验证成功次数为5次时,即代表字符验证成功次数达到了图片位置的数量,且5次字符验证成功次数刚好分别对应展示框分别展示的验证图片的各个不重复的图片位置中的图像内容。用户在针对不同的5个图片位置输入与图像内容中包含的待识别字符一致的验证字符之后,在验证图片中已经不再具备可以用展示框展示的图像内容;因此,当字符验证成功次数达到图片位置的数量时,服务器就必须进入步骤S10中重新更新验证图片中的待识别字符,也即重新返回步骤S10中自预设字符库中根据预设的选取规则自预设字符库中选取待识别字符,并执行其后续步骤,生成新的验证图片(包括验证图片中的新的待识别字符和新的图片位置等)。可以理解的是,本步骤中选取的待识别字符数量也是随机的。In this embodiment, when the number of successful character verifications reaches the number of picture positions, that is, the number of successful character verifications is equal to the number of picture positions, and the number of successful character verifications is less than the preset verification times threshold. For example, when the number of picture positions is 5, if the preset threshold of verification times is 8, at this time, when the number of successful character verifications is 5, it means that the number of successful character verifications has reached the number of picture positions, and The 5 successful character verification times correspond to the image content in each unique image position of the verification image respectively displayed in the display boxes. After the user enters the verification characters that are consistent with the characters to be recognized in the image content for 5 different image positions, there is no longer any image content that can be displayed in the display box in the verification image; therefore, when the number of successful character verifications reaches When the number of picture positions is determined, the server must enter step S10 to re-update the characters to be recognized in the verification picture, that is, to return to step S10 from the preset character library according to the preset selection rules to select the characters from the preset character library. Recognize the characters and execute the subsequent steps to generate a new verification picture (including the new character to be recognized and the new picture position in the verification picture). It is understandable that the number of characters to be recognized selected in this step is also random.
S704,若所述字符验证成功次数未达到所述图片位置的数量,则继续将所述预设的展示框偏移至所述展示队列中所述选取顺序最先的所述图片位置。S704: If the number of successful character verifications does not reach the number of picture positions, continue to shift the preset display frame to the picture position first in the selection order in the display queue.
可以理解的是,当字符验证成功次数未达到预设的更新次数时,则无需对验证图片中的待识别字符进行更新。仅需要返回至步骤S40中进行将展示框偏移值验证图片中的下一个图片位置以展示其对应的图像内容即可。It is understandable that when the number of successful character verifications does not reach the preset update times, there is no need to update the characters to be recognized in the verification picture. It is only necessary to return to step S40 to verify the next picture position in the picture with the display frame offset value to display its corresponding image content.
综上所述,上述提供了一种动态验证方法,接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符;根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含 与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符;自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中;将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容;接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致;在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败;在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。本提案通过自预设字符库中根据预设的选取规则选取随机数量的待识别字符,且在自验证图片中的所有图片位置中随机选取图片位置,并在字符验证成功次数大于或等于预设的验证次数阈值时,才确认验证成功。本提案中,针对每一个验证请求,都可以随机生成至少一个验证图片,且每一个验证图片中的图片格式以及待识别字符的选取规律均有所区别,且在验证过程中,被选取进行展示的验证图片中的图像内容的选取顺序也是随机的,通过具有区别的上述验证图片中的图像内容对不同的验证请求进行验证,可以大大提高机器人程序破解验证过程的难度,从而可以降低了数据信息泄密的可能性和提高验证过程中的安全性能。To sum up, the above provides a dynamic verification method, receiving a verification request, selecting a random number of characters to be recognized from a preset character library according to a preset selection rule; generating according to the random number of characters to be recognized A verification picture, where the verification picture includes image content corresponding to multiple picture positions, and each of the image content corresponding to the picture position includes at least one character to be recognized; from the verification picture After randomly selecting the picture position from all the picture positions in, add all the selected picture positions to the display queue in the order of selection; offset the preset display frame to the first in the selection order in the display queue The picture position, and the image content corresponding to the picture position in the verification picture is displayed in the preset display box; and the verification input by the user for the image content displayed in the display box is received Character, and determine whether the verification character is consistent with the character to be recognized contained in the image content displayed in the display frame; the verification character and the image content displayed in the display frame include When the characters to be recognized are not consistent, the verification fails; when the verified characters are consistent with the characters to be recognized contained in the image content displayed in the display box, the characters are verified successfully The number of times is increased by one, and when the number of successful character verifications is greater than or equal to the preset verification times threshold, the verification is confirmed to be successful. This proposal selects a random number of characters to be recognized from the preset character library according to preset selection rules, and randomly selects the picture position from all picture positions in the self-verified picture, and the number of successful character verification is greater than or equal to the preset Confirm that the verification is successful only when the verification times threshold is reached. In this proposal, for each verification request, at least one verification picture can be randomly generated, and the picture format in each verification picture and the selection rule of the characters to be recognized are different, and they are selected for display during the verification process The selection order of the image content in the verification picture is also random. The verification of different verification requests through the image content in the above verification pictures with differences can greatly increase the difficulty of the robot program to crack the verification process, thereby reducing data information The possibility of leaking secrets and improve the security performance in the verification process.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence number of each step in the foregoing embodiment does not mean the order of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
在一实施例中,提供一种动态验证装置,该动态验证装置与上述实施例中动态验证方法一一对应。如图7所示,该动态验证装置包括选取模块11、生成模块12、加入模块13、展示模块14、第一判断模块15、提示模块16和确认模块17。各功能模块详细说明如下:In one embodiment, a dynamic verification device is provided, and the dynamic verification device corresponds to the dynamic verification method in the above-mentioned embodiment one-to-one. As shown in FIG. 7, the dynamic verification device includes a selection module 11, a generation module 12, an addition module 13, a display module 14, a first judgment module 15, a prompt module 16 and a confirmation module 17. The detailed description of each functional module is as follows:
选取模块11,用于接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符;The selection module 11 is configured to receive a verification request, and select a random number of characters to be recognized from a preset character library according to a preset selection rule;
生成模块12,用于根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符;The generating module 12 is configured to generate a verification picture according to the random number of the characters to be recognized, the verification picture contains image content corresponding to a plurality of picture positions, and each of the images corresponding to the picture position The content includes at least one character to be recognized;
加入模块13,用于自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中;The adding module 13 is configured to randomly select the picture positions from all the picture positions in the verification picture, and then add all the selected picture positions to the display queue in the order of selection;
展示模块14,用于将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容;The display module 14 is configured to offset the preset display frame to the position of the picture in the selection sequence first in the display queue, and display the verification picture and the picture in the preset display frame The image content corresponding to the location;
第一判断模块15,用于接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致;The first judging module 15 is configured to receive the verification characters input by the user for the image content displayed in the display frame, and determine whether the verification characters and the image content contained in the image content displayed in the display frame Whether the characters to be recognized are consistent;
提示模块16,用于在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败;The prompting module 16 is used for prompting that the verification failed this time when the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame;
确认模块17,用于在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。The confirmation module 17 is configured to increase the number of successful character verifications by one when the verification character is consistent with the character to be recognized contained in the image content displayed in the display frame, and when the character verification is successful When the number of times is greater than or equal to the preset verification times threshold, the verification is confirmed to be successful.
进一步地,如图8所示,所述生成模块包括:Further, as shown in FIG. 8, the generating module includes:
第一获取子模块,用于获取用于生成所述验证图片的图片格式的图片参数,所述图片参数包括所述待识别字符在所述验证图片中的所述图片位置的数量、各所述图片位置的排列方式、显示字体、显示大小、显示背景、显示颜色和干扰元素中的一种或多种;The first acquisition sub-module is configured to acquire picture parameters of a picture format used to generate the verification picture, the picture parameters including the number of the picture positions of the character to be recognized in the verification picture, and each One or more of the arrangement of the picture position, display font, display size, display background, display color and interference elements;
设置子模块,用于为每一项所述图片参数设置与其对应的多种生成规则;A setting sub-module for setting multiple generation rules corresponding to each of the picture parameters;
选取子模块,用于从与每一项所述图片参数对应的多种所述生成规则中各自随机选取一种所述生成规则之后,根据随机选取的所有所述生成规则生成所述验证图片的所述图片格式;The selection sub-module is configured to randomly select one of the generation rules from the multiple generation rules corresponding to each of the picture parameters, and then generate the verification picture according to all the randomly selected generation rules The picture format;
确定子模块,用于根据所述随机数量以及所述图片格式中所述图片位置的数量确定各所述待识别字符与所述图片位置的对应关系;The determining sub-module is configured to determine the correspondence between each of the characters to be recognized and the picture position according to the random number and the number of the picture positions in the picture format;
第二获取子模块,用于获取可供生成所述验证图片的图片区域范围;The second obtaining submodule is used to obtain the range of the picture area available for generating the verification picture;
生成子模块,用于按照所述图片格式在所述图片区域范围内生成包含所有所述待识别字符的所述验证图片,且所述验证图片中的每一个所述待识别字符均按照各所述待识别字符与所述图片位置的对应关系被放置于所述验证图片中的各所述图片位置中。A generating submodule is used to generate the verification picture including all the characters to be recognized within the picture area according to the picture format, and each of the characters to be recognized in the verification picture is in accordance with each The corresponding relationship between the character to be recognized and the position of the picture is placed in each position of the picture in the verification picture.
进一步地,如图9所示,所述动态验证装置还包括:Further, as shown in FIG. 9, the dynamic verification device further includes:
第一确定模块,用于在所述图片区域范围内设立坐标系,并确定每一个所述图片位置在所述坐标系中的坐标值;A first determining module, configured to establish a coordinate system within the picture area, and determine the coordinate value of each picture position in the coordinate system;
第二确定模块,用于根据各所述坐标值,确定层叠样式表中的所述展示框在各所述图片位置之间偏移的偏移量;The second determining module is configured to determine the offset of the display frame in the cascading style sheet between each of the picture positions according to each of the coordinate values;
第一偏移模块,用于根据所述展示框在各所述图片位置之间偏移的所述偏移量,将所述展示框偏移至所述展示队列中所述选取顺序最先的所述图片位置。The first offset module is configured to offset the display frame to the first in the selection order in the display queue according to the offset of the display frame between each of the picture positions The location of the picture.
进一步地,所述动态验证装置还包括:Further, the dynamic verification device further includes:
第一获取模块,用于获取所述展示框中展示所述图片位置对应的所述图像内容的第一时间,以及所述用户针对所述展示框中展示的所述图像内容输入所述验证字符的第二时间;The first acquiring module is configured to acquire the first time when the image content corresponding to the position of the picture is displayed in the display box, and the user inputs the verification characters for the image content displayed in the display box Second time
第二判断模块,用于判断所述第二时间与所述第一时间之间的时间差值是否大于预设的时间阈值;The second judgment module is configured to judge whether the time difference between the second time and the first time is greater than a preset time threshold;
第三确定模块,用于若所述时间差值大于所述预设的时间阈值,则确定所述用户输入的与所述第二时间对应的所述验证字符无效,并提示所述用户已超时;The third determining module is configured to determine that the verification character input by the user corresponding to the second time is invalid if the time difference is greater than the preset time threshold, and prompt the user to have timed out ;
第二获取模块,用于自接收到所述验证请求之后所述用户输入的所述验证字符无效的次数,并判断所述验证字符无效的次数是否大于预设的无效次数阈值;The second acquiring module is configured to determine the number of times the verification character input by the user is invalid since receiving the verification request, and determine whether the number of times the verification character is invalid is greater than a preset invalidity times threshold;
禁止模块,用于若所述验证字符无效的次数大于所述预设的无效次数阈值,则在预设时长内禁止通过与所述用户对应的网际协议地址输入所述验证字符。The prohibition module is configured to prohibit input of the verification character through the Internet Protocol address corresponding to the user within a preset time period if the number of invalid times of the verification character is greater than the preset invalid number threshold.
进一步地,所述动态验证装置还包括:Further, the dynamic verification device further includes:
第三获取模块,用于获取所述验证图片中的所述图片位置的数量;The third acquiring module is configured to acquire the number of the picture positions in the verification picture;
第三判断模块,用于在所述字符验证成功次数小于所述预设的验证次数阈值时,则判断所述字符验证成功次数是否达到所述图片位置的数量;The third judgment module is configured to judge whether the number of successful character verifications reaches the number of positions in the picture when the number of successful character verifications is less than the preset verification times threshold;
选取模块,用于若所述字符验证成功次数达到所述图片位置的数量,则继续从所述自预设字符库中根据所述预设的选取规则选取所述随机数量的所述待识别字符,并根据所述随机数量的所述待识别字符生成所述验证图片;The selection module is configured to continue to select the random number of the characters to be recognized from the self-preset character library according to the preset selection rule if the number of successful character verifications reaches the number of positions in the picture , And generate the verification picture according to the random number of the characters to be recognized;
第二偏移模块,用于若所述字符验证成功次数未达到所述图片位置的数量,则继续将所述预设的展示框偏移至所述展示队列中所述选取顺序最先的所述图片位置。The second offset module is configured to continue to offset the preset display frame to the first selection order in the display queue if the number of successful character verifications does not reach the number of image positions The location of the picture.
关于动态验证装置的具体限定可以参见上文中对于动态验证方法的限定,在此不再赘述。上述动态验证装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the dynamic verification device, please refer to the above limitation of the dynamic verification method, which will not be repeated here. Each module in the above-mentioned dynamic verification device can be implemented in whole or in part by software, hardware, and combinations thereof. The foregoing modules may be embedded in the form of hardware or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the foregoing modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图10所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储动态验证方法中涉及到的数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种动态验证方法。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. 10. The computer equipment includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used to store the data involved in the dynamic verification method. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to realize a dynamic verification method.
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现如下步骤:In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor, and the processor implements the following steps when the processor executes the computer-readable instructions:
接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符;Receive a verification request, and select a random number of characters to be recognized from the preset character library according to preset selection rules;
根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符;A verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中;After randomly selecting the picture positions from all the picture positions in the verification picture, adding all the picture positions selected to the display queue in the order of selection;
将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容;Offset the preset display frame to the picture position in the selection order first in the display queue, and display the image corresponding to the picture position in the verification picture in the preset display frame content;
接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致;Receiving a verification character input by a user for the image content displayed in the display frame, and determining whether the verification character is consistent with the character to be recognized included in the image content displayed in the display frame;
在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败;When the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame, it is prompted that the verification fails;
在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。When the verification character is consistent with the character to be recognized contained in the image content displayed in the display box, the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
在一个实施例中,提供了一个或多个存储有计算机可读指令的非易失性可读存储介质,该非易失性可读存储介质上存储有计算机可读指令,该计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现以下步骤:In one embodiment, one or more non-volatile readable storage media storing computer readable instructions are provided, the non-volatile readable storage medium storing computer readable instructions, and the computer readable instructions When executed by one or more processors, one or more processors are caused to implement the following steps:
接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符;Receive a verification request, and select a random number of characters to be recognized from the preset character library according to preset selection rules;
根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符;A verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中;After randomly selecting the picture positions from all the picture positions in the verification picture, adding all the picture positions selected to the display queue in the order of selection;
将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容;Offset the preset display frame to the picture position in the selection order first in the display queue, and display the image corresponding to the picture position in the verification picture in the preset display frame content;
接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致;Receiving a verification character input by a user for the image content displayed in the display frame, and determining whether the verification character is consistent with the character to be recognized included in the image content displayed in the display frame;
在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败;When the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame, it is prompted that the verification fails;
在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。When the verification character is consistent with the character to be recognized contained in the image content displayed in the display box, the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through computer-readable instructions, which can be stored in a non-volatile computer. In a readable storage medium, when the computer-readable instructions are executed, they may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned functions can be allocated to different functional units and modules as required. Module completion means dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still implement the foregoing The technical solutions recorded in the examples are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the application, and should be included in Within the scope of protection of this application.

Claims (20)

  1. 一种动态验证方法,其特征在于,包括:A dynamic verification method, characterized in that it comprises:
    接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符;Receive a verification request, and select a random number of characters to be recognized from the preset character library according to preset selection rules;
    根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符;A verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
    自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中;After randomly selecting the picture positions from all the picture positions in the verification picture, adding all the picture positions selected to the display queue in the order of selection;
    将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容;Offset the preset display frame to the picture position in the selection order first in the display queue, and display the image corresponding to the picture position in the verification picture in the preset display frame content;
    接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致;Receiving a verification character input by a user for the image content displayed in the display frame, and determining whether the verification character is consistent with the character to be recognized included in the image content displayed in the display frame;
    在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败;When the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame, it is prompted that the verification fails;
    在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。When the verification character is consistent with the character to be recognized contained in the image content displayed in the display box, the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
  2. 根据权利要求1所述的动态验证方法,其特征在于,所述根据所述随机数量的所述待识别字符生成验证图片,包括:The dynamic verification method according to claim 1, wherein said generating a verification picture according to said random number of said characters to be recognized comprises:
    获取用于生成所述验证图片的图片格式的图片参数,所述图片参数包括所述待识别字符在所述验证图片中的所述图片位置的数量、各所述图片位置的排列方式、显示字体、显示大小、显示背景、显示颜色和干扰元素中的一种或多种;Acquire the picture parameters of the picture format used to generate the verification picture, the picture parameters including the number of the picture positions of the character to be recognized in the verification picture, the arrangement of each picture position, and the display font , Display size, display background, display color and one or more of interference elements;
    为每一项所述图片参数设置与其对应的多种生成规则;Set multiple generation rules corresponding to each of the picture parameters;
    从与每一项所述图片参数对应的多种所述生成规则中各自随机选取一种所述生成规则之后,根据随机选取的所有所述生成规则生成所述验证图片的所述图片格式;After randomly selecting one of the generation rules from the multiple generation rules corresponding to each of the picture parameters, generate the picture format of the verification picture according to all the randomly selected generation rules;
    根据所述随机数量以及所述图片格式中所述图片位置的数量确定各所述待识别字符与所述图片位置的对应关系;Determining the correspondence between each of the characters to be recognized and the picture position according to the random number and the number of the picture positions in the picture format;
    获取可供生成所述验证图片的图片区域范围;Obtaining a picture area range available for generating the verification picture;
    按照所述图片格式在所述图片区域范围内生成包含所有所述待识别字符的所述验证图片,且所述验证图片中的每一个所述待识别字符均按照各所述待识别字符与所述图片位置的对应关系被放置于所述验证图片中的各所述图片位置中。The verification picture including all the characters to be recognized is generated within the picture area according to the picture format, and each of the characters to be recognized in the verification picture is based on the characters to be recognized and all the characters. The corresponding relationship of the picture positions is placed in each of the picture positions in the verification picture.
  3. 根据权利要求1所述的动态验证方法,其特征在于,所述将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置之前,还包括:The dynamic verification method according to claim 1, wherein the shifting the preset display frame to before the picture position in the display queue that is selected in the first order, further comprises:
    在所述图片区域范围内设立坐标系,并确定每一个所述图片位置在所述坐标系中的坐标值;Establish a coordinate system within the picture area, and determine the coordinate value of each picture position in the coordinate system;
    根据各所述坐标值,确定层叠样式表中的所述展示框在各所述图片位置之间偏移的偏移量;Determine, according to each of the coordinate values, the offset of the display frame in the cascading style sheet between each of the picture positions;
    根据所述展示框在各所述图片位置之间偏移的所述偏移量,将所述展示框偏移至所述展示队列中所述选取顺序最先的所述图片位置。According to the offset of the display frame between each of the picture positions, the display frame is shifted to the picture position that is the first in the selection order in the display queue.
  4. 根据权利要求1所述的动态验证方法,其特征在于,所述接收用户针对所述展示框中展示的所述图像内容输入的验证字符之后,还包括:The dynamic verification method according to claim 1, wherein after receiving the verification characters input by the user for the image content displayed in the display frame, the method further comprises:
    获取所述展示框中展示所述图片位置对应的所述图像内容的第一时间,以及所述用户针对所述展示框中展示的所述图像内容输入所述验证字符的第二时间;Acquiring the first time when the image content corresponding to the picture position is displayed in the display box, and the second time when the user inputs the verification character for the image content displayed in the display box;
    判断所述第二时间与所述第一时间之间的时间差值是否大于预设的时间阈值;Determine whether the time difference between the second time and the first time is greater than a preset time threshold;
    若所述时间差值大于所述预设的时间阈值,则确定所述用户输入的与所述第二时间对应的所述验证字符无效,并提示所述用户已超时;If the time difference is greater than the preset time threshold, determining that the verification character corresponding to the second time input by the user is invalid, and prompting the user that the time has expired;
    获取自接收到所述验证请求之后所述用户输入的所述验证字符无效的次数,并判断所述验证字符无效的次数是否大于预设的无效次数阈值;Acquiring the number of invalid verification characters input by the user after receiving the verification request, and determining whether the number of invalid verification characters is greater than a preset invalid number threshold;
    若所述验证字符无效的次数大于所述预设的无效次数阈值,则在预设时长内禁止通过与所述用户 对应的网际协议地址输入所述验证字符。If the number of times the verification character is invalid is greater than the preset threshold of the number of invalid times, it is prohibited to input the verification character through the Internet Protocol address corresponding to the user within the preset time period.
  5. 根据权利要求1所述的动态验证方法,其特征在于,所述将字符验证成功次数加一之后,还包括:The dynamic verification method according to claim 1, wherein after adding one to the number of successful character verifications, the method further comprises:
    获取所述验证图片中的所述图片位置的数量;Acquiring the number of the picture positions in the verification picture;
    在所述字符验证成功次数小于所述预设的验证次数阈值时,则判断所述字符验证成功次数是否达到所述图片位置的数量;When the number of successful character verifications is less than the preset verification times threshold, determining whether the number of successful character verifications reaches the number of picture positions;
    若所述字符验证成功次数达到所述图片位置的数量,则继续从所述自预设字符库中根据所述预设的选取规则选取所述随机数量的所述待识别字符,并根据所述随机数量的所述待识别字符生成所述验证图片;If the number of successful character verifications reaches the number of positions in the picture, continue to select the random number of the characters to be recognized from the self-preset character library according to the preset selection rule, and according to the Generating the verification picture with a random number of the characters to be recognized;
    若所述字符验证成功次数未达到所述图片位置的数量,则继续将所述预设的展示框偏移至所述展示队列中所述选取顺序最先的所述图片位置。If the number of successful character verifications does not reach the number of picture positions, continue to shift the preset display frame to the picture position that is the first in the selection order in the display queue.
  6. 一种动态验证装置,其特征在于,包括:A dynamic verification device, characterized by comprising:
    选取模块,用于接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符;The selection module is used to receive a verification request, and select a random number of characters to be recognized from a preset character library according to a preset selection rule;
    生成模块,用于根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符;A generating module, configured to generate a verification picture according to the random number of the characters to be recognized, the verification picture contains image content corresponding to multiple picture positions, and each of the image content corresponding to the picture position Contains at least one character to be recognized;
    加入模块,用于自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中;The adding module is configured to randomly select the picture positions from all the picture positions in the verification picture, and add all the selected picture positions to the display queue in the order of selection;
    展示模块,用于将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容;The display module is configured to offset the preset display frame to the picture position in the selection sequence first in the display queue, and display the verification picture and the picture position in the preset display frame Corresponding image content;
    第一判断模块,用于接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致;The first judgment module is configured to receive the verification character input by the user for the image content displayed in the display frame, and determine whether the verification character is the same as the pending character contained in the image content displayed in the display frame. Whether the recognized characters are consistent;
    提示模块,用于在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败;A prompting module for prompting that the verification failed this time when the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame;
    确认模块,用于在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。The confirmation module is used for adding one to the number of successful character verification when the verification character is consistent with the character to be recognized contained in the image content displayed in the display box, and the number of successful character verification When it is greater than or equal to the preset verification times threshold, the verification is confirmed to be successful.
  7. 根据权利要求6所述的动态验证装置,其特征在于,所述生成模块包括:The dynamic verification device according to claim 6, wherein the generating module comprises:
    第一获取子模块,用于获取用于生成所述验证图片的图片格式的图片参数,所述图片参数包括所述待识别字符在所述验证图片中的所述图片位置的数量、各所述图片位置的排列方式、显示字体、显示大小、显示背景、显示颜色和干扰元素中的一种或多种;The first acquisition sub-module is configured to acquire picture parameters of a picture format used to generate the verification picture, the picture parameters including the number of the picture positions of the character to be recognized in the verification picture, and each One or more of the arrangement of the picture position, display font, display size, display background, display color and interference elements;
    设置子模块,用于为每一项所述图片参数设置与其对应的多种生成规则;A setting sub-module for setting multiple generation rules corresponding to each of the picture parameters;
    选取子模块,用于从与每一项所述图片参数对应的多种所述生成规则中各自随机选取一种所述生成规则之后,根据随机选取的所有所述生成规则生成所述验证图片的所述图片格式;The selection sub-module is configured to randomly select one of the generation rules from the multiple generation rules corresponding to each of the picture parameters, and then generate the verification picture according to all the randomly selected generation rules The picture format;
    确定子模块,用于根据所述随机数量以及所述图片格式中所述图片位置的数量确定各所述待识别字符与所述图片位置的对应关系;The determining sub-module is configured to determine the correspondence between each of the characters to be recognized and the picture position according to the random number and the number of the picture positions in the picture format;
    第二获取子模块,用于获取可供生成所述验证图片的图片区域范围;The second obtaining submodule is used to obtain the range of the picture area available for generating the verification picture;
    生成子模块,用于按照所述图片格式在所述图片区域范围内生成包含所有所述待识别字符的所述验证图片,且所述验证图片中的每一个所述待识别字符均按照各所述待识别字符与所述图片位置的对应关系被放置于所述验证图片中的各所述图片位置中。A generating submodule is used to generate the verification picture including all the characters to be recognized within the picture area according to the picture format, and each of the characters to be recognized in the verification picture is in accordance with each The corresponding relationship between the character to be recognized and the position of the picture is placed in each position of the picture in the verification picture.
  8. 根据权利要求6所述的动态验证装置,其特征在于,所述动态验证装置还包括:The dynamic verification device according to claim 6, wherein the dynamic verification device further comprises:
    第一确定模块,用于在所述图片区域范围内设立坐标系,并确定每一个所述图片位置在所述坐标系中的坐标值;A first determining module, configured to establish a coordinate system within the picture area, and determine the coordinate value of each picture position in the coordinate system;
    第二确定模块,用于根据各所述坐标值,确定层叠样式表中的所述展示框在各所述图片位置之间偏移的偏移量;The second determining module is configured to determine the offset of the display frame in the cascading style sheet between each of the picture positions according to each of the coordinate values;
    第一偏移模块,用于根据所述展示框在各所述图片位置之间偏移的所述偏移量,将所述展示框偏 移至所述展示队列中所述选取顺序最先的所述图片位置。The first offset module is configured to offset the display frame to the first in the selection order in the display queue according to the offset of the display frame between each of the picture positions The location of the picture.
  9. 根据权利要求6所述的动态验证装置,其特征在于,所述动态验证装置还包括:The dynamic verification device according to claim 6, wherein the dynamic verification device further comprises:
    第一获取模块,用于获取所述展示框中展示所述图片位置对应的所述图像内容的第一时间,以及所述用户针对所述展示框中展示的所述图像内容输入所述验证字符的第二时间;The first acquiring module is configured to acquire the first time when the image content corresponding to the position of the picture is displayed in the display box, and the user inputs the verification characters for the image content displayed in the display box Second time
    第二判断模块,用于判断所述第二时间与所述第一时间之间的时间差值是否大于预设的时间阈值;The second judgment module is configured to judge whether the time difference between the second time and the first time is greater than a preset time threshold;
    第三确定模块,用于若所述时间差值大于所述预设的时间阈值,则确定所述用户输入的与所述第二时间对应的所述验证字符无效,并提示所述用户已超时;The third determining module is configured to determine that the verification character input by the user corresponding to the second time is invalid if the time difference is greater than the preset time threshold, and prompt the user to have timed out ;
    第二获取模块,用于自接收到所述验证请求之后所述用户输入的所述验证字符无效的次数,并判断所述验证字符无效的次数是否大于预设的无效次数阈值;The second acquiring module is configured to determine the number of times the verification character input by the user is invalid since receiving the verification request, and determine whether the number of times the verification character is invalid is greater than a preset invalidity times threshold;
    禁止模块,用于若所述验证字符无效的次数大于所述预设的无效次数阈值,则在预设时长内禁止通过与所述用户对应的网际协议地址输入所述验证字符。The prohibition module is configured to prohibit input of the verification character through the Internet Protocol address corresponding to the user within a preset time period if the number of invalid times of the verification character is greater than the preset invalid number threshold.
  10. 根据权利要求6所述的动态验证装置,其特征在于,所述动态验证装置还包括:The dynamic verification device according to claim 6, wherein the dynamic verification device further comprises:
    第三获取模块,用于获取所述验证图片中的所述图片位置的数量;The third acquiring module is configured to acquire the number of the picture positions in the verification picture;
    第三判断模块,用于在所述字符验证成功次数小于所述预设的验证次数阈值时,则判断所述字符验证成功次数是否达到所述图片位置的数量;The third judgment module is configured to judge whether the number of successful character verifications reaches the number of positions in the picture when the number of successful character verifications is less than the preset verification times threshold;
    选取模块,用于若所述字符验证成功次数达到所述图片位置的数量,则继续从所述自预设字符库中根据所述预设的选取规则选取所述随机数量的所述待识别字符,并根据所述随机数量的所述待识别字符生成所述验证图片;The selection module is configured to continue to select the random number of the characters to be recognized from the self-preset character library according to the preset selection rule if the number of successful character verifications reaches the number of positions in the picture , And generate the verification picture according to the random number of the characters to be recognized;
    第二偏移模块,用于若所述字符验证成功次数未达到所述图片位置的数量,则继续将所述预设的展示框偏移至所述展示队列中所述选取顺序最先的所述图片位置。The second offset module is configured to continue to offset the preset display frame to the first selection order in the display queue if the number of successful character verifications does not reach the number of image positions The location of the picture.
  11. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and capable of running on the processor, wherein the processor executes the computer-readable instructions as follows step:
    接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符;Receive a verification request, and select a random number of characters to be recognized from the preset character library according to preset selection rules;
    根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符;A verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
    自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中;After randomly selecting the picture positions from all the picture positions in the verification picture, adding all the picture positions selected to the display queue in the order of selection;
    将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容;Offset the preset display frame to the picture position in the selection order first in the display queue, and display the image corresponding to the picture position in the verification picture in the preset display frame content;
    接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致;Receiving a verification character input by a user for the image content displayed in the display frame, and determining whether the verification character is consistent with the character to be recognized included in the image content displayed in the display frame;
    在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败;When the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame, it is prompted that the verification fails;
    在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。When the verification character is consistent with the character to be recognized contained in the image content displayed in the display box, the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
  12. 如权利要求11所述的计算机设备,其特征在于,所述根据所述随机数量的所述待识别字符生成验证图片,包括:11. The computer device of claim 11, wherein said generating a verification picture according to said random number of said characters to be recognized comprises:
    获取用于生成所述验证图片的图片格式的图片参数,所述图片参数包括所述待识别字符在所述验证图片中的所述图片位置的数量、各所述图片位置的排列方式、显示字体、显示大小、显示背景、显示颜色和干扰元素中的一种或多种;Acquire the picture parameters of the picture format used to generate the verification picture, the picture parameters including the number of the picture positions of the character to be recognized in the verification picture, the arrangement of each picture position, and the display font , Display size, display background, display color and one or more of interference elements;
    为每一项所述图片参数设置与其对应的多种生成规则;Set multiple generation rules corresponding to each of the picture parameters;
    从与每一项所述图片参数对应的多种所述生成规则中各自随机选取一种所述生成规则之后,根据随机选取的所有所述生成规则生成所述验证图片的所述图片格式;After randomly selecting one of the generation rules from the multiple generation rules corresponding to each of the picture parameters, generate the picture format of the verification picture according to all the randomly selected generation rules;
    根据所述随机数量以及所述图片格式中所述图片位置的数量确定各所述待识别字符与所述图片位置的对应关系;Determining the correspondence between each of the characters to be recognized and the picture position according to the random number and the number of the picture positions in the picture format;
    获取可供生成所述验证图片的图片区域范围;Obtaining a picture area range available for generating the verification picture;
    按照所述图片格式在所述图片区域范围内生成包含所有所述待识别字符的所述验证图片,且所述验证图片中的每一个所述待识别字符均按照各所述待识别字符与所述图片位置的对应关系被放置于所述验证图片中的各所述图片位置中。The verification picture including all the characters to be recognized is generated within the picture area according to the picture format, and each of the characters to be recognized in the verification picture is based on the characters to be recognized and all the characters. The corresponding relationship of the picture positions is placed in each of the picture positions in the verification picture.
  13. 如权利要求11所述的计算机设备,其特征在于,所述将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置之前,所述处理器执行所述计算机可读指令时还实现如下步骤:The computer device according to claim 11, wherein the processor executes the computer before the shifting the preset display frame to the first picture position in the selection sequence in the display queue The following steps are also implemented when reading instructions:
    在所述图片区域范围内设立坐标系,并确定每一个所述图片位置在所述坐标系中的坐标值;Establish a coordinate system within the picture area, and determine the coordinate value of each picture position in the coordinate system;
    根据各所述坐标值,确定层叠样式表中的所述展示框在各所述图片位置之间偏移的偏移量;Determine, according to each of the coordinate values, the offset of the display frame in the cascading style sheet between each of the picture positions;
    根据所述展示框在各所述图片位置之间偏移的所述偏移量,将所述展示框偏移至所述展示队列中所述选取顺序最先的所述图片位置。According to the offset of the display frame between each of the picture positions, the display frame is shifted to the picture position that is the first in the selection order in the display queue.
  14. 如权利要求11所述的计算机设备,其特征在于,所述接收用户针对所述展示框中展示的所述图像内容输入的验证字符之后,所述处理器执行所述计算机可读指令时还实现如下步骤:The computer device according to claim 11, wherein after receiving the verification characters input by the user for the image content displayed in the display frame, the processor further implements The following steps:
    获取所述展示框中展示所述图片位置对应的所述图像内容的第一时间,以及所述用户针对所述展示框中展示的所述图像内容输入所述验证字符的第二时间;Acquiring the first time when the image content corresponding to the picture position is displayed in the display box, and the second time when the user inputs the verification character for the image content displayed in the display box;
    判断所述第二时间与所述第一时间之间的时间差值是否大于预设的时间阈值;Determine whether the time difference between the second time and the first time is greater than a preset time threshold;
    若所述时间差值大于所述预设的时间阈值,则确定所述用户输入的与所述第二时间对应的所述验证字符无效,并提示所述用户已超时;If the time difference is greater than the preset time threshold, determining that the verification character corresponding to the second time input by the user is invalid, and prompting the user that the time has expired;
    获取自接收到所述验证请求之后所述用户输入的所述验证字符无效的次数,并判断所述验证字符无效的次数是否大于预设的无效次数阈值;Acquiring the number of invalid verification characters input by the user after receiving the verification request, and determining whether the number of invalid verification characters is greater than a preset invalid number threshold;
    若所述验证字符无效的次数大于所述预设的无效次数阈值,则在预设时长内禁止通过与所述用户对应的网际协议地址输入所述验证字符。If the number of times the verification character is invalid is greater than the preset threshold of the number of invalid times, it is forbidden to input the verification character through the Internet Protocol address corresponding to the user within the preset time period.
  15. 如权利要求11所述的计算机设备,其特征在于,所述将字符验证成功次数加一之后,所述处理器执行所述计算机可读指令时还实现如下步骤:The computer device according to claim 11, wherein after the number of successful character verifications is increased by one, the processor further implements the following steps when executing the computer-readable instruction:
    获取所述验证图片中的所述图片位置的数量;Acquiring the number of the picture positions in the verification picture;
    在所述字符验证成功次数小于所述预设的验证次数阈值时,则判断所述字符验证成功次数是否达到所述图片位置的数量;When the number of successful character verifications is less than the preset verification times threshold, determining whether the number of successful character verifications reaches the number of picture positions;
    若所述字符验证成功次数达到所述图片位置的数量,则继续从所述自预设字符库中根据所述预设的选取规则选取所述随机数量的所述待识别字符,并根据所述随机数量的所述待识别字符生成所述验证图片;If the number of successful character verifications reaches the number of positions in the picture, continue to select the random number of the characters to be recognized from the self-preset character library according to the preset selection rule, and according to the Generating the verification picture with a random number of the characters to be recognized;
    若所述字符验证成功次数未达到所述图片位置的数量,则继续将所述预设的展示框偏移至所述展示队列中所述选取顺序最先的所述图片位置。If the number of successful character verifications does not reach the number of picture positions, continue to shift the preset display frame to the picture position first in the selection order in the display queue.
  16. 一个或多个存储有计算机可读指令的非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:One or more non-volatile readable storage media storing computer readable instructions, wherein when the computer readable instructions are executed by one or more processors, the one or more processors execute The following steps:
    接收验证请求,自预设字符库中根据预设的选取规则选取随机数量的待识别字符;Receive a verification request, and select a random number of characters to be recognized from the preset character library according to preset selection rules;
    根据所述随机数量的所述待识别字符生成验证图片,所述验证图片中包含与多个图片位置对应的图像内容,且每一个与所述图片位置对应的所述图像内容中均包含至少一个所述待识别字符;A verification picture is generated according to the random number of the characters to be recognized, the verification picture includes image content corresponding to a plurality of picture positions, and each of the image contents corresponding to the picture position includes at least one The character to be recognized;
    自所述验证图片中的所有所述图片位置中随机选取所述图片位置后,将选取的所有所述图片位置按照选取顺序加入展示队列中;After randomly selecting the picture positions from all the picture positions in the verification picture, adding all the picture positions selected to the display queue in the order of selection;
    将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置,并在所述预设的展示框中展示所述验证图片中与所述图片位置对应的所述图像内容;Offset the preset display frame to the picture position in the selection order first in the display queue, and display the image corresponding to the picture position in the verification picture in the preset display frame content;
    接收用户针对所述展示框中展示的所述图像内容输入的验证字符,并判断所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符是否一致;Receiving a verification character input by a user for the image content displayed in the display frame, and determining whether the verification character is consistent with the character to be recognized included in the image content displayed in the display frame;
    在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符并不一致时,则提示本次验证失败;When the verification character is not consistent with the character to be recognized contained in the image content displayed in the display frame, it is prompted that the verification fails;
    在所述验证字符与所述展示框中展示的所述图像内容中包含的所述待识别字符一致时,则将字符验证成功次数加一,并在所述字符验证成功次数大于或等于预设的验证次数阈值时,确认验证成功。When the verification character is consistent with the character to be recognized contained in the image content displayed in the display box, the number of successful character verification is increased by one, and the number of successful character verification is greater than or equal to a preset Confirm that the verification is successful when the verification times threshold is set.
  17. 如权利要求16所述的非易失性可读存储介质,其特征在于,所述根据所述随机数量的所述待识别字符生成验证图片,包括:15. The non-volatile readable storage medium of claim 16, wherein said generating a verification picture according to said random number of said characters to be recognized comprises:
    获取用于生成所述验证图片的图片格式的图片参数,所述图片参数包括所述待识别字符在所述验证图片中的所述图片位置的数量、各所述图片位置的排列方式、显示字体、显示大小、显示背景、显示颜色和干扰元素中的一种或多种;Acquire the picture parameters of the picture format used to generate the verification picture, the picture parameters including the number of the picture positions of the character to be recognized in the verification picture, the arrangement of each picture position, and the display font , Display size, display background, display color and one or more of interference elements;
    为每一项所述图片参数设置与其对应的多种生成规则;Set multiple generation rules corresponding to each of the picture parameters;
    从与每一项所述图片参数对应的多种所述生成规则中各自随机选取一种所述生成规则之后,根据随机选取的所有所述生成规则生成所述验证图片的所述图片格式;After randomly selecting one of the generation rules from the multiple generation rules corresponding to each of the picture parameters, generate the picture format of the verification picture according to all the randomly selected generation rules;
    根据所述随机数量以及所述图片格式中所述图片位置的数量确定各所述待识别字符与所述图片位置的对应关系;Determining the correspondence between each of the characters to be recognized and the picture position according to the random number and the number of the picture positions in the picture format;
    获取可供生成所述验证图片的图片区域范围;Obtaining a picture area range available for generating the verification picture;
    按照所述图片格式在所述图片区域范围内生成包含所有所述待识别字符的所述验证图片,且所述验证图片中的每一个所述待识别字符均按照各所述待识别字符与所述图片位置的对应关系被放置于所述验证图片中的各所述图片位置中。The verification picture including all the characters to be recognized is generated within the picture area according to the picture format, and each of the characters to be recognized in the verification picture is based on the characters to be recognized and all the characters. The corresponding relationship of the picture positions is placed in each of the picture positions in the verification picture.
  18. 如权利要求16所述的非易失性可读存储介质,其特征在于,所述将预设的展示框偏移至所述展示队列中选取顺序最先的所述图片位置之前,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:The non-volatile readable storage medium according to claim 16, wherein the computer shifts the preset display frame to before the first picture position in the selection sequence in the display queue. When the readable instructions are executed by one or more processors, the one or more processors further execute the following steps:
    在所述图片区域范围内设立坐标系,并确定每一个所述图片位置在所述坐标系中的坐标值;Establish a coordinate system within the picture area, and determine the coordinate value of each picture position in the coordinate system;
    根据各所述坐标值,确定层叠样式表中的所述展示框在各所述图片位置之间偏移的偏移量;Determine, according to each of the coordinate values, the offset of the display frame in the cascading style sheet between each of the picture positions;
    根据所述展示框在各所述图片位置之间偏移的所述偏移量,将所述展示框偏移至所述展示队列中所述选取顺序最先的所述图片位置。According to the offset of the display frame between each of the picture positions, the display frame is shifted to the picture position that is the first in the selection order in the display queue.
  19. 如权利要求16所述的非易失性可读存储介质,其特征在于,所述接收用户针对所述展示框中展示的所述图像内容输入的验证字符之后,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:The non-volatile readable storage medium according to claim 16, wherein after receiving the verification characters input by the user for the image content displayed in the display frame, the computer readable instruction is When executed by the one or more processors, the one or more processors further execute the following steps:
    获取所述展示框中展示所述图片位置对应的所述图像内容的第一时间,以及所述用户针对所述展示框中展示的所述图像内容输入所述验证字符的第二时间;Acquiring the first time when the image content corresponding to the picture position is displayed in the display box, and the second time when the user inputs the verification character for the image content displayed in the display box;
    判断所述第二时间与所述第一时间之间的时间差值是否大于预设的时间阈值;Determine whether the time difference between the second time and the first time is greater than a preset time threshold;
    若所述时间差值大于所述预设的时间阈值,则确定所述用户输入的与所述第二时间对应的所述验证字符无效,并提示所述用户已超时;If the time difference is greater than the preset time threshold, determining that the verification character corresponding to the second time input by the user is invalid, and prompting the user that the time has expired;
    获取自接收到所述验证请求之后所述用户输入的所述验证字符无效的次数,并判断所述验证字符无效的次数是否大于预设的无效次数阈值;Acquiring the number of invalid verification characters input by the user after receiving the verification request, and determining whether the number of invalid verification characters is greater than a preset invalid number threshold;
    若所述验证字符无效的次数大于所述预设的无效次数阈值,则在预设时长内禁止通过与所述用户对应的网际协议地址输入所述验证字符。If the number of times the verification character is invalid is greater than the preset threshold of the number of invalid times, it is forbidden to input the verification character through the Internet Protocol address corresponding to the user within the preset time period.
  20. 如权利要求16所述的非易失性可读存储介质,其特征在于,所述将字符验证成功次数加一之后,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:The non-volatile readable storage medium of claim 16, wherein after the number of successful character verifications is increased by one, when the computer-readable instruction is executed by one or more processors, the One or more processors also perform the following steps:
    获取所述验证图片中的所述图片位置的数量;Acquiring the number of the picture positions in the verification picture;
    在所述字符验证成功次数小于所述预设的验证次数阈值时,则判断所述字符验证成功次数是否达到所述图片位置的数量;When the number of successful character verifications is less than the preset verification times threshold, determining whether the number of successful character verifications reaches the number of picture positions;
    若所述字符验证成功次数达到所述图片位置的数量,则继续从所述自预设字符库中根据所述预设的选取规则选取所述随机数量的所述待识别字符,并根据所述随机数量的所述待识别字符生成所述验证图片;If the number of successful character verifications reaches the number of positions in the picture, continue to select the random number of the characters to be recognized from the self-preset character library according to the preset selection rule, and according to the Generating the verification picture with a random number of the characters to be recognized;
    若所述字符验证成功次数未达到所述图片位置的数量,则继续将所述预设的展示框偏移至所述展示队列中所述选取顺序最先的所述图片位置。If the number of successful character verifications does not reach the number of picture positions, continue to shift the preset display frame to the picture position first in the selection order in the display queue.
PCT/CN2019/116433 2019-07-11 2019-11-08 Dynamic verification method and apparatus, and computer device and storage medium WO2021003916A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910625910.1 2019-07-11
CN201910625910.1A CN110472386B (en) 2019-07-11 2019-07-11 Dynamic verification method, dynamic verification device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2021003916A1 true WO2021003916A1 (en) 2021-01-14

Family

ID=68507986

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/116433 WO2021003916A1 (en) 2019-07-11 2019-11-08 Dynamic verification method and apparatus, and computer device and storage medium

Country Status (2)

Country Link
CN (1) CN110472386B (en)
WO (1) WO2021003916A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111953647B (en) * 2020-06-22 2022-09-27 北京百度网讯科技有限公司 Security verification method and device, electronic equipment and storage medium
CN111953850B (en) * 2020-08-21 2021-05-14 上海市刑事科学技术研究院 Non-real person incoming call identification method and device
CN116798153B (en) * 2023-06-13 2024-02-27 浙江德塔森特数据技术有限公司 Access control authorization opening method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7624277B1 (en) * 2003-02-25 2009-11-24 Microsoft Corporation Content alteration for prevention of unauthorized scripts
CN104298912A (en) * 2013-07-15 2015-01-21 深圳市腾讯计算机系统有限公司 Methods and devices of implementing and generating crack-resistant identifying code
CN105471808A (en) * 2014-05-28 2016-04-06 北京搜狗科技发展有限公司 Identifying code generating method, safety identification method, safety identification device and safety identification system
CN105787340A (en) * 2016-03-18 2016-07-20 厦门大学嘉庚学院 Image identifying code achievement method based on text adhesion and visual compensation
CN107463830A (en) * 2017-07-07 2017-12-12 北京人亩田网络科技有限公司 The generation method and device and verification method and device of identifying code

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7624277B1 (en) * 2003-02-25 2009-11-24 Microsoft Corporation Content alteration for prevention of unauthorized scripts
CN104298912A (en) * 2013-07-15 2015-01-21 深圳市腾讯计算机系统有限公司 Methods and devices of implementing and generating crack-resistant identifying code
CN105471808A (en) * 2014-05-28 2016-04-06 北京搜狗科技发展有限公司 Identifying code generating method, safety identification method, safety identification device and safety identification system
CN105787340A (en) * 2016-03-18 2016-07-20 厦门大学嘉庚学院 Image identifying code achievement method based on text adhesion and visual compensation
CN107463830A (en) * 2017-07-07 2017-12-12 北京人亩田网络科技有限公司 The generation method and device and verification method and device of identifying code

Also Published As

Publication number Publication date
CN110472386A (en) 2019-11-19
CN110472386B (en) 2024-02-27

Similar Documents

Publication Publication Date Title
WO2021003916A1 (en) Dynamic verification method and apparatus, and computer device and storage medium
US9680836B2 (en) Generation of a visually obfuscated representation of an alphanumeric message that indicates availability of a proposed identifier
Stobert et al. Exploring usability effects of increasing security in click-based graphical passwords
EP2892198B1 (en) Detecting and breaking captcha automation scripts and preventing image scraping
US20120222100A1 (en) Advanced captcha using integrated images
US20150309724A1 (en) Method and apparatus for setting keyboard
US20120272311A1 (en) Method for authenticating a user on a computing unit
CN109375972B (en) Method, apparatus, computer device and storage medium for multi-element layout
US20180114003A1 (en) Authentication Device, Authentication Method, and Electronic Device That Reduce Password Peeking by Third Person
US10078626B1 (en) Automated layout testing of content
US20150281215A1 (en) Method of Dynamically Adapting a Graphical Password Sequence by Executing Computer-Executable Instructions Stored On a Non-Transitory Computer-Readable Medium
EP3312751B1 (en) Systems and methods for generating multi-dimensional password and authenticating thereof
KR102273093B1 (en) Method of inputting confidential data on a terminal
US20170039361A1 (en) Method And Device For Fuzzily Inputting Password
EP3189472A1 (en) Managing registration of user identity using handwriting
CN110634095B (en) Watermark adding method, watermark identifying device and electronic equipment
CN104468486A (en) Information processing method and system and electronic device
US9710637B2 (en) Unicode-based image generation and testing
US10127376B1 (en) Graphical password generation
CN104125234A (en) Method and system for dynamic image security verification
US11238149B2 (en) Computerized user authentication method that utilizes the Cartesian coordinate system to verify a user's identity
US20170061113A1 (en) Unicode-based image generation and testing
CN108388463B (en) Icon processing method and device, computer equipment and storage medium
JP5045317B2 (en) User authentication system
CN105607906B (en) A kind of service implementation method, device and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19937321

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 11/05/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19937321

Country of ref document: EP

Kind code of ref document: A1