Verification code generation method, system, device and storage medium based on self-learning

Through the self-learning verification code generation method, the adversarial verification code and dynamic security level adjustment technology are used to solve the problem of the failure of existing verification code defense technology in advanced black industry attacks, and the continuous security and defense effect of verification code is achieved.

CN115001670BActive Publication Date: 2025-04-08WUHAN JIYI NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210579822.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-25
Publication Date
2025-04-08
Estimated Expiration
2042-05-25

AI Technical Summary

Technical Problem

The existing verification code defense technology can no longer be effectively intercepted when facing advanced black industry attacks, and the defense effect of the generator model gradually deteriorates after it is put into production, and it is impossible to continuously provide high-security verification codes.

Method used

The self-learning-based verification code generation method is adopted, and by obtaining the access request of an abnormal user and forwarding it to the induction system, the adversarial verification code is sent and the security level and generation model of the verification code are adjusted according to the recognition results, so as to continuously improve the security of the verification code.

Benefits of technology

Effectively prevent abnormal users from accessing the target system, and dynamically adjust the security level of the verification code and update the generation model to ensure the continuous security and defense effect of the verification code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115001670B_ABST
    Figure CN115001670B_ABST
Patent Text Reader

Abstract

The present invention provides a verification code generation method, system, device and storage medium based on self-learning, the method comprising: obtaining an access request from an abnormal user, forwarding the access request to an induction system; sending a first preset number of first adversarial verification codes to the abnormal user through the induction system; receiving a first recognition result returned by the abnormal user, and calculating a first recognition rate; when the first recognition rate is greater than a preset threshold, adjusting the security level of the current verification code, obtaining a configuration file corresponding to the security level; obtaining a training model group corresponding to the current generation model, and updating the current generation model according to the training model group and the configuration file to generate the verification code. The present invention forwards the access request to the induction system, so that the abnormal user cannot access the target system, thereby improving the security of the target system, using the abnormal user to perform security detection on the generation model, and upgrading the generation model according to the detection result, thereby ensuring the security of the verification code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data processing, and more specifically, to a verification code generation method, system, device and storage medium based on self-learning. Background Art

[0002] The verification code is a defensive measure that uses the Turing test to identify normal users or malicious black industry access. It can prevent: malicious cracking of passwords, malicious access to target programs, and effectively prevent a hacker from making continuous login attempts to a specific registered user by cracking a specific program package, thereby avoiding network congestion or even service paralysis caused by the above situations.

[0003] However, with the rapid development of computer technology, especially the rapid development of neural network technology, image recognition technology has become increasingly mature, and traditional verification code defense technology has been unable to effectively intercept malicious access from the black industry, and verification code defense technology has gradually lost its due function.

[0004] At present, in order to improve the defense level of verification codes and ensure the security of the program running environment, the current means used is to sacrifice the human eye recognition of verification codes, thereby reducing the success rate of hacker programs recognizing verification codes, thereby improving the defense level of verification codes and ensuring the security of the program running environment. However, in actual application, the generation model of verification codes often only uses a few specific rules for switching. After a long enough time, the defense effect of verification codes degrades and can no longer provide effective defense functions. Therefore, how to further improve the security of verification codes in the production of generation models is an urgent problem to be solved. Summary of the invention

[0005] The present invention aims at the technical problems existing in the prior art and provides a verification code generation method, system, device and storage medium based on self-learning, so as to solve the problem of further improving the security of the verification code in the production of the generation model, which is an urgent problem to be solved.

[0006] According to a first aspect of the present invention, there is provided a verification code generation method based on self-learning, comprising:

[0007] Obtaining an access request from an abnormal user, and forwarding the access request to an induction system;

[0008] Sending a first preset number of first confrontation verification codes to the abnormal user through the induction system;

[0009] receiving a first recognition result returned by the abnormal user, and calculating a first recognition rate;

[0010] When the first recognition rate is greater than a preset threshold, adjusting the security level of the current verification code, and obtaining a configuration file corresponding to the security level;

[0011] Obtain a training model group corresponding to the current generation model, and update the current generation model according to the training model group and the configuration file to generate a verification code.

[0012] Based on the above technical solution, the present invention can also make the following improvements.

[0013] Optionally, after the step of updating the current generation model to generate a verification code, the method further includes:

[0014] Generate a second preset number of second adversarial verification codes according to the generation model;

[0015] Sending the second confrontation verification code to the abnormal user through the induction system;

[0016] receiving a second recognition result returned by the abnormal user, and calculating a second recognition rate;

[0017] When the second recognition rate is less than the preset threshold, the updated current generation model is synchronized to the target system to generate a verification code.

[0018] Optionally, the method further includes:

[0019] When the second recognition rate is not less than a preset threshold, obtaining an updated configuration file corresponding to the current generation model;

[0020] Extracting a recognition model from a preset recognition model pool according to the configuration file to update the training model group;

[0021] Outputting a third adversarial verification code according to the training model group iteratively updated by the second adversarial verification code;

[0022] Sending the third confrontation verification code to the abnormal user through the induction system;

[0023] receiving a third recognition result returned by the abnormal user, and calculating a third recognition rate;

[0024] When the third recognition rate is less than the preset threshold, the current generation model is updated according to the updated training model group.

[0025] Optionally, the method further includes:

[0026] When the third recognition rate is not less than the preset threshold, an early warning message is generated and sent to the early warning module.

[0027] Optionally, before the step of obtaining the access request of the abnormal user, the following steps are included:

[0028] Obtaining a fourth recognition rate and a corresponding verification code input time duration corresponding to each user within a preset time duration;

[0029] When the fourth recognition rate and the input duration meet a preset condition, the corresponding user is marked as an abnormal user.

[0030] Optionally, the step of obtaining a configuration file corresponding to the security level includes:

[0031] Obtain a security level comparison table, and obtain a corresponding configuration file in the security level comparison table according to the security level.

[0032] Optionally, the method further includes:

[0033] When the first recognition rate is not greater than the preset threshold, the abnormal user is marked as a normal user.

[0034] According to a second aspect of the present invention, there is provided a verification code generation system based on self-learning, comprising:

[0035] A request forwarding module, used for obtaining access requests from abnormal users and forwarding the access requests to the induction system;

[0036] A sample sending module, used for sending a first preset number of first confrontation verification codes to the abnormal user through the induction system;

[0037] A rate value calculation module, used for receiving the first recognition result returned by the abnormal user and calculating a first recognition rate;

[0038] A configuration acquisition module, used to adjust the security level of the current verification code and acquire a configuration file corresponding to the security level when the first recognition rate is greater than a preset threshold;

[0039] The model update module is used to obtain the training model group corresponding to the current generation model, and update the current generation model according to the training model group and the configuration file to generate a verification code.

[0040] According to a third aspect of the present invention, there is provided a device comprising a memory and a processor, wherein the processor is configured to implement any step of the self-learning-based verification code generation method in the first aspect when executing a computer management program stored in the memory.

[0041] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium on which a computer management program is stored. When the computer management program is executed by a processor, the steps of any one of the self-learning-based verification code generation methods in the first aspect are implemented.

[0042] The present invention provides a verification code generation method, system, device and storage medium based on self-learning, by obtaining the access request of an abnormal user, forwarding the access request to an induction system; sending a first preset number of first confrontation verification codes to the abnormal user through the induction system; receiving the first recognition result returned by the abnormal user, and calculating the first recognition rate; when the first recognition rate is greater than a preset threshold, adjusting the security level of the current verification code, obtaining the configuration file corresponding to the security level; obtaining the training model group corresponding to the current generation model, and updating the current generation model according to the training model group and the configuration file to generate the verification code. The present invention obtains the access request of the abnormal user and forwards the access request to the induction system, so that the abnormal user cannot access the target system, thereby ensuring the security of the target system, by sending the first preset number of verification codes to the abnormal user, and adjusting the security level of the current verification code according to the verification code and the corresponding return result, and updating the current generation model according to the configuration file and the training model group corresponding to the safety belt level, so that the abnormal user is used as the verification model, and the generation model is verified, so that the generation model can be adjusted and upgraded according to the recognition situation of the abnormal user, thereby ensuring the security of the verification code output by the generation model. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A flow chart of a verification code generation method based on self-learning provided by the present invention;

[0044] Figure 2 A schematic diagram of the architecture of a verification code generation system based on self-learning provided by the present invention;

[0045] Figure 3 The working flow diagram of the attack module provided by the present invention;

[0046] Figure 4 A flowchart of the automatic update module provided by the present invention;

[0047] Figure 5 A schematic diagram of common user access provided by the present invention;

[0048] Figure 6 A schematic diagram of black market user access provided by the present invention;

[0049] Figure 7 A schematic diagram of user access to the induction environment provided by the present invention;

[0050] Figure 8 A schematic diagram of updating the model library provided by the present invention;

[0051] Fig. 9A structural diagram of a verification code generation system based on self-learning provided by the present invention;

[0052] Fig.10 A schematic diagram of the hardware structure of a possible device provided by the present invention;

[0053] Fig.11 A schematic diagram of the hardware structure of a possible computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION

[0054] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0055] Figure 1 A flow chart of a verification code generation method based on self-learning provided by the present invention, such as Figure 1 As shown, the method includes:

[0056] Step S100: obtaining an access request from an abnormal user, and forwarding the access request to an induction system;

[0057] It should be noted that the execution subject of the method of this embodiment can be a computer terminal device with data processing, network communication and program running functions, such as a computer, a tablet computer, etc.; it can also be a server device with the same or similar functions, or a cloud server virtual device with the same or similar functions, and this embodiment does not limit this. For ease of understanding, this embodiment and the following embodiments will be described using a server device as an example.

[0058] It is understandable that the above-mentioned abnormal user may be a user account registered by a black market user, or may be a network virus that attacks indiscriminately on the Internet, and this embodiment does not limit this.

[0059] It should be understood that the above-mentioned induction system can be a mirror system that is completely consistent with the target system, but the above-mentioned induction system and the above-mentioned target system are two completely independent systems, and there is no direct jump between the two systems.

[0060] It can also be understood that the above-mentioned forwarding of the access request to the induction system can be implemented through an nginx (engine x, a high-performance HTTP and reverse proxy web server) server proxy, or an application with a similar proxy forwarding function, which is not limited in this embodiment.

[0061] In a specific implementation, the access request of the abnormal user is obtained, and the access request is forwarded to the induction system through the proxy server.

[0062] Step S200: sending a first preset number of first confrontation verification codes to the abnormal user through the induction system;

[0063] It should be noted that the above-mentioned first preset number can be set by the administrator according to actual conditions, or it can be calculated by obtaining the duration of the above-mentioned abnormal user's access. Generally, in order to improve the accuracy of the test results, the above-mentioned preset data needs to be set as large as possible, for example: set to 1000.

