Verification code identification method and equipment based on browser and medium

By traversing the nodes of click event elements on the browser page, obtaining verification code images, performing preprocessing and feature extraction, and using large models to identify and verify through verification code library, the problem of low verification code recognition accuracy in the existing technology is solved, and higher recognition accuracy and ability to adapt to complex web environments are achieved.

CN119989325APending Publication Date: 2025-05-13SHANDONG INSPUR SCI RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510078757.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The existing verification code recognition method faces font changes, rotations, distortions, noise or interference lines, and the recognition accuracy is low, making it difficult to adapt to verification codes with various layouts and loading methods in complex web environments.

Method used

By obtaining the element node corresponding to the click event of the browser page, it traverses, obtains the initial verification code image, and preprocesses it, extracts local key features and appearance features, uses preset big models for identification, and finally match verification through the preset verification code library.

Benefits of technology

It improves the accuracy and pertinence of the acquisition of verification code images, enhances the adaptability to complex verification codes, and improves the accuracy and processing efficiency of verification code recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119989325A_ABST
    Figure CN119989325A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a verification code recognition method and device based on a browser and a medium, is applied to the technical field of intelligent recognition, and is used for solving the problem of low recognition accuracy of an existing verification code. The method comprises the steps of obtaining an element node corresponding to a click event of a current browser page, and performing element traversal on the current browser page by taking the element node as a base point to obtain an initial verification code image of the current browser page; preprocessing the initial verification code image to obtain a preprocessed verification code image; extracting local key features and appearance features of the verification code image, and identifying the local key features and the appearance features according to a preset large model to obtain identified verification code information; and performing matching verification on the identification verification code information through a preset verification code library to obtain a verification code identification result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent identification technology, and more particularly to a browser-based verification code identification method, device and medium. Background Art

[0002] With the popularization of network applications, users can use Internet resources according to their needs, for example, they can obtain articles, images, sounds, videos and other information they need from the Internet. However, there are currently cases where machines with programs maliciously use Internet resources improperly, such as downloading a large number of free resources, sending spam, and conducting saturation attacks. These improper uses not only occupy a large amount of Internet resources, but may also cause the server to crash in serious cases, affecting the normal use of users. In order to avoid server crashes, user identity authentication is required before users access network resources. Therefore, verification codes are widely used as an effective security verification method to prevent automated attacks and ensure user account security.

[0003] The current verification code recognition method generally compares a known verification code template, such as a standard image of numbers or letters, with the verification code image to be recognized. By calculating similarity metrics such as normalized cross-correlation, the sum of absolute differences, etc., the part that best matches the template is found to determine the characters in the verification code. However, if the verification code has font changes, rotation, distortion, added noise or interference lines, the accuracy of template matching will drop significantly, resulting in low recognition accuracy of the verification code. In addition, the existing recognition method is difficult to adapt to verification codes with various layouts and loading methods in the browser environment, which makes it difficult to accurately obtain the verification code image in a complex web page environment, affecting the recognition of the verification code. Summary of the invention

[0004] In order to solve the above technical problems, one or more embodiments of this specification provide a browser-based verification code recognition method, device and medium.

[0005] One or more embodiments of this specification adopt the following technical solutions:

[0006] One or more embodiments of this specification provide a browser-based verification code recognition method, the method comprising:

[0007] Obtaining the element node corresponding to the click event of the current browser page, and traversing the elements of the current browser page based on the element node to obtain the initial verification code image of the current browser page;

[0008] Preprocessing the initial verification code image to obtain a preprocessed verification code image;

[0009] Extracting local key features and appearance features of the verification code image, and identifying the local key features and the appearance features according to a preset large model to obtain identification verification code information;

[0010] The identification verification code information is matched and verified through a preset verification code library to obtain the verification code recognition result.

[0011] Optionally, in one or more embodiments of the present specification, obtaining an element node corresponding to a click event of a current browser page, and performing element traversal on the current browser page based on the element node to obtain an initial verification code image of the current browser page specifically includes:

[0012] Based on the verification code monitoring mechanism of the current browser page, determining whether there is a click event on the current browser page;

[0013] If yes, then obtain the element node corresponding to the click position of the click event;

[0014] Traversing the current browser page based on the element node to obtain a specified element containing verification code information;

[0015] The designated element is converted based on a preset conversion method of the current browser to obtain an initial verification code image of the current browser page.

