Intelligent verification code generation and anti-swiping method, system and computer equipment

Through multimodal data generation and user behavior characteristics analysis, the difficulty of verification codes is dynamically adjusted, which solves the problem of easy cracking of traditional verification codes and poor user experience, and achieves a balance between security and friendliness of intelligent verification codes.

CN119397477BActive Publication Date: 2025-08-22SHENZHEN GAUSS COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411518519.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-08-22
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

Traditional verification code methods are easily identified and cracked by machines, and are difficult to dynamically respond to diverse attacks and user personalized needs, making it difficult to balance security and user experience.

Method used

Multimodal data generation and dual attention network are used to combine user behavior characteristics to conduct dynamic difficulty evaluation and adaptive anti-brushing rules generation to generate intelligent verification codes.

Benefits of technology

It improves the diversity of verification codes and anti-cracking capabilities, achieves a good balance between security and user experience, can quickly respond to new attack modes, and improves the effectiveness and flexibility of anti-brushing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119397477B_ABST
    Figure CN119397477B_ABST
Patent Text Reader

Abstract

The present invention relates to an intelligent verification code generation and anti-brushing method, system, and computer device. The method: performs multimodal generation processing on the verification code content to obtain original verification code data; performs multidimensional feature extraction on user interaction behavior to obtain user behavior feature data; inputs the original verification code data and the user behavior feature data into a dual attention network for fusion processing to obtain fused feature data; performs dynamic difficulty assessment calculation based on the fused feature data to obtain a verification code difficulty adjustment parameter; adjusts the difficulty of the original verification code data according to the verification code difficulty adjustment parameter to obtain target verification code data; performs multidimensional anti-brushing rule analysis based on the fused feature data and the target verification code data to generate an adaptive anti-brushing rule set. The present invention can comprehensively utilize multimodal data, dynamically adjust difficulty, and adaptively generate intelligent verification codes with anti-brushing rules.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of verification code generation, and in particular to an intelligent verification code generation and anti-swiping method, system and computer equipment. Background Art

[0002] Traditional static CAPTCHA methods face increasingly severe challenges. On the one hand, with the advancement of artificial intelligence technology, simple CAPTCHAs are increasingly easy for machines to identify and crack, significantly reducing their protective effectiveness. On the other hand, the increased complexity of CAPTCHAs to improve security often leads to a significant decline in user experience, affecting website usability and user satisfaction.

[0003] Furthermore, existing CAPTCHA systems typically employ fixed generation rules and difficulty levels, lacking dynamic awareness of user behavior and system security status. This static design approach cannot effectively address diverse attack vectors and the personalized needs of diverse users, resulting in systems that are either overly fragile or overly restrictive, making it difficult to strike a balance between security and user-friendliness. Furthermore, with the continuous evolution of cyberattack methods, single CAPTCHA technology can no longer provide comprehensive protection. The lack of in-depth analysis of user behavior and multi-dimensional anti-scam rules makes the system susceptible to circumvention by advanced automated tools or human-machine collaboration. Summary of the Invention

[0004] The main purpose of the present invention is to provide a method, system and computer equipment for generating and preventing fraudulent transactions using intelligent verification codes. The present invention can comprehensively utilize multimodal data, dynamically adjust difficulty, and adaptively generate intelligent verification codes with anti-fraud rules.

[0005] To achieve the above objectives, the present invention provides a method for generating and preventing fraudulent verification codes, comprising the following steps:

[0006] Perform multimodal generation processing on the verification code content to obtain the original verification code data;

[0007] Perform multi-dimensional feature extraction on user interaction behaviors to obtain user behavior feature data;

[0008] Inputting the original verification code data and the user behavior feature data into a dual attention network for fusion processing to obtain fused feature data;

[0009] Performing a dynamic difficulty evaluation calculation based on the fused feature data to obtain a verification code difficulty adjustment parameter;

[0010] Adjusting the difficulty of the original verification code data according to the verification code difficulty adjustment parameter to obtain target verification code data;

[0011] A multi-dimensional anti-brushing rule analysis is performed based on the fused feature data and the target verification code data to generate an adaptive anti-brushing rule set.

[0012] The present invention also provides an intelligent verification code generation and anti-swiping system, comprising:

[0013] A processing module is used to perform multimodal generation processing on the verification code content to obtain original verification code data;

[0014] The extraction module is used to extract multi-dimensional features of user interaction behaviors and obtain user behavior feature data;

[0015] A fusion module is used to input the original verification code data and the user behavior feature data into a dual attention network for fusion processing to obtain fused feature data;

[0016] A calculation module, configured to perform a dynamic difficulty evaluation calculation based on the fused feature data to obtain a verification code difficulty adjustment parameter;

[0017] An adjustment module, configured to adjust the difficulty of the original verification code data according to the verification code difficulty adjustment parameter to obtain target verification code data;

[0018] The analysis module is used to perform multi-dimensional anti-brushing rule analysis based on the fused feature data and the target verification code data to generate an adaptive anti-brushing rule set.

[0019] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0020] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0021] In summary, the technical solution provided by the present invention significantly increases the diversity and unpredictability of verification codes by integrating multiple verification code types, including letters, numbers, graphics, and arithmetic problems, and using a generative adversarial network to dynamically generate content, effectively enhancing the system's anti-cracking capabilities. Multi-dimensional feature extraction and fusion techniques are used to comprehensively capture user interaction behavior characteristics, providing rich data support for subsequent difficulty adjustment and anti-scam judgment, significantly improving the system's intelligence level. Verification code difficulty is calculated in real time based on the fused feature data, and the difficulty parameter is dynamically adjusted based on user proficiency, verification code complexity, and system security status, achieving a good balance between security and user experience. Through multi-dimensional anti-scam rule analysis and adaptive rule generation mechanisms, the system can quickly respond to new attack patterns and continuously optimize protection strategies, significantly improving the effectiveness and flexibility of anti-scam. By intelligently adjusting the difficulty and format of verification codes, interference with legitimate users is reduced while maintaining effective interception of malicious behavior, significantly improving the user experience. Combining multimodal data analysis and dynamic protection strategies, the overall security of the system is comprehensively enhanced, effectively responding to various automated attacks and advanced human-machine collaborative cracking attempts. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 This is a schematic diagram of the steps of the intelligent verification code generation and anti-swiping method according to one embodiment of the present invention;

[0023] Figure 2 This is a structural block diagram of an intelligent verification code generation and anti-swiping system in one embodiment of the present invention;

[0024] Figure 3 It is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.

[0025] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0027] Reference Figure 1 This embodiment provides a method for generating and preventing fraudulent verification codes, including the following steps:

[0028] S1, performing multimodal generation processing on the verification code content to obtain the original verification code data;

[0029] The CAPTCHA type is randomly selected to determine its specific type and obtain a CAPTCHA type identifier. CAPTCHA types include letters, numbers, graphics, and arithmetic problems. This random selection of CAPTCHA types increases the diversity and unpredictability of CAPTCHAs, effectively making them more difficult for machines to crack. Based on the CAPTCHA type identifier, a generative adversarial network model is constructed to generate and discriminate CAPTCHA content. The GAN model consists of two components: a CAPTCHA generator and a CAPTCHA discriminator. The CAPTCHA generator generates various CAPTCHA content, while the CAPTCHA discriminator evaluates the generated CAPTCHAs, helping the generator continuously optimize their generation results and ensure sufficient complexity and authenticity. When constructing the GAN model, random noise data is input into the CAPTCHA generator. The generator generates CAPTCHA content based on the random input data, generating candidate CAPTCHA data. The candidate CAPTCHA data is evaluated for readability and complexity to determine whether it is suitable for user use and meets anti-scam requirements. The purpose of readability assessment is to ensure that the CAPTCHA is not too difficult for normal users, allowing them to easily decipher its content. Complexity calculation, on the other hand, ensures that the CAPTCHA is sufficiently difficult for automated programs to crack, preventing it from being easily identified or cracked by malicious programs. Through readability assessment and complexity calculation of candidate CAPTCHAs, a CAPTCHA evaluation metric is derived, comprehensively reflecting the quality and applicability of the generated CAPTCHA. This metric is then fed into a CAPTCHA discriminator, which uses this metric to determine the authenticity of the CAPTCHA, generating a CAPTCHA authenticity score. This score assesses whether the generated CAPTCHA is realistic, resilient to automated cracking, and meets the expected protection. Based on the CAPTCHA authenticity score, the parameters of the CAPTCHA generator are iteratively optimized. By continuously adjusting the generator's internal parameters, the generator's generation quality is continuously improved. Through multiple iterations and training, the generator produces high-quality CAPTCHAs. Next, the optimized CAPTCHA generator is used to generate original CAPTCHA images, which serve as the initial form of the original CAPTCHA data. The original CAPTCHA images are then subjected to interference processing. Interference processing involves adding interference lines, background noise, and deforming characters to obtain the original CAPTCHA data. Adding interference lines creates more obstacles for automated programs when recognizing the image, making it more difficult to crack. Adding background noise disrupts image features, making it difficult to segment and recognize using traditional image processing algorithms. Character deformation, on the other hand, distorts or randomly transforms the letters or numbers in the CAPTCHA, making it difficult for machine learning models to accurately recognize the characters.