[0064] In the specific implementation, the system will be induced to send a preset number of verification codes to the abnormal user in batches during the abnormal user's access. Since the abnormal user is an access program set by the black market user, the abnormal user will automatically identify the verification code information after receiving the verification code and return the identification result.

[0065] Step S300: receiving a first recognition result returned by the abnormal user, and calculating a first recognition rate.

[0066] Step S400: When the first recognition rate is greater than a preset threshold, adjusting the security level of the current verification code, and obtaining a configuration file corresponding to the security level;

[0067] It should be noted that the above-mentioned preset configuration file can be a configuration file corresponding to the training group model, which is stored in the memory of the server and can be obtained by querying the unique identifier of the training group model.

[0068] It should be understood that the above-mentioned preset thresholds can be manually set by an administrator, and the above-mentioned preset thresholds are generally set to: 95%, 97%, 99%.

[0069] It is understandable that the above security level may be set according to the anti-interference constraint value in the model parameters during system initialization, or may be set according to actual needs, and this embodiment does not limit this.

[0070] It should also be understood that the above-mentioned preset threshold value may be set by the administrator when the system is initialized, or may be calculated by the system according to the access pass rate of users in actual applications.

[0071] Step S500: Obtain a training model group corresponding to the current generation model, and update the current generation model according to the training model group and the configuration file to generate a verification code.

[0072] It should be noted that the above-mentioned training model group can be set in advance by an administrator, or can be constructed by extracting recognition models from a historical model pool, and this embodiment does not impose any restrictions on this.

[0073] It can be understood that the above-mentioned historical model pool can be constructed in the process of outputting the generation model, and the above-mentioned historical model pool can include mainstream image classification model clusters, target detection model clusters, word order recognition model clusters and / or speech recognition model clusters, etc.; the recognition model in the above-mentioned historical model pool can be used to identify nine-square verification codes, character verification codes, word order verification codes and / or voice verification codes, etc., and this embodiment does not limit this. For example: the image classification model cluster can include models of the vit / resnet / inception series, and the target detection model cluster can include yolov3, yolov4, yolov5, etc.

[0074] It can be understood that based on the defects in the background technology, the present invention provides a verification code generation method, system, device and storage medium based on self-learning, which obtains the access request of the abnormal user and forwards the above access request to the induction system; sends a first preset number of first adversarial verification codes to the above abnormal user through the above induction system; receives the first recognition result returned by the above abnormal user, and calculates the first recognition rate; when the above first recognition rate is greater than the preset threshold, adjusts the security level of the current verification code, and obtains the configuration file corresponding to the above security level; obtains the training model group corresponding to the current generation model, and updates the above current generation model according to the above training model group and the above configuration file to generate the verification code. The present invention obtains the access request of the abnormal user and forwards the access request to the induction system, so that the abnormal user cannot access the target system, thereby ensuring the security of the target system, and sends a first preset number of verification codes to the abnormal user, and adjusts the security level of the current verification code according to the above verification code and the corresponding return result, and updates the current generation model according to the configuration file and training model group corresponding to the above safety belt level, so that the abnormal user is used as the verification model, and the generation model is verified, so that the generation model can be adjusted and upgraded according to the identification situation of the abnormal user, thereby ensuring the security of the verification code output by the generation model.

[0075] In a possible embodiment, in order to further improve the security of the verification code, after the step of updating the current generation model to generate the verification code, the following steps are included:

[0076] Step S600: generating a second preset number of second adversarial verification codes according to the generation model;

[0077] It should be noted that the above-mentioned second preset number can be set by the administrator according to actual conditions, or it can be calculated by obtaining the duration of the above-mentioned abnormal user's access. Generally, in order to improve the accuracy of the test results, the above-mentioned preset data needs to be set as large as possible, for example: set to 1000.

[0078] Step S700: sending the second confrontation verification code to the abnormal user through the induction system;

[0079] In a specific implementation, the second confrontation verification code is sent to the abnormal user through the induced system, so that the abnormal user identifies and returns the result after receiving the second confrontation verification code, thereby preventing the abnormal user from realizing that he is accessing the induced system, thereby improving the security of the target system.

[0080] Step S800: receiving a second recognition result returned by the abnormal user, and calculating a second recognition rate;

[0081] Step S900: When the second recognition rate is less than the preset threshold, synchronizing the updated current generation model to the target system to generate a verification code.

[0082] In a specific implementation, when the second recognition rate is less than a preset threshold, it indicates that the security level of the current generated model has met the requirement, so the current generated model is synchronized to the target system, and the generated model in the target system is updated.

[0083] In an embodiment of the present invention, a certain number of adversarial verification codes are generated by a newly generated generation model, and the above verification codes are sent to abnormal users, so that the abnormal users become the verification models in the adversarial method, and the security level of the newly generated generation model is judged based on the above verification model, thereby further improving the security of the verification code and the security of the target system.

[0084] In a possible embodiment, in order to further improve the security of the verification code, the method further includes:

[0085] Step S901: when the second recognition rate is not less than a preset threshold, obtaining an updated configuration file corresponding to the current generation model;

[0086] Step S902: extracting a recognition model from a preset recognition model pool according to the configuration file to update the training model group;

[0087] It should be noted that the above-mentioned preset model pool may be a model pool built in advance, which includes but is not limited to: mainstream image classification model cluster, object detection model cluster, word order recognition model cluster, and speech recognition model cluster. Each model cluster contains models with different structures to increase the diversity of models in the same cluster.

