Verification code generation method and device and related equipment

By generating CAPTCHA images adapted to users' historical access data using AI models, the problem of limited slider CAPTCHA materials was solved, improving user experience and reducing server load, thus enhancing both security and diversity.

CN121746536APending Publication Date: 2026-03-27CHINA MOBILE FINANCIAL TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing methods for generating slider-based CAPTCHAs suffer from limited image resources, are easily cracked, and negatively impact user experience.

Method used

By using artificial intelligence (AI) models to generate verification images that match the user's historical webpage visit data and webpage content, the verification code images are expanded, and the verification code is generated on the terminal device, reducing server load.

Benefits of technology

A personalized verification mechanism for CAPTCHAs has been implemented, which improves user experience, reduces server load, and enhances the security and diversity of CAPTCHAs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121746536A_ABST
    Figure CN121746536A_ABST
Patent Text Reader

Abstract

The invention provides a verification code generation method and device and related equipment, and is applied to terminal equipment, the method comprises the following steps: under the condition that a user accesses a first webpage, sending a verification code generation request to a server, the verification code generation request carrying first information; target material information matched with the first information and sent by the server is received, the target material information is selected from verification material information by the server based on the first information, and the target material information comprises a target verification material picture selected from verification material pictures in the verification material information; the verification material picture is generated by utilizing an artificial intelligence AI model based on second information, the second information comprises second scene data when the user accesses a second webpage historically and second webpage content of the second webpage, and the verification material picture is matched with the second information; and generating a verification code for accessing the first webpage by the user based on the target material information.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of Internet, and particularly relates to a verification code generation method and device and related equipment. BACKGROUND

[0002] With the rapid development of the Internet, network security problems are increasingly prominent. In order to prevent attacks by malicious programs and robots, various verification code technologies have emerged. Traditional verification code technologies mainly include character verification codes, calculation verification codes, etc., but these verification codes are easy to be identified and cracked. In recent years, the sliding block jigsaw verification code has gradually become a mainstream verification code technology due to its high security, good user experience and other advantages.

[0003] However, the current sliding block jigsaw verification code generation method usually has the technical problem of limited picture materials, resulting in poor sliding block jigsaw verification code generation effect and affecting user experience. SUMMARY

[0004] The present application provides a verification code generation method, device and related equipment, which can solve the technical problem that the related art sliding block jigsaw verification code generation method usually has the technical problem of limited picture materials, resulting in poor sliding block jigsaw verification code generation effect and affecting user experience.

[0005] In a first aspect, the present application provides a verification code generation method applied to a terminal device, and the method comprises:

[0006] In the case that a user accesses a first web page, a verification code generation request is sent to a server, the verification code generation request carries first information, and the first information includes at least one of first scene data when the user accesses the first web page and first web page content of the first web page;

[0007] Target material information matching the first information is received, which is selected from verification material information by the server based on the first information, and the target material information includes target verification material pictures selected from verification material pictures in the verification material information, the verification material pictures are generated based on second information by using an artificial intelligence (AI) model, the second information includes second scene data when a user accesses a second web page and second web page content of the second web page, the verification material pictures are adapted to the second information, and the second web page is the first web page or a web page different from the first web page;

[0008] Based on the target material information, a verification code for the user accessing the first web page is generated.

[0009] Secondly, embodiments of this application provide a verification code generation method, applied to a server, the method comprising:

[0010] Upon receiving a verification code generation request sent by a terminal device for a user's access to a first webpage, target material information matching the first information is selected from verification material information based on the first information carried in the verification code generation request. The target material information includes a target verification material image selected from the verification material images in the verification material information. The first information includes at least one of the first scene data when the user accesses the first webpage and the first webpage content of the first webpage. The verification material image is generated using an artificial intelligence (AI) model based on second information. The second information includes the second scene data when the user historically accesses a second webpage and the second webpage content of the second webpage. The verification material image is adapted to the second information. The second webpage is the first webpage or a webpage different from the first webpage.

[0011] The target material information is sent to the terminal device, and the target material information is used by the terminal device to generate a verification code.

[0012] Thirdly, embodiments of this application provide a verification code generation device, applied to a terminal device, the device comprising:

[0013] The first sending module is used to send a verification code generation request to the server when a user visits the first webpage. The verification code generation request carries first information, which includes at least one of the first scenario data when the user visits the first webpage and the first webpage content of the first webpage.

[0014] The first receiving module is configured to receive target material information that matches the first information sent by the server. The target material information is selected by the server from the verification material information based on the first information. The target material information includes target verification material images selected from the verification material images in the verification material information. The verification material images are generated using an artificial intelligence (AI) model based on second information. The second information includes second scene data when the user historically accesses the second webpage and the second webpage content of the second webpage. The verification material images are adapted to the second information. The second webpage is the first webpage or a webpage different from the first webpage.

[0015] The generation module is used to generate a verification code for the user to access the first webpage based on the target material information.

[0016] Fourthly, embodiments of this application provide a verification code generation device applied to a server, the device comprising:

[0017] The selection module is configured to, upon receiving a verification code generation request sent by a terminal device for a user's access to a first webpage, select target material information matching the first information carried in the verification code generation request from verification material information; the target material information includes a target verification material image selected from verification material images in the verification material information; the first information includes at least one of the first scene data when the user accesses the first webpage and the first webpage content of the first webpage; the verification material image is generated using an artificial intelligence (AI) model based on second information; the second information includes the second scene data when the user historically accesses a second webpage and the second webpage content of the second webpage; the verification material image is adapted to the second information; the second webpage is the first webpage, or a webpage different from the first webpage;

[0018] The second sending module is used to send the target material information to the terminal device, and the target material information is used by the terminal device to generate a verification code.

[0019] Fifthly, embodiments of this application provide a terminal device, including: a first processor, a first memory, and a program stored in the first memory and executable on the first processor, wherein when the program is executed by the first processor, it implements the steps of the verification code generation method as described in the first aspect.

[0020] In a sixth aspect, embodiments of this application provide a server, including: a second processor, a second memory, and a program stored in the second memory and executable on the second processor, wherein the program, when executed by the second processor, implements the steps of the verification code generation method as described in the second aspect.

[0021] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the verification code generation method as described in the first aspect, or the steps of the verification code generation method as described in the second aspect.

[0022] Eighthly, embodiments of this application provide a computer program product, including computer instructions that, when executed by a processor, implement the steps of the verification code generation method as described in the first aspect, or the steps of the verification code generation method as described in the second aspect.

[0023] In this embodiment, when a user visits a first webpage, the terminal device sends a verification code generation request to the server. The verification code generation request carries first information, which includes at least one of the following: first scene data when the user visits the first webpage and the first webpage content. Based on the first information carried in the verification code generation request, the server selects target material information matching the first information from verification material information and sends the target material information to the terminal device. The target material information includes a target verification material image selected from the verification material images in the verification material information. The verification material image is generated using an artificial intelligence (AI) model based on second information, which includes second scene data when the user historically visits a second webpage and the second webpage content of the second webpage. The verification material image is adapted to the second information, and the second webpage is the first webpage or a webpage different from the first webpage. Accordingly, the terminal device generates the verification code for the user's visit to the first webpage based on the target material information. In this way, based on the second scene data and the content of the second webpage when the user visited the second webpage in the past, an AI model can be used to generate verification material images that are adapted to the second scene data and the content of the second webpage. On the one hand, the verification material images of the CAPTCHA can be expanded using the webpage content. On the other hand, when a user (who may be the same user or a different user who visited the second webpage) visits the first webpage (which may be the same or a different webpage), the target verification material image that matches the first information can be selected from the verification material images adapted to the second information based on the first scene data and / or the first webpage content when the user visited the first webpage. This ensures that the style of the target verification material image of the CAPTCHA is related to the content of the visited webpage, and also integrates the scene data when the user visited the webpage. This can solve the technical problem that users are often unfamiliar with the image materials of the CAPTCHA, which leads to the difficulty of verification, and that the same image appears under the same webpage for different users. It can realize a personalized verification mechanism. Attached Figure Description