[0030] S2, extract multi-dimensional features of user interaction behavior to obtain user behavior feature data;

[0031] Specifically, the user's operational behavior while filling out the verification code is captured in real time. The resulting raw interaction data includes mouse movement trajectories, click events, keyboard input patterns, and time intervals between operations. This data reflects the user's specific actions during the verification code interaction and reveals their behavioral habits and characteristics during the verification process. Next, time series analysis is performed on the raw interaction data to extract time-related behavioral features, generating temporal feature data. Time series analysis helps identify temporal variations in user interaction behavior, such as reaction speed and action intervals when filling out the verification code. These time-related features can effectively distinguish between human users and automated programs. Based on the raw interaction data, a user operation behavior graph is constructed, representing each operation node when filling out the verification code as a node in the graph, while the order and relationships of the operations constitute the edges in the graph. Graph convolution is performed on this user operation behavior graph to extract graph-structured feature data. Graph convolution is a deep learning method that effectively extracts features from graph-structured data. It can mine the graphical relationships implicit in user operation behaviors, helping to better understand user interaction characteristics. Next, local features of user behavior are extracted from the raw interaction data to generate local behavior feature data. Local behavior features reflect the detailed characteristics of a user's behavior during a single interaction, such as the duration of a specific action or the smoothness of the mouse trajectory. These features effectively capture the detailed characteristics of a user's behavior during a specific operation. Simultaneously, based on the temporal feature data, long-term dependencies of user behavior are extracted to generate global behavior feature data. Global behavior features focus on reflecting the overall pattern of user behavior throughout the entire interaction process, such as the consistency and stability of operations during the entire verification code input process. The combination of local and global features enables the model to capture both detailed changes in user behavior and understand its overall trends, achieving more comprehensive user feature extraction. Multi-head attention fusion is performed on the graph structure feature data, local behavior feature data, and global behavior feature data to generate fused behavior features. The multi-head attention mechanism is a deep learning method that establishes complex interactions between different features and dynamically weights the importance of each feature. This fused feature captures both local and global behaviors, as well as incorporating correlation information from the graph structure. The fused behavioral features are combined with the user's historical information, device information, and contextual data from the IP address. Time-decay weighting is applied to the fused behavioral features to generate weighted behavioral features. Time-decay weighting accounts for the varying importance of user behavioral features at different points in time. Recent behavior has a higher reference value than earlier behavior. By assigning different weights to features at different time points, the weighted behavioral features more accurately reflect the user's current behavior. This combination of device information and IP address contextual data improves the accuracy of user authenticity assessments.Nonlinear transformation and dimensionality reduction are performed on the weighted behavioral features to obtain the final user behavior feature data. The purpose of nonlinear transformation is to increase the complexity of feature representation, enabling the model to capture more complex behavioral patterns and improve its ability to identify automated attacks. Dimensionality reduction, on the other hand, is to reduce the dimension of the features, lowering computational complexity and improving model processing efficiency.

[0032] S3, input the original verification code data and user behavior feature data into the dual attention network for fusion processing to obtain fused feature data;

[0033] It should be noted that the original CAPTCHA data is input into the CAPTCHA encoder for feature extraction. The CAPTCHA encoder consists of five convolutional layers, each of which uses the ReLU activation function and is supplemented by batch normalization. The convolutional layers extract local features from the CAPTCHA image, while the ReLU activation function introduces nonlinearity to increase the model's expressiveness. Batch normalization helps accelerate training and ensures model stability across different batches of data. After processing through the five convolutional layers, a CAPTCHA feature vector is generated, representing the content information of the original CAPTCHA, including its image features and texture patterns. Simultaneously, user behavioral feature data is input into the behavioral encoder for feature extraction, resulting in a behavioral feature vector. The behavioral encoder uses three fully connected layers, each of which uses the LeakyReLU activation function and dropout regularization. The fully connected layers perform a high-dimensional mapping of the input features, extracting high-level features that are useful for determining user authenticity. The LeakyReLU activation function preserves a certain gradient when the input is negative, mitigating the "neuron death" problem and improving the network's expressiveness and robustness. Dropout regularization prevents overfitting by randomly setting some neurons to zero, enabling the model to generalize better to new data. After processing through these three fully connected layers, a user behavior feature vector is obtained, representing the user's operational information while completing the CAPTCHA. A self-attention calculation is performed on the CAPTCHA feature vector to obtain attention weights within the CAPTCHA. The self-attention calculation involves linearly transforming the CAPTCHA feature vector to obtain a query matrix, a key matrix, and a value matrix. The dot product operation is then performed on the query and key matrices, followed by softmax normalization to obtain attention weights. Finally, these weights are weighted summed over the value matrix to obtain the enhanced CAPTCHA features. The self-attention mechanism aims to capture the important components of the CAPTCHA feature vector and establish dependencies between different features, thereby enhancing the effectiveness and robustness of the feature representation and enabling more comprehensive utilization of the CAPTCHA feature information. A cross-attention calculation is performed on the user behavior feature vector and the enhanced CAPTCHA features to obtain cross-modal attention weights. Cross-attention calculations utilize a multi-head attention mechanism consisting of eight attention heads, each focusing on a different aspect of the input features. This captures distinct associations between CAPTCHA features and user behavior characteristics, enabling the model to fuse and correlate information across different feature levels and attentional directions. The cross-modal attention weights calculated using the multi-head attention mechanism are then weighted against the enhanced CAPTCHA features to produce attention-enhanced CAPTCHA features. These attention-enhanced CAPTCHA features are concatenated with the user behavior feature vector and fed into a feature fusion network consisting of two fully connected layers.Each layer of the feature fusion network uses the tanh activation function, which maps the input features to the range [-1, 1], providing a smoother nonlinear transformation and facilitating stable model training. The initial fused features are obtained through two fully connected layers. To enhance the expressive power of the fused features, residual connections and layer normalization are performed on the initial fused features. The residual connection consists of a short-circuit branch and a main branch containing a 1x1 convolution. The short-circuit branch directly introduces the input features into the output, while the main branch transforms the input features through a 1x1 convolution before adding them to the short-circuit branch. This residual connection effectively prevents the vanishing gradient problem in deep networks and ensures that the features retain their original information after multiple transformations. Furthermore, layer normalization is used to normalize the fused features to eliminate scale differences between features at different layers, ensuring model stability and convergence speed. Through residual connections and layer normalization, the fused feature data is finally obtained.

[0034] S4, performing dynamic difficulty evaluation calculation based on the fused feature data to obtain the verification code difficulty adjustment parameter;

