CN115758298A - Verification code verification method and device, electronic equipment and medium - Google Patents

Verification code verification method and device, electronic equipment and medium Download PDF

Info

Publication number
CN115758298A
CN115758298A CN202211424348.4A CN202211424348A CN115758298A CN 115758298 A CN115758298 A CN 115758298A CN 202211424348 A CN202211424348 A CN 202211424348A CN 115758298 A CN115758298 A CN 115758298A
Authority
CN
China
Prior art keywords
character
verification code
input
target
verification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211424348.4A
Other languages
Chinese (zh)
Inventor
李正操
汪骏
董红荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beidou Xingtong Zhilian Technology Nanjing Co ltd
BDstar Intelligent and Connected Vehicle Technology Co Ltd
Original Assignee
BDstar Intelligent and Connected Vehicle Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BDstar Intelligent and Connected Vehicle Technology Co Ltd filed Critical BDstar Intelligent and Connected Vehicle Technology Co Ltd
Priority to CN202211424348.4A priority Critical patent/CN115758298A/en
Publication of CN115758298A publication Critical patent/CN115758298A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Input From Keyboards Or The Like (AREA)

Abstract

The application provides a verification code verification method, a verification code verification device, electronic equipment and a medium, wherein the method comprises the following steps: when each character is input in a verification code input control of the target page based on the target verification code, judging whether the character is matched with a preset character check rule; if so, generating first prompt information; when an input verification code in the verification code input control is submitted, determining a second matching result of each character in the input verification code based on a pre-configured alignment check rule, and judging whether the input verification code is consistent with a target verification code according to the second matching result of each character; if not, determining the error reason of the input verification code, generating second prompt information according to the error reason, and prompting the details of the verification error when the verification fails, so that the scope of the re-input verification is reduced, and the probability of the re-verification failure is reduced.

Description