[0088] Step S903: outputting a third adversarial verification code according to the training model group iteratively updated by the second adversarial verification code;

[0089] Step S904: sending the third anti-verification code to the abnormal user through the induction system;

[0090] Step S905: receiving the third recognition result returned by the abnormal user, and calculating the third recognition rate;

[0091] Step S906: When the third recognition rate is less than the preset threshold, the current generation model is updated according to the updated training model group.

[0092] In an embodiment of the present invention, when the second recognition rate is less than a preset threshold, the training model group is retrained according to the second adversarial verification code, thereby generating a generation model that meets the requirements, thereby further improving the security of the verification code output by the generation model.

[0093] In a possible embodiment, in order to further improve the security of the verification code, the method further includes:

[0094] Step S9061: When the third recognition rate is not less than the preset threshold, generate warning information and send it to the warning module.

[0095] It should be noted that the above-mentioned early warning module can be a module with voice alarm connected to the server. After receiving the early warning information, the above-mentioned early warning module sends out a voice alarm to remind the administrator to check the alarm and handle it.

[0096] The present invention is a real-time example, and further improves the functional architecture of the system by combining the early warning module, so that when the system cannot automatically complete the automatic upgrade, the administrator is reminded to participate, thereby further ensuring the security of the verification code.

[0097] In a possible embodiment, for ease of understanding, before the step of obtaining the access request of the abnormal user, the following steps are included:

[0098] Step S01: obtaining a fourth recognition rate and a corresponding verification code input time duration corresponding to each user within a preset time duration;

[0099] It should be noted that the preset time period may be a fixed time period set by the administrator, or may be a time period set by the administrator to output a certain number of verification codes, which is not limited in this embodiment.

[0100] It is understandable that the above recognition success rate may be obtained by counting the verification code recognition success rates corresponding to each user within the above time period.

[0101] Step S02: When the fourth recognition rate and the input duration meet a preset condition, marking the corresponding user as an abnormal user;

[0102] It can be understood that the above-mentioned preset conditions can be manually set by an administrator, and the above-mentioned preset conditions can be: the input and output time is less than the preset time threshold and the recognition success rate is greater than the preset success rate threshold; the above-mentioned time threshold can be set to: 5 seconds, 10 seconds or 30 seconds, etc.; the above-mentioned preset success rate threshold can be set to: 90%, 95% or 99%, etc.

[0103] In the embodiment of the present invention, by performing threshold judgment on the input time of the user's input verification code and the corresponding recognition success rate, it is possible to accurately judge whether the current user is an abnormal user, thereby providing a basis for subsequent operations.

[0104] In a possible embodiment, for ease of understanding, the step of obtaining the configuration file corresponding to the security level includes:

[0105] Step S401: obtaining a security level comparison table, and obtaining a corresponding configuration file in the security level comparison table according to the security level.

[0106] It should be noted that the above security level comparison table may be stored in a local database of the server and used to store the security level of the verification code and the corresponding configuration file. The security level may be set as a primary key for quickly obtaining the corresponding configuration file.

[0107] In the embodiment of the present invention, the security level comparison table is stored on the server side, thereby speeding up the acquisition of the configuration file and further reducing the computing performance requirements of the server.

[0108] In a possible implementation manner, in order to further improve user experience, the method further includes:

[0109] Step S402: When the first recognition rate is not greater than the preset threshold, marking the abnormal user as a normal user.

[0110] In a specific implementation, when it is determined that the first recognition rate is not greater than a preset threshold, the mark of the abnormal user is cleared and the abnormal user is removed from the access blacklist.

[0111] In this embodiment, when it is determined that the first recognition rate is not greater than a preset threshold, the mark of the abnormal user is cleared and the abnormal user is removed from the access blacklist, thereby further improving the user experience.

[0112] In a possible embodiment, for ease of understanding, the embodiment of the present invention also provides a system architecture diagram of a verification code generation system based on self-learning, see Figure 2 , Figure 2A schematic diagram of the architecture of a verification code generation system based on self-learning provided by the present invention. The system of the verification code generation system based on self-learning includes: a model pool, a configuration module, an attack module, an evaluation module, a monitoring module and an automatic update module. The model pool is used to train the recognition model using the initial verification code, and store the obtained trained model; the configuration module can be used to configure the task type, and can be used to configure the type of adversarial verification code that needs to be generated, such as: nine-square grid, text selection or voice recognition and face recognition, and is also used to configure the maximum Lp constraint of adversarial interference (control the maximum interference noise acceptable to the human eye / ear), and can also be used to configure the test evaluation threshold; the attack module is used to output the generation model according to the relevant parameters of the configuration module, and the evaluation module is used to evaluate the adversarial verification code generated by the generation model; the monitoring module is used to monitor the recognition of the online verification code in real time; the automatic update module is used to determine whether it is necessary to trigger the generation model to update.

[0113] A possible application scenario includes the construction of a model pool: a model pool refers to a collection of models that can be used to identify verification codes, including: mainstream image classification model clusters, target detection model clusters, word order recognition model clusters and / or speech recognition model clusters. Each model cluster contains models with different structures to increase the diversity of models in the same cluster. For example, an image classification model cluster can include models from the VIT / RESNET / INCEPTION series, and a target detection model cluster can include YOLOv3, YOLOv4, YOLOv5, Fast-RCNN, SSD, etc.