[0016] Optionally, in one or more embodiments of the present specification, preprocessing the initial verification code image to obtain a preprocessed verification code image specifically includes:

[0017] Determine whether the current browser has an image processing logic module corresponding to the preprocessing of the verification code image;

[0018] If it exists, calling the image processing logic module to pre-process the initial verification code image according to the logic code of the image processing logic module to obtain a pre-processed verification code image;

[0019] If it does not exist, obtaining the pixel value of each point in the initial verification code image, performing grayscale processing on the initial verification code image according to the maximum value of the color channel in each pixel value, and obtaining a grayscale image corresponding to the initial verification code image;

[0020] Binarizing the grayscale image to obtain a binary image corresponding to the initial verification code image;

[0021] De-noising the binary image based on a preset filtering algorithm to obtain a pre-processed verification code image; wherein the preset filtering algorithm includes: a median filtering algorithm and a Gaussian filtering algorithm;

[0022] Preferably, after performing denoising processing on the binary image based on a preset filtering algorithm to obtain a preprocessed verification code image, the method further comprises:

[0023] The preprocessing process corresponding to the verification code image is encoded based on a compiler to obtain an image processing logic module corresponding to the preprocessing of the verification code image.

[0024] Optionally, in one or more embodiments of the present specification, extracting local key features and appearance features of the verification code image to identify the local key features and the appearance features according to a preset large model to obtain identification verification code information specifically includes:

[0025] Comparing each pixel point in the verification code image with the neighboring pixel points to obtain the local extreme pixel points of the verification code image, and determining the local key features of the verification code image according to the local extreme pixel points;

[0026] The verification code image is transformed into a coordinate domain based on a coordinate transformation formula to obtain a Zernike moment feature corresponding to the verification code image, and Zernike moment eigenvalues ​​of various orders corresponding to the verification code image are combined to obtain a required appearance feature of the verification code image;

[0027] Determining a verification scene corresponding to the verification code image, so as to determine the optional appearance feature type to be extracted according to the verification scene;

[0028] Calling an execution script corresponding to the appearance feature type to extract optional appearance features of the verification scenario based on the execution script;

[0029] Merging the required appearance feature with the optional appearance feature to obtain the appearance feature;

[0030] The local key features and the appearance features are input into the preset large model to output the identification verification code information.

[0031] Optionally, in one or more embodiments of the present specification, determining the local key features of the verification code image according to the local extreme pixel points specifically includes:

[0032] Filtering edge response points within the local extreme pixel points according to the position of each local extreme pixel point and a preset feature acquisition scale to obtain a current local key pixel point;

[0033] Determining a convolution extraction window of the local key feature based on the current local key pixel point and the preset feature acquisition scale;

[0034] A current extraction direction is determined according to the gradient histogram of the convolution extraction window, so as to extract the verification code image based on the current extraction direction and obtain local key features of the verification code image.

[0035] Optionally, in one or more embodiments of the present specification, before the local key features and the appearance features are identified according to the preset large model and the identification verification code information is obtained, the method further includes:

[0036] Acquire a data image set of each type of verification code based on the database corresponding to the current browser, and annotate each type of verification code image in the data image set to obtain an initial verification code image to be trained;

[0037] Normalizing each of the initial verification code images to be trained to obtain processed verification code images to be trained, and dividing the verification code images to be trained based on a preset ratio to obtain training set verification code images, verification set verification code images, and test set verification code images;

[0038] Build an initial large model according to the TensorFlow model architecture corresponding to the current browser;

[0039] The training set verification code images are divided into a plurality of training batches, and the training set verification code images of each training batch are sequentially input into the initial large model of each training cycle for training, so as to obtain the initial large model after each training cycle training;

[0040] Inputting the verification code image of the verification set into the initial large model after each training cycle, so as to adjust the trained initial large model according to the verification result, so as to iteratively obtain a large model that meets the requirements;

[0041] The large model that meets the requirements is evaluated based on the test set verification code image to determine whether to use the large model that meets the requirements as a preset large model according to the evaluation result.

[0042] Optionally, in one or more embodiments of the present specification, matching and verifying the identification verification code information through a preset verification code library to obtain the verification code recognition result specifically includes:

[0043] Performing matching verification on the identification verification code information through a preset verification code library;

[0044] If the preset verification code library contains verification code information corresponding to the identification verification code information, determining that the verification code identification result is verification success;

