Verification code verification method and device
By generating verification code pictures that require semantic understanding and verifying their consistency, the problem that existing verification code systems are easily cracked is solved, improving the difficulty and security of cracking are achieved, and a good user experience is ensured.
Patent Information
- Application Number
- CN202411585739.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-11-07
AI Technical Summary
The existing verification code system is easily cracked by black and gray products through OCR, image recognition algorithms and machine learning models, and lacks effective solutions to resist cracking attacks.
By generating verification code pictures that require semantic understanding, and verifying the semantic consistency between the verification code input by the user and the verification code pictures, the content AIGC model is used to generate randomly generate verification code pictures and present them in artistic fonts to increase complexity.
It increases the cost of cracking verification codes, increases the difficulty of cracking, ensures that the answers submitted by users can be correctly identified in ambiguous situations, improves security and ensures a good user experience.
Smart Images

Figure CN119740219A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a verification code verification method and device. Background Art
[0002] There are two main verification methods for traditional verification code systems: one is for users to manually enter verification codes for verification, and the other is for users to drag, slide, click, and other operations on relevant verification elements in the image for verification. For the first verification method, the black and gray industries can usually crack it through OCR recognition algorithms and image recognition algorithms. For the second verification method, the black and gray industries can usually crack it by identifying relevant verification elements in the image through machine learning models.
[0003] Based on the above reasons, the industry is in urgent need of a verification code verification solution that can effectively resist cracking attacks by black and gray industries. Summary of the invention
[0004] One or more embodiments of the present specification provide a verification code verification method and device, which can improve the ability to resist verification code cracking attacks by increasing the cost of cracking the verification code.
[0005] In a first aspect, a verification code verification method is provided, the method comprising:
[0006] In response to a verification request initiated by a user, feeding back to the user a verification code image that requires semantic understanding;
[0007] In response to the user inputting a first verification code, verifying semantic consistency between the first verification code and the verification code image;
[0008] Determine whether the verification request is successful based on a result of semantic consistency verification between the first verification code and the verification code image.
[0009] As an optional implementation manner of the method according to the first aspect, the verification code image is randomly generated by artificial intelligence generated content AIGC; generating the verification code image specifically includes:
[0010] Obtaining a randomly generated verification code and a text strategy of the verification code, wherein the text strategy is used to describe the generation effect of the verification code;
[0011] The verification code and the text strategy of the verification code are input into an artificial intelligence generated content AIGC model to obtain the verification code image.
[0012] As an optional implementation manner of the method described in the first aspect, the verification code image presents the verification code pattern in the form of an artistic font with light and shadow effects.
[0013] As an optional implementation manner of the method of the first aspect, in response to the user inputting a first verification code, verifying the consistency between the first verification code and the verification code image specifically includes:
[0014] In response to the user inputting a first verification code, obtaining a second verification code associated with the verification code image;
[0015] Verify the consistency of the first verification code and the second verification code.
[0016] As an optional implementation manner of the method of the first aspect, in response to the user inputting a first verification code, verifying the consistency between the first verification code and the verification code image specifically includes:
[0017] Inputting the verification code image and the first verification code into a pre-trained consistency comparison model;
[0018] The verification code image is semantically recognized by using the consistency comparison model, and a consistency comparison is performed between the semantic recognition result of the verification code image and the first verification code.
[0019] In a second aspect, a verification code verification device is provided, the device comprising:
[0020] A response module, configured to respond to a verification request initiated by a user and feed back a verification code image that needs semantic understanding to the user;
[0021] The verification module is configured to verify the consistency of the first verification code with the verification code image in response to the user inputting the first verification code, and determine whether the verification request is verified successfully based on the consistency verification result of the first verification code with the verification code image.
[0022] As an optional implementation manner of the device according to the second aspect, the device further includes:
[0023] The verification code generation module is configured to obtain a randomly generated verification code and a text strategy of the verification code, wherein the text strategy is used to describe the generation effect of the verification code; the verification code and the text strategy of the verification code are input into a pre-trained artificial intelligence generated content AIGC model to obtain the verification code image.
[0024] As an optional implementation manner of the device described in the second aspect, the verification code image generated by the verification code generation module presents a verification code pattern in the form of an artistic font with light and shadow effects.
[0025] As an optional implementation manner of the device described in the second aspect, the verification module is specifically used to obtain a second verification code associated with the verification code image in response to the user inputting a first verification code; and verify the consistency of the first verification code and the second verification code.
[0026] As an optional implementation manner of the device described in the second aspect, the verification module is specifically used to input the verification code image and the first verification code into a pre-trained consistency comparison model; perform semantic recognition on the verification code image through the consistency comparison model, and perform consistency comparison on the semantic recognition result of the verification code image and the first verification code.
[0027] In a third aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned verification code verification method is implemented.
[0028] In a fourth aspect, an electronic device is provided, including:
[0029] One or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions, and the program instructions, when read and executed by the one or more processors, execute the above-mentioned verification code verification method.
[0030] The beneficial effect of the verification code verification method described in one or more embodiments of this specification is that the verification code image generated by the method requires semantic understanding to identify the verification code therein, so it cannot be easily cracked by traditional OCR or image recognition algorithms, which increases the difficulty of cracking. In addition, by verifying the semantic consistency between the verification code input by the user and the verification code image to determine whether the verification is passed, it is ensured that the answer submitted by the user can be correctly identified under ambiguous input, thereby improving security while ensuring a good user experience. The verification code verification device described in the embodiments of this specification also has the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0032] Figure 1 A flowchart of a verification code verification method provided for one or more embodiments of this specification.
[0033] Figure 2 A verification code image provided for one or more embodiments of this specification.
[0034] Figure 3 A structural diagram of a semantic consistency comparison model provided for one or more embodiments of this specification.
[0035] Figure 4 A schematic diagram of the structure of a multimodal semantic consistency comparison model provided for one or more embodiments of this specification.
[0036] Figure 5 A schematic diagram of the structure of a verification code verification device provided in one or more embodiments of this specification.
[0037] Figure 6 A schematic diagram of the structure of an electronic device provided for one or more embodiments of this specification. DETAILED DESCRIPTION
[0038] First of all, it should be noted that the terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise.
[0039] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, rather than all the embodiments. Therefore, it should be recognized by those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0040] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0041] Verification codes are a key element that often appears in human-computer interaction interfaces. They are an important part of identity verification, risk prevention, and data anti-crawling, and thus have become an important target for the black and gray industries to crack. In order to crack verification codes, the black and gray industries usually use various technologies and means to quickly crack them in batches to meet the needs of illegal operations such as batch registration, batch login, and malicious theft.
[0042] There are two main verification methods for traditional verification code systems: one is for users to manually enter verification codes for verification, and the other is for users to drag, slide, click, and other operations on relevant verification elements in the image for verification. For the first verification method, the black and gray industries can usually crack it through OCR and image recognition algorithms. For the second verification method, the black and gray industries can usually crack it by identifying relevant verification elements in the image through machine learning models.
[0043] Based on the above reasons, the industry is in urgent need of a verification code verification solution that can effectively resist cracking attacks by black and gray industries.
[0044] In view of this, one or more embodiments of this specification propose a verification code verification method and device, which can effectively resist verification code cracking attacks.
[0045] The verification code verification method and device described in one or more embodiments of this specification will be further described in detail below in conjunction with the drawings and specific embodiments of the specification, but this detailed description does not constitute a limitation on the embodiments of this specification.
[0046] Please refer to Figure 1 , Figure 1 Flow chart of a verification code verification method proposed in one or more embodiments of this specification. Figure 1 As shown, the verification code verification method may include steps S100 to S104.
[0047] S100: In response to a verification request initiated by a user, a verification code image requiring semantic understanding is fed back to the user.
[0048] It should be noted that the verification code image above does not directly display the verification code text, but displays the verification code pattern that requires semantic understanding. Based on this, the attacker cannot use a simple OCR recognition algorithm or image recognition algorithm to directly recognize the verification code from the verification code image.
[0049] The verification code images can be generated in batches in advance, and then randomly fed back to the user when the user initiates a verification request. The verification code images can also be generated in real time when the user initiates a verification request, and fed back to the user. The generation method and generation time node of the verification code images can be adaptively set according to demand, and this embodiment does not limit this.
[0050] In some implementations, the verification code image may be randomly generated by artificial intelligence generated content AIGC (Artificial Intelligence Generated Content), and the specific generation process is as follows:
[0051] First, obtain the randomly generated verification code and the copywriting strategy for the verification code. This copywriting strategy is used to describe the generation effect of the corresponding verification code, such as font shape, light and shadow effect, elements that make up the font shape, picture background, element color, etc. This copywriting strategy can be input into the AI model as a prompt message, and the generation ability of the AI model can be used to generate the required verification code pattern.
[0052] Next, input the verification code and the copywriting strategy of the verification code into the AI model of artificial intelligence generated content AIGC, and the above verification code picture can be obtained.
[0053] In some embodiments, artificial intelligence generated content AIGC can be used to generate artistic fonts with special light and shadow effects to improve the visual effect and increase complexity. Please refer to Figure 2 , Figure 2 is a verification code picture generated by using artificial intelligence generated content AIGC. In this picture, elements such as lotus flowers and lotus leaves form a verification code pattern in the shape of the character "荷" with a light and shadow effect. This kind of artistic font with a light and shadow effect has higher complexity and is difficult to be recognized by OCR recognition algorithms or image recognition algorithms, but can be understood by users.
[0054] S102: In response to the user inputting the first verification code, verify the semantic consistency between the first verification code and the verification code picture.
[0055] By semantically understanding the above verification code pattern, the user can obtain the relevant information of the first verification code and input the first verification code based on this information. The first verification code input by the user can be non-unique and ambiguous. Taking Figure 2 the shown verification code picture as an example, Figure 2 shows a pattern in the shape of the character "荷" composed of lotus flower and lotus leaf elements. Then, after the user semantically understands the verification code pattern in Figure 2 , the first verification code input by the user can be "荷", or related descriptions such as "lotus leaf" and "lotus flower".
[0056] After obtaining the first verification code input by the user based on semantic understanding, it is necessary to verify the semantic consistency between the first verification code and the above verification code picture.
[0057] In some embodiments, when generating the above verification code picture, the verification character corresponding to the verification code picture, that is, the second verification code corresponding to the verification code picture, can be pre-saved, and the second verification code is associated and stored with the corresponding verification code picture. When verifying the semantic consistency between the first verification code and the verification code picture, the second verification code associated with the verification code picture can be obtained, and then the semantic consistency between the first verification code and the second verification code can be verified.
[0058] Specifically, the first verification code and the second verification code can be input into a pre-trained semantic consistency comparison model, and the semantic consistency comparison model can map the first verification code and the second verification code to the same feature space, and determine the semantic consistency verification result of the first verification code and the verification code image according to the distance between the semantic features of the first verification code and the semantic features of the second verification code. Among them, the distance between the semantic features of the first verification code and the semantic features of the second verification code can be measured by cross entropy.
[0059] Please refer to Figure 3 , Figure 3 FIG. 1 shows a schematic diagram of the structure of a semantic consistency comparison model. Figure 3 As shown, the semantic consistency comparison model includes a first text encoder 301, a second text encoder 302 and a multi-layer perceptron (MLP) 303. The first text encoder 301 is used to perform feature encoding on the first verification code to obtain a first semantic feature. The second text encoder 302 is used to perform feature encoding on the second verification code to obtain a second semantic feature. The multi-layer perceptron (MLP) 303 is used to perform semantic consistency matching on the first semantic feature and the second semantic feature, and output a semantic consistency matching result.
[0060] The first text encoder 301 and the second text encoder 302 mentioned above can be implemented by using network models such as BERT (Bidirectional Encoder Representation from Transformers) and VIT (Vision Transformer).
[0061] The above semantic consistency comparison model can be pre-trained in the following ways, including:
[0062] First, construct positive and negative sample pairs, where the positive sample pair is a text sample pair with consistent semantics, and the negative sample pair is a text sample pair with inconsistent semantics.
[0063] Then, the positive sample pair is input into the semantic consistency comparison model to obtain the similarity of the positive sample pair. Then, the negative sample pair is input into the semantic consistency comparison model to obtain the similarity of the negative sample pair.
[0064] Finally, based on the similarity of the positive sample pairs and the similarity of the negative sample pairs, the loss function can be determined; based on the loss function, the parameters of the semantic consistency comparison model are updated until the target semantic consistency comparison model is obtained.
[0065] In some implementations, the semantic consistency between the first verification code and the verification code image may also be directly verified.
[0066] Specifically, the verification code image and the first verification code can be input into a pre-trained multimodal semantic consistency comparison model. The verification code image is semantically recognized by the multimodal semantic consistency comparison model, and the semantic recognition result of the verification code image and the semantics of the first verification code are semantically compared for consistency.
[0067] Please refer to Figure 4 , Figure 4 FIG. 4 shows a schematic diagram of the structure of a multimodal semantic consistency comparison model. Figure 4 As shown, the multimodal semantic consistency comparison model includes a text encoder 401, an image encoder 402 and a multi-layer perceptron (MLP) 403. The text encoder 401 is used to extract semantic features of the input first verification code to obtain a third semantic feature. The image encoder 402 is used to extract semantic features of the input verification code image to obtain a fourth semantic feature. The multi-layer perceptron (MLP) 403 is used to perform semantic consistency matching on the third semantic feature and the fourth semantic feature, and output a semantic consistency matching result.
[0068] The above-mentioned text encoder 401 can be implemented using network models such as BERT (Bidirectional Encoder Representation from Transformers) and VIT (Vision Transformer).
[0069] The above-mentioned image encoder 402 can be implemented using network models such as film convolutional neural network (CNN), VIT (Vision Transformer), etc.
[0070] The above multimodal semantic consistency comparison model can be pre-trained in the following ways, including:
[0071] First, construct positive and negative sample pairs, where the positive sample pair is a semantically consistent text sample and a verification code image sample, and the negative sample pair is a semantically inconsistent text sample and a verification code image sample.
[0072] Then, the positive sample pair is input into the multimodal semantic consistency comparison model to obtain the similarity of the positive sample pair. Then, the negative sample pair is input into the multimodal semantic consistency comparison model to obtain the similarity of the negative sample pair.
[0073] Finally, based on the similarity of the positive sample pairs and the similarity of the negative sample pairs, the loss function can be determined; based on the loss function, the parameters of the multimodal semantic consistency comparison model are updated until the target multimodal semantic consistency comparison model is obtained.
[0074] S104: Determine whether the verification request is successful based on a result of semantic consistency verification between the first verification code and the verification code image.
[0075] Specifically, if the semantics of the first verification code and the verification code image are consistent, it is determined that the verification code entered by the user is correct, and the verification request is verified. If the semantics of the first verification code and the verification code image are inconsistent, it is determined that the verification code entered by the user is incorrect, and the verification request is verified unsuccessfully.
[0076] It can be seen that in Figure 1 In the verification method shown, the difficulty and cost of cracking the verification code for attackers is increased by generating a verification code that requires semantic understanding, thereby achieving the purpose of defending against verification code cracking attacks. Specifically, attackers currently usually use OCR recognition algorithms and image recognition algorithms to crack static verification codes, and use machine learning models to identify relevant verification elements in the image to crack dynamic verification codes, such as identifying the gap in the sliding verification code, clicking on the text elements and numeric elements in the verification code. The main technical means are image processing, image binarization, simulation of sliding trajectories and other related technologies. For the verification code images that require semantic understanding in the above verification method, cracking such verification codes requires the use of large language models and ultra-large computing power, which is very costly. Moreover, the large language model cannot be used out of the box and requires secondary configuration and definition, which greatly increases the difficulty and cost of cracking for the attacker.
[0077] For users, the above verification code verification method uses semantic consistency comparison to verify the verification code. There is no uniqueness requirement for the answer entered by the user. It can even correctly identify the answer submitted by the user when it is ambiguous, which improves security while ensuring a good user experience.
[0078] Corresponding to the verification code verification method described above, one or more embodiments of this specification also provide a verification code verification device. Figure 5 , Figure 5 1 is a schematic diagram of the structure of a verification code verification device proposed in one or more embodiments of this specification. The device can be used to implement the verification code verification method described above. It should be noted that the verification code verification method described in one or more embodiments of this application can rely on Figure 5 The verification code verification device shown is implemented, but not limited to this device.
[0079] like Figure 5 As shown, the verification code verification device includes:
[0080] The response module 501 is configured to respond to the verification request initiated by the user and feed back a verification code image that needs to be semantically understood to the user.
[0081] The verification module 502 is configured to verify the semantic consistency between the first verification code and the verification code image in response to the user inputting the first verification code, and determine whether the verification request is verified successfully based on the verification result of the semantic consistency between the first verification code and the verification code image.
[0082] Regarding the above-mentioned response module 501, the response module 501 does not directly display the verification code text in the verification code picture fed back to the user, but displays the verification code pattern that requires semantic understanding, so that the attacker cannot use a simple OCR recognition algorithm or image recognition algorithm to directly recognize the verification code from the verification code picture.
[0083] Regarding the above verification module 502, after obtaining the first verification code input by the user based on semantic understanding, the verification module 502 needs to verify the semantic consistency between the first verification code and the above verification code image.
[0084] In some implementations, the response module 501 can save the verification character corresponding to the verification code picture, that is, the second verification code corresponding to the verification code picture, in advance while feeding back the verification code picture to the user, and store the second verification code in association with the corresponding verification code picture. When the verification module 502 verifies the semantic consistency of the first verification code and the verification code picture, the second verification code associated with the verification code picture can be obtained, and then the semantic consistency of the first verification code and the second verification code can be verified.
[0085] Specifically, the verification module 502 can input the first verification code and the second verification code into a pre-trained semantic consistency comparison model, and the semantic consistency comparison model can map the first verification code and the second verification code to the same feature space, and determine the semantic consistency verification result of the first verification code and the verification code image according to the distance between the semantic features of the first verification code and the semantic features of the second verification code. The distance between the semantic features of the first verification code and the semantic features of the second verification code can be measured by cross entropy.
[0086] Optionally, the verification module 502 may utilize Figure 3 The semantic consistency comparison model shown is used to verify the semantic consistency of the first verification code and the second verification code. The semantic consistency comparison model includes a first text encoder 301, a second text encoder 302 and a multi-layer perceptron (MLP) 303. The first text encoder 301 is used to perform feature encoding on the first verification code to obtain a first semantic feature. The second text encoder 302 is used to perform feature encoding on the second verification code to obtain a second semantic feature. The multi-layer perceptron (MLP) 303 is used to perform semantic consistency matching on the first semantic feature and the second semantic feature, and output a semantic consistency matching result.
[0087] The first text encoder 301 and the second text encoder 302 mentioned above can be implemented by using network models such as BERT (Bidirectional Encoder Representation from Transformers) and VIT (Vision Transformer).
[0088] The verification module 502 may be pre-trained to obtain the above-mentioned semantic consistency comparison model in the following manner, and the specific training steps include:
[0089] First, construct positive and negative sample pairs, where the positive sample pair is a text sample pair with consistent semantics, and the negative sample pair is a text sample pair with inconsistent semantics.
[0090] Then, the positive sample pair is input into the semantic consistency comparison model to obtain the similarity of the positive sample pair. Then, the negative sample pair is input into the semantic consistency comparison model to obtain the similarity of the negative sample pair.
[0091] Finally, based on the similarity of the positive sample pairs and the similarity of the negative sample pairs, the loss function can be determined; based on the loss function, the parameters of the semantic consistency comparison model are updated until the target semantic consistency comparison model is obtained.
[0092] Optionally, the verification module 502 may also utilize Figure 4 The multimodal semantic consistency comparison model shown is used to directly verify the semantic consistency between the first verification code and the verification code image.
[0093] Specifically, the verification module 502 may input the verification code image and the first verification code into a pre-trained multimodal semantic consistency comparison model, perform semantic recognition on the verification code image through the multimodal semantic consistency comparison model, and perform semantic consistency comparison on the semantic recognition result of the verification code image and the semantics of the first verification code.
[0094] like Figure 4 As shown, the multimodal semantic consistency comparison model includes a text encoder 401, an image encoder 402 and a multi-layer perceptron (MLP) 403. The text encoder 401 is used to extract semantic features of the input first verification code to obtain a third semantic feature. The image encoder 402 is used to extract semantic features of the input verification code image to obtain a fourth semantic feature. The multi-layer perceptron (MLP) 403 is used to perform semantic consistency matching on the third semantic feature and the fourth semantic feature, and output a semantic consistency matching result.
[0095] The above-mentioned text encoder 401 can be implemented using network models such as BERT (Bidirectional Encoder Representation from Transformers) and VIT (Vision Transformer).
[0096] The above-mentioned image encoder 402 can be implemented using network models such as film convolutional neural network (CNN), VIT (Vision Transformer), etc.
[0097] The verification module 502 may be pre-trained to obtain the above-mentioned multimodal semantic consistency comparison model in the following manner, and the specific training steps include:
[0098] First, construct positive and negative sample pairs, where the positive sample pair is a semantically consistent text sample and a verification code image sample, and the negative sample pair is a semantically inconsistent text sample and a verification code image sample.
[0099] Then, the positive sample pair is input into the multimodal semantic consistency comparison model to obtain the similarity of the positive sample pair. Then, the negative sample pair is input into the multimodal semantic consistency comparison model to obtain the similarity of the negative sample pair.
[0100] Finally, based on the similarity of the positive sample pairs and the similarity of the negative sample pairs, the loss function can be determined; based on the loss function, the parameters of the multimodal semantic consistency comparison model are updated until the target multimodal semantic consistency comparison model is obtained.
[0101] The verification module 502 determines whether the verification request is verified based on the semantic consistency verification result of the first verification code and the verification code image, specifically including: if the semantics of the first verification code and the verification code image are consistent, it is determined that the verification code input by the user is correct, and the verification request is verified. If the semantics of the first verification code and the verification code image are inconsistent, it is determined that the verification code input by the user is incorrect, and the verification request is verified.
[0102] Please continue to refer to Figure 5 In some embodiments, the verification code verification device may further include a verification code generation module 503. The verification code generation module 503 is configured to obtain a randomly generated verification code and a text strategy of the verification code, and input the verification code and the text strategy of the verification code into an artificial intelligence generated content AIGC model to obtain a verification code image. The above-mentioned text strategy is used to describe the generation effect of the verification code.
[0103] The verification code generation module 503 can generate verification code images in batches in advance, and then randomly feed back to the user through the response module 501 when the user initiates a verification request. The verification code generation module 503 can also generate the above verification code image in real time when the user initiates a verification request, and feed back to the user through the response module 501. The generation method and generation time node of the verification code generation module 503 to generate the verification code image can be adaptively set according to demand, and this embodiment does not limit this.
[0104] In some implementations, the verification code generation module 503 may randomly generate a verification code image through artificial intelligence generated content AIGC (Artificial Intelligence Generated Content), and the specific generation process is as follows:
[0105] First, the verification code generation module 503 obtains the randomly generated verification code and the text strategy of the verification code, which is used to describe the generation effect of the corresponding verification code, such as font shape, light and shadow effects, elements that make up the font shape, picture background, element color, etc. The text strategy can be input into the AI model as prompt information, and the generation capability of the AI model is used to generate the required verification code pattern.
[0106] Next, the verification code generation module 503 inputs the verification code and the text strategy of the verification code into the AI model of artificial intelligence generated content AIGC to obtain the above-mentioned verification code image.
[0107] In some implementations, the verification code generation module 503 may generate artistic fonts including special light and shadow effects through artificial intelligence generated content AIGC to enhance visual effects and increase complexity.
[0108] For the above-mentioned verification code verification device, taking the module as an example of a software functional unit, the response module 501 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the response module 501 may include code running on multiple hosts / virtual machines / containers. The multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with close geographical locations. Among them, usually a region may include multiple AZs.
[0109] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0110] As an example of a hardware functional unit, the response module 501 may include at least one computing device, such as a server, etc. Alternatively, the response module 501 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0111] The multiple computing devices included in the response module 501 can be distributed in the same region or in different regions. The multiple computing devices included in the response module 501 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the response module 501 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0112] In other embodiments, the response module 501 can be used to execute any step in the above-mentioned verification code verification method, the verification module 502 can be used to execute any step in the above-mentioned verification code verification method, and the verification code generation module 503 can be used to execute any step in the above-mentioned verification code verification method.
[0113] The steps implemented by the response module 501, verification module 502 and verification code generation module 503 can be specified as needed. The response module 501, verification module 502 and verification code generation module 503 respectively implement different steps in the above-mentioned verification code verification method to achieve all the functions of the above-mentioned verification code verification device.
[0114] In this implementation, the verification code verification apparatus may also be applied to computing devices such as computers and servers, or to a computing device cluster including at least one computing device, to implement a verification code verification function.
[0115] In some embodiments, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned verification code verification method is implemented.
[0116] The computer-readable storage medium may be any available medium that can be stored in the electronic device or a data storage device such as a data center containing one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the electronic device to perform the above-mentioned verification code verification method.
[0117] This embodiment also provides an electronic device, including:
[0118] One or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions, and the program instructions, when read and executed by the one or more processors, implement the above-mentioned verification code verification method.
[0119] Please refer to Figure 6 , Figure 6 A structural schematic diagram of the above electronic device is shown. The electronic device includes a bus 601, a processor 602, a memory 603 and a communication interface 604. The memory 603 stores a computer program, and when the computer program runs on the processor 602, the processor 602 executes the specific steps in the above verification code verification method. It should be understood that the present application does not limit the number of processors and memories in the electronic device.
[0120] The bus 601 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus 601 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The bus 601 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 601 may include a path for transmitting information between various components of the terminal device (for example, the processor 602, the memory 603 and the communication interface 604).
[0121] The processor 602 may include any one or more of a processor such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0122] The memory 603 may include a volatile memory, such as a random access memory (RAM). The memory 603 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0123] The communication interface 604 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the electronic device and other devices or a communication network.
[0124] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0125] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0126] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0127] It should be noted that the above examples are only specific embodiments of the present invention, and the present invention is obviously not limited to the above examples, and there are many similar variations. All variations directly derived or associated from the contents disclosed by the technicians in this field should fall within the protection scope of the present invention.
Claims
1. A verification code verification method, comprising: In response to a verification request initiated by a user, feeding back to the user a verification code image that requires semantic understanding; In response to the user inputting a first verification code, verifying semantic consistency between the first verification code and the verification code image; Determine whether the verification request is successful based on a result of semantic consistency verification between the first verification code and the verification code image.
2. According to the method of claim 1, the verification code image is randomly generated by artificial intelligence generated content AIGC; generating the verification code image specifically includes: Obtaining a randomly generated verification code and a text strategy of the verification code, wherein the text strategy is used to describe the generation effect of the verification code; The verification code and the text strategy of the verification code are input into an artificial intelligence generated content AIGC model to obtain the verification code image.
3. The method according to claim 1, wherein the verification code image presents the verification code pattern in the form of an artistic font with light and shadow effects.
4. The method according to claim 1, in response to the user inputting a first verification code, verifying the semantic consistency between the first verification code and the verification code image, specifically comprising: In response to the user inputting a first verification code, obtaining a second verification code associated with the verification code image; Verify semantic consistency between the first verification code and the second verification code.
5. The method according to claim 1, in response to the user inputting a first verification code, verifying the semantic consistency between the first verification code and the verification code image, specifically comprising: Inputting the verification code image and the first verification code into a pre-trained consistency comparison model; The verification code image is semantically recognized by using the consistency comparison model, and a semantic consistency comparison is performed between the semantic recognition result of the verification code image and the semantics of the first verification code.
6. A verification code verification device, comprising: A response module, configured to respond to a verification request initiated by a user and feed back a verification code image that needs semantic understanding to the user; The verification module is configured to verify the semantic consistency between the first verification code and the verification code image in response to the user inputting the first verification code, and determine whether the verification request is verified successfully based on the verification result of the semantic consistency between the first verification code and the verification code image.
7. The device according to claim 6, further comprising: A verification code generation module, configured to obtain a randomly generated verification code and a text strategy of the verification code, wherein the text strategy is used to describe the generation effect of the verification code; The verification code and the text strategy of the verification code are input into an artificial intelligence generated content AIGC model to obtain the verification code image.
8. The device according to claim 6, wherein the verification code image generated by the verification code generation module presents a verification code pattern in the form of an artistic font with light and shadow effects.
9. The device according to claim 6, wherein the verification module is specifically used to obtain a second verification code associated with the verification code image in response to the user inputting a first verification code; and verify the semantic consistency between the first verification code and the second verification code.
10. According to the device of claim 6, the verification module is specifically used to input the verification code image and the first verification code into a pre-trained consistency comparison model; perform semantic recognition on the verification code image through the consistency comparison model, and perform voice consistency comparison on the semantic recognition result of the verification code image and the voice of the first verification code.
11. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 5 when executed by a processor.
12. An electronic device comprising: one or more processors; And a memory associated with the one or more processors, the memory is used to store program instructions, and when the program instructions are read and executed by the one or more processors, the method according to any one of claims 1 to 5 is executed.
Citation Information
Patent Citations
Verification code based on image content
CN103428163A
Method, device and system conducting verification through verification codes
CN104283682A
Multi-element semantic verification code and generation method thereof
CN116451207A
Semantic verification code generation method and device based on style migration, equipment and medium
CN117972673A
Semantic verification code generation method and device based on artistic style, equipment and medium
CN118035975A