Verification code verification method and device
By generating CAPTCHA images that require semantic understanding and using an artificial intelligence model to verify consistency, the problem of traditional CAPTCHAs being easily cracked is solved, achieving CAPTCHA verification with high security and a good user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2026-03-10
AI Technical Summary
Traditional CAPTCHA systems are easily cracked by cybercriminals using OCR and machine learning algorithms, and lack effective means of defense against attacks.
By generating CAPTCHA images that require semantic understanding, and using an AIGC (Artificial Intelligence Generated Content) model and a semantic consistency comparison model to verify the consistency between the user-input CAPTCHA and the image, the difficulty of cracking is increased.
It increases the cost of cracking CAPTCHAs, improves security and user experience, ensures correct recognition even with ambiguous input, and effectively resists attacks from black and gray market actors.
Smart Images

Figure CN119740219B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a verification code verification method and device. BACKGROUND
[0002] The verification code verification method of the traditional verification code system mainly includes two types: one is that the user manually inputs the verification code for verification, and the other is that the user performs dragging, sliding, clicking and the like on the related verification elements in the picture for verification. For the first verification method, the black and gray production can usually be cracked by using an OCR recognition algorithm and an image recognition algorithm. For the second verification method, the black and gray production can usually be cracked by using a machine learning model to identify the related verification elements in the picture.
[0003] Based on the above reasons, there is an urgent need in the industry for a verification code verification scheme that can effectively resist cracking attacks by black and gray production. SUMMARY
[0004] One or more embodiments of the present specification provide a verification code verification method and device, which can increase the cracking cost of the verification code to improve the resistance to cracking attacks on the verification code.
[0005] In a first aspect, a verification code verification method is provided, which includes:
[0006] In response to a verification request initiated by a user, feeding back a verification code picture requiring semantic understanding to the user;
[0007] In response to the user inputting a first verification code, verifying semantic consistency of the first verification code and the verification code picture;
[0008] According to the semantic consistency verification result of the first verification code and the verification code picture, determining whether the verification request is verified.
[0009] As an optional implementation manner of the method of the first aspect, the verification code picture is randomly generated by artificial intelligence generated content AIGC, and the generation of the verification code picture specifically includes:
[0010] Obtaining a randomly generated verification code and a script strategy of the verification code, the script strategy being used to describe the generation effect of the verification code;
[0011] Inputting the verification code and the script strategy of the verification code into an artificial intelligence generated content AIGC model to obtain the verification code picture.
[0012] As an optional implementation manner of the method of the first aspect, the verification code picture presents a verification code pattern in the form of an artistic font with a light and shadow effect.
[0013] As an optional implementation of the method of the first aspect, in response to the user inputting the first verification code, verifying the consistency of the first verification code with the verification code picture specifically includes:
[0014] In response to the user inputting the first verification code, obtaining a second verification code associated with the verification code picture;
[0015] Verifying the consistency of the first verification code with the second verification code.
[0016] As an optional implementation of the method of the first aspect, in response to the user inputting the first verification code, verifying the consistency of the first verification code with the verification code picture specifically includes:
[0017] Inputting the verification code picture and the first verification code into a pre-trained consistency comparison model;
[0018] Performing semantic recognition on the verification code picture through the consistency comparison model, and performing consistency comparison on the semantic recognition result of the verification code picture and the first verification code.
[0019] Secondly, a verification code verification device is provided, which comprises:
[0020] A response module configured to, in response to a verification request initiated by a user, feed back to the user a verification code picture that needs to be semantically understood;
[0021] A verification module configured to, in response to the user inputting a first verification code, verify the consistency of the first verification code with the verification code picture, and determine whether the verification request is verified based on the consistency verification result of the first verification code with the verification code picture.
[0022] As an optional implementation of the device of the second aspect, the device further comprises:
[0023] A verification code generation module configured to obtain a randomly generated verification code and a text strategy of the verification code, the text strategy being used to describe the generation effect of the verification code; inputting the verification code and the text strategy of the verification code into a pre-trained artificial intelligence generated content (AIGC) model to obtain the verification code picture.
[0024] As an optional implementation of the device of the second aspect, the verification code picture 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 of the apparatus of the second aspect, the verification module is specifically configured to acquire a second verification code associated with the verification code picture in response to the user inputting the first verification code; and verify consistency of the first verification code and the second verification code.
[0026] As an optional implementation of the apparatus of the second aspect, the verification module is specifically configured to input the verification code picture and the first verification code into a pre-trained consistency comparison model; perform semantic recognition on the verification code picture through the consistency comparison model, and perform consistency comparison on a semantic recognition result of the verification code picture and the first verification code.
[0027] In a third aspect, a computer readable storage medium is provided, which stores a computer program. The computer program is executed by a processor to implement the verification code verification method described above.
[0028] In a fourth aspect, an electronic device is provided, which includes:
[0029] one or more processors; and a memory associated with the one or more processors, the memory being configured to store program instructions, which, when executed by the one or more processors, perform the verification code verification method described above.
[0030] The verification code verification method described in one or more embodiments of the present specification has the beneficial effect that the verification code picture generated by the method needs to be semantically understood to identify the verification code therein, and thus cannot be easily cracked by traditional OCR or image recognition algorithms, thereby increasing the cracking difficulty. In addition, the semantic consistency of the verification code input by the user and the verification code picture is verified to determine whether the verification is passed, which ensures that the answer submitted by the user can be correctly identified under ambiguous input, thereby improving the security while ensuring good user experience. The verification code verification apparatus described in the embodiments of the present specification also has the beneficial effects described above. BRIEF DESCRIPTION OF DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present specification, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0032] Figure 1 A flowchart of a verification code verification method provided by one or more embodiments of the present specification.
[0033] Figure 2 A verification code picture provided by one or more embodiments of the present specification.
[0034] Figure 3 This is a schematic diagram of the structure of a semantic consistency comparison model provided in one or more embodiments of this specification.
[0035] Figure 4 This is a schematic diagram of the structure of a multimodal semantic consistency comparison model provided in one or more embodiments of this specification.
[0036] Figure 5 This is a schematic diagram of the structure of a verification code verification device provided in one or more embodiments of this specification.
[0037] Figure 6 This is a schematic diagram of the structure of an electronic device provided for one or more embodiments of this specification. Detailed Implementation
[0038] First, it should be noted that the terminology used in the embodiments of this invention is for the purpose of describing specific embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” used in the embodiments of this invention and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0039] 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 with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments in this specification, and not all of the embodiments. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0040] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0041] CAPTCHAs, as a key element frequently appearing in human-computer interaction interfaces, are an important component of identity verification, risk prevention, and data anti-scraping, thus becoming a primary target for black market and gray market actors. To crack CAPTCHAs, these actors typically utilize various techniques and methods to quickly and efficiently crack them in batches, meeting the needs of illegal operations such as mass registration, mass login, and malicious theft.
[0042] Traditional CAPTCHA systems primarily employ two verification methods: manual input of the CAPTCHA code by the user, and manipulation of the image by the user through actions such as dragging, swiping, and clicking. For the first method, malicious actors can typically crack it using OCR and image recognition algorithms. For the second method, they can usually bypass the detection by using machine learning models to identify relevant verification elements within the image.
[0043] For the reasons mentioned above, the industry urgently needs a CAPTCHA verification solution that can effectively resist cracking attacks from black and gray market actors.
[0044] In view of this, one or more embodiments of this specification propose a verification code verification method and apparatus that can effectively resist verification code cracking attacks.
[0045] The verification code verification method and apparatus described in one or more embodiments of this specification will be further described in detail below with reference to the accompanying drawings and specific embodiments. However, this detailed description does not constitute a limitation on the embodiments of this specification.
[0046] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating 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 user-initiated verification request, it sends the user a verification code image that requires semantic understanding.
[0048] It should be noted that the CAPTCHA images mentioned above do not directly display the CAPTCHA text, but rather a pattern that requires semantic understanding. Therefore, attackers cannot directly extract the CAPTCHA from the image using simple OCR or image recognition algorithms.
[0049] The aforementioned CAPTCHA images can be pre-generated in batches and then randomly presented to the user upon receiving a verification request. Alternatively, the CAPTCHA images can be generated in real-time upon receiving a verification request and presented to the user. The generation method and timing of the CAPTCHA images can be adaptively configured according to requirements; this embodiment does not impose any limitations on this.
[0050] In some implementations, the aforementioned CAPTCHA image can be randomly generated using Artificial Intelligence Generated Content (AIGC). 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 forming the font shape, picture background, element color, etc. This copywriting strategy can be input as a prompt message into the AI model, and the generation ability of the AI model is utilized 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-mentioned 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 For example, 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 artistic font with a light and shadow effect has a 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 fuzzy. For Figure 2 example, taking the verification code picture shown Figure 2 as an example, which shows a pattern in the shape of the character "荷" composed of lotus flower and lotus leaf elements. 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 stored in association 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 and second CAPTCHAs can be input into a pre-trained semantic consistency comparison model. This model maps the first and second CAPTCHAs to the same feature space and determines the semantic consistency verification result between the first and second CAPTCHAs based on the distance between their semantic features. Cross-entropy can be used to measure the distance between the semantic features of the first and second CAPTCHAs.
[0059] Please refer to Figure 3 , Figure 3 A schematic diagram of the structure of a semantic consistency comparison model is shown. Figure 3 As shown, the semantic consistency matching model includes a first text encoder 301, a second text encoder 302, and a multilayer perceptron (MLP) 303. The first text encoder 301 encodes the first CAPTCHA to obtain first semantic features. The second text encoder 302 encodes the second CAPTCHA to obtain second semantic features. The multilayer perceptron (MLP) 303 performs semantic consistency matching on the first and second semantic features and outputs the semantic consistency matching result.
[0060] The first text encoder 301 and the second text encoder 302 mentioned above can be implemented using network models such as BERT (Bidirectional Encoder Representation from Transformers) and VIT (Vision Transformer).
[0061] The semantic consistency comparison model described above can be pre-trained using the following methods, specifically:
[0062] First, construct positive and negative sample pairs. The positive sample pairs are text sample pairs with consistent semantics, while the negative sample pairs are text sample pairs with inconsistent semantics.
[0063] Then, the positive sample pairs are input to the semantic consistency comparison model to obtain the similarity of the positive sample pairs. Next, the negative sample pairs are input to the semantic consistency comparison model to obtain the similarity of the negative sample pairs.
[0064] Finally, the loss function can be determined based on the similarity between positive and negative sample pairs; the parameters of the semantic consistency comparison model are then updated based on this loss function 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 can also be directly verified.
[0066] Specifically, the CAPTCHA image and the first CAPTCHA can be input into a pre-trained multimodal semantic consistency comparison model. The multimodal semantic consistency comparison model performs semantic recognition on the CAPTCHA image and compares the semantic recognition result of the CAPTCHA image with the semantics of the first CAPTCHA.
[0067] Please refer to Figure 4 , Figure 4 A schematic diagram of the structure of a multimodal semantic consistency comparison model is shown. Figure 4 As shown, the multimodal semantic consistency matching model includes a text encoder 401, an image encoder 402, and a multilayer perceptron (MLP) 403. The text encoder 401 extracts semantic features from the input first CAPTCHA to obtain a third semantic feature. The image encoder 402 extracts semantic features from the input CAPTCHA image to obtain a fourth semantic feature. The multilayer perceptron (MLP) 403 performs semantic consistency matching between the third and fourth semantic features and outputs the semantic consistency matching result.
[0068] The text encoder 401 mentioned above can be implemented using network models such as BERT (Bidirectional Encoder Representation from Transformers) and VIT (Vision Transformer).
[0069] The image encoder 402 described above can be implemented using network models such as Convolutional Neural Network (CNN) and Vision Transformer (VIT).
[0070] The aforementioned multimodal semantic consistency comparison model can be pre-trained using the following methods, specifically:
[0071] First, construct positive and negative sample pairs. The positive sample pairs are text samples and CAPTCHA image samples with consistent semantics, while the negative sample pairs are text samples and CAPTCHA image samples with inconsistent semantics.
[0072] Then, positive sample pairs are input into the multimodal semantic consistency comparison model to obtain the similarity of positive sample pairs. Negative sample pairs are then input into the multimodal semantic consistency comparison model to obtain the similarity of negative sample pairs.
[0073] Finally, the loss function can be determined based on the similarity of positive sample pairs and the similarity of negative sample pairs; the parameters of the multimodal semantic consistency comparison model are updated based on this loss function until the target multimodal semantic consistency comparison model is obtained.
[0074] S104: Based on the semantic consistency verification result between the first verification code and the verification code image, determine whether the verification request has passed.
[0075] Specifically, if the semantics of the first verification code and the verification code image are consistent, then the user-entered verification code is determined to be correct, and the verification request passes. If the semantics of the first verification code and the verification code image are inconsistent, then the user-entered verification code is determined to be incorrect, and the verification request fails.
[0076] It can be seen that, in Figure 1 The verification method described above increases the difficulty and cost for attackers to crack CAPTCHAs by generating CAPTCHAs that require semantic understanding, thereby preventing CAPTCHA cracking attacks. Specifically, attackers typically use OCR and image recognition algorithms to crack static CAPTCHAs, and machine learning models to identify relevant verification elements in images to crack dynamic CAPTCHAs, such as identifying gaps in sliding CAPTCHAs or selecting text and number elements. Their main technical means include image processing, image binarization, and simulating sliding trajectories. However, cracking CAPTCHAs that require semantic understanding requires large language models and massive computing power, making it extremely costly. Furthermore, large language models are not ready to use out of the box and require secondary configuration and definition, which significantly increases the difficulty and cost for attackers.
[0077] For users, the above-mentioned CAPTCHA verification method uses semantic consistency comparison to verify the CAPTCHA. There is no requirement for the uniqueness of the user's input answer. It can even correctly identify the answer when the user's submission is ambiguous, which improves security and ensures a good user experience.
[0078] Corresponding to the above-described verification code method, one or more embodiments of this specification also propose a verification code verification device. Please refer to... Figure 5 , Figure 5 This is a schematic diagram of the structure of a verification code verification device proposed in one or more embodiments of this specification. This device can be used to implement the above-described verification code verification method. 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 is 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 a user-initiated verification request by providing the user with a verification code image that requires semantic understanding.
[0081] The verification module 502 is configured to respond to the user inputting a first verification code, verify the semantic consistency between the first verification code and the verification code image, and determine whether the verification request passes based on the semantic consistency verification result between the first verification code and the verification code image.
[0082] Regarding the aforementioned response module 501, the CAPTCHA image returned to the user by the response module 501 does not directly display the CAPTCHA text, but instead displays a CAPTCHA pattern that requires semantic understanding, so that attackers cannot directly identify the CAPTCHA from the CAPTCHA image using simple OCR recognition algorithms or image recognition algorithms.
[0083] Regarding the aforementioned 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 aforementioned verification code image.
[0084] In some implementations, the response module 501, while sending the verification code image to the user, can pre-save the verification characters corresponding to the verification code image, which is the second verification code corresponding to the verification code image, and associate the second verification code with the corresponding verification code image. When the verification module 502 verifies the semantic consistency between the first verification code and the verification code image, it can obtain the second verification code associated with the verification code image, and then verify the semantic consistency between the first verification code and the second verification code.
[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. This 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 between the first verification code and the verification code image based on the distance between the semantic features of the first verification code and the semantic features of the second verification code. Specifically, cross-entropy can be used to measure the distance between the semantic features of the first verification code and the semantic features of the second verification code.
[0086] Optionally, the verification module 502 can utilize Figure 3 The semantic consistency comparison model shown is used to verify the semantic consistency between the first CAPTCHA and the second CAPTCHA. This semantic consistency comparison model includes a first text encoder 301, a second text encoder 302, and a multilayer perceptron (MLP) 303. The first text encoder 301 is used to encode features of the first CAPTCHA to obtain first semantic features. The second text encoder 302 is used to encode features of the second CAPTCHA to obtain second semantic features. The multilayer perceptron (MLP) 303 is used to perform semantic consistency matching between the first and second semantic features and output the semantic consistency matching result.
[0087] The first text encoder 301 and the second text encoder 302 mentioned above can be implemented using network models such as BERT (Bidirectional Encoder Representation from Transformers) and VIT (Vision Transformer).
[0088] The verification module 502 can be pre-trained to obtain the semantic consistency comparison model described above using the following methods, specifically including:
[0089] First, construct positive and negative sample pairs. The positive sample pairs are text sample pairs with consistent semantics, while the negative sample pairs are text sample pairs with inconsistent semantics.
[0090] Then, the positive sample pairs are input to the semantic consistency comparison model to obtain the similarity of the positive sample pairs. Next, the negative sample pairs are input to the semantic consistency comparison model to obtain the similarity of the negative sample pairs.
[0091] Finally, the loss function can be determined based on the similarity between positive and negative sample pairs; the parameters of the semantic consistency comparison model are then updated based on this loss function until the target semantic consistency comparison model is obtained.
[0092] Optionally, the verification module 502 can also utilize Figure 4 The multimodal semantic consistency comparison model shown is used to directly verify the semantic consistency between the first CAPTCHA and the CAPTCHA image.
[0093] Specifically, the verification module 502 can input a pre-trained multimodal semantic consistency comparison model with the verification code image and the first verification code. The multimodal semantic consistency comparison model performs semantic recognition on the verification code image and compares the semantic recognition result of the verification code image with the semantics of the first verification code.
[0094] like Figure 4 As shown, the multimodal semantic consistency matching model includes a text encoder 401, an image encoder 402, and a multilayer perceptron (MLP) 403. The text encoder 401 extracts semantic features from the input first CAPTCHA to obtain a third semantic feature. The image encoder 402 extracts semantic features from the input CAPTCHA image to obtain a fourth semantic feature. The multilayer perceptron (MLP) 403 performs semantic consistency matching between the third and fourth semantic features and outputs the semantic consistency matching result.
[0095] The text encoder 401 mentioned above can be implemented using network models such as BERT (Bidirectional Encoder Representation from Transformers) and VIT (Vision Transformer).
[0096] The image encoder 402 described above can be implemented using network models such as Convolutional Neural Network (CNN) and Vision Transformer (VIT).
[0097] The verification module 502 can 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. The positive sample pairs are text samples and CAPTCHA image samples with consistent semantics, while the negative sample pairs are text samples and CAPTCHA image samples with inconsistent semantics.
[0099] Then, positive sample pairs are input into the multimodal semantic consistency comparison model to obtain the similarity of positive sample pairs. Negative sample pairs are then input into the multimodal semantic consistency comparison model to obtain the similarity of negative sample pairs.
[0100] Finally, the loss function can be determined based on the similarity of positive sample pairs and the similarity of negative sample pairs; the parameters of the multimodal semantic consistency comparison model are updated based on this loss function until the target multimodal semantic consistency comparison model is obtained.
[0101] The verification module 502 determines whether the verification request passes based on the semantic consistency verification result between the first verification code and the verification code image. Specifically, if the semantics of the first verification code and the verification code image are consistent, the user-input verification code is determined to be correct, and the verification request passes. If the semantics of the first verification code and the verification code image are inconsistent, the user-input verification code is determined to be incorrect, and the verification request fails.
[0102] Please continue to refer to this. Figure 5 In some embodiments, the CAPTCHA verification device described above may further include a CAPTCHA generation module 503. The CAPTCHA generation module 503 is configured to acquire a randomly generated CAPTCHA and a CAPTCHA text strategy, and input the CAPTCHA and the CAPTCHA text strategy into an AIGC (Artificial Intelligence Generated Content) model to obtain a CAPTCHA image. The aforementioned text strategy is used to describe the generation effect of the CAPTCHA.
[0103] The verification code generation module 503 can pre-generate verification code images in batches, and then randomly send them to the user via the response module 501 when the user initiates a verification request. Alternatively, the verification code generation module 503 can generate the aforementioned verification code images in real time when the user initiates a verification request, and send them to the user via the response module 501. The generation method and timing of the verification code images generated by the verification code generation module 503 can be adaptively set according to requirements; this embodiment does not impose any restrictions on this.
[0104] In some implementations, the verification code generation module 503 can randomly generate verification code images using Artificial Intelligence Generated Content (AIGC). The specific generation process is as follows:
[0105] First, the CAPTCHA generation module 503 obtains the randomly generated CAPTCHA and its text strategy. This text strategy describes the generation effect of the CAPTCHA, such as font shape, lighting effects, elements that make up the font shape, image background, element colors, etc. This text strategy can be input as a prompt message into the AI model, which then uses its generation capabilities to generate the required CAPTCHA pattern.
[0106] Next, the verification code generation module 503 inputs the verification code and its text strategy into the AI model of AIGC (Artificial Intelligence Generated Content) to obtain the aforementioned verification code image.
[0107] In some implementations, the CAPTCHA generation module 503 can generate artistic fonts with special lighting and shadow effects by using Artificial Intelligence Generated Content (AIGC) to improve visual effects and increase complexity.
[0108] For the aforementioned CAPTCHA verification device, taking a module as a software functional unit as an example, the response module 501 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the aforementioned 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 or in different regions. Further, 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 one or more geographically proximate data centers. Typically, a region may include multiple AZs.
[0109] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.
[0110] As an example of a hardware functional unit, the response module 501 may include at least one computing device, such as a server. 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 implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), 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. Similarly, the multiple computing devices included in the response module 501 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the response module 501 can be distributed in the same VPC or in multiple VPCs. These 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-described verification code verification method, the verification module 502 can be used to execute any step in the above-described verification code verification method, and the verification code generation module 503 can be used to execute any step in the above-described 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 device can also be applied to computing devices such as computers and servers, or to a cluster of computing devices including at least one computing device, to realize the verification code verification function.
[0115] In some embodiments, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the above-described verification code verification method.
[0116] The computer-readable storage medium can be any available medium that an electronic device can store, or a data storage device such as a data center that contains one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives). The computer-readable storage medium includes instructions that instruct the electronic device to perform one of the aforementioned CAPTCHA verification methods.
[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 that, when read and executed by the one or more processors, implement the above-described CAPTCHA verification method.
[0119] Please refer to Figure 6 , Figure 6 A schematic diagram of one possible structure of the aforementioned 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, which, when run on the processor 602, causes the processor 602 to execute the specific steps of the aforementioned verification code verification method. It should be understood that this application does not limit the number of processors and memories in the electronic device.
[0120] Bus 601 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 601 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The bus 601 may be represented by a single line, but this 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 (e.g., processor 602, memory 603, and communication interface 604).
[0121] Processor 602 may include any one or more of the following: a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0122] Memory 603 may include volatile memory, such as random access memory (RAM). Memory 603 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0123] Communication interface 604 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between electronic devices and other devices or communication networks.
[0124] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular hardware and software combination.
[0125] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0126] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0127] It should be noted that the above examples are merely specific embodiments of the present invention, and the present invention is obviously not limited to the above embodiments, with many similar variations. All modifications that can be directly derived or conceived by those skilled in the art from the content disclosed in this invention should fall within the protection scope of this invention.
Claims
1. A verification code verification method, comprising: in response to a user-initiated verification request, feeding back a verification code picture requiring semantic understanding to the user, wherein the verification code picture does not directly display verification code text, but displays a verification code pattern requiring semantic understanding; wherein the verification code picture is generated by: obtaining a randomly generated verification code and a script strategy of the verification code, the script strategy being used to describe the generation effect of the verification code, including at least one of font shape, light and shadow effect, element constituting font shape, picture background, and element color; inputting the verification code and the script strategy of the verification code into an artificial intelligence generated content (AIGC) model to obtain the verification code picture, the verification code picture presenting a verification code pattern in the form of an artistic font with light and shadow effect, the verification code pattern being difficult to be recognized by an OCR recognition algorithm or an image recognition algorithm, but being able to be understood by the user; in response to the user inputting a first verification code, verifying semantic consistency of the first verification code and the verification code picture; determining whether the verification request is verified according to the semantic consistency verification result of the first verification code and the verification code picture.
2. The method of claim 1, in response to the user inputting a first verification code, verifying semantic consistency of the first verification code and the verification code picture, specifically comprising: in response to the user inputting a first verification code, obtaining a second verification code associated with the verification code picture; verifying semantic consistency of the first verification code and the second verification code.
3. The method of claim 1, in response to the user inputting a first verification code, verifying semantic consistency of the first verification code and the verification code picture, specifically comprising: inputting the verification code picture and the first verification code into a pre-trained consistency comparison model; performing semantic recognition on the verification code picture through the consistency comparison model, and performing semantic consistency comparison on the semantic recognition result of the verification code picture and the semantic of the first verification code.
4. A verification code verification device, comprising: a response module configured to, in response to a user-initiated verification request, feed back a verification code picture requiring semantic understanding to the user, wherein the verification code picture does not directly display verification code text, but displays a verification code pattern requiring semantic understanding; a verification code generation module configured to obtain a randomly generated verification code and a script strategy of the verification code, the script strategy being used to describe the generation effect of the verification code, including at least one of font shape, light and shadow effect, element constituting font shape, picture background, and element color; inputting the verification code and the script strategy of the verification code into an artificial intelligence generated content (AIGC) model to obtain the verification code picture, the verification code picture presenting a verification code pattern in the form of an artistic font with light and shadow effect, the verification code pattern being difficult to be recognized by an OCR recognition algorithm or an image recognition algorithm, but being able to be understood by the user; The verification module is configured to, in response to the user inputting a first verification code, verify semantic consistency between the first verification code and the verification code picture, and determine whether the verification request is passed according to a verification result of the semantic consistency between the first verification code and the verification code picture. 5.The apparatus of claim 4, wherein the verification module is specifically configured to, in response to the user inputting a first verification code, acquire a second verification code associated with the verification code picture, and verify semantic consistency between the first verification code and the second verification code. 6.The apparatus of claim 4, wherein the verification module is specifically configured to input the verification code picture and the first verification code into a pre-trained consistency comparison model, perform semantic recognition on the verification code picture by using the consistency comparison model, and perform voice consistency comparison on a semantic recognition result of the verification code picture and a voice of the first verification code. 7.A computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method of any one of claims 1 to 3. 8.An electronic device comprising: one or more processors; and a memory associated with the one or more processors, the memory configured to store program instructions that, when executed by the one or more processors, perform the method of any one of claims 1 to 3.
Citation Information
Patent Citations
Verification code based on image content
CN103428163A
Semantic verification code generation method and device based on artistic style, equipment and medium
CN118035975A