[0114] The model pool in the model pool may be selected in advance by the administrator, or may be generated in the process of outputting the generated model, or may be continuously updated by the administrator based on the latest recognition model.

[0115] Since the initial untrained model cannot be directly used in the process of generating adversarial samples and outputting the generated model, the quality of the adversarial samples will be reduced and the security of the verification code finally generated by the generated model will be unstable when it is directly used to participate in the generation of adversarial samples and output the generated model. In this embodiment, the untrained model is first trained with the verification codes in the historical verification code material library to obtain a preliminary trained model.

[0116] Among them, the recognition model in the model pool is used to generate corresponding training models, attack models and verification models according to needs.

[0117] A possible application scenario includes configuration of a configuration module: the configuration module provides a user with an entry for user interaction in the system of this embodiment, and provides the user with: task type, adversarial verification code type, adversarial interference constraints and / or evaluation thresholds.

[0118] Since the recognition image of the verification code by the human eye and / or ear and the security of the verification code are two contradictory and mutually restrictive conditions, and the recognition degree of people for the verification code is different in different scenarios, it is necessary to configure an initial anti-interference constraint to set the maximum interference noise acceptable to people. The maximum interference noise can be judged and optimized by generating the verification code recognition accuracy of the model output in the actual production environment.

[0119] At the same time, the evaluation threshold can be configured by the user on the configuration module. It is used as a criterion for judging the effectiveness of adversarial samples generated by the generative model. The recognition rate of the evaluation model for the adversarial samples output by the generative model is calculated. The evaluation threshold is used to compare with the above recognition rate to determine the security level of the above generative model.

[0120] In a possible application scenario, the attack module outputs the process of generating the model G: Figure 3 , Figure 3 The following is a workflow diagram of the attack module provided by the present invention; wherein the steps of the attack module outputting the generation model include:

[0121] Step S1001: Obtain configuration parameter information, verification code type, and anti-noise LP constraints;

[0122] It should be noted that the above configuration parameter information may be the task type and / or anti-captcha type configured in the configuration module, or may be the operating environment parameters of the system configured by the administrator according to the server performance.

[0123] It is understandable that the above verification code types may include: picture verification code, text click verification code, icon click verification code and / or voice verification code.

[0124] Step S1002: extracting training model A and verification model B from the model pool according to the verification code type;

[0125] It should be noted that the above-mentioned training model A and verification model B are models that have been initially trained in the model pool. The above-mentioned process of extracting models according to the verification code type can be understood as extracting the corresponding model according to the type of verification code that needs to be generated. For example: for the verification codes of character verification and icon selection, the target detection model is selected, the icon recognition model is selected for the nine-square verification code, and the voice recognition model is selected for the voice verification code.

[0126] Step S1003: Load all data of all verification codes of this type and initialize the number of iterations iter to 0;

[0127] It is understandable that all the above data may be a basic verification code database, a pre-prepared verification code material library, or may be manually acquired in real time from a third-party material library, and this embodiment does not limit this.

[0128] Step S1004: using GAN to train a network G for generating adversarial verification codes for the recognition model A;

[0129] It should be noted that GAN (Generative Adversarial Nets) is a deep learning model based on adversarial sample generation technology.

[0130] In the specific implementation, GAN constructs the corresponding generation model G and loss function L based on the recognition model A, iteratively runs the training program, minimizes the loss function L, until the adversarial sample output by the generation model G can mislead the verification model B, stops the iteration, and outputs the generation model G at this time.

[0131] Step S1005: Generate 1000 adversarial verification codes for recognition model A using the generative network G;

[0132] Step S1006: Calculate the accuracy acc of 1000 adversarial verification codes on the verification model B. When the accuracy acc is not less than a preset threshold, increase the number of iterations by one and re-execute step S1004.

[0133] Step S1007: When the accuracy acc is less than a preset threshold, the generated model G is output.

[0134] In the above application scenario, the embodiment of the present invention extracts training model A and verification model B from the model pool, iterates the recognition model on GAN to output a generation model G that meets the requirements, verifies the generation model G through the verification model B, and outputs the generation model G when the adversarial verification code generated by the generation model G meets the requirements; thereby, the adversarial sample technology is applied to the attack and defense confrontation scenario of the verification code, which increases the security of the verification code, and utilizes the adversarial verification code generation architecture based on GAN to decouple the training and generation of the adversarial verification code and reduce the engineering cost. Since the training model includes the target detection model, the icon recognition model and / or the speech recognition model, the type of the output generation model G can be automatically switched according to the requirements, thereby meeting the needs of different users.

[0135] In a possible application scenario, an evaluation model is also included: the evaluation model is a test model C extracted from the model pool, where the test model C is a recognition model different from the training model A and the verification model B. The evaluation model is used to identify the adversarial verification code generated by the generation model G and calculate the recognition accuracy.

[0136] In a possible application scenario, a monitoring module is also included. The monitoring module is used to monitor the online verification code situation in real time, count the verification pass ratio of each verification code form, and display it visually; it is also used to monitor the month-on-month growth of the number of passes per hour every day, and send an over-limit alarm to the automatic update module when the month-on-month growth of the number of passes exceeds a preset threshold. The preset threshold can be set by the administrator when initializing the system.

[0137] A possible application scenario also includes an automatic update module, which is used to trigger an update upon receiving an over-limit alarm. That is, if the monitoring module finds that the throughput of a certain verification code format increases dramatically, the automatic update module is triggered to generate the model G for update.

[0138] See also Figure 4 , Figure 4 This is a workflow diagram of the automatic update module provided by the present invention.