[0035] Specifically, the fused feature data is decomposed to obtain a subset of user behavior features and a subset of CAPTCHA features. Based on the subset of user behavior features, a user proficiency index is calculated to produce a user proficiency score. User proficiency indicators include CAPTCHA entry speed, operational fluency, and the user's historical pass rate. Entry speed reflects the user's efficiency in entering CAPTCHAs, while operational fluency represents the user's smoothness during CAPTCHA interactions, such as the smoothness of the mouse trajectory and the accuracy of clicks. The historical pass rate reflects whether the user has successfully completed CAPTCHAs in past interactions. Users with a high pass rate are generally proficient users. Combining these indicators, a score representing the user's current interaction proficiency is derived. This score is used to dynamically adjust the difficulty of CAPTCHAs to ensure that proficient users are not overly burdened while increasing the difficulty for suspicious users. Simultaneously, complexity features of the CAPTCHA are extracted based on the CAPTCHA feature subset to calculate a CAPTCHA complexity score. CAPTCHA complexity features include the degree of character distortion, the number of distracting elements, and the complexity of the background. Character distortion describes the degree of deformation and distortion of the characters in the CAPTCHA. A higher degree of distortion increases the difficulty for machines to crack, while a moderate degree of distortion ensures that normal users can still see the content clearly. The number of interference elements refers to the number of noise lines and dots contained in the CAPTCHA. These elements effectively interfere with the recognition process of image processing algorithms, increasing the security of the CAPTCHA. Background complexity refers to the complexity of the CAPTCHA background. A complex background effectively obscures character features, hindering automated image segmentation and recognition. Based on these characteristics, a score representing the complexity of the CAPTCHA itself is generated to measure the security capabilities of the CAPTCHA. The user proficiency score and the CAPTCHA complexity score are input into a preset difficulty assessment function to obtain an initial difficulty score. The difficulty assessment function comprehensively considers the user's interactive ability and the current complexity of the CAPTCHA to determine a preliminary difficulty score. For more proficient users, the CAPTCHA difficulty is reduced, while for less proficient or abnormal users, the complexity of the CAPTCHA is increased to prevent automated attacks. After the initial difficulty score is obtained, it is weighted and adjusted based on the current security threat level of the system. The system's security threat level changes in real time. When the system detects an increase in security threats, such as an abnormal increase in traffic within a short period of time or multiple failed attempts from the same IP address, the overall protection level is increased, thereby weighting the initial difficulty score accordingly to enhance the protection effectiveness of the verification code. The weighted difficulty score reflects the current system security situation and user interaction, ensuring that the verification code's protection capabilities match the risk level. The adjusted difficulty score is normalized based on the historical verification code difficulty distribution to obtain a standardized difficulty score. Based on the standardized difficulty score, the most suitable difficulty adjustment strategy is selected from a predefined set of difficulty adjustment strategies to obtain a difficulty adjustment solution.The difficulty adjustment strategy set includes a variety of optional adjustment strategies, such as increasing the degree of character distortion, increasing background noise, increasing the number of interference elements, or introducing multimodal verification (such as image selection or audio verification). Based on the standardized difficulty score, the difficulty adjustment strategy that best suits the current user and the current environment is automatically selected to ensure that the difficulty of the verification code does not affect the experience of normal users and can effectively protect against malicious behavior. The selected difficulty adjustment scheme is converted into a specific verification code parameter adjustment instruction to obtain the verification code difficulty adjustment parameter. S5, adjust the difficulty of the original verification code data according to the verification code difficulty adjustment parameter to obtain the target verification code data;.

[0036] The verification code difficulty adjustment parameters are parsed to obtain a corresponding difficulty adjustment instruction set, including adjustment requirements for various aspects such as character complexity, background noise, degree of deformation, and color contrast. These adjustment instructions are used to control the difficulty of various aspects of the verification code, achieving fine-grained personalized adjustment. Based on the character complexity instructions in the difficulty adjustment instruction set, the characters in the original verification code data are subjected to stroke addition and subtraction operations to obtain verification code data with adjusted character complexity. The stroke addition and subtraction operation increases or reduces the number of strokes in the verification code characters, making them more complex or simplified. For example, adding additional strokes or connecting lines to characters makes them more difficult for machines to recognize. Based on the background noise instructions in the difficulty adjustment instruction set, dynamic interference elements are added to the verification code data after character complexity adjustment to obtain verification code data with enhanced background. Dynamic interference elements include curves, dot patterns, and geometric shapes. By adding these elements to the verification code background, the visual complexity of the verification code is effectively increased, making it difficult for automated programs to separate character information from the background. The addition of curves disrupts the outline features of the characters, while the introduction of dot matrices and geometric shapes increases the overall noise level of the image, making it difficult for cracking programs to perform edge detection and image segmentation. The position, shape, and number of interference elements are dynamically changed and randomly generated according to the user's specified difficulty level, ensuring that each generated CAPTCHA is unique and increasing the difficulty for attackers. Based on the deformation instructions in the difficulty adjustment instruction set, the background-enhanced CAPTCHA data is subjected to nonlinear transformations, including distortion, rotation, and perspective transformation, to produce the deformed CAPTCHA data. The purpose of these nonlinear transformations is to increase the difficulty of the CAPTCHA, making it difficult for automated programs to recognize the CAPTCHA using image matching algorithms. Distortion transforms the characters, making them appear irregular, rotation changes the angle of the characters, and perspective transforms the characters to appear rotated in three-dimensional space, increasing the image's complexity. Based on the color contrast instructions in the difficulty adjustment instruction set, the deformed CAPTCHA data is subjected to color space adjustments to produce color-enhanced CAPTCHA data. Color space adjustments include hue shifting, saturation changes, and brightness adjustments. By shifting the hue, the overall color of the verification code is changed, giving each character a different color and increasing the diversity of the image. Saturation changes make colors more vivid or less vivid, increasing visual complexity. Brightness adjustment changes the brightness of the verification code, making the colors of certain areas brighter or darker, increasing interference with machine vision recognition. The color-enhanced verification code data is locally blurred to obtain locally blurred verification code data. The blurred area is dynamically determined based on the difficulty level of the verification code. For example, in the case of high difficulty, the edges of the characters are blurred, making the outlines of the characters even less clear, effectively interfering with the image's edge detection algorithm and making it impossible for automated programs to accurately segment and recognize characters.For CAPTCHAs with lower difficulty, the background area is blurred to improve readability. The partially blurred CAPTCHA data is adaptively fused with the original CAPTCHA data to generate the target CAPTCHA data. During the fusion process, fusion weights are used to dynamically calculate the contribution ratios of different data types. These weights are determined based on the difficulty adjustment parameter to ensure that the resulting CAPTCHA has high protection capabilities while not causing excessive interference to legitimate users.

[0037] S6, perform multi-dimensional anti-brushing rule analysis based on the fused feature data and target verification code data to generate an adaptive anti-brushing rule set.

[0038] The fused feature data is segmented into time windows to generate multiple time-segment features representing user behavior at different time intervals. The length of the time segments is dynamically adjusted based on the difficulty of the CAPTCHA. For easier CAPTCHAs, shorter time windows are selected to more precisely capture user behavior, while for more difficult CAPTCHAs, longer time windows are used to more comprehensively observe user interactions. This time-window segmentation allows the system to flexibly adapt to varying levels of difficulty, effectively capturing the time series characteristics of user behavior. Based on the segmented time-segment features, a user behavior sequence graph is constructed. The nodes in the graph represent the individual actions taken by the user during the CAPTCHA process, while the edges represent the sequence and dependencies between these actions. Topological sorting is performed on the graph to identify the dependencies between user actions, helping the system understand the sequence and logical connections between user actions during interaction and identify the rationality and consistency of user behavior. Based on the behavioral dependencies derived from the topological sorting, the target CAPTCHA data is partitioned to determine the resulting interaction regions within the CAPTCHA. The purpose of partition mapping is to associate different parts of the CAPTCHA with user actions based on their behavioral characteristics. For example, based on user information such as mouse movement and click locations, the CAPTCHA image is divided into multiple interactive areas to understand the user's interaction behavior in each area. This interactive area division helps the system better understand user behavior patterns and effectively determine whether the user performs reasonable operations on the entire CAPTCHA, preventing automated programs from cracking the CAPTCHA by targeting only certain areas. Based on the interactive area division results, the user's operation entropy is calculated to obtain a behavioral complexity index. The operation entropy measures the randomness and complexity of user operations in each interactive area. If the user's operations exhibit high randomness and complexity across areas, the operation entropy is high, while if not, the operation entropy is low. By calculating the operation entropy, the user's behavior complexity index is obtained, effectively distinguishing legitimate users from automated programs. The behavior complexity index is compared with a preset threshold to obtain a preliminary anti-scam determination result, reflecting the rationality and authenticity of the user's behavior and used to identify possible abnormal behavior. Fuzzy reasoning is performed on this preliminary anti-scam determination result to obtain an anti-scam confidence level. Fuzzy reasoning is a reasoning method based on a predefined set of rules and membership functions, and is highly adaptable when processing complex and uncertain information. During the fuzzy inference process, the initial anti-brushing determination results are mapped to different membership levels based on different membership functions. This is then deduced based on the pre-set anti-brushing rules to arrive at the final anti-brushing confidence level. The anti-brushing confidence level reflects the system's assessment of the user's behavior's abnormality. A higher confidence level indicates a higher suspicion of abnormal behavior, while a lower confidence level indicates a more normal behavior.Based on the anti-scaling confidence, the weights of anti-scaling rules are dynamically adjusted to produce updated rule weights. Anti-scaling rule weights reflect the importance of different rules within the overall anti-scaling strategy. Dynamically adjusting these weights based on the current user's behavioral characteristics and confidence allows the anti-scaling strategy to more flexibly adapt to different risk scenarios. Based on the updated rule weights, historical anti-scaling rules are reordered and pruned to generate an adaptive anti-scaling rule set. Reordering sorts all historical rules according to the current rule weights to ensure that the most important rules are prioritized within the current anti-scaling strategy. Pruning removes rules that are no longer applicable or have too low a weight, improving system efficiency and streamlining the anti-scaling rule set. This reordering and pruning process results in an adaptive anti-scaling rule set that dynamically adjusts the anti-scaling strategy based on different user behavioral characteristics and current risk scenarios, ensuring that the CAPTCHA system provides a good user experience while maintaining sufficient protection against various potential automated attacks.