[0024] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is one of the flowcharts of a verification code generation method provided in the embodiments of this application;

[0026] Figure 2This is a diagram illustrating the process of extracting relevant elements from webpage content to construct verification material information;

[0027] Figure 3 This is a schematic diagram illustrating the process of using an AI model to generate content that is style-appropriate for web pages and incorporates random data.

[0028] Figure 4 This is a diagram illustrating the process of adjusting the difficulty of CAPTCHAs by adding an intelligent dynamic difficulty adjustment engine.

[0029] Figure 5 This is a second flowchart of a verification code generation method provided in an embodiment of this application;

[0030] Figure 6 This is one of the structural schematic diagrams of a verification code generation device provided in the embodiments of this application;

[0031] Figure 7 This is a second schematic diagram of the structure of a verification code generation device provided in an embodiment of this application;

[0032] Figure 8 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application;

[0033] Figure 9 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation

[0034] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0035] Currently, character-based CAPTCHAs and computation-based CAPTCHAs have the following drawbacks:

[0036] 1. Poor user experience; sometimes distorted characters are difficult to recognize, leading to input errors and affecting users' normal use of the website or services.

[0037] 2. Easily cracked: With the development of image recognition technology, some character verification codes can be automatically recognized by machine learning algorithms, thus losing their original protective function.

[0038] 3. Inconvenience in adapting to aging poses a significant challenge for older adults with poor eyesight or declining cognitive abilities.

[0039] Therefore, slider puzzle CAPTCHAs are widely used because they offer better security and user experience. However, existing slider puzzle CAPTCHA generation methods have the following drawbacks:

[0040] 1. The available image resources are limited and easily cracked.

[0041] 2. Users are often unfamiliar with image materials, which increases the difficulty of verification.

[0042] 3. The generation process is complex and puts excessive pressure on the server.

[0043] It should be noted that the verification code generation method in this application embodiment is applied to a verification code generation system, which relates to the basic field of information technology (IT). The verification code generation system may include terminal devices and servers, and the terminal devices and servers can interact to implement the verification code generation method in this application embodiment.

[0044] See Figure 1 , Figure 1 This is one of the flowcharts of a verification code generation method provided in the embodiments of this application, applied to terminal devices, such as... Figure 1 As shown, the method includes the following steps:

[0045] Step 101: When a user visits the first webpage, a verification code generation request is sent to the server. The verification code generation request carries first information, which includes at least one of the first scenario data when the user visits the first webpage and the first webpage content of the first webpage.

[0046] Step 102: Receive target material information sent by the server that matches the first information. The target material information is selected by the server from the verification material information based on the first information. The target material information includes target verification material images selected from the verification material images in the verification material information. The verification material images are generated using an artificial intelligence (AI) model based on second information. The second information includes second scene data from the user's historical visits to the second webpage and the second webpage content of the second webpage. The verification material images are adapted to the second information. The second webpage is the first webpage or a webpage different from the first webpage.

[0047] Step 103: Based on the target material information, generate a verification code for the user to access the first webpage.

[0048] The terminal device can be equipped with a browser for accessing web pages.

[0049] In this embodiment, the verification code generation method can be applied to two scenarios. The first scenario is the initial login to a webpage, where the user verifies the webpage by using a slider puzzle verification code after entering the webpage password. The second scenario is during webpage access, where the user has not triggered the webpage for a long time, and in this case, the user needs to verify the webpage by using a slider puzzle verification code.

[0050] If any of the above-mentioned situations are triggered when a user accesses the first webpage through a browser, the terminal device can send a verification code generation request to the server. The verification code generation request may carry first information, which may include at least one of the following: first scenario data of the user accessing the first webpage and the content of the first webpage.

[0051] In some embodiments, if the first webpage is accessed for the first time, the first information may include first scene data when the user accesses the first webpage. In some embodiments, if the first webpage is being accessed, the first information may include first scene data when the user accesses the first webpage and first webpage data of the first webpage.

[0052] The first scenario data may include random data such as weather temperature, timestamp, and geolocation marker when the user visits the first webpage, as well as user device information and user behavior data when visiting the first webpage.

[0053] Correspondingly, the server can receive a verification code generation request sent by the terminal device, and can select target material information that matches the first information from the verification material information based on the verification code generation request.

[0054] Before selecting target material information, the server needs to pre-construct verification material information to ensure that the verification code has sufficient material elements.

[0055] In this embodiment, verification material information can be constructed based on the second scene data when the user historically accessed the second webpage and the content of the second webpage.

[0056] In some embodiments, the second webpage can be the same as the first webpage. For example, in the second scenario, verification material information can be constructed based on the content of the first webpage when the user previously visited the first webpage. In this way, when the user revisits the first webpage, target material information that matches the first information can be selected from the verification material information. The selected target material information is relatively familiar to the user, thereby simplifying the verification difficulty.

[0057] In some embodiments, the second webpage may also be different from the first webpage. For example, in the first scenario, verification material information can be constructed based on the content of the second webpage when the user has historically visited it. This enriches the material images for the verification code. At the same time, the verification material images in the verification material information are adapted to the second information. Correspondingly, a target verification material image is selected from the verification material images. This target verification material image also matches the first information. For example, the second webpage has content with a similar style to the first webpage, or the second scenario data when the user has historically visited the second webpage is similar to the first scenario data when the user visited the first webpage (e.g., similar timestamps). In this way, even if the second webpage is different from the first webpage, by constructing verification material images adapted to the second information, and when the user visits the first webpage, a target verification material image matching the first information can be selected from the verification material images. The selected target material information is relatively familiar to the user, thereby simplifying the verification difficulty.

[0058] The adaptation and matching processes can be the same. Matching can refer to content matching, scene matching, or both content and scene matching. No specific limitations are made here.

[0059] It should be noted that the types of scenario data included in the first information and the second information, that is, the content types of the first scenario data and the second scenario data, can be the same. For example, the first scenario data includes device information, timestamps, weather temperature, and geolocation markers, and the second scenario data also includes scenario data of these content types. The difference between the two is that the user accesses the webpage in different scenarios. The first scenario data is the scenario data when the user accesses the first webpage, and the second scenario data is the scenario data when the user has historically accessed the first or second webpage.

[0060] In some embodiments, prior to step 102, the method further includes:

[0061] If a user has previously visited a second webpage, parse the HTML content of the second webpage to construct a document object model tree.

[0062] Based on the document object model tree, extract element information from the second webpage;

[0063] The second information is sent to the server, wherein the second webpage content of the second webpage in the second information includes the element information, and the second information is used by the server to construct the verification material information.

[0064] like Figure 2As shown, when a user visits the second webpage in the past, the terminal device can parse and render the HyperText Markup Language (HTML) content through the browser, construct the Document Object Model (DOM) tree, and extract key elements from the second webpage, such as text elements, color elements, and image elements. The key elements are then classified and labeled, such as text elements labeled as "text1" and "text2", color elements labeled as "color1" and "color2", and image elements labeled as "image1" and "image2".

[0065] The terminal device can submit the extracted key element information of the second webpage, along with second scenario data such as user device information, to the server as verification material. The user device information may include device screen information such as screen width and height, and model number. The second information may include second scenario data from the user's historical visits to the second webpage and element information of the second webpage, which represents the content of the second webpage.

[0066] In some embodiments, the second information may further include key features of the element information. The terminal device can extract features from the element information, such as extracting text content, font, size, and color for text elements; extracting color values, color percentage, and transparency for color elements; and extracting color histograms, edge features, and texture features for image elements.

[0067] The server can construct verification material text based on text element information in the element information, construct verification material color based on color element information in the element information, and construct verification material image based on image element information in the element information. Besides constructing verification material information in the above methods, it can also be generated using an Artificial Intelligence (AI) model based on the second information. The AI ​​model can be a large AI model. The content types included in the second scene data and the first scene data can be the same.