[0139] The workflow of automatically updating modules in a possible application scenario includes:

[0140] Step S2001: monitor and count the number of passes of each verification form and the month-on-month growth of the number of passes;

[0141] Step S2002: when the month-on-month growth of the throughput exceeds a threshold, the current generation model and configuration parameters are obtained;

[0142] Step S2003: submitting the generated model and configuration parameters to the training module for retraining.

[0143] In the above application scenario, the embodiment of the present invention determines the adversarial effect of the generation model generation process against the verification code by monitoring the pass-through volume and the month-on-month growth of the pass-through volume of each verification form. When the month-on-month growth of the pass-through volume exceeds the threshold, it is determined that the adversarial effect of the verification code generated by the generation model is seriously degraded, and the generation model and configuration parameters are submitted to the training model, and the configuration parameter information in the configuration module is updated, so that the generation model can cope with different cracking models, and automatically updates the generation model when the adversarial effect is degraded, without the need for manual interference, reducing manual participation, and increasing the security of the verification code.

[0144] A possible application scenario includes a scenario where a normal user accesses the target system, see Figure 5 , Figure 5A schematic diagram of ordinary user access provided by the present invention is shown. In the figure, user A is a normal ordinary user, and user A accesses the target system deployed in the cloud through the client, and the cloud is deployed with the verification code generation system based on self-learning and the target system of the present embodiment; wherein the access process can be: user A sends an access request to the target system through the client, and the above access is forwarded to the verification code generation system based on self-learning, and the verification code generation system based on self-learning outputs a confrontation verification code, and user A recognizes the confrontation verification code and inputs the confrontation verification code according to the prompt of the verification code generation system based on self-learning, and the verification code generation system based on self-learning allows user A to continue to access the target system after judging that the verification code input and output by user A is correct, and forwards the access request to the target system.

[0145] In a possible application scenario, user A is marked as a normal user by a self-learning based verification code generation system. User A enters incorrect answers multiple times in one day when entering the adversarial verification code that he recognizes. The self-learning based verification code generation system records and determines that the maximum Lp constraint value for adversarial interference is too large. The self-learning based verification code generation system automatically reduces the maximum Lp constraint value for adversarial interference, updates the configuration parameters in the configuration module, and retrains the generation model, thereby ensuring that normal users can easily identify the verification codes generated by the generation model, thereby improving the availability of the verification codes.

[0146] In a possible application scenario, the verification code generation system based on self-learning records the verification code pass rate of each user marked as a normal user. When the pass rate is 100% within ten days, it is determined that the maximum Lp constraint value for combating interference is too small. The verification code generation system based on self-learning automatically increases the maximum Lp constraint value for combating interference, updates the configuration parameters in the configuration module, and retrains the generation model, thereby increasing the security of the verification code generated by the generation model.

[0147] One possible application scenario includes the situation where a black market user accesses the target system, see Figure 6 , Figure 6 The schematic diagram of black industry user access provided by the present invention. In the figure, black industry B is an abnormal black industry user, and black industry B accesses the target system deployed in the cloud through the client, and the cloud is deployed with the verification code generation system based on self-learning and the target system of this implementation; wherein the access process can be: black industry user B sends an access request to the target system through the client segment, and the above access request is forwarded to the verification code generation system based on self-learning, and the verification code generation system based on self-learning outputs a confrontation verification code, and the black industry user B identifies the confrontation verification code and inputs the confrontation verification code according to the prompt of the verification code generation system based on self-learning, and the verification code generation system based on self-learning prohibits the black industry user B from continuing to access the target system after judging that the verification code input by the black industry user B is abnormal.

[0148] In one possible application scenario, a legitimate user and a black market user access the target system at the same time. Figure 7 , Figure 7 A schematic diagram of user access in an induction environment provided by the present invention. In the figure, user A is a normal access user, black industry B is an abnormal access user, the target system, the induction system and the self-learning based verification code generation system are deployed on the cloud server side, and user A and black industry B access the target system deployed in the cloud through the client, wherein the access process can be: user A and black industry B send access requests to the target system through the client, the above access is forwarded to the self-learning based verification code generation system, the self-learning based verification code generation system outputs a confrontation verification code, user A and black industry B identify the confrontation verification code and input the confrontation verification code according to the prompt of the self-learning based verification code generation system, the self-learning based verification code generation system allows user A to continue to access the target system after judging that the input and output verification code of user A is correct, and forwards the access request to the target system, and the self-learning based verification code generation system prohibits black industry user B from continuing to access the target system after judging that the input and output verification code of black industry B is abnormal.

[0149] In a possible application scenario, when black market user B accesses the target system, the self-learning verification code generation system monitors the pass rate of all verification codes of black market user B and the time to input the verification code. When the pass rate is greater than the set threshold and the time is within the normal range, it is determined that the maximum Lp constraint value against interference is too small. The self-learning verification code generation system automatically increases the maximum Lp constraint value against interference, updates the configuration parameters in the configuration module, retrains the generation model and updates the generation model, and continues to detect the verification code pass rate and verification code input time of black market user B. When the passing rate of user B's verification code drops significantly, the black industry user B is determined to be an abnormal user, and the IP address and account of the black industry user B are set as abnormal users; and when the black industry user B passes the verification code verification, the black industry user's access request is forwarded to the induction system, where the access to each module in the induction system needs to be verified again using the verification code. The self-learning-based verification code generation system monitors the recognition of different verification codes by the black industry user B for self-learning, and further optimizes the generation model, so as to effectively respond to the endless black industry attacks and improve the security of the verification code.