Verification code verification method and device, electronic equipment and medium
Technical Field
The present application relates to the field, and in particular, to a verification code verification method, apparatus, electronic device, and medium.
Background
Currently, when a user using a terminal device such as a mobile phone or a computer registers or logs in through a page, a verification code is often displayed on a current registration or login website, or a short message containing the verification code is sent to the user terminal device; the user needs to input the verification code into the input control of the page to verify the verification code, and the page executes the verification operation according to the verification code, so as to enter the page to complete the registration or login process. Alternatively, verification of the file is often required by means of an authentication code.
However, when the user fills in the verification code, the user is difficult to avoid making mistakes, which results in the failure of verification and failure of login or registration. After the verification fails, generally only prompting the user that the verification fails and asking for retrying; the user does not know what the error reason is, whether the error is partially correct or not, and the same error can still be made when the verification code is input again, so that the user experience is influenced.
Disclosure of Invention
In view of this, an object of the present application is to provide a verification code verification method, apparatus, electronic device, and medium, which prompt details of a verification error when verification fails, reduce a range of re-input verification, and reduce a probability of re-verification failure.
The verification code checking method provided by the embodiment of the application runs on the terminal equipment, the terminal equipment runs on a target page, and a verification code input control is displayed on the target page; the method comprises the following steps:
when each character is input in a verification code input control of the target page based on the target verification code, judging whether the character is matched with a preset character check rule;
if so, generating first prompt information, and displaying the first prompt information on the target page;
when an input verification code in the verification code input control is submitted, determining a second matching result of each character in the input verification code based on a pre-configured alignment check rule, and judging whether the input verification code is consistent with a target verification code according to the second matching result of each character;
if not, determining an error reason of the input verification code according to a second matching result of each character in the input verification code, generating second prompt information according to the error reason, and displaying the second prompt information on the target page.
In some embodiments, in the verification method, it is determined whether the character matches a pre-configured character verification rule; the method comprises the following steps:
when the target verification code is the unrepeatable verification code, after the character is input, judging whether the character in the verification code input control is repeated or not, and determining the length of a first character in the verification code input control;
if the character is repeated and/or the first character length is equal to the first preset character length, the character is matched with a preset character check rule;
or when the target verification code is a repeatable verification code, determining the length of a second character in the verification code input control after the character is input;
and if the second character length is equal to a second preset character length, matching the character with a preset character check rule.
In some embodiments, in the verification method for verification codes, the non-repeatable verification codes include a plurality of types, and the first preset characters corresponding to different types of non-repeatable verification codes are different in length; the types of the unrepeatable verification codes comprise digital verification codes, letter verification codes and alphanumeric verification codes;
the repeatable verification codes comprise a plurality of types, and the lengths of second preset characters corresponding to different types of repeatable verification codes are different; wherein the repeatable verification code comprises a digital verification code, an alphabetic verification code and an alphanumeric verification code.
In some embodiments, in the verification method for verification of an authentication code, the generating a first prompt message includes:
determining a first matching result of the character and the character checking rule according to a pre-configured character checking rule; the first matching result is character repetition or maximum length of input characters;
and generating first prompt information according to the first matching result.
In some embodiments, in the verification method for the verification code, a second matching result of each character in the input verification code is determined based on a pre-configured alignment verification rule, and whether the input verification code is consistent with the target verification code is judged according to the second matching result of each character; the method comprises the following steps:
matching each character in the input verification code with at least partial character in the target verification code based on a preset alignment check rule to obtain a second matching result of each character in the input verification code; the second matching result is at least one of: characters at the same position are consistent, characters at different positions are consistent, and the characters do not exist;
and judging whether the input verification code is consistent with the target verification code or not according to the second matching result of each character in the input verification code.
In some embodiments, in the verification method, based on a preconfigured alignment verification rule, each character in an input verification code is matched with at least part of characters in a target verification code, so as to obtain a second matching result of each character in the input verification code; the method comprises the following steps:
when the target verification code is the unrepeatable verification code, matching target characters in the input verification code with characters at least at partial positions in the target verification code;
if the target character in the input verification code is consistent with the character at the same position in the target verification code, determining that the second matching result of the target character is consistent with the character at the same position;
if the target character in the input verification code is consistent with the characters at different positions in the target verification code, the second matching result of the target character is considered to be that the characters at different positions are consistent;
and if the target character in the input verification code is inconsistent with all characters in the target verification code, determining that the character of the second matching result of the target character does not exist.
In some embodiments, in the verification code verification method, based on a pre-configured alignment verification rule, each character in an input verification code is matched with at least part of characters in a target verification code, so as to obtain a second matching result of each character in the input verification code;
when the target verification code is a repeatable verification code, matching target characters in the input verification code with characters to be aligned in the target verification code in sequence;
if the target character in the input verification code is consistent with the character to be aligned at the same position in the target verification code, determining that a second matching result of the target character is consistent with the character at the same position;
if the target character in the input verification code is consistent with the character to be aligned at different positions in the target verification code, the second matching result of the target character is considered to be that the characters at different positions are consistent;
if the target character in the input verification code is inconsistent with all characters to be aligned in the target verification code, determining that the character of the second matching result of the target character does not exist;
and after the matching result of the target character is determined, taking the character to be aligned corresponding to the second matching result with the same position character and the same different position character as the aligned character, and updating the character to be aligned in the target verification code.
In some embodiments, a verification code checking apparatus is further provided, and is operated in a terminal device, the terminal device operates a target page, and a verification code input control is displayed on the target page; the device comprises:
the first judgment module is used for judging whether each character is matched with a preset character check rule or not when each character is input in the verification code input control of the target page based on the target verification code;
the first generation module is used for generating first prompt information when the character is judged to be matched with a pre-configured character check rule, and displaying the first prompt information on a target page;
the second judgment module is used for determining a second matching result of each character in the input verification code based on a preset alignment check rule when the input verification code in the verification code input control is submitted, and judging whether the input verification code is consistent with the target verification code according to the second matching result of each character;
and the second generation module is used for determining the error reason of the input verification code according to the second matching result of each character in the input verification code when the input verification code is inconsistent with the target verification code, generating second prompt information according to the error reason, and displaying the second prompt information on the target page.
In some embodiments, there is also provided an electronic device comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is operating, the machine-readable instructions being executable by the processor to perform the steps of the captcha checking method.
In some embodiments, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, performs the steps of the authentication code verification method.
Based on the above, the application provides a verification code checking method, a verification code checking device, an electronic device and a medium, wherein when each character is input in a verification code input control of a target page, the method judges whether the character is matched with a pre-configured character checking rule, if the character is wrong, first prompt information is generated, and the first prompt information is displayed on the target page, so that one-time checking is performed in the character input process, a user can timely perceive an input error and timely correct the input error, the probability of the verification code input error is reduced, and the probability of verification failure is reduced; when all characters of the verification code are input and the input verification code in the verification code input control is submitted, the matching result of each character in the input verification code is determined based on a preset alignment check rule, whether the input verification code is consistent with the target verification code is judged according to the matching result of each character, if the input verification code is not consistent with the target verification code, the matching result is completely determined to determine an error reason, second prompt information is generated according to the error reason, and the second prompt information is displayed on a target page, so that specific prompt information is provided for users, the verification effect is diversified, users who frequently fail verification without any feeling have a traceable input mode, the use experience of the users is improved, and the frequency of failure verification is reduced.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a flowchart illustrating a method of verifying a verification code according to an embodiment of the present application;
fig. 2 is a flowchart illustrating a method for determining whether the character matches a pre-configured character check rule according to an embodiment of the present application;
fig. 3 is a flowchart illustrating another method for determining whether the character matches a pre-configured character check rule according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating a method for generating first prompt information according to an embodiment of the present application;
FIG. 5 is a flowchart illustrating a method for determining whether an input verification code and a target verification code are consistent according to a second matching result of each character according to an embodiment of the present application;
FIG. 6 is a flowchart illustrating a method for obtaining a second matching result for each character in an input validation code according to an embodiment of the present application;
FIG. 7 is a flowchart illustrating an alternative method for obtaining a second match result for each character of an input authentication code according to an embodiment of the present application;
fig. 8 is a schematic structural diagram illustrating an authentication code verification apparatus according to an embodiment of the present application;
fig. 9 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. In addition, one skilled in the art, under the guidance of the present disclosure, may add one or more other operations to the flowchart, or may remove one or more operations from the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
Currently, when a user using a terminal device such as a mobile phone or a computer registers or logs in through a page, a verification code is often displayed on a current registration or login website, or a short message containing the verification code is sent to the user terminal device; the user needs to input the verification code into the input control of the page to verify the verification code, and the page executes the verification operation according to the verification code, so as to enter the page to complete the registration or login process. Alternatively, verification of the file is often required by means of an authentication code.
However, when the user fills in the verification code, the user is difficult to avoid making mistakes, which results in the failure of verification and failure of login or registration. After the verification fails, generally only prompting the user that the verification fails and asking for reattempting; the user does not know what the cause of the error is, whether there is a partial error, and the same error may still be made when the verification code is entered again. After the user fails to verify, the user usually thinks that the user has a small hint about how much the user wants, and at least knows whether the input information is partially correct, so that the range of inputting the verification code again can be reduced, and the probability of failure of the verification again is reduced.
Based on this, the application provides a verification code checking method, a verification code checking device, electronic equipment and a medium, when each character is input in a verification code input control of a target page, the method judges whether the character is matched with a preset character checking rule, if the character is wrong, first prompt information is generated, and the first prompt information is displayed on the target page, so that one-time checking is performed in the character input process, a user can conveniently detect the input error in time and correct the input error in time, the probability of the input error of the verification code is reduced, and the probability of verification failure is reduced; when all characters of the verification code are input and the input verification code in the verification code input control is submitted, the matching result of each character in the input verification code is determined based on a preset alignment check rule, whether the input verification code is consistent with the target verification code is judged according to the matching result of each character, if the input verification code is not consistent with the target verification code, the matching result is completely determined to determine an error reason, second prompt information is generated according to the error reason, and the second prompt information is displayed on a target page, so that specific prompt information is provided for users, the verification effect is diversified, users who frequently fail verification without any feeling have a traceable input mode, the use experience of the users is improved, and the frequency of failure verification is reduced.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for verifying a verification code according to an embodiment of the present application; as shown in fig. 1, the verification code verification method is executed in a terminal device, the terminal device executes a target page, and a verification code input control is displayed on the target page; the method comprises the following steps S101-S104;
s101, when each character is input in a verification code input control of the target page based on a target verification code, judging whether the character is matched with a preset character check rule;
s102, if yes, generating first prompt information, and displaying the first prompt information on a target page;
s103, when the input verification code in the verification code input control is submitted, determining a second matching result of each character in the input verification code based on a preset alignment check rule, and judging whether the input verification code is consistent with the target verification code according to the second matching result of each character;
and S104, if not, determining the error reason of the input verification code according to the second matching result of each character in the input verification code, generating second prompt information according to the error reason, and displaying the second prompt information on the target page.
In the embodiment of the application, the verification code verification method can be operated on terminal equipment or a server; the terminal device may be a local terminal device, and when the verification code verification method runs on the server, the verification code verification method may be implemented and executed based on a cloud interaction system, where the cloud interaction system at least includes the server and the client device (that is, the terminal device).
Specifically, for example, when the verification code verification method is applied to the terminal device, the verification code verification method is used for displaying the first prompt information when the input of the characters is wrong according to the detection result, detecting the error reason of the input verification code when the input verification code is submitted, displaying the second prompt information, and giving a more detailed prompt to the user.
In the step S101, when each character is input in the verification code input control of the target page based on the target verification code, it is determined whether the character matches a pre-configured character check rule.
When a character is input in the verification code input control of the target page, judging whether the character is matched with a preset character check rule, and if the character is wrong, displaying first prompt information; if the input character is correct, the first prompt message is not displayed, and the user continues to input the next character; when a user inputs a next character, judging whether the character is matched with a preset character check rule; and detecting whether the last character is wrong or not until the user inputs the last character.
The user inputs each character in the verification code input control of the target page based on the target verification code; the target verification code may be displayed on a target page, or may be sent to the terminal device of the user in advance, for example, sent to the mobile phone of the user in advance.
And aiming at the difficulty degree of the check rule, the target verification code comprises a non-repeatable verification code and a repeatable verification code. The characters in the non-repeatable verification code, namely the verification code, can not be repeated, and the characters in the repeatable verification code, namely the verification code, can be repeated.
Referring to fig. 2, the determination of whether the character matches a pre-configured character check rule is described; comprising the following steps S201-S202;
s201, when the target verification code is the unrepeatable verification code, after the character is input, judging whether the character in the verification code input control is repeated, and determining the length of a first character in the verification code input control;
s202, if the character is repeated and/or the first character length is equal to the first preset character length, the character is matched with a preset character checking rule.
Alternatively, referring to fig. 3, the step of determining whether the character matches a pre-configured character check rule includes the following steps S301 to S302;
s301, when the target verification code is a repeatable verification code, after the character is input, determining the length of a second character in the verification code input control;
s302, if the second character length is equal to a second preset character length, the character is matched with a preset character checking rule.
In the embodiment of the application, the non-repeatable verification codes comprise a plurality of types, and the lengths of first preset characters corresponding to different types of non-repeatable verification codes are different; the types of the unrepeatable verification codes comprise digital verification codes, letter verification codes and alphanumeric verification codes;
the repeatable verification codes comprise a plurality of types, and the lengths of second preset characters corresponding to different types of repeatable verification codes are different; wherein the type of the repeatable verification code comprises a digital verification code, an alphabetic verification code and an alphanumeric verification code.
The digital verification code is a pure-number verification code, the letter verification code is a pure-letter verification code, and the alphanumeric mixed verification code is a verification code with both letters and numbers.
Illustratively, the overrun length of different types of captchas is described below, and here some special characters (emoticons, punctuation marks, etc.) are not involved, but only numbers (0-9) and letters (A-Z ).
Specifically, for the unrepeatable digital verification code, when verification input is performed, input is required to be pure numbers and unrepeatable, the maximum value of the input length is ten bits, and the length of the first preset character is 10; that is, the inputted character length ranges (0, 10%).
For the unrepeatable alphanumeric verification code, when verification input is carried out, pure letters are required to be input and unrepeatable, if case and case are distinguished, the maximum value of the input length is 52 bits, and the length of a first preset character is 52; that is, the input character length range is (0, 52), if case-by-case, it is stated that the maximum input length is 26 bits, and the first preset character length is 26, that is, the input character length range is (0, 26).
For the unrepeatable letter verification code, when verification input is carried out, the input is required to be pure letters and is unrepeatable, if case and case are distinguished, the maximum value of the input length is 52 bits, and the length of a first preset character is 52; that is, the input character length range is (0, 52]; if case is not distinguished, the input length is 26 bits at the maximum, and the first preset character length is 26; that is, the input character length range is (0, 26).
For unrepeatable alphanumeric mixed verification codes, during verification input, if case and case are distinguished, the maximum value of the input length is 62 bits, and the length of a first preset character is 62 bits; that is, the input character length range is (0, 62), if case-by-case, it is stated that the maximum input length is 36 bits, and the first preset character length is 36, that is, the input character length range is (0, 36).
For the repeatable verification code, when the verification input is carried out, the input is required to be numbers or letters or a combination of the letters and the numbers, and because the repeatable verification code is repeatable, the default condition is that no length limit is provided, and a maximum limit length can be specified at the moment, and the value is reasonable. For example, a second predetermined character length of 20 for a purely numerically repeatable validation code and 70 for an alphanumeric repeatable validation code is set.
Here, the first preset character length and the second preset character length may also be set according to the usage scenario, for example, if the target verification code in the target page has a length of 4 for a specific target page, the first preset character length is set to be 4, or the second preset character length is set to be 4.
In the step S102, if yes, a first prompt message is generated, and the first prompt message is displayed on the target page.
That is, when an input character error is detected, the first prompt information is presented on the target page. Or when the input characters are detected not to match the pre-configured character check rules, displaying the first prompt information on the target page.
Specifically, referring to fig. 4, the generating the first prompt message includes the following steps S401 to S402;
s401, determining a first matching result of the character and the character checking rule according to a pre-configured character checking rule; the first matching result is character repetition or maximum length of input characters;
s402, generating first prompt information according to the first matching result.
Here, since the character check rule verifies whether the currently input character is repeated with the previously input character and whether the length of all characters already input after the character is input exceeds the limit for the unrepeatable verification code; aiming at the repeatable verification code, the character verification rule verifies whether the length of all the input characters exceeds the limit after the characters are input; therefore, the character error is due to character repetition or the reaching of the maximum length of the input character.
In the embodiment of the application, after the first prompt message is generated, the user is not allowed to input the next character in the verification code input control; when the user modifies the currently input character and passes the character verification, the user is allowed to input the next character in the verification code input control.
For example, for the non-repeatable verification code, when the input number or letter is input before, the user is not allowed to input the next character again, and a first prompt message is generated to prompt the user to: if the input characters can not be repeated, please re-input; when the length of the input character reaches the limited maximum length, generating a first prompt message to prompt the user to: the length of the input has reached a maximum value and cannot be input again.
Illustratively, for repeatable validation codes, when the length of the entered character reaches a defined maximum length, a first prompt is generated to prompt the user to: the length of the input has reached a maximum value and cannot be input again.
In the step S103, a second matching result of each character in the input verification code is determined based on the pre-configured alignment check rule, and whether the input verification code and the target verification code are consistent is determined according to the second matching result of each character
Referring to fig. 5, a second matching result of each character in the input verification code is determined based on a pre-configured alignment check rule, and whether the input verification code is consistent with the target verification code is determined according to the second matching result of each character; comprises the following steps S501-S502;
s501, matching each character in the input verification code with at least partial characters in the target verification code based on a preset alignment check rule to obtain a second matching result of each character in the input verification code; the second matching result is at least one of: characters at the same position are consistent, characters at different positions are consistent, and the characters do not exist;
s502, judging whether the input verification code is consistent with the target verification code according to a second matching result of each character in the input verification code.
In the embodiment of the present application, specifically, referring to fig. 6, based on a preconfigured alignment check rule, matching each character in an input verification code with at least part of characters in a target verification code to obtain a second matching result of each character in the input verification code; includes the following steps S601-S604;
s601, when the target verification code is the unrepeatable verification code, matching target characters in the input verification code with characters at least at part of positions in the target verification code;
s602, if the target character in the input verification code is consistent with the character at the same position in the target verification code, determining that the second matching result of the target character is consistent with the character at the same position;
s603, if the target characters in the input verification code are consistent with the characters at different positions in the target verification code, considering that the second matching result of the target characters is consistent with the characters at different positions;
s604, if the target characters in the input verification code are inconsistent with all the characters in the target verification code, determining that the characters of the second matching result of the target characters do not exist.
That is, for the unrepeatable verification code, only the alignment relationship between the characters in the target verification code and the input characters needs to be considered at this time because the characters confirmed to be verified are unrepeatable;
there are three alignment check rules: firstly, the method comprises the following steps: two characters in the same position are consistent, and then the two characters are considered to be aligned; secondly, the method comprises the following steps: if two characters at different positions are consistent, the character is considered to exist, and the positions are not aligned; thirdly, the method comprises the following steps: when the input character does not exist, the input character is not related to the actual character.
When the characters of the input verification code are completely correct, the user can directly enter the verification code without any prompt.
In step S104, an error reason of the input verification code is determined according to the second matching result of each character in the input verification code, and second prompt information is generated according to the error reason.
Here, the second prompt information is generated according to the error cause, and does not necessarily directly include the error cause, and may prompt, for example, whether a partial character is correct, a partial character is incorrect, and the type of error is that a character does not exist, or that a character exists but a position is not correct.
Illustratively, the target verification code is "36Az", the input verification code is "26zB", and then the second matching result of characters 2 and B is that no character exists; the second match for character 6 is: the characters at the same position are consistent; the second match result for character Z is: characters at different positions are consistent;
the second prompt message is: "input has 2 characters and 1 correctly positioned".
The target verification code is '36 Az', the input verification code is '124B', and the result of four characters
The prompt information is as follows: "0 characters exist for input".
Referring to fig. 7, in the verification method for verification codes, based on a pre-configured alignment verification rule, each character in an input verification code is matched with at least part of characters in a target verification code to obtain a second matching result of each character in the input verification code, including the following steps S701 to S705;
s701, when the target verification code is a repeatable verification code, matching target characters in the input verification code with characters to be aligned in the target verification code according to a sequence;
s702, if the target character in the input verification code is consistent with the character to be aligned at the same position in the target verification code, determining that the second matching result of the target character is the character consistency at the same position;
s703, if the target character in the input verification code is consistent with the character to be aligned at different positions in the target verification code, considering that the second matching result of the target character is consistent with the characters at different positions;
s704, if the target character in the input verification code is inconsistent with all characters to be aligned in the target verification code, determining that the character of the second matching result of the target character does not exist;
s705, after the matching result of the target character is determined, the character to be aligned corresponding to the second matching result with the same position character and the same different position character is used as the aligned character, and the character to be aligned in the target verification code is updated.
For repeatable validation codes, since the characters to be validated are repeatable, the case to be considered here is to adopt the principle of preferential matching with the top position for repeated unaligned characters. The pre-configured alignment check rule comprises the following steps: firstly: two characters in the same position are consistent, and then the two characters are considered to be aligned; secondly, the method comprises the following steps: if the two characters at different positions are consistent, the character is considered to exist, and the positions are not aligned; because the characters are repeated, the characters which exist in an aligned mode (namely the characters with the same position and the same characters at different positions in the second matching result) are removed, a priority principle that the positions are matched in the front is adopted, and the matched characters in the target verification code are not matched any more. Thirdly, the method comprises the following steps: according to the principle of the prior matching of the position, when the input character does not exist or exists but can not be matched, the input character is considered to be nonexistent.
When the input is completely correct, the input is directly carried out without any prompt.
Illustratively, the target verification code is '11 AZ 2', when the input verification code is '11 sA 1', the second matching result of the character '11' is that the characters at the same position are consistent, the '11' in the target verification code is removed, and the character to be aligned is AZ2; a second match result bit character of the character s does not exist; the 4 th character A in the input verification code is matched with the 4 th character A in the target verification code, but the positions of the characters A are different, and the matching result of the 4 th character A in the input verification code is that the characters at different positions are consistent; eliminating 'A' in the target verification code, wherein the character to be aligned is Z2; the 5 th character 1 in the input validation code matches only Z2, and the second match is that no character exists.
Based on this, the second prompt message is: "input has 3 characters and 2 correctly positioned characters".
Here the three characters present in the input validation code are 11A and the correctly positioned character is 11.
When the character text of the target verification code is "11AZ2", and when the character text of the input verification code is "101A1", the second prompt information is: "there are 3 characters of input, 1 correctly located".
The verification method is suitable for the Android platform, and a novel verification mode on the Android platform is realized; besides JAVA language, the patent can also use programming languages such as C and C + +, etc.
Based on the same inventive concept, the embodiment of the present application further provides a verification code verification apparatus corresponding to the verification code verification method, and since the principle of the apparatus in the embodiment of the present application for solving the problem is similar to that of the verification code verification method in the embodiment of the present application, the implementation of the apparatus can refer to the implementation of the method, and repeated details are not described again.
Referring to fig. 8, fig. 8 is a schematic structural diagram illustrating a verification code verification apparatus according to an embodiment of the present application, where the verification code verification apparatus operates in a terminal device, the terminal device operates a target page, and a verification code input control is displayed on the target page; the device comprises:
a first judging module 801, configured to, when each character is input in a verification code input control of the target page based on a target verification code, judge whether the character matches a pre-configured character verification rule;
the first generating module 802 is configured to generate first prompt information when it is determined that the character matches a pre-configured character verification rule, and display the first prompt information on a target page;
a second judging module 803, configured to, when the input verification code in the verification code input control is submitted, determine a second matching result of each character in the input verification code based on a pre-configured alignment check rule, and judge whether the input verification code and the target verification code are consistent according to the second matching result of each character;
the second generating module 804 is configured to, when the input verification code is inconsistent with the target verification code, determine an error reason of the input verification code according to a second matching result of each character in the input verification code, generate second prompt information according to the error reason, and display the second prompt information on the target page.
When each character is input in a verification code input control of a target page, judging whether the character is matched with a preset character verification rule or not, if so, generating first prompt information, and displaying the first prompt information on the target page, so that one-time verification is performed in the character input process, a user can conveniently detect input errors in time and correct the input errors in time, the probability of the input errors of the verification codes is reduced, and the probability of verification failure is reduced; when all characters of the verification code are input and the input verification code in the verification code input control is submitted, the matching result of each character in the input verification code is determined based on a preset alignment check rule, whether the input verification code is consistent with the target verification code is judged according to the matching result of each character, if the input verification code is not consistent with the target verification code, the matching result is judged to determine an error reason, second prompt information is generated according to the error reason, and the second prompt information is displayed on a target page, so that specific prompt information is provided for users, the verification effect is diversified, the users who frequently fail verification without any trouble can have a traceable input mode, the use experience of the users is improved, and the frequency of failure verification is reduced.
In some embodiments, the first determining module in the verification code checking apparatus determines whether the character matches a pre-configured character checking rule; the method is specifically used for:
when the target verification code is the unrepeatable verification code, after the character is input, judging whether the character in the verification code input control is repeated, and determining the length of a first character in the verification code input control;
if the character is repeated and/or the first character length is equal to the first preset character length, the character is matched with a preset character check rule;
or when the target verification code is a repeatable verification code, determining the length of a second character in the verification code input control after the character is input;
and if the second character length is equal to a second preset character length, matching the character with a preset character check rule.
In some embodiments, in the verification code verification apparatus, the non-repeatable verification codes include a plurality of types, and the first preset character lengths corresponding to different types of non-repeatable verification codes are different; the types of the unrepeatable verification codes comprise digital verification codes, letter verification codes and alphanumeric verification codes;
the repeatable verification codes comprise a plurality of types, and the lengths of second preset characters corresponding to different types of repeatable verification codes are different; wherein the type of the repeatable verification code comprises a digital verification code, an alphabetic verification code and an alphanumeric verification code.
In some embodiments, when generating the first prompt information, the first generating module in the verification code verifying apparatus is specifically configured to:
determining a first matching result of the character and the character checking rule according to a pre-configured character checking rule; the first matching result is character repetition or maximum length of input characters;
and generating first prompt information according to the first matching result.
In some embodiments, the second determining module in the verification code checking apparatus is specifically configured to, when determining a second matching result of each character in the input verification code based on a preconfigured alignment checking rule, and determining whether the input verification code and the target verification code are consistent according to the second matching result of each character:
matching each character in the input verification code with at least partial character in the target verification code based on a preset alignment check rule to obtain a second matching result of each character in the input verification code; the second matching result is at least one of: characters at the same position are consistent, characters at different positions are consistent, and the characters do not exist;
and judging whether the input verification code is consistent with the target verification code or not according to the second matching result of each character in the input verification code.
In some embodiments, when, based on a pre-configured alignment check rule, each character in the input verification code is matched with at least a part of characters in the target verification code, and a second matching result of each character in the input verification code is obtained, the second determining module in the verification code verifying apparatus is specifically configured to:
when the target verification code is the unrepeatable verification code, matching target characters in the input verification code with characters at least at partial positions in the target verification code;
if the target character in the input verification code is consistent with the character at the same position in the target verification code, determining that the second matching result of the target character is consistent with the character at the same position;
if the target characters in the input verification code are consistent with the characters at different positions in the target verification code, considering that the second matching result of the target characters is consistent with the characters at different positions;
and if the target characters in the input verification code are inconsistent with all the characters in the target verification code, determining that the characters of the second matching result of the target characters do not exist.
In some embodiments, when, based on a pre-configured alignment check rule, each character in the input verification code is matched with at least a part of characters in the target verification code, and a second matching result of each character in the input verification code is obtained, the second determining module in the verification code verifying apparatus is specifically configured to:
when the target verification code is a repeatable verification code, matching target characters in the input verification code with characters to be aligned in the target verification code in sequence;
if the target character in the input verification code is consistent with the character to be aligned at the same position in the target verification code, determining that a second matching result of the target character is consistent with the character at the same position;
if the target character in the input verification code is consistent with the character to be aligned at different positions in the target verification code, the second matching result of the target character is considered to be that the characters at different positions are consistent;
if the target character in the input verification code is inconsistent with all characters to be aligned in the target verification code, determining that the character of the second matching result of the target character does not exist;
and after the matching result of the target character is determined, taking the character to be aligned corresponding to the second matching result with the same position character and the same different position character as the aligned character, and updating the character to be aligned in the target verification code.
Based on the same inventive concept, the embodiment of the present application further provides an electronic device corresponding to the verification code checking method, and as the principle of solving the problem of the electronic device in the embodiment of the present application is similar to that of the verification code checking method in the embodiment of the present application, the implementation of the electronic device may refer to the implementation of the method, and repeated details are not repeated.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device 900 includes: a processor 901, a memory 902 and a bus, wherein the memory 902 stores machine-readable instructions executable by the processor 901, the processor 901 and the memory 902 communicate via the bus when the electronic device 900 is running, and the machine-readable instructions, when executed by the processor 901, perform the steps of the captcha verification method.
Based on the same inventive concept, a computer-readable storage medium corresponding to the verification code verification method is also provided in the embodiments of the present application, and since the principle of solving the problem of the computer-readable storage medium in the embodiments of the present application is similar to that of the verification code verification method described above in the embodiments of the present application, the implementation of the computer-readable storage medium may refer to the implementation of the method, and repeated parts are not described again.
A computer-readable storage medium, having stored thereon a computer program for executing the steps of the captcha checking method when executed by a processor.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to corresponding processes in the method embodiments, and are not described in detail in this application. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and there may be other divisions in actual implementation, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solutions of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a platform server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A verification code checking method is characterized by running in terminal equipment, wherein the terminal equipment runs a target page, and a verification code input control is displayed on the target page; the method comprises the following steps:
when each character is input in a verification code input control of the target page based on the target verification code, judging whether the character is matched with a pre-configured character verification rule or not;
if so, generating first prompt information, and displaying the first prompt information on the target page;
when the input verification code in the verification code input control is submitted, determining a second matching result of each character in the input verification code based on a preset alignment check rule, and judging whether the input verification code is consistent with the target verification code according to the second matching result of each character;
if not, determining an error reason of the input verification code according to a second matching result of each character in the input verification code, generating second prompt information according to the error reason, and displaying the second prompt information on the target page.
2. The verification method of claim 1, wherein determining whether the character matches a pre-configured character verification rule; the method comprises the following steps:
when the target verification code is the unrepeatable verification code, after the character is input, judging whether the character in the verification code input control is repeated, and determining the length of a first character in the verification code input control;
if the character is repeated and/or the first character length is equal to the first preset character length, the character is matched with a pre-configured character checking rule;
or when the target verification code is a repeatable verification code, determining the length of a second character in the verification code input control after the character is input;
and if the second character length is equal to a second preset character length, matching the character with a preset character check rule.
3. The verification method of claim 2, wherein the non-repeatable verification codes comprise a plurality of types, and the first preset character lengths corresponding to different types of non-repeatable verification codes are different; the types of the unrepeatable verification codes comprise digital verification codes, letter verification codes and alphanumeric verification codes;
the repeatable verification codes comprise a plurality of types, and the lengths of second preset characters corresponding to different types of repeatable verification codes are different; wherein the type of the repeatable verification code comprises a digital verification code, an alphabetic verification code and an alphanumeric verification code.
4. The verification method of claim 2, wherein the generating the first prompt message comprises:
determining a first matching result of the character and the character checking rule according to a pre-configured character checking rule; the first matching result is character repetition or maximum length of input characters;
and generating first prompt information according to the first matching result.
5. The verification method of claim 1, wherein a second matching result of each character in the input verification code is determined based on a pre-configured alignment verification rule, and whether the input verification code is consistent with the target verification code is judged according to the second matching result of each character; the method comprises the following steps:
matching each character in the input verification code with at least partial character in the target verification code based on a preset alignment check rule to obtain a second matching result of each character in the input verification code; the second matching result is at least one of: characters at the same position are consistent, characters at different positions are consistent, and the characters do not exist;
and judging whether the input verification code is consistent with the target verification code or not according to the second matching result of each character in the input verification code.
6. The verification method of claim 5, wherein based on a pre-configured alignment verification rule, each character in the input verification code is matched with at least partial character in the target verification code to obtain a second matching result of each character in the input verification code; the method comprises the following steps:
when the target verification code is the unrepeatable verification code, matching target characters in the input verification code with characters at least at partial positions in the target verification code;
if the target character in the input verification code is consistent with the character at the same position in the target verification code, determining that the second matching result of the target character is consistent with the character at the same position;
if the target character in the input verification code is consistent with the characters at different positions in the target verification code, the second matching result of the target character is considered to be that the characters at different positions are consistent;
and if the target character in the input verification code is inconsistent with all characters in the target verification code, determining that the character of the second matching result of the target character does not exist.
7. The verification method of claim 5, wherein each character in the input verification code is matched with at least partial position characters in the target verification code based on a pre-configured alignment verification rule to obtain a second matching result of each character in the input verification code;
when the target verification code is a repeatable verification code, matching target characters in the input verification code with characters to be aligned in the target verification code in sequence;
if the target character in the input verification code is consistent with the character to be aligned at the same position in the target verification code, determining that a second matching result of the target character is consistent with the character at the same position;
if the target character in the input verification code is consistent with the character to be aligned at different positions in the target verification code, considering that the second matching result of the target character is consistent with the characters at different positions;
if the target character in the input verification code is inconsistent with all characters to be aligned in the target verification code, determining that the character of the second matching result of the target character does not exist;
and after the matching result of the target character is determined, taking the character to be aligned corresponding to the second matching result with the same position character and the same different position character as the aligned character, and updating the character to be aligned in the target verification code.
8. A verification code checking device is characterized by running in a terminal device, wherein the terminal device runs a target page, and a verification code input control is displayed on the target page; the device comprises:
the first judgment module is used for judging whether each character is matched with a preset character check rule or not when each character is input in the verification code input control of the target page based on the target verification code;
the first generation module is used for generating first prompt information when the character is judged to be matched with a pre-configured character check rule, and displaying the first prompt information on a target page;
the second judgment module is used for determining a second matching result of each character in the input verification code based on a preset alignment check rule when the input verification code in the verification code input control is submitted, and judging whether the input verification code is consistent with the target verification code according to the second matching result of each character;
and the second generation module is used for determining the error reason of the input verification code according to the second matching result of each character in the input verification code when the input verification code is inconsistent with the target verification code, generating second prompt information according to the error reason, and displaying the second prompt information on the target page.
9. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when the electronic device is in operation, the machine-readable instructions, when executed by the processor, performing the steps of the captcha verification method of any of claims 1 to 7.
10. A computer-readable storage medium, having stored thereon a computer program for performing the steps of the authentication code verification method according to any one of claims 1 to 7 when executed by a processor.
CN202211424348.4A 2022-11-14 2022-11-14 Verification code verification method and device, electronic equipment and medium Pending CN115758298A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211424348.4A CN115758298A (en) 2022-11-14 2022-11-14 Verification code verification method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211424348.4A CN115758298A (en) 2022-11-14 2022-11-14 Verification code verification method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN115758298A true CN115758298A (en) 2023-03-07