[0045] If the preset verification code library does not contain verification code information corresponding to the identification verification code information, it is determined that the verification code recognition result is a verification failure.

[0046] Optionally, in one or more embodiments of the present specification, after matching and verifying the identification verification code information through a preset verification code library and obtaining the verification code recognition result, the method further includes:

[0047] If it is determined that the verification code recognition result is successful, obtaining the verification code recognition box of the current browser page based on a preset interface, and filling the verification code recognition result into the verification code recognition box;

[0048] If it is determined that the verification identification result is a verification failure, a failure prompt pop-up box is displayed on the current browser page based on the link corresponding to the verification failure.

[0049] One or more embodiments of this specification provide a browser-based verification code recognition device, the device comprising:

[0050] at least one processor; and,

[0051] a memory communicatively connected to the at least one processor; wherein,

[0052] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform any of the above methods.

[0053] One or more embodiments of the present specification provide a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute any of the above-described methods.

[0054] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects:

[0055] By traversing from the element node corresponding to the click event of the current browser page, the verification code image can be accurately located, avoiding the problem of mistakenly obtaining other irrelevant images in a complex web page environment, thereby improving the accuracy and pertinence of obtaining the verification code image. At the same time, local key features and appearance features are extracted, which can comprehensively describe the verification code image from multiple dimensions, improve the coverage of important information of the verification code image, and thus enhance the adaptability to various complex verification codes. The verification code information is matched and verified by the preset verification code library, which facilitates the subsequent rapid identification of the verification code content and automatic filling of the recognition results, improving the processing efficiency of the verification process. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:

[0057] Figure 1 A flowchart of a verification code recognition method based on a browser provided in an embodiment of this specification;

[0058] Figure 2 A schematic diagram of the structure of a browser-based verification code recognition device provided in an embodiment of this specification;

[0059] Figure 3 A schematic diagram of the structure of a non-volatile storage medium provided in an embodiment of this specification. DETAILED DESCRIPTION

[0060] The embodiments of this specification provide a browser-based verification code recognition method, device and medium.

[0061] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0062] like Figure 1 As shown, the embodiment of this specification provides a flowchart of a verification code recognition method based on a browser. Figure 1 It can be seen that in one or more embodiments of this specification, a verification code recognition method based on a browser includes the following steps:

[0063] S101: Acquire an element node corresponding to a click event of a current browser page, and perform element traversal on the current browser page based on the element node to acquire an initial verification code image of the current browser page.

[0064] In order to solve the problem that the existing recognition method is difficult to adapt to the verification codes of various layouts and loading methods in the browser environment, which makes it difficult to accurately obtain the verification code image in a complex web page environment, affecting the recognition of the verification code, the embodiment of this specification obtains the element node corresponding to the click event of the current browser page, and uses the element node as the base point to traverse the elements of the current browser page, thereby obtaining the initial verification code image of the current browser page. Specifically, in one or more embodiments of this specification, the element node corresponding to the click event of the current browser page is obtained, and the element node is used as the base point to traverse the elements of the current browser page to obtain the initial verification code image of the current browser page, which specifically includes the following process:

[0065] First, based on the verification code monitoring mechanism of the current browser page, determine whether there is a click event in the current browser page. If it exists, when the click event is monitored, the browser will record the location where the click occurs. This location is usually expressed in the form of page coordinates, so at this time, the element node corresponding to the click location of the click event can be obtained. Since the verification code may be nested in a complex HTML structure, the element node obtained only by the click position is not necessarily the element where the verification code is located, so it is necessary to use the node as the starting point to traverse the DOM tree of the entire page, that is, to traverse the current browser page with the element node as the base point to obtain the specified element containing the verification code information. The specified element is converted based on the preset conversion method of the current browser to obtain the initial verification code image of the current browser page.

[0066] For example, in a certain application scenario, you can click on the verification code image, and then obtain the clicked DomElement through the click event ClickEvent, and recursively traverse the DomElement to obtain the CanvasDom where the target verification code is located, and then use the toDataURL function to convert the canvasDom where the verification code is located into image data. That is, in a complex browser page environment, the verification code image may be nested in various HTML elements, and by traversing the element node corresponding to the click event, you can accurately find the location of the verification code image and thus accurately locate the verification code.

[0067] S102: Preprocessing the initial verification code image to obtain a preprocessed verification code image.