[0068] In some embodiments, the terminal device may send the second information to the server, and the server may generate a verification material image based on the second information using an AI model. This verification material image is used as an image element in the verification material information.

[0069] In some embodiments, the server may first use an AI model to select an image from the images of the second webpage that matches the content of the second webpage, and then use the AI ​​model to fuse the image with the second scene data.

[0070] In some embodiments, for scenarios where the second webpage content does not contain image elements, the server can generate an image based on the second information using an AI model, and then integrate this image with the second scenario data, so that the generated verification material image is compatible with the second information. For example... Figure 3 As shown, the server can introduce an AI model to extract style features based on the webpage context information of the second webpage content, such as element information. Simultaneously, it can add random data input, such as weather temperature, timestamps, and geolocation markers, embedding random variables into the AI ​​model. Correspondingly, the AI ​​model can combine the style features of the second webpage content with the embedded random variable representation to generate an image that matches the style of the second webpage content and incorporates random data. For example... Figure 3 As shown, the second webpage content is an e-commerce product page. The verification material images generated by the AI ​​model can be consistent with the style of the second webpage content. They can be e-commerce advertising images, but they incorporate random data. For example, the background of the image changes to sunny or rainy depending on the weather, a widget showing the current time can be displayed in the corner of the image, and the product icons in the image can be adjusted according to the geographical location.

[0071] If the server builds and verifies the material information, such as Figure 2 As shown, the server can store verification material information in a database such as Redis, so that when a verification code needs to be generated, the corresponding target material information can be selected from the verification material information in the Redis database.

[0072] In some embodiments, the verification code to be generated is a slider puzzle verification code. The server can select a target verification material text that matches the first information from the verification material text in the verification material information. The target material information also includes the target verification material text. The target verification material text is used to construct the sliding target block of the slider puzzle verification code. The verification material text is constructed based on the text element information in the element information of the second webpage.

[0073] A target verification material color matching the first information can be selected from the verification material colors in the verification material information. The target material information also includes the target verification material color. The target verification material color is used to construct the color of the sliding target block of the slider puzzle CAPTCHA. The verification material color is constructed based on the color element information in the element information of the second webpage.

[0074] In other words, the target verification material text and color are used to construct the sliding target block of the slider puzzle CAPTCHA. Simultaneously, the server can select a target verification material image from the verification material images in the verification material information that matches the first piece of information to construct the sliding background image of the slider puzzle CAPTCHA.

[0075] In addition, the server can also determine the sliding position of the sliding target block of the slider puzzle verification code based on the device screen information of the terminal device in the first scene data, and the target material information also includes the sliding position.

[0076] The server can select target material information from the verification material information based on the first information, and can also select target material information from the verification material information based on the first webpage content and / or the first scene data. This allows for dynamic adjustment of the element parameters of the verification code based on the first webpage content and / or the first scene data, generating a code that is consistent with the style of the first webpage content and can also incorporate random data and / or behavioral data from when users visit the webpage. This can solve the technical problem that users are often unfamiliar with the image materials of the verification code, which leads to verification difficulty, and that the same image appears under the same webpage for different users. This enables a personalized verification mechanism.

[0077] For example, if the first webpage is an e-commerce product page, you can select target verification images from the verification material images that are consistent with the style of the e-commerce product page and match random data such as the timestamp and weather temperature when the user visits the first webpage.

[0078] For example, if the first webpage is an e-commerce product page, the server can select target verification images from the verification image library that match the style of the e-commerce product page and are relevant to the user's behavior when visiting the first webpage. For instance, if a user visits the product details page of an e-commerce product page but the page is not triggered for a long time, the server can select target verification images related to the product details page from the verification image library.

[0079] In some embodiments, the step of the server selecting the target material information for generating the slider CAPTCHA can be as follows:

[0080] Step 1: Select the target verification material text, which will be used to generate the sliding target block.

[0081] The algorithm for selecting target verification material text can be described as follows:

[0082] Step 1, Random Seed Generation: Create a random seed using first scene data such as the current timestamp or based on device information;

[0083] Step 2: Initialize parameters by setting text parameters such as content, font, size, and color of the text elements; in some embodiments, parameters can be initialized based on the content of the first webpage to select target verification material text that matches the content of the first webpage.

[0084] Step 3: Based on the set criteria, select candidate text elements that meet the text parameters from the verification material text of the verification material information;

[0085] Step 4: Select the target verification material text from the candidate text elements using a random seed and a random algorithm.

[0086] Step 2: Select the target verification material color to determine the color of the sliding target block.

[0087] The algorithm for selecting the color of the target verification material can be as follows:

[0088] Step 1, Random Seed Generation: Create a random seed using first scene data such as the current timestamp or based on device information;

[0089] Step 2: Initialize parameters by setting color values, proportions, transparency, and other color parameters for color elements. In some embodiments, parameters can be initialized based on the content of the first webpage to select target verification material colors that match the content of the first webpage.

[0090] Step 3: Based on the set criteria, select candidate color elements that meet the color parameters from the verification material colors of the verification material information;

[0091] Step 4: Use a random seed and a random algorithm to select the target verification material color from the filtered candidate color elements.

[0092] Step 3: Select the target verification image, which will be used to generate the sliding background image for the CAPTCHA.

[0093] The algorithm for selecting target verification images can be described as follows:

[0094] Step 1: Combine the features of the verification material images in the verification material information to obtain the feature vector of the verification material images; specifically, the extracted features of the verification material images can be combined to form a high-dimensional feature vector.

[0095] Step 2: Based on the feature vector, cluster the verification material images; specifically, cluster the images using algorithms such as K-means and hierarchical clustering based on the high-dimensional feature vector.

[0096] Step 3: Determine the verification material images located at the cluster centers among the verification material images to obtain candidate verification material images; specifically, the verification material images corresponding to each cluster center can be selected as candidate verification material images, and these candidate verification material images are representative images;

[0097] Step 4: Determine the candidate verification material images that match the first information from the candidate verification material images as the target verification material images; specifically, based on the clustering results, select the candidate verification material images that match the first information from the candidate verification material images corresponding to each cluster center as the target verification material images. Here, matching the first information can mean that each cluster center is closest to the image center corresponding to the first information. In this case, the candidate verification material image matches the first information.

[0098] Step 4: Based on the device screen width and height information, randomly generate a set of coordinates [X,Y], where the X and Y values ​​do not exceed the screen width and height, and determine the sliding position of the sliding target block.

[0099] After the server selects the target material information, it can return the target material information to the terminal device. The terminal device can then render based on the target material information, such as generating a verification code for the user to access the first webpage based on the returned sliding background image, the text and color elements of the sliding target block, and its position, and then rendering and displaying it on the page.

[0100] In some embodiments, the terminal device can generate a verification code for the user accessing the first webpage based on the target material information and according to preset rules. Since the verification code generation process is complex and puts excessive pressure on the server, having the terminal generate the verification code for the user accessing the first webpage based on the target material information can reduce the server load.

[0101] In some embodiments, before generating and rendering the verification code, the terminal device can adjust the complexity of the verification code by adding an intelligent dynamic difficulty adjustment engine to adapt to the performance of the terminal device. Before step 103, the method further includes:

[0102] The system obtains performance monitoring information of the terminal device in M ​​indicator dimensions, and obtains target weight information of M weight coefficients corresponding to the M indicator dimensions, where M is a positive integer greater than 1.

[0103] Based on the performance monitoring information and the target weight information, scoring information is determined, which is used to reflect the terminal device's ability to verify the verification code;

[0104] Based on the scoring information, K adjustment parameters for the target material information across K difficulty dimensions are determined, where K is a positive integer;

[0105] Step 103 specifically includes:

[0106] Based on the target material information, a verification code for the user to access the first webpage is generated according to the K adjustment parameters.

[0107] In CAPTCHA systems, accurate quantification of device performance is the core basis for dynamically adjusting the verification difficulty. Traditional solutions rely solely on single metrics such as the Central Processing Unit (CPU) or memory, leading to a mismatch between verification strength and device capabilities. For example, high-performance devices may implement overly simplistic verification (making them vulnerable to attacks), while low-end devices may implement overly strict verification, resulting in a degraded user experience.