Family

ID=85370861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211424348.4A Pending CN115758298A (en) 2022-11-14 2022-11-14 Verification code verification method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN115758298A (en)

Similar Documents

Publication Publication Date Title
CN107656874B (en) Interface testing method and device, simulation baffle and system
CN111241517B (en) Method and device for constructing biological feature verification question-answer library
CN104113413A (en) Apparatus And Method For Managing Passwords
CN107181733B (en) Login verification method and device
CN104301875B (en) SMS processing and device
CN112583799B (en) Processing method, related device, equipment and medium for registered account
CN103747013A (en) Cloud terminal login verification method and device
EP3618379A1 (en) Identity verification method and apparatus, and electronic device
CN112507326A (en) SM3 hash algorithm-based password information encryption method and device and computer equipment
EP2947591A1 (en) Authentication by Password Mistyping Correction
CN107623664B (en) Password input method and device
JP5568696B1 (en) Password management system and program for password management system
CN109344604B (en) Method and system for judging password risk of user based on user habit
CN115758298A (en) Verification code verification method and device, electronic equipment and medium
CN109857634A (en) Interface testing parameter verification method, apparatus, electronic equipment and storage medium
CN111277579B (en) Method and equipment for identifying verification information
CN111159048A (en) Application program testing method and device and computer readable storage medium
CN106941496B (en) login verification method and device
CN111460403A (en) Information processing method and system
WO2015198463A1 (en) Information processing device, information processing method, program, storage medium, and password entering device
CN113781261A (en) Detonator online registration method and device
CN111538481B (en) Application program customization method and system
CN110046491B (en) Method and device for verifying security problem, electronic equipment and storage medium
EP3067811A1 (en) Apparatus and method for password authentication
CN111199027B (en) User authentication method and device, computer-readable storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20231030

Address after: 401120 Building 2, No. 81, Tonggui Avenue, Yufengshan Town, Yubei District, Chongqing

Applicant after: Beidou Xingtong Zhilian Technology Co.,Ltd.

Applicant after: Beidou Xingtong Zhilian Technology (Nanjing) Co.,Ltd.

Address before: 401120 No.3, Tonggui Avenue, Yufengshan Town, Yubei District, Chongqing

Applicant before: Beidou Xingtong Zhilian Technology Co.,Ltd.