[0150] It is understandable that the set threshold corresponding to the above pass rate can be obtained by calculating the average pass rate of all users, or can be set by the administrator during initialization, and can generally be: 90%, 85% or 80%.

[0151] It should be understood that the normal range corresponding to the above time can be the time for all users to enter verification codes, or it can be set by the administrator during initialization, which can generally be: 10s, 20s or 30s.

[0152] One possible application scenario includes automatic updating of model libraries. Figure 8 , Figure 8 A schematic diagram of the model library update provided by the present invention. In the figure, the verification code generation system based on self-learning is deployed on the server side of the cloud, client A, client B... Client N is a client server deployed with a verification code generation system client based on self-learning. Since the model used by black market users to attack the verification code is also constantly iterating and updating, when the client uses the verification code generation system based on self-learning provided by the present invention, he may choose to simplify the deployment due to cost factors. The simplified deployment is generally in the form of: the client is deployed with a generation model, a data sending module and a data receiving module, and the cloud server is deployed with a complete verification code generation system based on self-learning.

[0153] In a possible application scenario, the self-learning-based verification code generation system deployed on the cloud server segment communicates data with the client to obtain the verification code situation in the client, determine whether the verification code adversarial effect has degraded, and update the generation model in the client when degradation occurs.

[0154] Fig. 9 A structure diagram of a verification code generation system based on self-learning provided by an embodiment of the present invention, such as Fig. 9 As shown, a verification code generation system based on self-learning includes a request forwarding module 100, a sample sending module 200, a sample rate value calculation module 300, a configuration acquisition module 400 and a model update module 500, wherein:

[0155] A request forwarding module 100 is used to obtain an access request from an abnormal user and forward the access request to an induction system;

[0156] A sample sending module 200, used for sending a first preset number of first confrontation verification codes to the abnormal user through the induction system;

[0157] The rate value calculation module 300 is used to receive the first recognition result returned by the abnormal user and calculate the first recognition rate;

[0158] A configuration acquisition module 400, configured to adjust the security level of the current verification code and acquire a configuration file corresponding to the security level when the first recognition rate is greater than a preset threshold;

[0159] The model updating module 500 is used to obtain the training model group corresponding to the current generation model, and update the current generation model according to the training model group and the configuration file to generate a verification code.

[0160] The present invention provides a verification code generation system based on self-learning, which obtains the access request of an abnormal user and forwards the access request to an induction system; sends a first preset number of first confrontation verification codes to the abnormal user through the induction system; receives the first recognition result returned by the abnormal user and calculates the first recognition rate; when the first recognition rate is greater than a preset threshold, adjusts the security level of the current verification code and obtains the configuration file corresponding to the security level; obtains the training model group corresponding to the current generation model, and updates the current generation model according to the training model group and the configuration file to generate the verification code. The present invention obtains the access request of the abnormal user and forwards the access request to the induction system, so that the abnormal user cannot access the target system, thereby ensuring the security of the target system, sends the first preset number of verification codes to the abnormal user, and adjusts the security level of the current verification code according to the verification code and the corresponding return result, and updates the current generation model according to the configuration file and the training model group corresponding to the safety belt level, so that the abnormal user is used as the verification model to verify the generation model, so that the generation model can be adjusted and upgraded according to the recognition situation of the abnormal user, thereby ensuring the security of the verification code output by the generation model.

[0161] It can be understood that the self-learning based verification code generation system provided by the present invention corresponds to the self-learning based verification code generation method provided by the aforementioned embodiments. The relevant technical features of the self-learning based verification code generation system can refer to the relevant technical features of the self-learning based verification code generation method, which will not be repeated here.

[0162] See also Fig.10 , Fig.10 Schematic diagram of an embodiment of the device provided by the embodiment of the present invention. Fig.10 As shown, an embodiment of the present invention provides a device, including a memory 1310, a processor 1320, and a computer program 1311 stored in the memory 1310 and executable on the processor 1320. When the processor 1320 executes the computer program 1311, the following steps are implemented: obtaining an access request of an abnormal user, and forwarding the access request to an induction system; sending a first preset number of first adversarial verification codes to the abnormal user through the induction system; receiving a first recognition result returned by the abnormal user, and calculating a first recognition rate; when the first recognition rate is greater than a preset threshold, adjusting the security level of the current verification code, and obtaining a configuration file corresponding to the security level; obtaining a training model group corresponding to the current generation model, and updating the current generation model according to the training model group and the configuration file to generate a verification code.

[0163] It can be understood that the device provided by the present invention is used to execute the verification code generation method based on self-learning provided in the aforementioned embodiments, and its relevant technical features can refer to the relevant technical features of the verification code generation method based on self-learning, which will not be repeated here.

[0164] See also Fig.11 , Fig.11 Schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. Fig.11 As shown, this embodiment provides a computer-readable storage medium 1400, on which a computer program 1411 is stored. When the computer program 1411 is executed by a processor, it implements the following steps: obtaining an access request from an abnormal user, and forwarding the access request to an induction system; sending a first preset number of first adversarial verification codes to the abnormal user through the induction system; receiving a first recognition result returned by the abnormal user, and calculating a first recognition rate; when the first recognition rate is greater than a preset threshold, adjusting the security level of the current verification code, and obtaining a configuration file corresponding to the security level; obtaining a training model group corresponding to the current generation model, and updating the current generation model according to the training model group and the configuration file to generate a verification code.