[0068] After obtaining the initial verification code image based on the above steps, in order to avoid the problem of low recognition accuracy caused by noise or interference lines, the initial verification code image will be preprocessed in the embodiments of this specification to obtain a processed verification code image, so as to improve the accuracy of subsequent verification code recognition and reduce the error rate. Specifically, in one or more embodiments of this specification, the initial verification code image is preprocessed to obtain the preprocessed verification code image, which specifically includes the following process:

[0069] First, determine whether the current browser has an image processing logic module corresponding to the preprocessing of the verification code image. If so, in order to improve the calculation efficiency, the image processing logic module can be directly called to preprocess the initial verification code image according to the logic code of the image processing logic module to obtain the preprocessed verification code image. If not, it is necessary to obtain the pixel value of each point in the initial verification code image, so as to grayscale the initial verification code image according to the maximum value of the color channel in each pixel value, and obtain the grayscale image corresponding to the initial verification code image. In addition, the RGB value of each pixel point can be converted into a grayscale value by the weighted average method to obtain the grayscale image corresponding to the initial verification code image. In order to improve the recognition efficiency, the grayscale image will be binarized to obtain the binarized image corresponding to the initial verification code image, that is, the grayscale image is converted into an image containing only black and white colors. According to the set threshold, the pixel points with grayscale values ​​greater than the threshold are set to white, and the pixel points with grayscale values ​​less than the threshold are set to black. Then, the binary image is denoised based on the preset filtering algorithm to obtain the preprocessed verification code image, thereby removing the noise points or impurity points in the image to improve the image quality. Among them, the preset filtering algorithms include: median filtering algorithm and Gaussian filtering algorithm.

[0070] Preferably, because the preprocessing involves a large amount of calculations, in order to improve the calculation efficiency, after the binary image is denoised based on a preset filtering algorithm to obtain a preprocessed verification code image, the method also includes the following process: encoding the preprocessing process corresponding to the verification code image based on a compiler, thereby obtaining an image processing logic module corresponding to the preprocessing of the verification code image, so that the image processing logic module can be subsequently optimized based on the wasm method, thereby improving the processing efficiency of the initial verification code image.

[0071] S103: extracting local key features and appearance features of the verification code image, and identifying the local key features and the appearance features according to a preset large model to obtain identification verification code information.

[0072] The current method of determining the characters in the verification code by calculating similarity metrics such as normalized cross-correlation and the sum of absolute differences to find the part that best matches the template is difficult to adapt to verification scenarios with high variability. For example, when the verification code has font changes, rotation, distortion, noise or interference lines, the recognition accuracy is limited. At this time, in order to highlight the significant features of the verification code and achieve the purpose of extracting effective information from complex backgrounds and interference, the local key features and appearance features of the verification code image will be extracted in the embodiments of this specification, so as to identify the local key features and appearance features according to the preset large model to obtain the identification verification code information. That is, by combining the local key features and appearance features, the coverage of important information in the verification code image is improved compared to the recognition method that relies on a single feature, thereby improving the recognition accuracy. Specifically, in one or more embodiments of this specification, the local key features and appearance features of the verification code image are extracted to identify the local key features and appearance features according to the preset large model to obtain the identification verification code information, which specifically includes the following process:

[0073] First, each pixel in the verification code image is compared with the neighboring pixel points to obtain the local extreme pixel points of the verification code image, and the local key features of the verification code image are determined based on the local extreme pixel points. Then, the verification code image is transformed in the coordinate domain based on the coordinate transformation formula, so that the Zernike moment feature corresponding to the verification code image is combined with the Zernike moment eigenvalues ​​of each order corresponding to the verification code image, and the required appearance features of the verification code image that can display the global features of the verification code image can be obtained. Then, in order to adapt to different verification scene requirements, for example, in some scenes with extremely high security requirements, more attention may be paid to the color distribution, texture and other detailed features of the verification code, while in general scenes, more emphasis may be placed on the overall shape and basic structure. Therefore, by determining the verification scene corresponding to the verification code image, the optional appearance feature type to be extracted can be determined according to the verification scene. Then, the execution script corresponding to the appearance feature type is called, so as to extract the optional appearance features of the verification scene according to the execution script. The required appearance features are combined with the optional appearance features to obtain the appearance features, and then the local key features and the appearance features are input into the preset large model, so as to obtain the identification verification code information processed and output by the preset large model.

