Verification code generation method and verification code generation system
By generating verification codes for unordered text sets containing characters and place nouns, and using statement IDs for identity verification, the problem that existing verification codes are easily cracked is solved, the security of the system is improved, and the security of the website and users is ensured. .
Patent Information
- Application Number
- CN202310691989.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2024-12-13
AI Technical Summary
Existing verification codes are easily cracked by computer programs, making it difficult to effectively verify user identity, and cannot guarantee the security of the website and users.
By obtaining the terminal's verification code generation request, randomly selecting preset statements and pictures, building an unordered text set containing characters and place nouns, generating target verification codes, and using statement IDs for authentication to ensure the uniqueness and randomness of verification codes. sex.
It significantly reduces the probability of verification code being cracked, improves the security of the system, and ensures the security of the website and users' information.
Smart Images

Figure CN119128861A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network security, and in particular to a verification code generation method and a verification code generation system. Background Art
[0002] In order to protect the website and user information security, a verification code verification step is added when registering and logging in to the website. By requiring users to enter a randomly generated verification code, it is determined whether the subject who requires access to specific information is a person or a computer program (for example, a virus or other malicious program), thereby preventing computer programs from disguising themselves as users to access servers or obtain user privacy.
[0003] At present, the commonly used verification code types include text-click verification codes. Text-click verification codes refer to: placing multiple texts and prompts on a base map, and the prompts are similar to "Please click "XX, YY, ZZ" in sequence." However, since current computer programs have a high accuracy rate for text recognition, and the prompts indicate the order in which the text should be clicked, the text-click verification code is easily cracked by computer programs, making it difficult to effectively verify the user's identity and unable to guarantee the security of the website and users. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a verification code generation method and a verification code generation system, which can reduce the probability of the verification code being cracked by a computer program, improve the security of the system, and ensure the security of the website and users.
[0005] In a first aspect, an embodiment of the present invention provides a verification code generation method, comprising: obtaining a verification code generation request sent by a terminal; randomly selecting a pre-stored statement from a preset statement set as a verification statement according to the verification code generation request; determining a verification word corresponding to the verification statement from a preset text set, and constructing a to-be-selected text set according to the verification word; the text set contains multiple words; replacing the words in the verification statement that are identical to the verification word with prompt symbols to be filled, and determining the replaced verification statement containing the prompt symbols to be filled as the to-be-filled statement; randomly selecting a picture from a preset picture set as a verification picture, and generating a target verification code based on the to-be-selected text set, the to-be-filled sentence and the verification picture; sending the target verification code and the statement ID corresponding to the pre-stored statement to the terminal, so that the terminal performs identity authentication according to the target verification code and the statement ID; the statement ID is used to uniquely identify the pre-stored statement.
[0006] Furthermore, the preset statement set is set in the following manner: a preset number of declarative statements are obtained from a preset corpus according to a first time period; wherein the declarative statements include a person noun and a place noun; the declarative statements are determined to be pre-stored statements, and a preset statement set is constructed based on all pre-stored statements; wherein each pre-stored statement corresponds to a unique statement ID.
[0007] Furthermore, the preset text set includes a character text set and a place text set; the preset text set is set in the following manner: all pre-stored sentences and corresponding sentence IDs in the preset sentence set are obtained according to the second time period; according to the pre-set recognition rules, the target character nouns and target place nouns corresponding to each pre-stored sentence are determined; the character text set is constructed according to the target character nouns, and the place text set is constructed according to the target place nouns; wherein each character noun and each target place noun corresponds to a text ID and a sentence ID.
[0008] Furthermore, the steps of determining the verification words corresponding to the verification sentence from the preset text set and constructing the text set to be selected based on the verification words include: obtaining the sentence ID corresponding to the verification sentence; determining the character nouns and place nouns corresponding to the sentence ID; including the character nouns and place nouns in the verification words; splitting the character nouns and place nouns into multiple single words, and forming the text set to be selected based on all the single words.
[0009] Furthermore, the step of generating a target verification code based on the set of characters to be selected, the sentence to be filled and the verification picture includes: adding the sentence to be filled and each single word in the set of characters to be selected to the verification picture to generate a first verification code; wherein the positions of each single word in the sentence to be filled and the set of characters to be selected are randomly distributed on the verification picture; and generating at least one interference line on the first verification code to obtain a target verification code.
[0010] Furthermore, after the step of sending the target verification code and the statement ID corresponding to the pre-stored statement to the terminal, the method also includes: obtaining the statement to be verified and the statement ID containing the user's click result returned by the terminal; determining the verification statement corresponding to the statement to be verified according to the statement ID; comparing the statement to be verified with the verification statement, determining the verification result according to the comparison result, and returning the verification result to the terminal.
[0011] Furthermore, the step of comparing the sentence to be verified with the verification sentence, determining the verification result according to the comparison result, and returning the verification result to the terminal includes: if all the words in the sentence to be verified are the same as all the words in the verification sentence, determining that the user identity authentication is successful, and returning the verification success information to the terminal; if any word in the sentence to be verified is different from the word in the verification sentence, determining that the user identity authentication fails, and regenerating the target verification code, and sending the regenerated target verification code to the terminal.
[0012] In a second aspect, an embodiment of the present invention provides a verification code generation system, including: a request acquisition module, used to obtain a verification code generation request sent by a terminal; a verification statement generation module, used to randomly select a pre-stored statement from a preset statement set as a verification statement according to the verification code generation request; a to-be-selected text set generation module, used to determine a verification word corresponding to the verification statement from the preset text set, and construct a to-be-selected text set based on the verification word; the text set contains multiple words; a to-be-filled sentence generation module, used to replace the words in the verification sentence that are the same as the verification word with a to-be-filled prompt symbol, and determine the replaced verification sentence containing the to-be-filled prompt symbol as the to-be-filled sentence; a target verification code generation module, used to randomly select a picture from a preset picture set as a verification picture, and generate a target verification code based on the to-be-selected text set, the to-be-filled sentence and the verification picture; a verification code sending module, used to send the target verification code and the statement ID corresponding to the pre-stored statement to the terminal, so that the terminal performs identity authentication according to the target verification code and the statement ID; the statement ID is used to uniquely identify the pre-stored statement.
[0013] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the method described above when executing the computer program.
[0014] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the program code enables the processor to execute the method as described above.
[0015] The embodiment of the present invention provides a verification code generation method and a verification code generation system, including: obtaining a verification code generation request sent by a terminal; randomly selecting a pre-stored statement from a preset statement set as a verification statement according to the verification code generation request; determining a verification word corresponding to the verification statement from a preset text set, and constructing a to-be-selected text set according to the verification word; the text set contains multiple words; replacing the words identical to the verification word in the verification statement with prompt symbols to be filled, and determining the replaced verification statement containing the prompt symbols to be filled as the to-be-filled statement; randomly selecting a picture from a preset picture set as a verification picture, and generating a target verification code based on the to-be-selected text set, the to-be-filled sentence and the verification picture; sending the target verification code and the statement ID corresponding to the pre-stored statement to the terminal, so that the terminal performs identity authentication according to the target verification code and the statement ID; the statement ID is used to uniquely identify the pre-stored statement. In this method, by setting the verification code as an unordered text set containing words of person and place names, the security of the system can be improved, and the security of the website and the user can be guaranteed.
[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0017] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A flow chart of a verification code generation method provided in Embodiment 1 of the present invention;
[0020] Figure 2 A flowchart of a method for setting a preset statement set provided in Embodiment 1 of the present invention;
[0021] Figure 3 A flowchart of a method for setting a preset text set provided in Embodiment 1 of the present invention;
[0022] Figure 4 A flowchart of a method for generating a sentence to be filled provided in Embodiment 1 of the present invention;
[0023] Figure 5 A flowchart of a verification code verification method provided in Embodiment 1 of the present invention;
[0024] Figure 6 A schematic diagram of a verification code generation system provided in Embodiment 2 of the present invention.
[0025] Icons: 1-Request acquisition module; 2-Verification sentence generation module; 3-Selected text set generation module; 4-To-be-filled sentence generation module; 5-Target verification code generation module; 6-Verification code sending module. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] To facilitate understanding of this embodiment, the embodiment of the present invention is described in detail below.
[0028] Embodiment 1:
[0029] Figure 1 This is a flow chart of a verification code generation method provided in Embodiment 1 of the present invention.
[0030] Reference Figure 1 , the verification code generation method includes:
[0031] Step S101, obtaining a verification code generation request sent by a terminal.
[0032] Here, before entering the website, users need to verify their user information. The verification code verification method can block access by illegal users. Users send a request to the system through a terminal to obtain a verification code. The terminal can be a mobile phone, a computer, etc.
[0033] Step S102: randomly selecting a pre-stored statement from a preset statement set as a verification statement according to the verification code generation request.
[0034] Here, the preset sentence set includes at least one pre-stored sentence. For example, a pre-stored sentence "Today Wang Mei went to Century Park for a visit" is selected from the preset sentence set as a verification sentence.
[0035] In one embodiment, referring to Figure 2 , the default statement set is set as follows:
[0036] Step S201, obtaining a preset number of declarative sentences from a preset corpus according to a first time period; wherein the declarative sentences include a person noun and a place noun.
[0037] Here, the preset corpus includes a preset number of complete statements containing people, time, place, and event. The range of person nouns in the sentence comes from the names of people in world history, the names of authors of primary and secondary school textbooks, and names of daily life. The range of place nouns in the sentence comes from world famous attractions, world famous countries, world famous cities, and daily places.
[0038] The preset quantity can be set according to the actual situation.
[0039] The statements in the preset corpus need to be replaced every first time period. The first time period can be set according to actual conditions.
[0040] Step S202, determining that the statement is a pre-stored statement, and constructing a preset statement set based on all the pre-stored statements; wherein each pre-stored statement corresponds to a unique statement ID.
[0041] Here, the preset statement set includes pre-stored statements and their corresponding statement IDs.
[0042] Step S103, determining the verification words corresponding to the verification sentence from the preset word set, and constructing a to-be-selected word set according to the verification words; the word set includes a plurality of words.
[0043] Here, the verification words are the person nouns and place nouns in the pre-stored sentences. For example, when the verification sentence is "Today Wang Mei went to Century Park for a visit.", the verification words are "Wang Mei" and "Century Park". The set of characters to be selected includes "Wang", "Mei", "Shi", "Ji", "Gong" and "Yuan".
[0044] In one embodiment, referring to Figure 3 , the preset text set includes a character text set and a location text set; the preset text set is set in the following way:
[0045] Step S301: Obtain all pre-stored statements and corresponding statement IDs in a preset statement set according to a second time period.
[0046] Here, the second time period is after the first time period, and the preset text set is updated after the preset sentence set is updated.
[0047] Step S302: determining the target person noun and target location noun corresponding to each pre-stored sentence according to the preset recognition rules.
[0048] Here, the target person noun and target location noun corresponding to each pre-stored sentence are automatically identified through natural language processing technology.
[0049] Step S303, constructing a character text set according to the target character nouns, and constructing a location text set according to the target location nouns; wherein each character noun and each target location noun corresponds to a text ID and a sentence ID.
[0050] Here, the text ID includes a person noun ID and a place noun ID.
[0051] The character text set includes the sentence IDs of all pre-stored sentences, the target character nouns corresponding to the pre-stored sentences, and the unique character noun ID corresponding to the target character noun. The place text set includes the sentence IDs of all pre-stored sentences, the target place nouns corresponding to the pre-stored sentences, and the unique place noun ID corresponding to the target place noun.
[0052] Step S104: replace the words in the verification sentence that are the same as the verification words with prompt symbols to be filled in, and determine the replaced verification sentence containing the prompt symbols to be filled in as the sentence to be filled in.
[0053] Here, the prompts to be filled in include brackets, spaces, underscores, and question marks, etc., which can all prompt the user that the characters to be selected are here, and verification code verification is performed. The sentence to be filled in is a sentence containing prompts to be filled in, such as "Today ()() went to ()()()() to play.", "Today went to play.", "Today __ went to ____ to play." or "Today ?? went to ?????? to play.". All of them can prompt the user that the characters to be selected are here, and verification code verification is performed.
[0054] In one embodiment, referring to Figure 4 , step S104, comprising:
[0055] Step S401, obtaining a statement ID corresponding to a verification statement.
[0056] Step S402, determining the person noun and place noun corresponding to the sentence ID; verifying that the person noun and place noun are included in the words.
[0057] Here, the text ID corresponding to the sentence ID in the preset text set is found according to the sentence ID, and the person noun and place noun corresponding to the sentence ID are determined according to the text ID.
[0058] Step S403, splitting the person nouns and place nouns into multiple single words, and forming a character set to be selected based on all the single words.
[0059] Here, the number of characters in the set of characters to be selected is the sum of the number of single characters in person nouns and place nouns.
[0060] Step S105, randomly selecting a picture from the preset picture set as a verification picture, and generating a target verification code based on the text set to be selected, the sentence to be filled and the verification picture.
[0061] Here, the preset picture set includes at least one picture. The pictures in the preset picture set are pre-selected from the network.
[0062] In one embodiment, step S105 includes:
[0063] The sentence to be filled and each single word in the text set to be selected are added to the verification picture to generate a first verification code; wherein the positions of each single word in the sentence to be filled and the text set to be selected on the verification picture are randomly distributed.
[0064] At least one interference line is generated on the first verification code to obtain a target verification code.
[0065] Here, the sentences to be filled and the individual words in the text set to be selected are added to the verification picture, and at least one interference line with a random trajectory is added to the verification picture, so as to generate a complete point-selection target verification code, which is helpful for users to verify.
[0066] Step S106, sending the target verification code and the statement ID corresponding to the pre-stored statement to the terminal, so that the terminal performs identity authentication according to the target verification code and the statement ID; the statement ID is used to uniquely identify the pre-stored statement.
[0067] Here, if the identity authentication is passed, the user is allowed to access normally. If the identity authentication is not passed, the access of the illegal user is blocked and a new verification code is reissued.
[0068] In one embodiment, referring to Figure 5 After step S106, the method further includes:
[0069] Step S501, obtaining the statement to be verified and the statement ID including the user selection result returned by the terminal.
[0070] Step S502: Determine the verification statement corresponding to the statement to be verified according to the statement ID.
[0071] Here, the verification statement in the preset statement set is determined according to the statement ID.
[0072] Step S503: compare the statement to be verified with the verification statement, determine the verification result according to the comparison result, and return the verification result to the terminal.
[0073] In one embodiment, step S503 includes:
[0074] If all the words in the sentence to be verified are the same as all the words in the verification sentence, it is determined that the user identity authentication is successful, and a verification success message is returned to the terminal.
[0075] If any single word in the sentence to be verified is different from the single word in the verification sentence, it is determined that the user identity authentication fails, and the target verification code is regenerated and sent to the terminal.
[0076] The embodiment of the present invention provides a verification code generation method, including: obtaining a verification code generation request sent by a terminal; randomly selecting a pre-stored statement from a preset statement set as a verification statement according to the verification code generation request; determining a verification word corresponding to the verification statement from a preset text set, and constructing a to-be-selected text set according to the verification word; the text set contains multiple words; replacing the words identical to the verification word in the verification statement with prompt symbols to be filled, and determining the replaced verification statement containing the prompt symbols to be filled as the to-be-filled statement; randomly selecting a picture from a preset picture set as a verification picture, and generating a target verification code based on the to-be-selected text set, the to-be-filled sentence and the verification picture; sending the target verification code and the statement ID corresponding to the pre-stored statement to the terminal, so that the terminal performs identity authentication according to the target verification code and the statement ID; the statement ID is used to uniquely identify the pre-stored statement. In this method, by setting the verification code as an unordered text set containing words of person and place names, the security of the system can be improved, and the security of the website and the user can be guaranteed.
[0077] Embodiment 2:
[0078] Figure 6 A schematic diagram of a verification code generation system provided in Embodiment 2 of the present invention.
[0079] Reference Figure 6 , the verification code generation system includes:
[0080] The request acquisition module 1 is used to acquire the verification code generation request sent by the terminal.
[0081] The verification statement generation module 2 is used to randomly select a pre-stored statement from a preset statement set as a verification statement according to a verification code generation request.
[0082] The candidate text set generation module 3 is used to determine the verification words corresponding to the verification sentence from the preset text set, and construct the candidate text set according to the verification words; the text set includes multiple words.
[0083] The to-be-filled sentence generating module 4 is used to replace the words in the verification sentence that are the same as the verification words with the to-be-filled prompt symbol, and determine the replaced verification sentence containing the to-be-filled prompt symbol as the to-be-filled sentence.
[0084] The target verification code generation module 5 is used to randomly select a picture from a preset picture set as a verification picture, and generate a target verification code based on the text set to be selected, the sentence to be filled and the verification picture.
[0085] The verification code sending module 6 sends the target verification code and the statement ID corresponding to the pre-stored statement to the terminal, so that the terminal performs identity authentication according to the target verification code and the statement ID; the statement ID is used to uniquely identify the pre-stored statement.
[0086] The embodiment of the present invention provides a verification code generation system, including: obtaining a verification code generation request sent by a terminal; randomly selecting a pre-stored statement from a preset statement set as a verification statement according to the verification code generation request; determining a verification word corresponding to the verification statement from a preset text set, and constructing a text set to be selected according to the verification word; the text set contains multiple words; replacing the words identical to the verification word in the verification statement with prompt symbols to be filled, and determining the replaced verification statement containing the prompt symbols to be filled as the sentence to be filled; randomly selecting a picture from a preset picture set as a verification picture, and generating a target verification code based on the text set to be selected, the sentence to be filled and the verification picture; sending the target verification code and the statement ID corresponding to the pre-stored statement to the terminal, so that the terminal performs identity authentication according to the target verification code and the statement ID; the statement ID is used to uniquely identify the pre-stored statement. In this way, by setting the verification code as an unordered text set containing words of person and place names, the security of the system can be improved, and the security of the website and the user can be guaranteed.
[0087] An embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the verification code generation method provided in the above embodiment are implemented.
[0088] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the verification code generation method of the above embodiment are executed.
[0089] The computer program product provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment and will not be repeated here.
[0090] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0091] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0092] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0093] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0094] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes 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 present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for generating a verification code, characterized in that: include: Get the verification code generation request sent by the terminal; According to the verification code generation request, randomly selecting a pre-stored statement from a preset statement set as a verification statement; Determine a verification word corresponding to the verification sentence from a preset word set, and construct a to-be-selected word set according to the verification word; the word set includes a plurality of words; Replacing the words in the verification sentence that are identical to the verification words with prompt symbols to be filled in, and determining the verification sentence containing the prompt symbols to be filled in after replacement as the sentence to be filled in; Randomly select a picture from a preset picture set as a verification picture, and generate a target verification code based on the set of characters to be selected, the sentence to be filled, and the verification picture; Sending the target verification code and the statement ID corresponding to the pre-stored statement to the terminal, so that the terminal performs identity authentication according to the target verification code and the statement ID; The statement ID is used to uniquely identify the pre-stored statement.
2. The method for generating a verification code according to claim 1, characterized in that: The preset statement set is set in the following manner: Acquire a preset number of declarative sentences from a preset corpus according to a first time period; wherein the declarative sentences include a person noun and a place noun; Determine that the statement is the pre-stored statement, and construct the preset statement set according to all the pre-stored statements; wherein each of the pre-stored statements corresponds to a unique statement ID.
3. The method for generating a verification code according to claim 1, characterized in that: The preset text set includes a character text set and a location text set; the preset text set is set in the following manner: Acquire all the pre-stored statements and corresponding statement IDs in the preset statement set according to a second time period; Determining the target person noun and the target location noun corresponding to each of the pre-stored sentences according to the preset recognition rules; The character character set is constructed according to the target character noun, and the location character set is constructed according to the target location noun; wherein each character noun and each target location noun corresponds to a character ID and a sentence ID.
4. The method for generating a verification code according to claim 3, characterized in that: The step of determining the verification words corresponding to the verification sentence from the preset word set and constructing a to-be-selected word set according to the verification words includes: Obtain the statement ID corresponding to the verification statement; Determine the person noun and the place noun corresponding to the sentence ID; the verification words include the person noun and the place noun; The character nouns and the place nouns are split into a plurality of single words, and the set of characters to be selected is formed based on all the single words.
5. The method for generating a verification code according to claim 4, characterized in that: The step of generating a target verification code based on the set of characters to be selected, the sentence to be filled in, and the verification picture includes: Adding the sentence to be filled and each single word in the text set to be selected to the verification picture to generate a first verification code; wherein the positions of the sentence to be filled and each single word in the text set to be selected on the verification picture are randomly distributed; At least one interference line is generated on the first verification code to obtain the target verification code.
6. The method for generating a verification code according to claim 1, characterized in that: After the step of sending the target verification code and the statement ID corresponding to the pre-stored statement to the terminal, the method further includes: Obtaining the statement to be verified and the statement ID including the user selection result returned by the terminal; Determine the verification statement corresponding to the statement to be verified according to the statement ID; The statement to be verified is compared with the verification statement, a verification result is determined according to the comparison result, and the verification result is returned to the terminal.
7. The method for generating a verification code according to claim 6, characterized in that: The step of comparing the statement to be verified with the verification statement, determining a verification result according to the comparison result, and returning the verification result to the terminal includes: If all the words in the sentence to be verified are the same as all the words in the verification sentence, it is determined that the user identity authentication is successful, and verification success information is returned to the terminal; If any single word in the sentence to be verified is different from the single word in the verification sentence, it is determined that the user identity authentication fails, and the target verification code is regenerated and sent to the terminal.
8. A verification code generation system, characterized in that: include: A request acquisition module is used to obtain a verification code generation request sent by a terminal; A verification statement generation module, configured to randomly select a pre-stored statement from a preset statement set as a verification statement according to the verification code generation request; A candidate text set generation module is used to determine the verification words corresponding to the verification sentence from a preset text set, and construct a candidate text set according to the verification words; the text set includes a plurality of words; A to-be-filled sentence generating module, used for replacing the words in the verification sentence that are identical to the verification words with to-be-filled prompt symbols, and determining the replaced verification sentence containing the to-be-filled prompt symbols as the to-be-filled sentence; A target verification code generation module is used to randomly select a picture from a preset picture set as a verification picture, and generate a target verification code based on the set of characters to be selected, the sentence to be filled and the verification picture; A verification code sending module, which sends the target verification code and the statement ID corresponding to the pre-stored statement to the terminal, so that the terminal performs identity authentication according to the target verification code and the statement ID; The statement ID is used to uniquely identify the pre-stored statement.
9. An electronic device, characterized in that: The invention comprises a computer-readable storage medium storing a computer program and a processor, wherein when the computer program is read and executed by the processor, the method for generating a verification code according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating a verification code according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Picture verification code generation method, picture verification code and verification method and device
CN107908946A
Verification request processing method and system
CN109450646A
Context-based verification code generation method and device and storage medium
CN114465762A