[0165] The embodiment of the present invention provides a verification code generation method, system, device and storage medium based on self-learning, by obtaining the access request of an abnormal user, forwarding the access request to the induction system; sending a first preset number of first confrontation verification codes to the abnormal user through the induction system; receiving the first recognition result returned by the abnormal user, and calculating the first recognition rate; when the first recognition rate is greater than the preset threshold, adjusting the security level of the current verification code, obtaining the configuration file corresponding to the security level; obtaining the training model group corresponding to the current generation model, and updating the current generation model according to the training model group and the configuration file to generate the verification code. The present invention obtains the access request of the abnormal user and forwards the access request to the induction system, so that the abnormal user cannot access the target system, thereby ensuring the security of the target system, by sending the first preset number of verification codes to the abnormal user, and adjusting the security level of the current verification code according to the verification code and the corresponding return result, and updating the current generation model according to the configuration file and the training model group corresponding to the safety belt level, so that the abnormal user is used as the verification model, and the generation model is verified, so that the generation model can be adjusted and upgraded according to the recognition of the abnormal user, thereby ensuring the security of the verification code output by the generation model.

[0166] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0167] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0168] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0169] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0170] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0171] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0172] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A verification code generation method based on self-learning, characterized in that: The method comprises: Obtaining an access request from an abnormal user, and forwarding the access request to an induction system; Sending a first preset number of first confrontation verification codes to the abnormal user through the induction system; receiving a first recognition result returned by the abnormal user, and calculating a first recognition rate; When the first recognition rate is greater than a preset threshold, adjusting the security level of the current verification code, and obtaining a configuration file corresponding to the security level; Obtaining a training model group corresponding to the current generation model, and updating the current generation model according to the training model group and the configuration file to generate a verification code; Generate a second preset number of second adversarial verification codes according to the generation model; Sending the second confrontation verification code to the abnormal user through the induction system; receiving a second recognition result returned by the abnormal user, and calculating a second recognition rate; When the second recognition rate is less than the preset threshold, synchronizing the updated current generation model to the target system to generate a verification code; When the second recognition rate is not less than a preset threshold, obtaining an updated configuration file corresponding to the current generation model; Extracting a recognition model from a preset recognition model pool according to the configuration file to update the training model group; Outputting a third adversarial verification code according to the training model group iteratively updated by the second adversarial verification code; Sending the third confrontation verification code to the abnormal user through the induction system; receiving a third recognition result returned by the abnormal user, and calculating a third recognition rate; When the third recognition rate is less than the preset threshold, the current generation model is updated according to the updated training model group.

2. The verification code generation method based on self-learning according to claim 1, characterized in that: Also includes: When the third recognition rate is not less than the preset threshold, an early warning message is generated and sent to the early warning module.

3. The verification code generation method based on self-learning according to claim 1, characterized in that: Before the step of obtaining the access request of the abnormal user, the method includes: Obtaining a fourth recognition rate and a corresponding verification code input time duration corresponding to each user within a preset time duration; When the fourth recognition rate and the input duration meet a preset condition, the corresponding user is marked as an abnormal user.

4. The verification code generation method based on self-learning according to claim 1, characterized in that: The step of obtaining the configuration file corresponding to the security level includes: Obtain a security level comparison table, and obtain a corresponding configuration file in the security level comparison table according to the security level.

5. The verification code generation method based on self-learning according to claim 1, characterized in that: Also includes: When the first recognition rate is not greater than the preset threshold, the abnormal user is marked as a normal user.

6. A verification code generation system based on self-learning, characterized in that: include A request forwarding module, used for obtaining access requests from abnormal users and forwarding the access requests to the induction system; A sample sending module, used for sending a first preset number of first confrontation verification codes to the abnormal user through the induction system; A rate value calculation module, used for receiving the first recognition result returned by the abnormal user and calculating a first recognition rate; A configuration acquisition module, used to adjust the security level of the current verification code and acquire a configuration file corresponding to the security level when the first recognition rate is greater than a preset threshold; A model updating module, used to obtain a training model group corresponding to a current generation model, and update the current generation model to generate a verification code according to the training model group and the configuration file; Generate a second preset number of second confrontation verification codes according to the generation model; send the second confrontation verification codes to the abnormal user through the induction system; Receive a second recognition result returned by the abnormal user and calculate a second recognition rate; when the second recognition rate is less than the preset threshold, synchronize the updated current generation model to the target system to generate a verification code; when the second recognition rate is not less than the preset threshold, obtain a configuration file corresponding to the updated current generation model; Extracting a recognition model from a preset recognition model pool according to the configuration file to update the training model group; Outputting a third adversarial verification code according to the training model group iteratively updated by the second adversarial verification code; sending the third adversarial verification code to the abnormal user through the induction system; Receive the third recognition result returned by the abnormal user, and calculate a third recognition rate; when the third recognition rate is less than the preset threshold, update the current generation model according to the updated training model group.

7. An electronic device, characterized in that: It comprises a memory and a processor, wherein the processor is used to implement the steps of the self-learning based verification code generation method as described in any one of claims 1 to 5 when executing the computer management program stored in the memory.

8. A computer-readable storage medium, characterized in that: A computer management program is stored thereon, and when the computer management program is executed by a processor, the steps of the verification code generation method based on self-learning as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Confrontation learning-based method and system for generating image confrontation verification codes

    CN108717550A