[0074] In this process, local key features are determined by comparing pixels with their neighborhoods to obtain local extreme pixel points, which can capture important information at the detail level in the verification code image, such as the edges and corners of characters. These features are critical for distinguishing similar characters or patterns. At the same time, the Zernike moment features are used to obtain the required appearance features, which describe the overall shape, structure and other characteristics of the verification code image from a global perspective, so that the model has a comprehensive understanding of the image. This combination of local and global features ensures full utilization of the verification code image information and improves recognition accuracy. In addition, the optional appearance feature type to be extracted is determined according to different verification scenarios, and the corresponding execution script is called to extract, so that the feature extraction process can be optimized for specific scenarios.

[0075] Furthermore, in one or more embodiments of the present specification, the above process determines the local key features of the verification code image according to the local extreme pixel points, which specifically includes the following process:

[0076] First, according to the position of each local extreme pixel and the preset feature acquisition scale, the edge response points within the local extreme pixel are filtered to obtain the current local key pixel. Then, according to the current local key pixel and the preset feature acquisition scale, the convolution extraction window of the local key feature is determined. According to the gradient histogram of the convolution extraction window, the current extraction direction is determined, so that the verification code image is extracted according to the current extraction direction to obtain the local key features of the verification code image.

[0077] For example: suppose we set the preset feature acquisition scale to a 3x3 neighborhood, then for each pixel, we check whether it is an extreme point in the 3x3 neighborhood. If the pixel value of the point is the largest in this neighborhood, it is a local extreme pixel. After traversing the entire image, all local extreme pixels can be found. At this time, the edge response point is determined by a simple gradient calculation. For a pixel, calculate its horizontal and vertical gradients. For example, for a pixel (x, y), the horizontal gradient Gx can be approximated by the difference between the pixel values ​​of (x+1, y) and (x-1, y), and the vertical gradient Gy can be approximated by the difference between the pixel values ​​of (x, y+1) and (x, y-1). If both Gx and Gy are large, it means that the point may be an edge response point. For some edge response points, since their features may be unstable, they are filtered out to obtain the current local key pixel. With one of the local key pixels as the center, the preset feature acquisition scale can be set to determine the 3x3 area corresponding to the convolution extraction window. In this 3x3 convolution extraction window, the gradient direction of each pixel is calculated, and the number of pixels in different gradient directions is counted to form a gradient histogram. Assuming that the gradient direction is divided into 8 intervals (0-45°, 45-90°, ..., 315-360°), by counting the number of pixels in each interval, it can be found that the number of pixels in a certain interval is the largest, and the direction corresponding to this interval is the current extraction direction. For example, if the pixel gradient in the 45-90° direction is the largest in this window, then this direction is the current extraction direction. According to the determined current extraction direction, features can be further extracted in this window to form local key features of the local area.

[0078] Furthermore, in one or more embodiments of the present specification, before identifying the local key features and the appearance features according to the preset large model and obtaining the identification verification code information, the method further includes the following process:

[0079] First, based on the database corresponding to the current browser, a data image set of each type of verification code is obtained, and each type of verification code image in the data image set is annotated to obtain an initial verification code image to be trained. Then, each initial verification code image to be trained is normalized to obtain a processed verification code image to be trained, and the verification code image to be trained is divided based on a preset ratio to obtain a training set verification code image, a verification set verification code image, and a test set verification code image. According to the TensorFlow model architecture corresponding to the current browser, an initial large model is constructed. The training set verification code image is divided into multiple training batches, so that the training set verification code images of each training batch are sequentially input into the initial large model of each training cycle for training, and the initial large model after each training cycle training is obtained. Then the verification set verification code image is input into the initial large model after each training cycle, so as to adjust the trained initial large model according to the verification result, so as to iteratively obtain a large model that meets the requirements. The large model that meets the requirements is evaluated according to the test set verification code image, so as to determine whether to use the large model that meets the requirements as the preset large model according to the evaluation result. The verification code images in the training set are divided into multiple training batches, and the initial large model of each training cycle is input into the training in sequence. This helps to process large-scale data under limited memory resources. At the same time, the model gradually learns the characteristics of the data in multiple iterations, thereby improving the recognition reliability of the model.