[0108] To address this, a multi-dimensional device performance quantification model can be proposed. This model involves real-time monitoring of four key indicators: CPU, Graphics Processing Unit (GPU), memory, and network. By acquiring performance monitoring information of the terminal device across M indicator dimensions, including the four key indicators, a scoring system that accurately reflects the device's overall capabilities can be constructed. The scoring information under this system can quantify the overall device performance of the terminal device, thereby reflecting its ability to verify CAPTCHAs.

[0109] In some embodiments, the device performance quantification model can be: .

[0110] The functions of equipment performance quantification models include:

[0111] Dynamic adaptation: Automatically adjusts the difficulty of CAPTCHAs based on the real-time status of the terminal device, enhancing security on high-performance devices and ensuring smoothness on low-performance devices.

[0112] Energy efficiency optimization: Prevent devices with low power or overheating from lag or power consumption spikes due to excessive computing load.

[0113] Terminal devices can collect device performance parameters across M metrics dimensions in real time through browser performance application programming interfaces (APIs) (such as the Performance Timeline API) and hardware sensors. For example, ... Figure 4 As shown, five types of equipment performance parameters under four key indicators can be collected to construct the above-mentioned equipment performance quantification model, as follows:

[0114] C: Current CPU utilization (%), reflecting the computational load of the current process. A moving average filter (window size = 5) is used to eliminate instantaneous fluctuations. Where C... max =100%.

[0115] Tr: Average GPU rendering latency (ms), which can be calculated using the time difference of the frame rendering time through the browser's method (requestAnimationFrame).

[0116] Memory availability ,in, Available memory (MB) This represents the total amount of memory (MB).

[0117] Network round-trip time (RTT) (in milliseconds) can be used to measure real network latency based on the Session Traversal Utilities for NAT (STUN) protocol of WebRTC (Web Address Translation).

[0118] Screen refresh rate (H): The hardware refresh cycle can be obtained through the window.screen.updateInterval method.

[0119] in, Network latency baseline (recommended 150ms); : Refresh rate baseline performance value (recommended value 90Hz); e: Natural constant, approximately equal to 2.71828; Exponential decay term. The GPU latency term uses an exponential function to reflect the diminishing marginal returns of rendering performance.

[0120] Wherein, λ,η: attenuation factors (recommended values ​​are 0.05-0.2). λ,η can be fixed or adjusted based on performance monitoring information.

[0121] Correspondingly, such as Figure 4 As shown, scoring information can be calculated based on the equipment performance quantification model.

[0122] In some embodiments, before determining the scoring information based on the performance monitoring information and the target weight information, the method further includes:

[0123] If the performance monitoring information of the target device performance parameter in the device performance parameters is greater than or equal to a preset threshold, the attenuation factor corresponding to the target device performance parameter in the device performance parameters is adjusted. The target device performance parameter includes at least one of GPU rendering latency and network latency. The attenuation factor is used to control the attenuation rate of the target device performance parameter participating in the scoring.

[0124] The determination of scoring information based on the performance monitoring information and the target weight information includes:

[0125] The scoring information is determined based on the adjusted attenuation factor, the performance monitoring information, and the target weight information.

[0126] Where λ can be the GPU rendering latency attenuation factor, controlling the GPU rendering latency ( The exponential decay rate of the performance score P.

[0127] In benchmark tests, measurements were taken on different devices. The correlation with user operation latency determines the critical threshold (e.g.) =50ms (user-perceived stuttering), meaning that when the GPU rendering latency is greater than or equal to the preset threshold. In this case, the attenuation factor λ corresponding to the GPU rendering latency can be adjusted.

[0128] Its adjustment method can be optimized through fitting, specifically through nonlinear regression, so that... The value at the critical threshold reaches the preset decay target (e.g.) =At 50ms, the weight is retained at 10%), using express.

[0129] Recommended range for its adjustment:

[0130] In a typical scenario, λ ∈ [0.03, 0.06], which balances performance and user experience.

[0131] High-security scenario: λ ∈ [0.08, 0.12], which is more sensitive to latency.

[0132] Where η: the steepness coefficient of the sigmoid function of network latency RTT, controlling whether network latency (RTT) exceeds the baseline value. The rate of change of the penalty intensity at that time.

[0133] This allows for the definition of preset thresholds, setting an acceptable range of network latency, such as... =150ms, and a significant penalty is required when RTT>250ms.

[0134] The attenuation factor can be adjusted by curve fitting to make the Sigmoid function at RTT= The output drops to 10% at +100ms, using η express.

[0135] Recommended range for its adjustment:

[0136] For a normal network: η ∈ [0.01, 0.03], this allows for a smooth transition.

[0137] High-security scenario: η ∈ [0.05, 0.1], which allows for rapid punishment.

[0138] Sigmoid normalization can be performed, and the network latency term uses the Logistic function. This results in a non-linear penalty when the RTT exceeds the baseline value R0 = 150ms.

[0139] Wherein, α, β, γ, δ: weight coefficients on the four key indicator dimensions, and the sum of the weights of the weight coefficients on the four key indicator dimensions is equal to 1.

[0140] In some embodiments, the weight information of the weight coefficient is fixed. In some embodiments, a dynamic weight allocation algorithm can be introduced to determine the optimal weight combination of the weight coefficients (α, β, γ, δ) in the device performance quantification model, and obtain the target weight information, so that the device performance quantification model can better quantify the comprehensive performance of the terminal device, thereby better reflecting the terminal device's ability to verify verification codes.

[0141] In some embodiments, obtaining the target weight information of the M weight coefficients corresponding to the M indicator dimensions includes:

[0142] Determine the influence weight information of the M weight coefficients, wherein the influence weight information is used to indicate the degree of influence of the M weight coefficients on the verification performance;

[0143] Based on the influence weight information, target weight information for the M weight coefficients corresponding to the M indicator dimensions is determined. The first value obtained by weighting the influence weight information and the target weight information is greater than or equal to the second value. The second value is obtained by weighting the influence weight information and the first weight information. The first weight information is the weight information other than the target weight information among the weight information of the M weight coefficients.

[0144] The influence weight information can be preset according to actual performance needs. In some embodiments, the influence weight information of the weight coefficient can be determined by experimental data.

[0145] In some embodiments, the experimental objective is to determine the optimal weight combination of the weight coefficients (α, β, γ, δ) in the device performance quantification model, obtain target weight information, and minimize rendering latency while ensuring a user pass rate of ≥95% and a machine interception rate of ≥99%.

[0146] The factors and levels were selected as shown in Table 1 below.

[0147] Table 1. Factor and Level Selection Table

[0148]

[0149] The orthogonal array selection is shown in Table 2 below. Among them, L9 (…) can be selected. The orthogonal array requires a total of 9 sets of experiments, which can cover 11.1% of all 81 combinations.

[0150] Table 2 Orthogonal Array

[0151]

[0152] The test environment can be configured, and its device matrix is ​​shown in Figure 3 below. Each test can be repeated 3 times to collect test data.

[0153] Table 3 Test Environment Configuration Table

[0154]

[0155] The test results can be recorded, as shown in Table 4 below.

[0156] Table 4 Test Results

[0157]

[0158] Based on the test results, range analysis can be performed to calculate the mean values ​​of each factor at different levels, as shown in Table 5 below.

[0159] Table 5. Mean values ​​of indicators for each factor at different levels

[0160]

[0161] Based on the above analysis, it can be concluded that β (i.e., GPU weight) has the greatest impact on security and latency, while α (i.e., CPU weight) has a significant impact on user experience. Accordingly, based on the conclusions of the experimental data, the influence weight information of the M weight coefficients can be determined. For example, the influence weight information of α, β, γ, and δ can be set to 0.4, 0.35, 0.2, and 0.05, respectively.