[0039] In one example, multimodal generation processing is performed on the verification code content to obtain original verification code data, including: randomly selecting a verification code type to obtain a verification code type identifier, where the verification code types include letters, numbers, graphics, and arithmetic problems; constructing a generative adversarial network model based on the verification code type identifier to obtain a verification code generator and a verification code discriminator; inputting random noise data into the verification code generator to generate verification code content to obtain candidate verification code data, and performing readability evaluation and complexity calculation on the candidate verification code data to obtain a verification code evaluation index; inputting the verification code evaluation index into the verification code discriminator to judge the authenticity to obtain a verification code authenticity score, and iteratively optimizing the parameters of the verification code generator based on the verification code authenticity score to obtain an optimized verification code generator; using the optimized verification code generator to generate an original verification code image, and performing interference processing on the original verification code image, including adding interference lines, background noise, and character deformation, to obtain original verification code data.

[0040] In this example, the verification code type is randomly selected to obtain the verification code type identification. The verification code types include letters, numbers, graphics, arithmetic problems, etc. When generating the verification code, in order to ensure the diversity and unpredictability of the verification code, random selection is performed among these different types. Assume that the random selection process is represented by a probability distribution function, set as ,in Indicates the type of verification code. Letters, numbers, shapes, arithmetic problems Through the distribution function, the type identifier used for each verification code generation is randomly determined , ensuring the diversity of verification code types. After determining the verification code type, a generative adversarial network (GAN) model is constructed based on the type identification to generate and discriminate the verification code content. The generative adversarial network model mainly consists of two parts: the generator and the discriminator. The generator is responsible for generating the verification code content, while the discriminator is responsible for judging whether the generated verification code is realistic. Let the generator be and the discriminator is , generator The input is random noise data , the noise data is usually randomly sampled from a normal distribution, By Input Generator , generate candidate verification code data, the generation process is expressed by the formula:

[0041] ;

[0042] in, Indicates the generated candidate verification code data, It is the verification code type identifier. The generator is based on and Different types of verification codes are generated, for example, if If the type is letter, the generator will generate a verification code containing random letters. If the type is arithmetic problem, the generator will generate a verification code containing a simple arithmetic expression. Readability evaluation and complexity calculation are performed on the candidate verification code data to ensure that the generated verification code is both readable for human users and has a certain degree of anti-cracking difficulty for automated programs. Readability evaluation uses specific metrics, such as calculating the clarity of characters, the spacing between strokes, and other indicators. Let the readability index be The complexity is calculated by calculating the number of interference elements and the degree of distortion of characters in the verification code. The complexity index is set as Combining readability and complexity, we get a comprehensive captcha evaluation metric:

[0043] ;

[0044] in, and The weight coefficients for readability and complexity are used to balance the importance of the two. , effectively measure whether the generated verification code meets the reading needs of human users and the requirements of preventing automated cracking. Input Discriminator , the discriminator judges the authenticity of the generated verification code to obtain the authenticity score of the verification code The goal of the discriminator is to distinguish between the verification codes generated by the generator and the real verification code samples, while the goal of the generator is to generate realistic verification codes so that the discriminator cannot easily distinguish between the two. The adversarial process is carried out by alternately training the generator and the discriminator, so that the generation quality of the generator is continuously improved. The loss function of the generator is expressed as:

[0045] ;

[0046] By minimizing the loss function, the parameters of the generator are optimized to improve the authenticity of the generated verification code, making it impossible for the discriminator to distinguish between the generated and the real verification code. After multiple iterations of training, an optimized generator is obtained. , the generator can generate verification codes with high readability and complexity. Then, using the optimized generator Generate the original verification code image. In order to increase the protection capability of the verification code, the generated original verification code image is interfered with, including adding interference lines, background noise, and character deformation. For example, adding interference lines is to increase the visual complexity of the verification code, making it difficult for automated programs to segment and recognize characters; adding background noise interferes with the overall structure of the image, making it more difficult for machine vision algorithms to extract effective character features; character deformation is to twist and rotate the characters to make the shape of the characters irregular, increasing the difficulty of cracking. The interference processing process is expressed as:

[0047] ;

[0048] Among them, Noise(·) represents the interference processing operation on the generated image, and the final result is is the original verification code data after interference.

[0049] In one example, multi-dimensional feature extraction is performed on user interaction behavior to obtain user behavior feature data, including: real-time capture of the user's operation behavior in the process of filling in the verification code to obtain original interaction data, the original interaction data including mouse movement trajectory, click events, keyboard input mode and operation time interval; time series analysis is performed on the original interaction data to extract time-related features to obtain time series feature data, and a user operation behavior graph is constructed based on the original interaction data, and graph convolution processing is performed on the user operation behavior graph to obtain graph structure feature data; local feature extraction is performed on the user behavior based on the original interaction data to obtain local behavior feature data, and long-term dependency of the user behavior is extracted based on the time series feature data to obtain global behavior feature data; multi-head attention fusion is performed on the graph structure feature data, local behavior feature data and global behavior feature data to obtain fused behavior features; time-attenuated weighted processing is performed on the fused behavior features in combination with the contextual data of user historical information, device information and IP address to obtain weighted behavior features, and nonlinear transformation and dimensionality reduction processing are performed on the weighted behavior features to obtain user behavior feature data.

[0050] In this example, the user's operating behavior in the process of filling out the verification code is captured in real time to obtain raw interaction data, including mouse movement trajectory, click events, keyboard input mode, and operation time intervals. The mouse movement trajectory refers to the movement path of the mouse when the user fills out the verification code. This trajectory reflects whether the user operates in a natural way; the click event is the specific location and number of click operations performed by the user on the interface; the keyboard input mode refers to the user's input behavior when using the keyboard, such as the sequence of keys, changes in key strength, etc.; the operation time interval is the pause and duration of the user between each operation. These data reflect whether the user's behavior conforms to the typical human operation mode. Then, the raw interaction data is subjected to time series analysis to extract time-related features and obtain time series feature data. By capturing the changes in user behavior at different time points, the user's overall operation mode can be understood. For example, suppose the user's operation behavior is at time The characteristics of , the entire operation process is regarded as a time series . By analyzing the time series, calculating the speed, acceleration and time interval characteristics of the operation, it helps to determine whether the user's operation has a real behavior pattern. Construct a user operation behavior graph based on the original interaction data to capture the relationship and structure between different user operations. The nodes of the user operation behavior graph represent the specific operations of the user at different time points (such as mouse clicks or keyboard input), and the edges between the nodes represent the order and mutual dependence of the operations. For example, if the user first clicks on a certain area and then enters certain characters when filling in the verification code, there is an edge association between the two operations. By constructing a behavior graph, the logical structure of the user operation and the dependency between each operation are portrayed. Let the operation behavior graph be ,in Represents a collection of operation nodes, Represents the edge set between operations. Graph convolution is performed on the behavior graph, and a graph convolution network is used to extract graph structural feature data from user behavior. The graph convolution process is expressed as:

[0051] ;

[0052] in, Indicates the The node feature matrix of the layer, represents the adjacency matrix of the graph, Indicates the The weight matrix of the layer, It is an activation function. Through graph convolution, the features of each node are aggregated to extract the structural feature data of the operation behavior graph. , reflecting the dependencies and logical order between different user operations. At the same time, local features are extracted from the original interaction data to obtain local behavior feature data. Local behavior features refer to the detailed performance of users in specific operations, such as the smoothness of mouse movement, the accuracy of clicks, etc. These features are extracted by in-depth analysis of the data of each specific operation. At the same time, based on the time series feature data, the long-term dependencies of user behaviors are extracted to obtain global behavior feature data. Long-term dependencies reflect the consistency and continuity of user behaviors throughout the interaction process. These features help identify automated programs. Next, the graph structure feature data, local behavior feature data, and global behavior feature data are fused using a multi-head attention mechanism. The multi-head attention mechanism weights the input features through multiple different attention heads to capture the correlation between different features. Let the graph structure features, local features, and global features be , the multi-head attention mechanism is expressed as:

[0053] ;

[0054] in, Represents the fused behavioral features, and MultiHead represents the calculation process of the multi-head attention mechanism. The fused behavioral features are obtained by weighted summation and aggregation of different features. Combining the contextual data of user history information, device information and IP address, the fused behavior features are weighted by time decay to obtain weighted behavior features. Considering the timeliness of user behavior, recent behavior features usually have higher reference value, and higher weights are given to recent features. Let the fused behavior features be , the time decay weighting is expressed as:

[0055] ;

[0056] in, is the time decay weight function, Represents the time range of the feature. Through weighted processing, the user's current behavioral status is more reasonably reflected, and historical data is combined to comprehensively evaluate the user. The weighted behavioral features are subjected to nonlinear transformation and dimensionality reduction processing to obtain user behavioral feature data. Nonlinear transformation maps features into a nonlinear space through activation functions (such as ReLU or Tanh) to increase the complexity of feature representation, allowing the model to capture more complex behavioral patterns. Dimensionality reduction processing maps high-dimensional features to lower dimensions through methods such as principal component analysis or autoencoders, reducing computational complexity and removing redundant features.

[0057] In one example, the original verification code data and user behavior feature data are input into the dual attention network for fusion processing to obtain fused feature data, including: inputting the original verification code data into the verification code encoder for feature extraction to obtain a verification code feature vector, the verification code encoder contains 5 convolutional layers, each convolutional layer uses the ReLU activation function and batch normalization; inputting the user behavior feature data into the behavior encoder for feature extraction to obtain a behavior feature vector, the behavior encoder contains 3 fully connected layers, each layer uses the LeakyReLU activation function and dropout regularization; performing self-attention calculation on the verification code feature vector to obtain the internal attention weight of the verification code, the self-attention calculation includes linear transformation of the query matrix, key matrix and value matrix, and softmax normalization Operation; weighted summation of the verification code feature vector based on the internal attention weight of the verification code is performed to obtain the enhanced verification code feature; cross-attention calculation is performed on the behavioral feature vector and the enhanced verification code feature to obtain the cross-modal attention weight. The cross-attention calculation uses a multi-head attention mechanism, which includes 8 attention heads; weighting the enhanced verification code feature according to the cross-modal attention weight is performed to obtain the attention-enhanced verification code feature; the attention-enhanced verification code feature and the behavioral feature vector are spliced ​​and input into a feature fusion network containing 2 fully connected layers, each layer using a tanh activation function to obtain the initial fusion feature; residual connection and layer normalization are performed on the initial fusion feature to obtain fusion feature data. The residual connection includes a short-circuit branch and a main branch containing a 1x1 convolution.

[0058] In this example, the original verification code data is input into the verification code encoder for feature extraction. The verification code encoder consists of 5 convolutional layers, each of which uses the ReLU activation function and batch normalization. The function of the convolutional layer is to extract local features in the image. The ReLU activation function introduces nonlinearity by keeping the positive input and setting the negative value to zero, thereby enhancing the expressive power of the model. The batch normalization operation is used to standardize the input data of each batch, reduce the offset of internal covariates, and accelerate the convergence process of the model. Assume that The output of the convolutional layer is , then The operation of the layer is expressed as:

[0059] ;

[0060] in, It is The output features of the layer, Indicates the convolutional layers, BatchNorm is the batch normalization operation, and ReLU is the activation function. Through the operation of these five convolutional layers, a high-dimensional verification code feature vector is obtained. The user behavior feature data is input into the behavior encoder for feature extraction to obtain a behavior feature vector. The behavior encoder contains 3 fully connected layers, and each fully connected layer uses the LeakyReLU activation function and dropout regularization. The function of the fully connected layer is to perform a linear transformation on the input features, reduce the dimensionality of the high-dimensional features, or map them to a new feature space. The LeakyReLU activation function maintains a certain gradient when the input is negative, alleviating the "neuron death" problem and making the model more robust. Dropout is used to randomly set a part of the neurons to zero to reduce the overfitting phenomenon of the model. Suppose The output of the fully connected layer is , then The operation of the layer is expressed as:

[0061] ;

[0062] in, It is The output features of the layer, Indicates the Fully connected layers, LeakyReLU is the activation function, and Dropout is the regularization operation. After processing through three fully connected layers, the behavior feature vector is obtained. Next, self-attention calculation is performed on the verification code feature vector to obtain the attention weight within the verification code. The self-attention calculation linearly transforms the feature vector to obtain the query matrix , key matrix Sum Matrix , and calculate the attention weight by taking the dot product of the query matrix and the key matrix, and then normalize it by softmax to get the weight distribution. The calculation of attention weight is expressed as:

[0063] ;

[0064] in, is the linear transformation matrix of query, key and value, is the dimension of the bond matrix, is the attention weight matrix. Based on the attention weight matrix Pair Matrix Perform weighted summation to obtain enhanced verification code features , the calculation formula is:

[0065] ;

[0066] Through this process, the important parts of the verification code features are strengthened, making the model pay more attention to the key parts of the verification code image. and enhanced verification code features Perform cross-attention calculation to obtain cross-modal attention weights. The purpose of cross-attention is to capture the correlation between verification code features and user behavior features, and use multi-head attention mechanism to associate in different feature spaces to enhance the interactive information of features. Assume that multi-head attention includes The weight calculated by each attention head is ( ), then the calculation of cross-modal attention weight is:

[0067] ;

[0068] in, Indicates the The value matrix corresponding to each head is obtained by splicing the attention results of different heads to obtain the cross-modal fusion features. The enhanced verification code features are weighted according to the cross-modal attention weight to obtain the attention-enhanced verification code features . Captcha features that enhance attention and behavioral feature vector The concatenation is performed and input into a feature fusion network consisting of two fully connected layers. Each layer uses the tanh activation function to obtain the initial fusion feature. The role of the tanh activation function is to map the input to the range of [-1, 1], providing a smooth nonlinear mapping to increase the effect of feature fusion. The output of the fully connected layer of the layer is , then The operation of the layer is expressed as:

[0069] ;

[0070] Through these two layers of full connection operations, the initial fusion features are obtained The initial fusion features are subjected to residual connection and layer normalization to obtain the final fusion feature data. The purpose of the residual connection is to prevent the information from being gradually lost in the deep network by adding the input directly to the output, thereby improving the stability of training. Assume that the residual connection consists of a short-circuit branch and a The main branch of the convolution, the calculation of the fusion feature is expressed as:

[0071] ;

[0072] Residual features Perform layer normalization to eliminate the scale differences between different feature dimensions, so that the model can converge better and finally obtain fused feature data .

[0073] In one example, a dynamic difficulty assessment calculation is performed based on fused feature data to obtain a verification code difficulty adjustment parameter, including: feature decomposition of the fused feature data to obtain a user behavior feature subset and a verification code feature subset; calculating a user proficiency index based on the user behavior feature subset to obtain a user proficiency score, where the user proficiency index includes verification code filling speed, operation fluency, and historical pass rate; extracting verification code complexity features based on the verification code feature subset to obtain a verification code complexity score, where the verification code complexity features include the degree of character distortion, the number of interference elements, and background complexity; inputting the user proficiency score and the verification code complexity score into a preset difficulty assessment function to obtain an initial difficulty score; weightedly adjusting the initial difficulty score based on the current security threat level of the system to obtain an adjusted difficulty score, and normalizing the adjusted difficulty score based on the historical verification code difficulty distribution to obtain a standardized difficulty score; based on the standardized difficulty score, selecting the most suitable difficulty adjustment strategy from a predefined difficulty adjustment strategy set to obtain a difficulty adjustment scheme, and converting the difficulty adjustment scheme into a specific verification code parameter adjustment instruction to obtain a verification code difficulty adjustment parameter.

[0074] In this example, the fused feature data is decomposed to obtain the user behavior feature subset and the verification code feature subset. The fused feature data contains the user's operation behavior when filling in the verification code and the characteristics of the verification code itself. The feature fusion reflects the interaction process between the user and the verification code. Calculate the user's proficiency index and get the user's proficiency score. The user proficiency index includes multiple aspects, such as verification code filling speed, operation fluency and historical pass rate. Filling speed is measured by the time it takes for the user to complete the entire verification code filling. Let the filling time be The smoothness of the operation is evaluated by the smoothness of the user's mouse movement trajectory and the accuracy of the click operation. Let the smoothness be The historical pass rate indicates the percentage of users who have successfully passed the verification code in the past. Based on these indicators, the user's proficiency score is calculated. , the formula is:

[0075] ;

[0076] in, is the weight coefficient, which is used to balance the importance of different indicators in the proficiency score. Extract the complexity features of the verification code to obtain the verification code complexity score. The complexity features of the verification code include the degree of character distortion, the number of interference elements, and the complexity of the background. The degree of character distortion is measured by analyzing the deformation amplitude of the characters in the verification code, and it is set as ; The number of interference elements represents the number of random noise lines and dots in the verification code, set it to ; Background complexity is evaluated by analyzing the complexity of the verification code image background, set it to . Based on the complexity characteristics, calculate the complexity score of the verification code , the formula is:

[0077] ;

[0078] in, is a weight coefficient used to balance the importance of different complexity features in the overall score. Higher character distortion, number of interference elements and background complexity will result in a higher complexity score for the verification code. and verification code complexity score Input into the preset difficulty evaluation function to get the initial difficulty score The difficulty evaluation function combines the user's proficiency and the complexity of the verification code to ensure that the verification code difficulty is appropriate for users of different proficiency levels. The initial difficulty score is expressed as:

[0079] ;

[0080] in, and is a weight coefficient used to balance the impact of user proficiency and verification code complexity in the overall score. If the user proficiency is high, the verification code difficulty score will be low. Conversely, if the user proficiency is low and the verification code complexity is high, the difficulty score will be high. Based on the current security threat level of the system, the initial difficulty score is weighted and adjusted to obtain the adjusted difficulty score. Security Threat Level Reflects the current security risk status of the system. When the system faces a higher attack risk, the difficulty of the verification code should be increased accordingly. The adjusted difficulty score is expressed as:

[0081] ;

[0082] Ensure that in high-risk situations, even if the user is highly proficient, the difficulty of the CAPTCHA is increased accordingly to prevent automated attacks. The adjusted difficulty score is normalized based on the historical CAPTCHA difficulty distribution to obtain a standardized difficulty score. For example, let the mean and standard deviation of the historical difficulty score be and , then the standardized difficulty score is expressed as:

[0083] ;

[0084] Through normalization, the difficulty score of the current user is evaluated relative to the historical average level. Based on the standardized difficulty score, the most suitable difficulty adjustment strategy is selected from the predefined difficulty adjustment strategy set to obtain the difficulty adjustment plan. For example, the predefined difficulty adjustment strategy set includes different adjustment methods such as increasing character distortion, increasing background noise, or adding interference elements. The appropriate strategy is selected based on the standardized difficulty score to ensure that the difficulty of the verification code can adapt to the current user's proficiency and security requirements. The difficulty adjustment plan is then converted into specific verification code parameter adjustment instructions, such as adjusting the degree of character deformation, increasing the number of interference lines, or changing the complexity of the background, etc., to obtain the difficulty adjustment parameters of the verification code.

[0085] In one example, the difficulty of original verification code data is adjusted according to verification code difficulty adjustment parameters to obtain target verification code data, including: parsing the verification code difficulty adjustment parameters to obtain a difficulty adjustment instruction set, the difficulty adjustment instruction set including character complexity, background interference, deformation degree and color contrast; according to the character complexity instruction in the difficulty adjustment instruction set, adding or subtracting strokes of characters in the original verification code data to obtain verification code data after character complexity adjustment; based on the background interference instruction in the difficulty adjustment instruction set, adding dynamic interference elements, including curves, dot matrices and geometric figures, to the verification code data after character complexity adjustment to obtain background enhanced verification code data; according to the background interference instruction in the difficulty adjustment instruction set, adding or subtracting strokes of characters in the original verification code data ... difficulty adjustment instruction set, adding or subtracting strokes of characters in the original verification code data to obtain background enhanced verification code data; according to the difficulty adjustment instruction set, adding or subtracting strokes of characters in the original verification code data to obtain background enhanced verification code data; according to the difficulty adjustment instruction set, adding or subtracting strokes of characters in the original verification code data to obtain background enhanced verification code data; according to the difficulty adjustment instruction set, adding or subtracting strokes of characters in the original verification code data to obtain background enhanced verification code data; The deformation degree instruction in the difficulty adjustment instruction set performs nonlinear transformation on the background-enhanced verification code data, including distortion, rotation and perspective transformation, to obtain the deformed verification code data; based on the color contrast instruction in the difficulty adjustment instruction set, the color space adjustment is performed on the deformed verification code data, including hue shift, saturation change and brightness adjustment, to obtain color-enhanced verification code data; the color-enhanced verification code data is locally blurred, and the blurred area is dynamically determined according to the difficulty level to obtain locally blurred verification code data; the locally blurred verification code data is adaptively fused with the original verification code data, and the fusion weight is dynamically calculated according to the difficulty adjustment parameter to obtain the target verification code data.

[0086] In this example, the difficulty adjustment parameters of the verification code are parsed to obtain a specific difficulty adjustment instruction set. The difficulty adjustment instruction set contains four main dimensions: character complexity, background interference, deformation degree, and color contrast. These instruction sets represent the adjustment requirements of the verification code in various aspects to increase its protection difficulty. For example, the character complexity instruction is used to describe the degree of increase or decrease in the strokes of the character, the background interference instruction describes the type and amount of noise to be added, the deformation degree instruction describes the distortion or perspective intensity of the image, and the color contrast instruction describes the way to adjust the color. According to the character complexity instruction in the difficulty adjustment instruction set, the characters in the original verification code data are increased or decreased in strokes to obtain the verification code data after the character complexity is adjusted. Suppose the original character image is The character complexity is adjusted by increasing or decreasing the strokes of the character. For example, the increase or decrease operation is achieved by adding additional lines or removing existing strokes. The adjusted character complexity image is recorded as The character complexity adjustment formula is expressed as:

[0087] ;

[0088] in, Indicates the stroke set to be added. Represents a set of strokes that need to be removed. By adding or subtracting operations, the complexity of the characters is increased or decreased, which increases the difficulty for the machine to crack the verification code. Based on the result of the character complexity adjustment, the verification code is enhanced according to the background interference instruction in the difficulty adjustment instruction set. The addition of background interference includes elements such as dynamic curves, dot matrices, and geometric figures to increase the complexity and protection capabilities of the verification code. For example, by adding randomly generated curves to the image, these curves partially overlap with the characters, increasing the visual interference of the image, making it difficult for the automated program to recognize the character boundaries. Add dot matrices and geometric figures to the image to increase the visual complexity of the verification code. Let the enhanced verification code image be , the process of adding background interference elements is expressed as:

[0089] ;

[0090] in, The set of interference elements representing curves, dot matrices, and geometric shapes respectively. The higher the background interference, the higher the number and complexity of these elements. Next, the background-enhanced verification code data is subjected to nonlinear transformations according to the deformation degree instruction, including distortion, rotation, and perspective transformation. The distortion transformation bends the characters or background along a specific curve, so that the shape of the characters no longer presents a simple straight line or regular shape. This transformation is expressed as a coordinate transformation function:

[0091] ;

[0092] in, is the original pixel coordinate, is the pixel coordinate after distortion transformation, is a distortion function. Rotating the image causes the characters to rotate at a certain angle, making it more difficult for the cracking program to identify the direction of the characters. Perspective transformation makes the image appear to have a sense of depth in three-dimensional space, making the characters appear to be displayed on different planes, increasing the complexity of cracking. After nonlinear transformation, the deformed verification code data is obtained. Based on the color contrast instruction in the difficulty adjustment instruction set, the color space of the deformed verification code data is adjusted, including hue shift, saturation change and brightness adjustment. Color adjustment increases the complexity of the image by changing the color attributes of the verification code image, making it difficult for automated programs to recognize characters by color features. Let the adjusted color image be , color space adjustment is expressed as:

[0093] ;

[0094] in, Represents the transformation operations of hue, saturation and brightness respectively. For example, by adjusting the hue, the color of the character is shifted, so that the same character has different colors in different verification codes, increasing the difficulty of cracking; by adjusting the saturation and brightness, some parts of the characters appear more blurred or more conspicuous. The color-enhanced verification code data is locally blurred to obtain locally blurred verification code data. The blurred area is dynamically determined according to the difficulty level. For example, in the case of high difficulty, the edges or intersections of the characters are blurred to interfere with the morphological information of the characters, making it impossible for the automated program to accurately segment the characters. The blurring is achieved through convolution operations. Let the blurred image be , the fuzzy operation is expressed as:

[0095] ;

[0096] in, is a blur kernel used to perform blur convolution on the local area of ​​the image. The degree of blur depends on the difficulty adjustment parameter. The size and weight of the blur kernel are adjusted according to different difficulties to ensure that the blur effect of the image can effectively interfere with automatic recognition. The locally blurred verification code data is adaptively fused with the original verification code data to obtain the final target verification code data. Adaptive fusion combines the blurred and deformed features with the original verification code features, so that the final verification code has both high protection capabilities and a certain degree of readability. Let the fused image be , adaptive fusion is expressed as:

[0097] ;

[0098] in, To integrate the weights, the parameters are dynamically calculated based on the difficulty adjustment. Closer to 1, it retains more blur and deformation features; at lower difficulty, Reduce, so that the original features are easier to preserve.

[0099] In one example, a multi-dimensional anti-brushing rule analysis is performed based on fused feature data and target verification code data to generate an adaptive anti-brushing rule set, including: segmenting the fused feature data into time windows to obtain multiple time segment features, and dynamically adjusting the length of each time segment according to the difficulty of the verification code; constructing a user behavior sequence diagram based on the time segment features, and topologically sorting the user behavior sequence diagram to obtain behavioral dependencies; partitioning and mapping the target verification code data according to the behavioral dependencies to obtain the verification code interaction area division results; calculating the user operation entropy value based on the verification code interaction area division results to obtain a behavior complexity index, and comparing the behavior complexity index with a preset threshold to obtain a preliminary anti-brushing judgment result; performing fuzzy reasoning on the preliminary anti-brushing judgment result to obtain anti-brushing confidence, and the fuzzy reasoning is based on a predefined rule set and membership function; dynamically adjusting the weight of the anti-brushing rule according to the anti-brushing confidence to obtain an updated rule weight, and reordering and pruning the historical anti-brushing rules based on the updated rule weight to obtain an adaptive anti-brushing rule set.

[0100] In this example, the fused feature data is segmented into time windows to obtain multiple time segment features. The user's behavior data is divided into time periods to capture the changes in the user's behavior in different time segments. The length of each time window is dynamically adjusted, depending on the difficulty level of the current verification code. Suppose the total fused feature data is , which is in The time window length is , then the time segment feature is expressed as ,in , , is the number of time segments obtained by segmentation. The higher the difficulty of the verification code, the longer the time window The shorter the time window, the more detailed the system observation of the user's behavior. A user behavior sequence diagram is constructed based on the time segment characteristics. The nodes of the user behavior sequence diagram represent the user's behavior in different time segments, and the edges between each node represent the time dependency between behaviors. For example, if the user performs a mouse movement operation in the first time window and a click operation in the next time window, there is a directed edge between the two behavior nodes, indicating the user's behavior dependency order. Let the user behavior sequence diagram be ,in is a set of behavior nodes, is the edge set of the behavior dependency relationship. In order to obtain the dependency order of user behavior, the user behavior sequence graph is topologically sorted. The result of topological sorting represents the user behavior dependency relationship. For example, the node sequence of the behavior sequence graph is , its topological sorting result reflects whether the user's behavior sequence in the interaction process is logical. Based on the behavior dependency relationship obtained by topological sorting, the target verification code data is partitioned and mapped to obtain the verification code interaction area division result. The partition mapping process is to map the user's operation behavior to different parts of the verification code image, so as to determine whether the user has reasonably interacted with all areas of the verification code. For example, the verification code image is divided into several interaction areas, and the interaction area is , the user's operation behavior is mapped to these areas to obtain a regional division result. Through regional division, it is analyzed whether the user has performed effective operations on the key parts of the verification code (such as all character areas) to prevent the automated program from cracking only part of the area. Based on the division results of the verification code interaction area, the user's operation entropy value is calculated to obtain the behavior complexity index. The operation entropy value is an indicator that measures the randomness and complexity of the user's operation behavior, and is used to determine whether the user's behavior conforms to the normal human behavior characteristics. Suppose the user is in area The operation probability is , the user's operation entropy value is expressed as:

[0101] ;

[0102] in, Indicates the entropy value of user operations, Indicates that the user is in the area The operating frequency, is the total number of regions. A higher operation entropy value indicates that the user's operations in each region are relatively uniform and have a certain degree of randomness, which is usually a characteristic of human users, while automated programs show a lower entropy value because their operations are often concentrated in certain specific regions or have a high degree of regularity. With the preset threshold Compare and get the preliminary anti-swiping judgment result. , it means that the user behavior has high complexity and is a normal user; otherwise, there is suspicion of automated attack. Next, fuzzy reasoning is performed on the preliminary anti-brushing judgment results to obtain the anti-brushing confidence. The purpose of fuzzy reasoning is to process complex and uncertain information and use fuzzy logic to evaluate the abnormality of user behavior. Fuzzy reasoning is based on a predefined set of rules and membership functions. Each rule describes the user behavior characteristics and their possible confidence in different situations. The membership function is used to map characteristics such as operation entropy and behavior sequence to fuzzy sets to obtain the corresponding confidence. Let the anti-brushing confidence be , the confidence obtained by fuzzy reasoning is expressed as:

[0103] ;

[0104] in, represents the fuzzy inference function, The operation entropy value, TopoOrder, represents the topological sorting result of the behavior dependency relationship. The higher the confidence, the more the user's behavior conforms to the characteristics of normal humans. , dynamically adjust the weights of anti-brushing rules to obtain updated rule weights. The weights of anti-brushing rules reflect the importance of different rules in the anti-brushing strategy. The weights of these rules are adjusted according to the current confidence level to ensure the flexibility and effectiveness of the anti-brushing strategy. For example, if the confidence level is low, it means that the user behavior is more likely to be abnormal, then the weights of rules related to strict protection will be increased, while the weights of more relaxed rules will be reduced. Let the updated rule weights be Expressed as:

[0105] ;

[0106] in, is the original rule weight, is the adjustment coefficient, is the confidence level for anti-scamming. When the confidence level is low, the weight is increased accordingly, making the anti-scamming strategy more stringent. Based on the updated rule weights, historical anti-scamming rules are reordered and pruned to obtain an adaptive anti-scamming rule set. The reordering process sorts the rules according to the updated weights to ensure that the most important rules are applied first; the pruning process removes rules with lower weights and no longer applicable to improve system efficiency. Through reordering and pruning, an adaptive anti-scamming rule set is ultimately generated, allowing the system to flexibly respond to different user behaviors and risk conditions.

[0107] Reference Figure 2 This embodiment provides an intelligent verification code generation and anti-swiping system, including:

[0108] Processing module 1, used to perform multimodal generation processing on the verification code content to obtain original verification code data;

[0109] Extraction module 2, used to extract multi-dimensional features of user interaction behavior to obtain user behavior feature data;

[0110] Fusion module 3, used to input the original verification code data and user behavior feature data into the dual attention network for fusion processing to obtain fused feature data;

[0111] Calculation module 4, used to perform dynamic difficulty evaluation calculation based on the fused feature data to obtain verification code difficulty adjustment parameters;

[0112] Adjustment module 5, used to adjust the difficulty of the original verification code data according to the verification code difficulty adjustment parameter to obtain target verification code data;

[0113] The analysis module 6 is used to perform multi-dimensional anti-brushing rule analysis based on the fused feature data and the target verification code data to generate an adaptive anti-brushing rule set.

[0114] In this embodiment, for the specific implementation of each unit in the above system embodiment, please refer to the above method embodiment, which will not be repeated here.

[0115] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, memory, display screen, input system, network interface and database connected via a system bus. The processor of the computer design is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the above method is implemented.

[0116] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention and does not constitute a limitation on the computer device to which the solution of the present invention is applied.

[0117] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the above-described method when executed by a processor. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0118] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware using a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described method embodiments. Any reference to memory, storage, database, or other media provided herein and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM.

[0119] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, system, article, or method comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, system, article, or method. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, system, article, or method comprising the element.