[0080] In this process, the initial large model is built based on the TensorFlow model architecture corresponding to the current browser, which can make full use of the relevant characteristics and optimization experience in the browser environment, making the model more structurally adapted to the verification code recognition task faced by the browser, and improving the model's learning efficiency and recognition accuracy.

[0081] S104: performing matching verification on the identification verification code information through a preset verification code library to obtain the verification code recognition result.

[0082] After obtaining the identification verification code information based on the above steps S101-S103, in order to determine whether the verification is passed, the embodiment of this specification will match and verify the identification verification code information through the preset verification code library to obtain the verification code recognition result. Specifically, in one or more embodiments of this specification, matching and verifying the identification verification code information through the preset verification code library to obtain the verification code recognition result specifically includes the following process:

[0083] First, the identification verification code information is matched and verified through the preset verification code library. If it is determined that the preset verification code library contains verification code information corresponding to the identification verification code information, then it can be determined that the verification code recognition result is a successful verification. If it is determined that the preset verification code library does not contain verification code information corresponding to the identification verification code information, then it can be determined that the verification code recognition result is a failed verification. That is, the identification verification information is compared with the preset verification code library or the user input. It can be understood that since the preset verification code library stores all possible verification code values ​​and their corresponding image features, if the recognition result matches the information in the verification code library at this time, it can be said that the verification is successful, otherwise the verification fails. Through this verification process, ambiguous judgment situations are avoided, which facilitates the correct implementation of subsequent operations.

[0084] Furthermore, in order to quickly identify the verification code content and automatically fill in the recognition result when processing the page, thereby improving work efficiency, in one or more embodiments of the present specification, after matching and verifying the recognition verification code information through a preset verification code library and obtaining the verification code recognition result, the method further includes:

[0085] If the verification code recognition result is determined to be successful, the verification code recognition box of the current browser page is obtained based on the preset interface DOMElementApi, so that the verification code recognition result is automatically filled into the verification code recognition box. If the verification recognition result is determined to be a verification failure, a failure prompt pop-up box can be displayed on the current browser page according to the link corresponding to the verification failure.

[0086] like Figure 2 As shown, the present specification provides a schematic diagram of the structure of a browser-based verification code recognition device, which comprises Figure 2 It can be seen that in one or more embodiments of this specification, a browser-based verification code recognition device includes:

[0087] at least one processor; and,

[0088] a memory communicatively connected to the at least one processor; wherein,

[0089] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform any of the above methods.

[0090] like Figure 3 As shown, a schematic diagram of a non-volatile storage medium structure is provided in an embodiment of the present specification, which comprises Figure 3It can be seen that in one or more embodiments of the present specification, a non-volatile storage medium stores computer-executable instructions, and the computer-executable instructions can execute any of the methods described above.

[0091] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0092] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0093] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.

Claims

1. A verification code recognition method based on a browser, characterized in that: The method comprises: Obtaining the element node corresponding to the click event of the current browser page, and performing element traversal on the current browser page based on the element node to obtain the initial verification code image of the current browser page; Preprocessing the initial verification code image to obtain a preprocessed verification code image; Extracting local key features and appearance features of the verification code image, and identifying the local key features and the appearance features according to a preset large model to obtain identification verification code information; The identification verification code information is matched and verified through a preset verification code library to obtain the verification code recognition result.

2. A browser-based verification code recognition method according to claim 1, characterized in that: Obtaining an element node corresponding to a click event of the current browser page, and traversing the elements of the current browser page based on the element node to obtain an initial verification code image of the current browser page, specifically includes: Based on the verification code monitoring mechanism of the current browser page, determining whether there is a click event on the current browser page; If yes, then obtain the element node corresponding to the click position of the click event; Traversing the current browser page based on the element node to obtain a specified element containing verification code information; The designated element is converted based on a preset conversion method of the current browser to obtain an initial verification code image of the current browser page.

3. A browser-based verification code recognition method according to claim 1, characterized in that: Preprocessing the initial verification code image to obtain a preprocessed verification code image specifically includes: Determine whether the current browser has an image processing logic module corresponding to the preprocessing of the verification code image; If it exists, calling the image processing logic module to pre-process the initial verification code image according to the logic code of the image processing logic module to obtain a pre-processed verification code image; If it does not exist, obtaining the pixel value of each point in the initial verification code image, performing grayscale processing on the initial verification code image according to the maximum value of the color channel in each pixel value, and obtaining a grayscale image corresponding to the initial verification code image; Binarizing the grayscale image to obtain a binary image corresponding to the initial verification code image; De-noising the binary image based on a preset filtering algorithm to obtain a pre-processed verification code image; wherein the preset filtering algorithm includes: a median filtering algorithm and a Gaussian filtering algorithm; Preferably, after performing denoising processing on the binary image based on a preset filtering algorithm to obtain a preprocessed verification code image, the method further comprises: The preprocessing process corresponding to the verification code image is encoded based on a compiler to obtain an image processing logic module corresponding to the preprocessing of the verification code image.