[0162] A multi-distance traffic restriction regression model can be established based on the influence weight information and M weight coefficients. For example, the comprehensive score under the multi-distance traffic restriction regression model = 0.4α + 0.35β + 0.2γ + 0.05δ + ,in, This is either a random error term or a score for an additional factor not covered by the previous indicators.

[0163] Constraint optimization can be set up. Under the constraint α+β+γ+δ=1, the optimal solution can be found to maximize the comprehensive score. The corresponding numerical solutions for α, β, γ, and δ can be obtained: α=0.39, β=0.32, γ=0.21, δ=0.08, which can be approximated as α=0.4, β=0.3, γ=0.2, δ=0.1.

[0164] In some embodiments, a mapping function between scoring information and adjustment parameters can be established, and correspondingly, K adjustment parameters of the target material information in K difficulty dimensions can be determined based on the scoring information.

[0165] In some embodiments, such as Figure 4 As shown, determining the K adjustment parameters of the target material information across K difficulty dimensions based on the scoring information includes:

[0166] Based on the scoring information, a difficulty coefficient is determined using a first preset mapping function. The difficulty coefficient is used to reflect the difficulty of the terminal device in generating the verification code.

[0167] For each of the aforementioned difficulty dimensions, based on the difficulty coefficient, the adjustment parameters of the target material information on the aforementioned difficulty dimension are determined using the second preset mapping function corresponding to the difficulty dimension.

[0168] In some embodiments, the first preset mapping function can be A smooth mapping from performance score P to difficulty coefficient D can be achieved using an improved Sigmoid function.

[0169] The difficulty level can be controlled between 0.3 and 1.8. The adjustment range is limited by D_min=0.3 and D_max=1.8 to prevent loss of control in extreme cases. Performance baseline values ​​can be set. =0.65 is used as the performance threshold; when P> The difficulty of the process has slowed down to protect high-performance equipment.

[0170] Where k: curve steepness coefficient. When the steepness coefficient k=2.5, P can complete 80% of the difficulty change in the interval [0.5,0.8].

[0171] For each difficulty dimension, based on the difficulty coefficient, the adjustment parameters of the target material information in the difficulty dimension can be determined using the second preset mapping function corresponding to the difficulty dimension, so as to realize the parameter linkage adjustment mechanism of multiple difficulty dimensions, as shown in Table 6 below. In some embodiments, the K difficulty dimensions can be text rotation angle, text scaling ratio, blur degree, and noise point density, respectively.

[0172] Table 6. Parameter Price Adjustment for Multiple Difficulty Dimensions

[0173]

[0174] The text rotation angle control algorithm can be: That is, generating an independent random factor for each character. Calculate the actual rotation angle .

[0175] The fuzziness level composite model can be: .