[0120] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A smart verification code generation and anti-swiping method, characterized in that: The following steps are involved: Perform multimodal generation processing on the verification code content to obtain the original verification code data; Perform multi-dimensional feature extraction on user interaction behaviors to obtain user behavior feature data; Inputting the original verification code data and the user behavior feature data into a dual attention network for fusion processing to obtain fused feature data; The method further comprises: performing a dynamic difficulty assessment calculation based on the fused feature data to obtain a verification code difficulty adjustment parameter; specifically comprising: performing feature decomposition on the fused feature data to obtain a user behavior feature subset and a verification code feature subset; calculating a user proficiency index based on the user behavior feature subset to obtain a user proficiency score, wherein the user proficiency index includes verification code filling speed, operation fluency, and historical pass rate; extracting verification code complexity features based on the verification code feature subset to obtain a verification code complexity score, wherein the verification code complexity features include the degree of character distortion, the number of interference elements, and background complexity; inputting the user proficiency score and the verification code complexity score into a preset difficulty assessment function to obtain an initial difficulty score; performing a weighted adjustment on the initial difficulty score based on the current security threat level of the system to obtain an adjusted difficulty score, and normalizing the adjusted difficulty score based on the historical verification code difficulty distribution to obtain a standardized difficulty score; selecting the most suitable difficulty adjustment strategy from a predefined difficulty adjustment strategy set based on the standardized difficulty score to obtain a difficulty adjustment scheme, and converting the difficulty adjustment scheme into a specific verification code parameter adjustment instruction to obtain a verification code difficulty adjustment parameter; Adjusting the difficulty of the original verification code data according to the verification code difficulty adjustment parameter to obtain target verification code data; A multi-dimensional anti-brushing rule analysis is performed based on the fused feature data and the target verification code data to generate an adaptive anti-brushing rule set.

2. The intelligent verification code generation and anti-swiping method according to claim 1, characterized in that: The multimodal generation process is performed on the verification code content to obtain the original verification code data, including: Randomly select a verification code type to obtain a verification code type identifier, wherein the verification code type includes letters, numbers, graphics, and arithmetic problems; Constructing a generative adversarial network model based on the verification code type identifier to obtain a verification code generator and a verification code discriminator; Inputting random noise data into the verification code generator to generate verification code content to obtain candidate verification code data, and performing readability evaluation and complexity calculation on the candidate verification code data to obtain a verification code evaluation index; Inputting the verification code evaluation index into the verification code discriminator to perform authenticity judgment to obtain a verification code authenticity score, and iteratively optimizing the parameters of the verification code generator according to the verification code authenticity score to obtain an optimized verification code generator; The optimized verification code generator is used to generate an original verification code image, and interference processing is performed on the original verification code image, including adding interference lines, background noise and character deformation, to obtain the original verification code data.

3. The intelligent verification code generation and anti-swiping method according to claim 1, characterized in that: The multi-dimensional feature extraction of user interaction behavior to obtain user behavior feature data includes: Capture the user's operational behavior during the verification code filling process in real time to obtain raw interaction data, which includes mouse movement trajectory, click events, keyboard input mode, and operation time interval; Performing time series analysis on the raw interaction data to extract time-related features to obtain time series feature data, constructing a user operation behavior graph based on the raw interaction data, and performing graph convolution processing on the user operation behavior graph to obtain graph structure feature data; Extracting local features of user behaviors based on the original interaction data to obtain local behavior feature data, and extracting long-term dependencies of user behaviors based on the time series feature data to obtain global behavior feature data; Performing multi-head attention fusion on the graph structure feature data, the local behavior feature data, and the global behavior feature data to obtain fused behavior features; Combined with the contextual data of user history information, device information and IP address, the fused behavior features are subjected to time-attenuated weighted processing to obtain weighted behavior features, and the weighted behavior features are subjected to nonlinear transformation and dimensionality reduction processing to obtain the user behavior feature data.

4. The intelligent verification code generation and anti-swiping method according to claim 1, characterized in that: The step of inputting the original verification code data and the user behavior feature data into a dual attention network for fusion processing to obtain fused feature data includes: Inputting the original verification code data into a verification code encoder for feature extraction to obtain a verification code feature vector, wherein the verification code encoder comprises five convolutional layers, each of which uses a ReLU activation function and batch normalization; Input the user behavior feature data into a behavior encoder for feature extraction to obtain a behavior feature vector. The behavior encoder includes three fully connected layers, each layer uses a LeakyReLU activation function and dropout regularization; Performing a self-attention calculation on the verification code feature vector to obtain an internal attention weight of the verification code, wherein the self-attention calculation includes a linear transformation of a query matrix, a key matrix, and a value matrix, and a softmax normalization operation; Performing weighted summation on the verification code feature vector based on the internal attention weight of the verification code to obtain enhanced verification code features; Performing a cross-attention calculation on the behavior feature vector and the enhanced verification code feature to obtain a cross-modal attention weight, wherein the cross-attention calculation uses a multi-head attention mechanism including 8 attention heads; Weighting the enhanced verification code feature according to the cross-modal attention weight to obtain an attention-enhanced verification code feature; The attention-enhanced verification code feature and the behavior feature vector are concatenated and input into a feature fusion network comprising two fully connected layers, each layer using a tanh activation function, to obtain an initial fusion feature; The initial fused features are subjected to residual connection and layer normalization processing to obtain fused feature data, where the residual connection includes a short-circuit branch and a main branch including a 1x1 convolution.

5. The intelligent verification code generation and anti-swiping method according to claim 1, characterized in that: The step of adjusting the difficulty of the original verification code data according to the verification code difficulty adjustment parameter to obtain target verification code data includes: Parsing the verification code difficulty adjustment parameters to obtain a difficulty adjustment instruction set, wherein the difficulty adjustment instruction set includes character complexity, background interference, deformation degree, and color contrast; performing a stroke adding and subtracting operation on the characters in the original verification code data according to the character complexity instruction in the difficulty adjustment instruction set to obtain verification code data after character complexity adjustment; Based on the background interference instruction in the difficulty adjustment instruction set, dynamic interference elements, including curves, dot matrices, and geometric figures, are added to the verification code data after the character complexity is adjusted to obtain background-enhanced verification code data; performing a nonlinear transformation on the background-enhanced verification code data according to the deformation degree instruction in the difficulty adjustment instruction set, including distortion, rotation, and perspective transformation, to obtain deformed verification code data; Based on the color contrast instruction in the difficulty adjustment instruction set, performing color space adjustment on the deformed verification code data, including hue shift, saturation change, and brightness adjustment, to obtain color-enhanced verification code data; Performing local blurring processing on the color-enhanced verification code data, where the blurring area is dynamically determined according to the difficulty level, to obtain locally blurred verification code data; The locally blurred verification code data is adaptively fused with the original verification code data, and the fusion weight is dynamically calculated according to the difficulty adjustment parameter to obtain the target verification code data.

6. The intelligent verification code generation and anti-swiping method according to claim 1, characterized in that: The multi-dimensional anti-brushing rule analysis based on the fused feature data and the target verification code data is performed to generate an adaptive anti-brushing rule set, including: The fused feature data is segmented into time windows to obtain multiple time segment features, and the length of each time segment is dynamically adjusted according to the difficulty of the verification code; Constructing a user behavior sequence diagram based on the time segment features, and topologically sorting the user behavior sequence diagram to obtain behavior dependency relationships; Performing partition mapping on the target verification code data according to the behavior dependency relationship to obtain a verification code interaction area division result; Calculate the user operation entropy value based on the verification code interaction area division result to obtain a behavior complexity index, and compare the behavior complexity index with a preset threshold to obtain a preliminary anti-brushing determination result; Performing fuzzy reasoning on the preliminary anti-brushing determination result to obtain anti-brushing confidence, wherein the fuzzy reasoning is based on a predefined rule set and membership function; The weights of the anti-brushing rules are dynamically adjusted according to the anti-brushing confidence to obtain updated rule weights, and the historical anti-brushing rules are reordered and pruned based on the updated rule weights to obtain the adaptive anti-brushing rule set.

7. An intelligent verification code generation and anti-swiping system, characterized in that: For implementing the steps of the method according to any one of claims 1 to 6, the system comprises: A processing module is used to perform multimodal generation processing on the verification code content to obtain original verification code data; The extraction module is used to extract multi-dimensional features of user interaction behaviors and obtain user behavior feature data; A fusion module is used to input the original verification code data and the user behavior feature data into a dual attention network for fusion processing to obtain fused feature data; A calculation module, configured to perform a dynamic difficulty evaluation calculation based on the fused feature data to obtain a verification code difficulty adjustment parameter; An adjustment module, configured to adjust the difficulty of the original verification code data according to the verification code difficulty adjustment parameter to obtain target verification code data; The analysis module is used to perform multi-dimensional anti-brushing rule analysis based on the fused feature data and the target verification code data to generate an adaptive anti-brushing rule set.

8. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Safety processing method, device and equipment based on user behaviors

    CN111428231A

  • Security protection method and device for system verification code

    CN118540132A