4. A browser-based verification code recognition method according to claim 1, characterized in that: Extracting local key features and appearance features of the verification code image to identify the local key features and the appearance features according to a preset large model to obtain identification verification code information, specifically including: Comparing each pixel point in the verification code image with the neighboring pixel points to obtain the local extreme pixel points of the verification code image, and determining the local key features of the verification code image according to the local extreme pixel points; The verification code image is transformed into a coordinate domain based on a coordinate transformation formula to obtain a Zernike moment feature corresponding to the verification code image, and Zernike moment eigenvalues ​​of various orders corresponding to the verification code image are combined to obtain a required appearance feature of the verification code image; Determining a verification scene corresponding to the verification code image, so as to determine the optional appearance feature type to be extracted according to the verification scene; Calling an execution script corresponding to the appearance feature type to extract optional appearance features of the verification scenario based on the execution script; Merging the required appearance feature with the optional appearance feature to obtain the appearance feature; The local key features and the appearance features are input into the preset large model to output the identification verification code information.

5. A browser-based verification code recognition method according to claim 4, characterized in that: Determining the local key features of the verification code image according to the local extreme pixel points specifically includes: Filtering edge response points within the local extreme pixel points according to the position of each local extreme pixel point and a preset feature acquisition scale to obtain a current local key pixel point; Determining a convolution extraction window of the local key feature based on the current local key pixel point and the preset feature acquisition scale; A current extraction direction is determined according to the gradient histogram of the convolution extraction window, so as to extract the verification code image based on the current extraction direction to obtain local key features of the verification code image.

6. A browser-based verification code recognition method according to claim 1, characterized in that: The local key features and the appearance features are identified according to the preset large model, and before obtaining the identification verification code information, the method further includes: Acquire a data image set of each type of verification code based on the database corresponding to the current browser, and annotate each type of verification code image in the data image set to obtain an initial verification code image to be trained; Normalizing each of the initial verification code images to be trained to obtain processed verification code images to be trained, and dividing the verification code images to be trained based on a preset ratio to obtain training set verification code images, verification set verification code images, and test set verification code images; Build an initial large model according to the TensorFlow model architecture corresponding to the current browser; The training set verification code images are divided into a plurality of training batches, and the training set verification code images of each training batch are sequentially input into the initial large model of each training cycle for training, so as to obtain the initial large model after each training cycle training; Inputting the verification code image of the verification set into the initial large model after each training cycle, so as to adjust the trained initial large model according to the verification result, so as to iteratively obtain a large model that meets the requirements; The large model that meets the requirements is evaluated based on the test set verification code image to determine whether to use the large model that meets the requirements as a preset large model according to the evaluation result.

7. A browser-based verification code recognition method according to claim 1, characterized in that: The verification code information is matched and verified by a preset verification code library to obtain the verification code recognition result, specifically including: Performing matching verification on the identification verification code information through a preset verification code library; If the preset verification code library contains verification code information corresponding to the identification verification code information, determining that the verification code identification result is verification success; If the preset verification code library does not contain verification code information corresponding to the identification verification code information, it is determined that the verification code recognition result is a verification failure.

8. A browser-based verification code recognition method according to claim 1, characterized in that: After matching and verifying the identification verification code information through a preset verification code library and obtaining the verification code recognition result, the method further includes: If it is determined that the verification code recognition result is successful, obtaining the verification code recognition box of the current browser page based on a preset interface, and filling the verification code recognition result into the verification code recognition box; If it is determined that the verification identification result is a verification failure, a failure prompt pop-up box is displayed on the current browser page based on the link corresponding to the verification failure.

9. A verification code recognition device based on a browser, characterized in that: The device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method of any one of claims 1 to 8.

10. A non-volatile storage medium storing computer executable instructions, characterized in that: The computer executable instructions can execute the method according to any one of the above claims 1.