[0176] You can apply Gaussian blur using CSS: filter: blur( Motion blur: Uses Canvas to generate motion blur with random orientation.

[0177] The noise point density can be as follows.

[0178]

[0179] Where (x, y): current pixel coordinates, ( , ): Coordinates of the character center. : Reference noise density (determined by the difficulty coefficient D).

[0180] It can generate a Perlin noise field as a density reference, enhance the noise density at the character outline edge (3 times the reference value), and dynamically adjust the color of the noise points.

[0181] The text scaling ratio can be: .

[0182] That is, generate an independent random factor for each character. Calculate the actual rotation angle .

[0183] In one example, when the terminal device is detected to have the following characteristics: CPU utilization > 75%, available memory < 300MB, network RTT > 200ms, and screen refresh rate 90Hz, a score can be calculated based on the device performance quantification model, with P = 0.42. Based on the score, the difficulty coefficient D = 0.61 is determined using the first preset mapping function.

[0184] When the difficulty coefficient D=1.2 is detected, K adjustment parameters for K difficulty dimensions can be determined based on the second preset mapping function, namely: text rotation: 18°±9°; blur level: 0.5+0.3×1.2=0.86px; noise density: =14 points / 100px²; Text scaling: 1.0 + 0.2 * 1.2 = 1.24.

[0185] In this embodiment, by adding an intelligent difficulty adjustment engine, based on a dynamically changing device performance quantification model including CPU / GPU / memory / network, and by establishing precise mathematical models such as a first preset mapping function and a second preset mapping function, the engine can dynamically adjust parameters in at least three difficulty dimensions according to the real-time calculated device performance score. This allows the intelligent difficulty adjustment engine to dynamically adjust the verification difficulty and automatically adjust the CAPTCHA difficulty based on the device's real-time status. This achieves a dynamic balance between verification strength and device capabilities, ensuring rigorous verification on high-end devices, enhancing security on high-performance devices, while avoiding user experience degradation on low-end devices and ensuring smoothness on low-performance devices. This optimizes user experience while maintaining system security. For example, when the model detects that a user is using an older phone (high CPU load + insufficient memory), it automatically reduces the CAPTCHA difficulty; while for flagship gaming phones, it activates a high-difficulty adjustment, achieving a precise balance between security and user experience.

[0186] In this embodiment, resource allocation efficiency can be optimized, and system load pressure can be reduced. This avoids resource idleness on high-performance devices and prevents low-performance devices from slowing down the overall system response speed due to task overload, ultimately achieving "dynamic matching of device performance and task difficulty" and reducing long-term operating costs. Furthermore, because the CAPTCHA material is derived from web page elements, it fully considers integration with web page content and does not rely on other third-party image materials. The user experience is better; the CAPTCHA design considers integration with web page content, making it visually less jarring and improving user acceptance to a certain extent, thus increasing the efficiency of successful verification.

[0187] See Figure 5 , Figure 5 This is a second flowchart of a verification code generation method provided in an embodiment of this application, applied to a server, such as... Figure 5 As shown, the method includes the following steps:

[0188] Step 501: Upon receiving a verification code generation request sent by the terminal device for a user's access to the first webpage, based on the first information carried in the verification code generation request, target material information matching the first information is selected from the verification material information; the target material information includes a target verification material image selected from the verification material images in the verification material information; the first information includes at least one of the first scene data when the user accesses the first webpage and the first webpage content of the first webpage; the verification material image is generated using an artificial intelligence (AI) model based on second information; the second information includes the second scene data when the user historically accesses the second webpage and the second webpage content of the second webpage; the verification material image is adapted to the second information; the second webpage is the first webpage, or a webpage different from the first webpage.

[0189] Step 502: Send the target material information to the terminal device. The target material information is used by the terminal device to generate a verification code.

[0190] Optionally, the verification code is a slider puzzle verification code, and step 501 specifically includes:

[0191] Based on the first information, a target verification material text matching the first information is selected from the verification material text in the verification material information. The target material information also includes the target verification material text. The target verification material text is used to construct the sliding target block of the slider puzzle verification code. The verification material text is constructed based on the text element information in the element information of the second webpage.

[0192] Based on the first information, a target verification material color matching the first information is selected from the verification material colors in the verification material information. The target material information also includes the target verification material color. The target verification material color is used to construct the color of the sliding target block of the slider puzzle verification code. The verification material color is constructed based on the color element information in the element information of the second webpage.

[0193] Based on the first information, a target verification material image matching the first information is selected from the verification material images in the verification material information. The target verification material image is used to construct the sliding background image of the slider puzzle CAPTCHA.

[0194] Based on the device screen information of the terminal device in the first scene data, the sliding position of the sliding target block of the slider puzzle verification code is determined, and the target material information also includes the sliding position.

[0195] Optionally, selecting a target verification material image that matches the first information from the verification material images in the verification material information based on the first information includes:

[0196] The features of the verification material images in the verification material information are combined to obtain the feature vector of the verification material images;

[0197] Based on the feature vectors, the verification material images are clustered;

[0198] The candidate verification images are obtained by identifying the verification images that are at the cluster center among the verification images.

[0199] The candidate verification material image that matches the first information is determined as the target verification material image.

[0200] It should be noted that the specific process of the server-side verification code generation method has been described in detail in the above embodiments, and will not be repeated here.

[0201] The embodiments of this application have broad commercial value.

[0202] (1) Reduce network transmission costs.

[0203] The embodiments of this application can generate verification codes using already loaded webpage information without the need to load additional network data, thereby significantly reducing network transmission costs.

[0204] Hypothetical scenario: An e-commerce platform with an average daily page view (PV) of 100 million. Traditional CAPTCHAs transmit images of 10KB each time, resulting in a daily data transmission volume of 100 million * 10KB = 1TB. Assuming a network transmission cost of 0.8 RMB / GB, the daily cost would be 1TB * 0.8 RMB / GB = ¥8,000. Using the embodiment of this application, no additional network transmission is required, resulting in zero cost and saving ¥8,000 per day, or ¥290,000 per year.

[0205] (2) Optimize user experience and improve conversion rate.

[0206] By reducing network traffic and dynamically adjusting the difficulty of CAPTCHAs based on device performance, the embodiments of this application can significantly improve the user experience.

[0207] Traditional CAPTCHAs require additional image data loading, averaging 1 second. This embodiment eliminates the need for additional data loading, achieving a loading time of 0 seconds, representing a 100% improvement. Research on relevant browsers shows that for every second increase in page load time, user churn rate increases by 20%. This embodiment can reduce user churn rate. Furthermore, it automatically adjusts the CAPTCHA difficulty based on the device's real-time status, enhancing security on high-performance devices and ensuring smoothness on low-performance devices.

[0208] (3) Providing professional services

[0209] It enables charging for Software as a Service (SaaS) services. Custom development and industry-specific solutions are also available for sectors such as e-commerce, finance, and gaming.

[0210] 2. Application Scenarios

[0211] (1) E-commerce platforms need to verify user identity in key operations such as user login, registration, and order placement to prevent malicious crawling and order brushing. Hebao Pay needs strong identity verification in user login, transfer, and payment operations.

[0212] (2) For internet giants, it can meet security requirements and prevent malicious crawlers and automated tools from abusing their platform resources. It can improve user experience optimization: the intuitive slider puzzle CAPTCHA enhances user satisfaction. It can achieve technical compatibility: lightweight generation and verification are achieved using front-end technology, adapting to high-concurrency scenarios. For financial service companies, it can prevent fraud: high-strength CAPTCHA technology prevents account theft and fraudulent transactions. It can achieve rapid response: rapid generation and verification of CAPTCHAs in high-concurrency scenarios ensures business continuity. For government and public service institutions, it can meet high security requirements: prevent malicious programs from stealing user information or abusing public services. It is easy to use: the intuitive slider puzzle CAPTCHA adapts to users of different ages and technical levels.

[0213] See Figure 6 , Figure 6 This is one of the structural schematic diagrams of a verification code generation device provided in the embodiments of this application, applied to terminal devices, such as... Figure 6 As shown, the verification code generation device 600 includes:

[0214] The first sending module 601 is used to send a verification code generation request to the server when a user visits the first webpage. The verification code generation request carries first information, which includes at least one of the first scene data when the user visits the first webpage and the first webpage content of the first webpage.

[0215] The first receiving module 602 is configured to receive target material information that matches the first information sent by the server. The target material information is selected by the server from the verification material information based on the first information. The target material information includes a target verification material image selected from the verification material images in the verification material information. The verification material image is generated using an artificial intelligence (AI) model based on second information. The second information includes second scene data when the user historically accesses the second webpage and the second webpage content of the second webpage. The verification material image is adapted to the second information. The second webpage is the first webpage or a webpage different from the first webpage.

[0216] The generation module 603 is used to generate a verification code for the user to access the first webpage based on the target material information.

[0217] Optionally, the device further includes:

[0218] The acquisition module is used to acquire performance monitoring information of the terminal device in M ​​indicator dimensions, and to acquire target weight information of M weight coefficients corresponding to the M indicator dimensions, where M is a positive integer greater than 1.

[0219] The first determining module is used to determine scoring information based on the performance monitoring information and the target weight information, wherein the scoring information is used to reflect the terminal device's ability to verify the verification code;

[0220] The second determining module is used to determine K adjustment parameters of the target material information in K difficulty dimensions based on the scoring information, where K is a positive integer;

[0221] The generation module 603 is specifically used for:

[0222] Based on the target material information, a verification code for the user to access the first webpage is generated according to the K adjustment parameters.

[0223] Optionally, the second determining module is specifically used for:

[0224] Based on the scoring information, a difficulty coefficient is determined using a first preset mapping function. The difficulty coefficient is used to reflect the difficulty of the terminal device in generating the verification code.

[0225] For each of the aforementioned difficulty dimensions, based on the difficulty coefficient, the adjustment parameters of the target material information on the aforementioned difficulty dimension are determined using the second preset mapping function corresponding to the difficulty dimension.

[0226] Optionally, the acquisition module is specifically used for:

[0227] Determine the influence weight information of the M weight coefficients, wherein the influence weight information is used to indicate the degree of influence of the M weight coefficients on the verification performance;

[0228] Based on the influence weight information, target weight information for the M weight coefficients corresponding to the M indicator dimensions is determined. The first value obtained by weighting the influence weight information and the target weight information is greater than or equal to the second value. The second value is obtained by weighting the influence weight information and the first weight information. The first weight information is the weight information other than the target weight information among the weight information of the M weight coefficients.

[0229] Optionally, the device further includes:

[0230] An adjustment module is used to adjust the attenuation factor corresponding to the target device performance parameter in the device performance parameters when the performance monitoring information of the target device performance parameter in the device performance parameters is greater than or equal to a preset threshold. The target device performance parameter includes at least one of GPU rendering latency and network latency. The attenuation factor is used to control the attenuation rate of the target device performance parameter participating in the scoring.

[0231] The first determining module is specifically used for:

[0232] The scoring information is determined based on the adjusted attenuation factor, the performance monitoring information, and the target weight information.

[0233] Optionally, the device further includes:

[0234] The parsing module is used to parse the Hypertext Markup Language (HTML) content of the second webpage when the user has previously visited it, in order to construct a Document Object Model (DOM) tree.

[0235] The extraction module is used to extract element information from the second webpage based on the document object model tree;

[0236] The third sending module is used to send the second information to the server. The second information includes the element information of the second webpage content of the second webpage. The second information is used by the server to construct the verification material information.

[0237] The verification code generation device 600 can implement all the processes implemented in the above-mentioned terminal device-side verification code generation method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0238] See Figure 7 , Figure 7 This is a second schematic diagram of a verification code generation device provided in an embodiment of this application, applied to a server, such as... Figure 7 As shown, the verification code generation device 700 includes:

[0239] The selection module 701 is configured to, upon receiving a verification code generation request sent by a terminal device for a user's access to a first webpage, select target material information matching the first information carried in the verification code generation request from verification material information; the target material information includes a target verification material image selected from verification material images in the verification material information; the first information includes at least one of the first scene data when the user accesses the first webpage and the first webpage content of the first webpage; the verification material image is generated using an artificial intelligence (AI) model based on second information; the second information includes the second scene data when the user historically accesses a second webpage and the second webpage content of the second webpage; the verification material image is adapted to the second information; the second webpage is the first webpage, or a webpage different from the first webpage.

[0240] The second sending module 702 is used to send the target material information to the terminal device, and the target material information is used by the terminal device to generate a verification code.

[0241] Optionally, the selection module 701 is specifically used for:

[0242] Based on the first information, a target verification material text matching the first information is selected from the verification material text in the verification material information. The target material information also includes the target verification material text. The target verification material text is used to construct the sliding target block of the slider puzzle verification code. The verification material text is constructed based on the text element information in the element information of the second webpage.

[0243] Based on the first information, a target verification material color matching the first information is selected from the verification material colors in the verification material information. The target material information also includes the target verification material color. The target verification material color is used to construct the color of the sliding target block of the slider puzzle verification code. The verification material color is constructed based on the color element information in the element information of the second webpage.

[0244] Based on the first information, a target verification material image matching the first information is selected from the verification material images in the verification material information. The target verification material image is used to construct the sliding background image of the slider puzzle CAPTCHA.

[0245] Based on the device screen information of the terminal device in the first scene data, the sliding position of the sliding target block of the slider puzzle verification code is determined, and the target material information also includes the sliding position.

[0246] Optionally, the selection module 701 is specifically used for:

[0247] The features of the verification material images in the verification material information are combined to obtain the feature vector of the verification material images;

[0248] Based on the feature vectors, the verification material images are clustered;

[0249] The candidate verification images are obtained by identifying the verification images that are at the cluster center among the verification images.

[0250] The candidate verification material image that matches the first information is determined as the target verification material image.

[0251] The verification code generation device 700 can implement all the processes implemented in the above-described server-side verification code generation method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0252] See Figure 8 The figure shows a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. Figure 8 As shown, the terminal device 800 includes: a first processor 801, a first memory 802, a first user interface 803, and a first bus interface 804.

[0253] The first processor 801 is used to read the program from the first memory 802 and execute the following procedures:

[0254] When a user visits the first webpage, a verification code generation request is sent to the server. The verification code generation request carries first information, which includes at least one of the first scenario data when the user visits the first webpage and the first webpage content.

[0255] The server receives target material information that matches the first information. The target material information is selected by the server from the verification material information based on the first information. The target material information includes target verification material images selected from the verification material images in the verification material information. The verification material images are generated using an artificial intelligence (AI) model based on second information. The second information includes second scene data when the user historically visited the second webpage and the second webpage content of the second webpage. The verification material images are adapted to the second information. The second webpage is the first webpage or a webpage different from the first webpage.

[0256] Based on the target material information, a verification code is generated for the user to access the first webpage.

[0257] exist Figure 8 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by the first processor 801 and the memory represented by the first memory 802. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The first bus interface 804 provides an interface. For different user devices, the first user interface 803 can also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.

[0258] The first processor 801 is responsible for managing the bus architecture and general processing, and the first memory 802 can store the data used by the first processor 801 when performing operations.

[0259] In some embodiments, the first processor 801 is further configured to:

[0260] The system obtains performance monitoring information of the terminal device in M ​​indicator dimensions, and obtains target weight information of M weight coefficients corresponding to the M indicator dimensions, where M is a positive integer greater than 1.

[0261] Based on the performance monitoring information and the target weight information, scoring information is determined, which is used to reflect the terminal device's ability to verify the verification code;

[0262] Based on the scoring information, K adjustment parameters for the target material information across K difficulty dimensions are determined, where K is a positive integer;

[0263] Based on the target material information, a verification code for the user to access the first webpage is generated according to the K adjustment parameters.

[0264] In some embodiments, the first processor 801 is further configured to:

[0265] Based on the scoring information, a difficulty coefficient is determined using a first preset mapping function. The difficulty coefficient is used to reflect the difficulty of the terminal device in generating the verification code.

[0266] For each of the aforementioned difficulty dimensions, based on the difficulty coefficient, the adjustment parameters of the target material information on the aforementioned difficulty dimension are determined using the second preset mapping function corresponding to the difficulty dimension.

[0267] In some embodiments, the first processor 801 is further configured to:

[0268] Determine the influence weight information of the M weight coefficients, wherein the influence weight information is used to indicate the degree of influence of the M weight coefficients on the verification performance;

[0269] Based on the influence weight information, target weight information for the M weight coefficients corresponding to the M indicator dimensions is determined. The first value obtained by weighting the influence weight information and the target weight information is greater than or equal to the second value. The second value is obtained by weighting the influence weight information and the first weight information. The first weight information is the weight information other than the target weight information among the weight information of the M weight coefficients.

[0270] In some embodiments, the first processor 801 is further configured to:

[0271] If the performance monitoring information of the target device performance parameter in the device performance parameters is greater than or equal to a preset threshold, the attenuation factor corresponding to the target device performance parameter in the device performance parameters is adjusted. The target device performance parameter includes at least one of GPU rendering latency and network latency. The attenuation factor is used to control the attenuation rate of the target device performance parameter participating in the scoring.

[0272] The scoring information is determined based on the adjusted attenuation factor, the performance monitoring information, and the target weight information.

[0273] Optionally, the first processor 801 is also used for:

[0274] If a user has previously visited a second webpage, parse the HTML content of the second webpage to construct a document object model tree.

[0275] Based on the document object model tree, extract element information from the second webpage;

[0276] The second information is sent to the server, wherein the second webpage content of the second webpage in the second information includes the element information, and the second information is used by the server to construct the verification material information.

[0277] Preferably, the present invention also provides a terminal device 800, including a first processor 801, a first memory 802, and a computer program stored in the first memory 802 and executable on the first processor 801. When the computer program is executed by the first processor 801, it implements the various processes of the above-described terminal device-side verification code generation method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0278] See Figure 9 The figure shows a schematic diagram of the server structure provided in an embodiment of the present invention. Figure 9 As shown, server 900 includes: a second processor 901, a second memory 902, a second user interface 903, and a second bus interface 904.

[0279] The second processor 901 is used to read the program from the second memory 902 and execute the following procedures:

[0280] Upon receiving a verification code generation request sent by a terminal device for a user's access to a first webpage, target material information matching the first information is selected from verification material information based on the first information carried in the verification code generation request. The target material information includes a target verification material image selected from the verification material images in the verification material information. The first information includes at least one of the first scene data when the user accesses the first webpage and the first webpage content of the first webpage. The verification material image is generated using an artificial intelligence (AI) model based on second information. The second information includes the second scene data when the user historically accesses a second webpage and the second webpage content of the second webpage. The verification material image is adapted to the second information. The second webpage is the first webpage or a webpage different from the first webpage.

[0281] The target material information is sent to the terminal device, and the target material information is used by the terminal device to generate a verification code.

[0282] exist Figure 9 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by the second processor 901 and the memory represented by the second memory 902. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The second bus interface 904 provides an interface. For different devices, the second user interface 903 can also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.

[0283] The second processor 901 is responsible for managing the bus architecture and general processing, while the second memory 902 can store the data used by the second processor 901 when performing operations.

[0284] In some embodiments, the verification code is a slider puzzle verification code, and the second processor 901 is further configured to:

[0285] Based on the first information, a target verification material text matching the first information is selected from the verification material text in the verification material information. The target material information also includes the target verification material text. The target verification material text is used to construct the sliding target block of the slider puzzle verification code. The verification material text is constructed based on the text element information in the element information of the second webpage.

[0286] Based on the first information, a target verification material color matching the first information is selected from the verification material colors in the verification material information. The target material information also includes the target verification material color. The target verification material color is used to construct the color of the sliding target block of the slider puzzle verification code. The verification material color is constructed based on the color element information in the element information of the second webpage.

[0287] Based on the first information, a target verification material image matching the first information is selected from the verification material images in the verification material information. The target verification material image is used to construct the sliding background image of the slider puzzle CAPTCHA.

[0288] Based on the device screen information of the terminal device in the first scene data, the sliding position of the sliding target block of the slider puzzle verification code is determined, and the target material information also includes the sliding position.

[0289] In some embodiments, the second processor 901 is further configured to:

[0290] The features of the verification material images in the verification material information are combined to obtain the feature vector of the verification material images;

[0291] Based on the feature vectors, the verification material images are clustered;

[0292] The candidate verification images are obtained by identifying the verification images that are at the cluster center among the verification images.

[0293] The candidate verification material image that matches the first information is determined as the target verification material image.

[0294] Preferably, the present invention also provides a server 900, including a second processor 901, a second memory 902, and a computer program stored in the second memory 902 and executable on the second processor 901. When the computer program is executed by the second processor 901, it implements the various processes of the above-described server-side verification code generation method embodiment and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0295] This invention also provides a readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the aforementioned terminal device-side or server-side verification code generation method embodiments, achieving the same technical effects. To avoid repetition, these processes will not be described again here. The readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0296] This application also provides a computer program product, including computer instructions. When executed by a processor, these computer instructions implement the various processes of the above-described terminal device-side or server-side verification code generation method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0297] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0298] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0299] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0300] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.

[0301] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0302] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0303] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for generating verification codes, characterized in that, Applied to a terminal device, the method includes: When a user visits the first webpage, a verification code generation request is sent to the server. The verification code generation request carries first information, which includes at least one of the first scenario data when the user visits the first webpage and the first webpage content. The server receives target material information that matches the first information. The target material information is selected by the server from the verification material information based on the first information. The target material information includes target verification material images selected from the verification material images in the verification material information. The verification material images are generated using an artificial intelligence (AI) model based on second information. The second information includes second scene data when the user historically visited the second webpage and the second webpage content of the second webpage. The verification material images are adapted to the second information. The second webpage is the first webpage or a webpage different from the first webpage. Based on the target material information, a verification code is generated for the user to access the first webpage.

2. The method according to claim 1, characterized in that, Before generating the verification code for the user accessing the first webpage based on the target material information, the method further includes: The system obtains performance monitoring information of the terminal device in M ​​indicator dimensions, and obtains target weight information of M weight coefficients corresponding to the M indicator dimensions, where M is a positive integer greater than 1. Based on the performance monitoring information and the target weight information, scoring information is determined, which is used to reflect the terminal device's ability to verify the verification code; Based on the scoring information, K adjustment parameters for the target material information across K difficulty dimensions are determined, where K is a positive integer; The step of generating a verification code for the user to access the first webpage based on the target material information includes: Based on the target material information, a verification code for the user to access the first webpage is generated according to the K adjustment parameters.

3. The method according to claim 2, characterized in that, The step of determining K adjustment parameters for the target material information across K difficulty dimensions based on the scoring information includes: Based on the scoring information, a difficulty coefficient is determined using a first preset mapping function. The difficulty coefficient is used to reflect the difficulty of the terminal device in generating the verification code. For each of the aforementioned difficulty dimensions, based on the difficulty coefficient, the adjustment parameters of the target material information on the aforementioned difficulty dimension are determined using the second preset mapping function corresponding to the difficulty dimension.

4. The method according to claim 2, characterized in that, The step of obtaining the target weight information corresponding to the M weight coefficients of the M indicator dimensions includes: Determine the influence weight information of the M weight coefficients, wherein the influence weight information is used to indicate the degree of influence of the M weight coefficients on the verification performance; Based on the influence weight information, target weight information for the M weight coefficients corresponding to the M indicator dimensions is determined. The first value obtained by weighting the influence weight information and the target weight information is greater than or equal to the second value. The second value is obtained by weighting the influence weight information and the first weight information. The first weight information is the weight information other than the target weight information among the weight information of the M weight coefficients.

5. The method according to claim 2, characterized in that, Before determining the scoring information based on the performance monitoring information and the target weight information, the method further includes: If the performance monitoring information of the target device performance parameter in the device performance parameters is greater than or equal to a preset threshold, the attenuation factor corresponding to the target device performance parameter in the device performance parameters is adjusted. The target device performance parameter includes at least one of GPU rendering latency and network latency. The attenuation factor is used to control the attenuation rate of the target device performance parameter participating in the scoring. The determination of scoring information based on the performance monitoring information and the target weight information includes: The scoring information is determined based on the adjusted attenuation factor, the performance monitoring information, and the target weight information.

6. The method according to claim 1, characterized in that, Before receiving the target material information that matches the first information sent by the server, the method further includes: If a user has previously visited a second webpage, parse the HTML content of the second webpage to construct a document object model tree. Based on the document object model tree, extract element information from the second webpage; The second information is sent to the server, wherein the second webpage content of the second webpage in the second information includes the element information, and the second information is used by the server to construct the verification material information.

7. A method for generating verification codes, characterized in that, Applied to a server, the method includes: Upon receiving a verification code generation request sent by a terminal device for a user's access to a first webpage, target material information matching the first information is selected from verification material information based on the first information carried in the verification code generation request. The target material information includes a target verification material image selected from the verification material images in the verification material information. The first information includes at least one of the first scene data when the user accesses the first webpage and the first webpage content of the first webpage. The verification material image is generated using an artificial intelligence (AI) model based on second information. The second information includes the second scene data when the user historically accesses a second webpage and the second webpage content of the second webpage. The verification material image is adapted to the second information. The second webpage is the first webpage or a webpage different from the first webpage. The target material information is sent to the terminal device, and the target material information is used by the terminal device to generate a verification code.

8. The method according to claim 7, characterized in that, The verification code is a slider puzzle verification code. The step of selecting target material information matching the first information from the verification material information based on the first information carried in the verification code generation request includes: Based on the first information, a target verification material text matching the first information is selected from the verification material text in the verification material information. The target material information also includes the target verification material text. The target verification material text is used to construct the sliding target block of the slider puzzle verification code. The verification material text is constructed based on the text element information in the element information of the second webpage. Based on the first information, a target verification material color matching the first information is selected from the verification material colors in the verification material information. The target material information also includes the target verification material color. The target verification material color is used to construct the color of the sliding target block of the slider puzzle verification code. The verification material color is constructed based on the color element information in the element information of the second webpage. Based on the first information, a target verification material image matching the first information is selected from the verification material images in the verification material information. The target verification material image is used to construct the sliding background image of the slider puzzle CAPTCHA. Based on the device screen information of the terminal device in the first scene data, the sliding position of the sliding target block of the slider puzzle verification code is determined, and the target material information also includes the sliding position.

9. The method according to claim 8, characterized in that, The step of selecting a target verification material image that matches the first information from the verification material images in the verification material information, based on the first information, includes: The features of the verification material images in the verification material information are combined to obtain the feature vector of the verification material images; Based on the feature vectors, the verification material images are clustered; The candidate verification images are obtained by identifying the verification images that are at the cluster center among the verification images. The candidate verification material image that matches the first information is determined as the target verification material image.

10. A verification code generation device, characterized in that, Applied to a terminal device, the device includes: The first sending module is used to send a verification code generation request to the server when a user visits the first webpage. The verification code generation request carries first information, which includes at least one of the first scenario data when the user visits the first webpage and the first webpage content of the first webpage. The first receiving module is configured to receive target material information that matches the first information sent by the server. The target material information is selected by the server from the verification material information based on the first information. The target material information includes target verification material images selected from the verification material images in the verification material information. The verification material images are generated using an artificial intelligence (AI) model based on second information. The second information includes second scene data when the user historically accesses the second webpage and the second webpage content of the second webpage. The verification material images are adapted to the second information. The second webpage is the first webpage or a webpage different from the first webpage. The generation module is used to generate a verification code for the user to access the first webpage based on the target material information.

11. A verification code generation device, characterized in that, Applied to a server, the device includes: The selection module is configured to, upon receiving a verification code generation request sent by a terminal device for a user's access to a first webpage, select target material information matching the first information carried in the verification code generation request from verification material information; the target material information includes a target verification material image selected from verification material images in the verification material information; the first information includes at least one of the first scene data when the user accesses the first webpage and the first webpage content of the first webpage; the verification material image is generated using an artificial intelligence (AI) model based on second information; the second information includes the second scene data when the user historically accesses a second webpage and the second webpage content of the second webpage; the verification material image is adapted to the second information; the second webpage is the first webpage, or a webpage different from the first webpage; The second sending module is used to send the target material information to the terminal device, and the target material information is used by the terminal device to generate a verification code.

12. A terminal device, characterized in that, include: A first processor, a first memory, and a program stored in the first memory and executable on the first processor, wherein the program, when executed by the first processor, implements the steps of the verification code generation method as described in any one of claims 1 to 6.

13. A server, characterized in that, include: The second processor, the second memory, and the program stored in the second memory and executable on the second processor, wherein when the program is executed by the second processor, it implements the steps of the verification code generation method as described in any one of claims 7 to 9.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the verification code generation method as described in any one of claims 1 to 9.

15. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of the verification code generation method as described in any one of claims 1 to 9.