A data processing method, apparatus, computer equipment, and storage medium

By acquiring and mapping the image information of the sliding object, the position of the sliding object in the CAPTCHA area is determined and matched, which solves the problem of poor compatibility between different browsers and applications in the sliding CAPTCHA verification method, and achieves high verification pass rate and universality.

CN115331019BActive Publication Date: 2026-05-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2021-05-11
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing automatic verification methods for sliding CAPTCHAs have poor compatibility across different browsers and applications, and lack sufficient verification accuracy and versatility, making them difficult to work effectively on pages with strong security features.

Method used

By acquiring a first image and a second image containing the sliding object, as well as the control position information of the sliding control, feature extraction and image mapping are performed to determine the object area and candidate matching area of ​​the sliding object in the verification code area, and then matching is performed to accurately move the sliding object to the target matching area for verification.

Benefits of technology

It improves the verification pass rate of sliding CAPTCHAs, has good versatility and accuracy, adapts to different browsers and applications, and can even work effectively on pages with strong security protection features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115331019B_ABST
    Figure CN115331019B_ABST
Patent Text Reader

Abstract

This application discloses a data processing method, apparatus, computer device, and storage medium. The method involves acquiring a first image and a second image containing a sliding object, and the control position information of a sliding control in the first image; extracting features from the first image to obtain a feature image; performing image mapping based on the first and second images to obtain a verification code region in the feature image; determining the object region of the sliding object within the verification code region of the feature image, and a candidate matching region corresponding to the object region within the verification code region, based on the control position; matching the object region and the candidate matching regions to determine a target matching region; and moving the sliding object into the target matching region to verify the sliding object. This solution eliminates the need to design a corresponding algorithm based on the shape of the sliding object to determine the required position of the sliding control; it improves the verification pass rate and has good versatility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, specifically to a data processing method, apparatus, computer equipment, and storage medium. Background Technology

[0002] There are three main automated verification methods for sliding CAPTCHAs (a verification method that involves moving a sliding object to a target position for verification). The first is to use third-party tools, such as Selenium WebDriver, to obtain verification information such as the sliding control, the sliding object, and the corresponding gap in the page code, and then control the sliding control to move the object to the gap position. The second is to use image recognition to extract the gap and sliding control from the verification page, determine the gap position, and then move the object to the gap position. The third is to train a neural network model to determine the gap position and then move the object to the gap position.

[0003] The inventors of this application discovered that the first method has poor compatibility because different browsers and applications have different verification pages, resulting in different verification information. When unprocessable verification information appears, automatic verification cannot be completed. In addition, some verification pages have security protection functions, making it impossible to obtain verification information through the page code, thus preventing verification. The second method requires designing different algorithms to obtain the sliding object and the gap based on their shapes, resulting in poor universality. Furthermore, extracting the sliding object and the gap from an image is easily interfered with by other objects in the image, leading to low accuracy in extracting the sliding object and the gap. The third method requires sufficient samples to train the neural network model. However, even with sufficient samples for training, the accuracy of the neural network model in identifying the gap position still differs from the verification accuracy of the sliding object CAPTCHA, resulting in a low verification pass rate for the neural network model. Summary of the Invention

[0004] This application provides a data processing method, apparatus, computer device, and storage medium to improve the verification pass rate for sliding objects.

[0005] This application provides a data processing method, including:

[0006] Obtain a first image and a second image containing a sliding object, as well as the control position information of the sliding control in the first image, wherein the sliding object moves in accordance with the sliding control;

[0007] Feature extraction is performed on the first image to obtain a feature image;

[0008] Image mapping is performed based on the first image and the second image to obtain the verification code region in the feature image, and the verification code region contains the sliding object;

[0009] Based on the control position information, the object region of the sliding object in the verification code region of the feature image is determined, as well as the candidate matching region corresponding to the object region in the verification code region;

[0010] The target matching region is determined from the candidate matching regions by matching the object region with the candidate matching regions;

[0011] The sliding object is moved to the target matching area to verify the sliding object.

[0012] Accordingly, this application also provides a data processing apparatus, including:

[0013] The acquisition unit is used to acquire a first image and a second image containing a sliding object, as well as the control position information of the sliding control in the first image, wherein the sliding object moves following the sliding control;

[0014] The feature extraction unit is used to extract features from the first image to obtain a feature image;

[0015] A mapping unit is used to perform image mapping on the first image and the second image to obtain a verification code region in the feature image, wherein the verification code region contains the sliding object;

[0016] The region determination unit is used to determine, based on the control position information, the object region of the sliding object in the verification code region of the feature image, and the candidate matching region in the verification code region corresponding to the object region;

[0017] A region matching unit is used to determine a target matching region from the candidate matching regions by matching the object region and the region to be matched.

[0018] The verification unit is used to move the sliding object to the target matching area to verify the sliding object.

[0019] Accordingly, this application also provides a computer device including a memory and a processor; the memory stores a computer program, and the processor runs the computer program in the memory to execute any of the data processing methods provided in this application.

[0020] Accordingly, embodiments of this application also provide a storage medium for storing a computer program, which is loaded by a processor to execute any of the data processing methods provided in embodiments of this application.

[0021] This application embodiment employs the following methods: acquiring a first image and a second image containing a sliding object, and the control position information of a sliding control in the first image; the sliding object moves following the sliding control; feature extraction is performed on the first image to obtain a feature image; image mapping is performed based on the first and second images to obtain a verification code region in the feature image, the verification code region containing the sliding object; based on the control position information, the object region of the sliding object in the verification code region of the feature image is determined, as well as the candidate matching region corresponding to the object region in the verification code region; the object region and the candidate matching region are matched, and the target matching region is determined from the candidate matching region; the sliding object is moved to the target matching region to verify the moved object. This scheme determines the object region and candidate matching region in the verification code region through the control position information of the sliding control, and performs image matching between the object region and the candidate matching region to determine the target matching region, which can accurately move the sliding object to the target matching region, improving the verification pass rate for the sliding object; and it does not require designing a corresponding algorithm based on the shape of the sliding object to determine the movement position of the sliding object (i.e., the position of the target matching region), thus having good versatility. Attached Figure Description

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

[0023] Figure 1 This is a scenario diagram of the data processing method provided in the embodiments of this application;

[0024] Figure 2 This is a flowchart of the data processing method provided in the embodiments of this application;

[0025] Figure 3 This is a schematic diagram of the sliding control provided in the embodiment of this application in its initial position;

[0026] Figure 4 This is a schematic diagram of the feature images provided in the embodiments of this application;

[0027] Figure 5 This is a schematic diagram of the verification code area provided in an embodiment of this application;

[0028] Figure 6These are schematic diagrams illustrating the differences provided in the embodiments of this application;

[0029] Figure 7 This is a schematic diagram of the object region and candidate matching region provided in the embodiments of this application;

[0030] Figure 8 This is another flowchart of the data processing method provided in the embodiments of this application;

[0031] Figure 9 This is a schematic diagram showing the sliding control provided in this application embodiment located at the rightmost position;

[0032] Figure 10 This is a schematic diagram illustrating the matching of the object region and the candidate matching region provided in an embodiment of this application;

[0033] Figure 11 This is a schematic diagram of the data processing apparatus provided in an embodiment of this application;

[0034] Figure 12 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation

[0035] 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, and 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.

[0036] This application provides a data processing method, apparatus, computer device, and storage medium. The data processing apparatus can be integrated into a computer device, which can be a terminal, a server, or other similar device.

[0037] The terminals can include mobile phones, wearable smart devices, tablets, laptops, personal computers (PCs), and in-vehicle computers. Servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0038] For example, such as Figure 1As shown, the computer device acquires a first image and a second image containing a sliding object, as well as control position information; performs feature extraction on the first image to obtain a feature image; performs image mapping on the first and second images to obtain the verification code region in the feature image; based on the control position information, it determines the object region of the sliding object and the corresponding candidate matching region; matches the object region and the candidate matching region to determine the target matching region; and moves the sliding object to the target matching region to verify the sliding object. This scheme can determine the object region and candidate matching region of the verification page through control position information, and accurately move the sliding object to the target matching region, improving the pass rate of verification for sliding objects; moreover, it does not require designing a corresponding algorithm based on the shape of the sliding object to determine the movement position of the sliding object (i.e., determining the target matching region), thus having good versatility.

[0039] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0040] This embodiment will be described from the perspective of a data processing device, which can be integrated into a computer device, such as a server or a terminal. Figure 2 As shown, the specific flow of this data processing method can be as follows:

[0041] 101. Obtain a first image and a second image containing a sliding object, and control position information of the sliding control in the first image, wherein the sliding object moves following the sliding control.

[0042] The first image can be an image of a display page (also known as a verification page) used by a client application, terminal application, or browser application to verify the user's identity. The first image contains a sliding object and a sliding control to control the movement of the sliding object.

[0043] Verifying user identity can be done by checking whether a related operation is performed by a human or a machine, preventing malicious access to client applications, terminal applications, or browsers by machines to obtain private data.

[0044] The second image can be an image of the verification page. The second image and the first image can be images of the verification page when the sliding control is in different control positions. That is, the sliding control in the first image and the second image are in different positions. Since the sliding object moves with the sliding control, the position of the sliding object in the first image and the second image is also different.

[0045] A sliding control can be an encapsulation of data and methods, allowing it to move based on received control position information using the encapsulated methods and data. Sliding controls come in various forms, such as... Figure 3 The button shown can also be in the form of an icon or other similar format.

[0046] The method can be a sliding control that implements the corresponding function, such as the code for moving the sliding control; the data can be the data required to respond to the user's operation on the sliding control.

[0047] The sliding object can be an object that moves along with the sliding control; the sliding object can be an image, button, or icon, etc.

[0048] The control position information can be the coordinate information of the sliding control in the first image, and the position of the sliding control in the first image can be determined by the coordinate information.

[0049] For example, if the control's position information is (x1, x2, y1, y2), then... Figure 3 As shown, a straight line in the first image can be obtained from x1 in the control position information (x1, x2, y1, y2): x=x1. Similarly, based on the control position information, four straight lines in the first image can be obtained: x=x1, x=x2, y=y1, and y=y2.

[0050] The sliding control is located in the rectangular area enclosed by the lines x=x1, x=x2, y=y1, and y=y2 in the first image.

[0051] For example, when the application's verification page finishes loading, a screenshot of the verification page can be taken to obtain the first image. By using the code related to the sliding control in the verification page's code, the sliding control contained in the first image and the position information of the sliding control in the first image can be determined, that is, the control position information of the sliding control can be determined.

[0052] Once the sliding control in the first image and its position information are determined, the sliding control can be moved on the verification page, and the sliding object will follow the movement of the sliding control. At this point, a screenshot of the verification page is taken to obtain the second image.

[0053] In real-world applications, some applications protect their verification pages to ensure security, making it impossible to obtain the verification page's code and thus determine the position of the sliding control.

[0054] Image recognition methods can be used to determine the sliding control and its position from the first image. Specifically, in one embodiment, the step "obtaining a first image and a second image containing the sliding object, and control position information in the first image" can be:

[0055] Get the first image and the image of the sliding control;

[0056] Match the sliding control image with the first image to determine the control position information of the sliding control in the first image at its initial position;

[0057] Move the sliding control from its initial position to the target position to obtain the second image.

[0058] The initial position can be the location of the sliding control when the client application, terminal application, or browser is opened, for example, Figure 3 The location of the slider control shown.

[0059] The initial position can also be the position of the sliding control when a sliding object is displayed on the verification page.

[0060] The target location can be a different location within the verification page than the initial location.

[0061] For example, it can be done by matching the characteristics of the sliding control in the first image to determine the position of the sliding control in the first image, and then setting that position as the initial position.

[0062] The sliding control image can be an image of the sliding control on the verification page, such as a screenshot of the sliding control displayed on the verification page; the sliding control image can also be a pre-stored image similar to the sliding control.

[0063] Matching the features of the slider control in the first image can be done by acquiring the slider control image and the first image, and then using a feature matching algorithm, such as SIFT, SURF, or ORB, to detect key points in the slider control image, obtain the features of the slider control, and describe the features of the key points to obtain a descriptor for the slider control image. Similarly, key points in the first image are detected and described to obtain a descriptor for the first image.

[0064] Since the distance between descriptors can reflect the degree of similarity between key points in two images, after obtaining the descriptors of the sliding control image and the first image, the key points are determined to be corresponding based on the degree of similarity between the two descriptors, thereby identifying the sliding control in the first image.

[0065] Specifically, the brute-force matching method can be used to calculate the distance between the descriptor of the sliding control image and the descriptor of the first image. Then, the obtained distances are sorted, and the descriptor of the first image with the closest distance is taken as the matching point of the key point corresponding to the descriptor of the sliding control image.

[0066] Alternatively, the KNN matching algorithm can be used to calculate the distance between the descriptor of the sliding control image and the descriptor of the first image to determine the matching point. During matching, K points most similar to the feature point are selected. If the difference between these K points is sufficiently large, the keypoint corresponding to the most similar descriptor is selected as the matching point. Typically, K=2 is chosen, i.e., nearest neighbor matching. For each keypoint, two nearest neighbor matching points are returned. If the ratio of the distance between the first and second matching points is sufficiently large (the ratio threshold is usually around 2), the descriptor with the closer distance is selected as the matching point.

[0067] By identifying the key points of all key points in the sliding control image that correspond to the key points in the first image, the control position information of the sliding control can be determined.

[0068] Optionally, the position information of the sliding control in the first image can also be determined using a multi-scale template matching algorithm. The multi-template matching algorithm can be an algorithm that uses a pre-stored image of the sliding control as a template to compare with the first image and find the sub-image in the first image that matches the template.

[0069] For example, it could involve obtaining a first image and a sliding control image, using the sliding control image as a template, converting both the first image and the sliding control image into grayscale images, iterating through the first image, obtaining the sub-image corresponding to the sliding control image in the first image, and matching it with the sliding control image to find the sub-image most similar to the sub-template from the first image.

[0070] The matching of sub-images and control images can be performed by calculating the similarity between the sliding control image and the sub-image using the Mean Absolute Differences (MAD), Sum of Absolute Differences (SAD), Sum of Squared Differences (SSD), Mean Square Differences (MSD), or Sequential Simplicity Detection Algorithm (NCC).

[0071] Find the sub-image that is most similar to the sliding control image from the first image. Based on the position of the sub-image in the first image, the control position information of the sliding control in the first image can be determined. This is equivalent to determining the control position information of the sliding control on the verification page when the sliding control is in its initial position. The sliding control can be moved to the target position on the verification page. At this time, a screenshot of the verification page where the sliding control is in the target position is taken to obtain the second image.

[0072] 102. Perform feature extraction on the first image to obtain the feature image.

[0073] The feature image can be an image containing the extracted features obtained after feature extraction from the first image.

[0074] For example, specifically, it could be done through image recognition to identify the sliding object in the first image and the notch object corresponding to the shape of the sliding object (such as...). Figure 3 Feature extraction is performed on object a) to obtain, for example... Figure 4 The image shown includes feature images of sliding objects and gap objects.

[0075] Alternatively, sufficient image samples from the verification page can be pre-acquired to train a neural network model to identify sliding objects and gap objects on the verification page, resulting in a trained neural network model. Features such as sliding objects and gap objects in the first image are then extracted using the trained neural network model to obtain a feature image.

[0076] Since the shapes of sliding objects and gap objects vary in different applications, extracting sliding objects and gap objects using image recognition and neural network models requires different algorithms designed based on the shapes of the sliding objects and gap objects in order to correctly identify them.

[0077] It can identify the sliding object and the gap object without relying on their shapes. Instead, it can extract edge features from the first image to obtain the edges of the sliding object and the gap object (determining the shape of the sliding object and the gap object through edge features).

[0078] In this context, edge features refer to regions in the first image where the color changes. For example, if the first image contains a table, and the table's color differs from the colors of other objects or the environment, meaning the colors of the pixels at the table's edges change, then the table can be identified from the first image by defining the regions where the color changes drastically as edge features. Edge detection algorithms can determine whether an edge feature exists by comparing the pixel values ​​of adjacent pixels and then extracting it.

[0079] Since the sliding object and the gap object have the same shape, the extracted edge features of the sliding object are the same as those of the sliding object. Therefore, the target matching region can be determined by matching the object region where the sliding object is located with the candidate matching region, that is, the region where the gap object is located.

[0080] In order to extract complete edges, the image can be preprocessed. In one embodiment, the step "extracting features from the first image to obtain a feature image" can specifically be:

[0081] The first image is converted to grayscale to obtain a grayscale image;

[0082] Based on the image edge detection algorithm, the edge features of the grayscale image are extracted to obtain the feature image.

[0083] A grayscale image can be obtained by converting the color of each pixel in the first image into several levels of grayscale based on a logarithmic relationship between white and black. The color values ​​of the red, green, and blue channels of the grayscale image are equal.

[0084] For example, each pixel can include a red channel, a green channel, and a blue channel. The color values ​​of the red, green, and blue channels of one pixel in the first image are obtained. The color values ​​of the red, green, and blue channels of the pixel are averaged to obtain the gray value of the pixel, that is, gray value = (color value of red channel + color value of green channel + color value of blue channel) / 3. The color values ​​of the red, green, and blue channels of the pixel are replaced with the calculated gray value.

[0085] Perform the above operation on all pixels in the first image to replace the color values ​​of the red, green, and blue channels of all pixels with the corresponding gray color values, thereby converting the first image to grayscale and obtaining a grayscale image.

[0086] The gray value can be the color value of the red, green, and blue channels of a pixel in a grayscale image.

[0087] In addition to averaging the red, green, and blue channel values ​​of a pixel in the first image to obtain its gray value, the weights of the red, green, and blue channel values ​​can be flexibly set according to requirements before averaging to obtain the gray value of the pixel.

[0088] For example, if the weight of the red channel color value is 1, the weight of the green channel color value is 3, and the weight of the blue channel color value is 2, then the gray color value corresponding to this pixel is: (1x the color value of the red channel + 3x the color value of the green channel + 2x the color value of the blue channel) / 3.

[0089] Optionally, the minimum / maximum value of the red, green, and blue channels of a pixel in the first image can be taken as the gray value of that pixel.

[0090] There are other ways to convert the first image to a grayscale image. As long as the color values ​​of the red, green, and blue channels are equal, a grayscale image can be obtained. Therefore, other methods will not be elaborated here.

[0091] After obtaining the grayscale image, edge features can be extracted from the grayscale image using edge detection algorithms, such as the Roberts operator, Prewitt operator, Sobel operator, or Canny operator, to obtain a feature image, as shown in the schematic diagram of the feature object. In practical applications, the feature image includes not only the edge features of the sliding object, sliding control, and notched object, but also the edge features of other items in the first image.

[0092] 103. Based on the first image and the second image, perform image mapping to obtain the verification code region in the feature image, and the verification code region contains the sliding object.

[0093] The verification code area can be an area containing a sliding object. For example, if the verification method provided on the verification page is an image, and the sliding object is an object that can be moved according to a sliding control based on a partial image of its location, the verification code area is the area containing the image. Therefore, the verification code area contains the sliding object.

[0094] For example, specifically, an edge feature algorithm can be used to identify the CAPTCHA region in the first image and the CAPTCHA region in the second image, and then a mapping can be performed based on the two CAPTCHA regions to determine the CAPTCHA region of the feature image.

[0095] For example, the verification code area in the first image is a rectangular region defined by (xm1, xn1, ym1, yn1), and the verification code area in the first image is a rectangular region defined by (xm2, xn2, ym2, yn2). (The method of determining the verification code area using coordinate information can refer to the method described above for determining the position of the control in the first image based on the control's position information.)

[0096] We can take the larger value among xm1 and xm2, xn1 and xn2, ym1 and ym2, and yn1 and yn2. Assuming we obtain (xm1, xn2, ym2, yn1) based on the larger value, we can map the obtained (xm1, xn2, ym2, yn1) onto the feature image. This will determine that the verification code region in the feature image is the rectangle defined by (xm1, xn2, ym2, yn1).

[0097] It is understandable that it can also take the smaller value between xm1 and xm2, the smaller value between ym1 and ym2, or the average value between xm1 and xm2. It can be flexibly set according to the application needs.

[0098] To more accurately obtain the CAPTCHA region of the feature region, background removal processing can be performed on the first and second images to highlight the CAPTCHA region. Specifically, in one embodiment, the step "image mapping based on the first and second images to obtain the CAPTCHA region in the feature image" can be:

[0099] Background removal processing is performed on the first and second images to obtain target region information;

[0100] Image mapping processing is performed based on the target region information to obtain the verification code region of the feature image.

[0101] The target area information can be the coordinates of the verification code area on the verification page, for example, the target area information is (x3, x4, y3, y4), i.e. Figure 5 As shown, the verification code area is the rectangular area enclosed by the lines x=x3, x=x4, y=y3, and y=y4 on the verification page (for specific determination methods, please refer to the above method of determining the position of the control in the first image based on the control position information).

[0102] Since the first image and the second image are images of the verification page when the sliding control is in different positions, the target area information can also be the coordinate information of the verification code area in the first image. Based on the target area information, the verification code area in the first image can be determined.

[0103] Similarly, the target area information can also be the coordinate information of the verification code area in the second image. The verification code area in the second image can be determined based on the target area information.

[0104] Background removal can be achieved by performing addition, subtraction, multiplication, and division operations on corresponding pixels of the first and second images to remove the background portion.

[0105] For example, image processing can be performed on the first and second images. By processing the color values ​​of each channel of the pixels in the first and second images, a clearer image can be obtained to accurately extract the outline of the verification code area in the image, that is, to remove the background and determine the target area information.

[0106] For example, by performing an addition operation on the first and second images, the noise in the images can be balanced due to the uncertainty of the noise, reducing the impact of noise on the images. Additionally, the color values ​​of each channel of the image pixels can be superimposed to enhance the image quality of the CAPTCHA area (e.g., the outline of the CAPTCHA area is clearer and more obvious). The region outline of the CAPTCHA area in the processed image is extracted, which means removing the part of the verification page other than the CAPTCHA area—removing the background parts of the first and second images. The target region information is determined based on the extracted region outline.

[0107] Since the feature image can be the image obtained by extracting features from the first image, and the target region information can be the coordinate information of the verification code region in the first image obtained by removing the background from the first image and the second image, the verification code region in the feature image can be determined by mapping the target region information to the feature image.

[0108] Determining the CAPTCHA region can reduce the interference of features contained in other regions of the feature image besides the CAPTCHA region, thus improving the accuracy of matching the object region and the candidate matching region.

[0109] As the sliding control moves to the target position, the sliding object also moves with the sliding control. The client application, terminal application, or browser application draws and displays the corresponding verification page based on the movement of the sliding control and the sliding object. Due to the influence of the movement of the sliding object, the drawn verification page will change. Therefore, the color values ​​of each channel of the corresponding pixel in the verification code area in the first image and the second image may be different.

[0110] In addition, the verification code area displayed on the verification code page can also have dynamic effects. For example, a set of specific static images in the verification code area can switch at a specified frequency to produce a certain dynamic effect. Therefore, the background can be removed by subtracting the first image and the second image, while retaining the verification code area.

[0111] In one embodiment, the step "performing background removal processing on the first image and the second image to obtain target region information" can specifically be:

[0112] A subtraction operation is performed on the first image and the second image to obtain a target difference image between the first image and the second image. The target difference image includes multiple contour regions.

[0113] Obtain the target contour region in the target difference image whose contour region is greater than a preset threshold;

[0114] Target region information is determined based on the target contour region.

[0115] The contour region can be a region with a contour in the target difference image, such as... Figure 7 The CAPTCHA region in the image has a rectangular outline, and the sliding object has a square outline. Therefore, the difference image includes at least two outline regions, where the CAPTCHA region is one outline region and the sliding object in the difference image is another outline region.

[0116] The target outline region can be the CAPTCHA region.

[0117] For example, a subtraction operation can be performed on the first image and the second image. If the values ​​of each color channel of the corresponding pixel in the first image and the second image are the same, then after the subtraction operation, the value of each channel of the pixel will be 0, and it will appear black.

[0118] Since the backgrounds in the first and second images are identical, the background becomes black after subtraction, thus removing the background from both images and obtaining the target difference image. The target difference image is shown below. Figure 6 As shown.

[0119] Contour extraction is performed on the processed target difference image to obtain contour regions. The target contour region is determined based on the size of the contour region; for example, contour regions whose size is greater than a preset threshold are identified as target contour regions. The target region information is then determined based on the length and width values ​​of this target contour region.

[0120] For example, the control position information of the sliding control at the initial position is (x1, x2, y1, y2), the target area information is (x3, x4, y3, y4), the length of the target outline area is L, and the width is D, that is, x3=x1, x4=x1+L, y3=y2, y4=y2+D.

[0121] In one embodiment, contour regions with shapes different from the CAPTCHA region can be filtered according to the shape of the CAPTCHA region to improve the efficiency of determining the target contour region. For example, if the CAPTCHA region is rectangular, the extracted contour regions can be filtered to remove non-rectangular contour regions, and the contour region of the largest rectangle can be determined as the target contour region.

[0122] To reduce interference factors in the images obtained by processing the first and second images, thus affecting the accuracy of determining the target contour region, the images can be pre-processed. Specifically, in one embodiment, the step "performing a subtraction operation on the first and second images to obtain a target difference image between the first and second images, the target difference image including multiple contour regions" can be:

[0123] Perform image subtraction on the first image and the second image to obtain an initial difference image between the first image and the second image;

[0124] The initial cropping position information of the difference image is determined based on the control position information;

[0125] The target difference image is obtained by cropping the initial difference image based on the cropping location information.

[0126] The initial difference image can be obtained by removing the background from the first image and the second image, but before any cropping is performed.

[0127] The target difference image can be an image obtained by cropping the initial image.

[0128] For example, a subtraction operation could be performed on the first and second images to remove the background from both, resulting in an initial difference image. If the verification code area is located above the sliding control, and the control's position information is (x1, x2, y1, y2), then the cropping position can be determined as line y1 based on the control's position information. The image above the sliding control in the initial difference image can then be cropped as the target difference image. If the verification code area is located below the control, and the control's position information is (x1, x2, y1, y2), then the cropping position can be determined as line y1 based on the control's position information. The image below the sliding control in the initial difference image can then be cropped as the target difference image. (This can be understood as the initial difference image being obtained by subtracting the first and second images; the position of the sliding control in the first image can be determined within the initial difference image.)

[0129] by Figure 3The verification code area shown is located in the upper right corner of the control. Taking the control position information as (x1, x2, y1, y2), where x1 < x2 and y1 < y2 (i.e., x1 is to the left of x2 and y2 is above y1) as an example, according to the positional relationship between the sliding control and the verification code area, it can be determined that the verification code area is located above the line y = y2 and to the right of the line x = x2.

[0130] According to the control position information, it can be determined that the intercept position information is the line y = y2, and the image above the line y = y2 is intercepted as the target difference image.

[0131] Optionally, further, the lines x = x2 and y = y2 can be used as the intercept position information to intercept a more accurate image as the target difference image.

[0132] After intercepting, image processing can also be performed to eliminate noise and highlight the contour of the verification code area. For example, binary processing is performed to convert the image into a black-and-white image, and morphological erosion processing can also be performed on the image. That is, in one embodiment, the step of "intercepting the initial difference image based on the intercept position information to obtain the target difference image" can specifically be:

[0133] Intercept the initial difference image based on the intercept position information to obtain the intercepted difference image;

[0134] Perform binary processing on the intercepted difference image to obtain a binary image;

[0135] Perform denoising processing on the binary image to obtain the target difference image.

[0136] Among them, the binary image can be an image where each pixel point is either black or white.

[0137] For example, specifically, the intercepted difference image obtained by interception can first be converted into a grayscale image (the conversion process can refer to the steps mentioned in step 102). The pixel grayscale values greater than a certain critical grayscale value in the grayscale image are set to the maximum grayscale value, and the pixel grayscale values less than this value are set to the minimum grayscale value, thereby achieving binary conversion to obtain a binary image.

[0138] Then, perform noise reduction processing on the binary image, such as morphological erosion processing, to eliminate noise and highlight the contour of the verification code area to obtain the target difference image.

[0139] Then, perform contour extraction on the target difference image obtained through interception, binary processing, and noise reduction, etc., and determine the largest contour area as the target contour area.

[0140] 104. Based on the control position information, determine the object region of the sliding object in the CAPTCHA region of the feature image, and the candidate matching region in the CAPTCHA region that corresponds to the object region.

[0141] The object region can be a region in the feature image that includes the sliding object, and the candidate matching region can include a notch object corresponding to the shape of the sliding object (e.g., Figure 3 The region of object a).

[0142] For example, specifically, the object area and the candidate matching area can be determined by the position of the sliding control based on the relationship between the sliding control and the sliding object. Figure 7 The area A defined by the dashed box shown is the object area, and the other areas in the CAPTCHA area outside of area A are candidate matching areas.

[0143] Generally, the gap object is located to the right of the sliding object. By controlling the sliding control to slide to the right, the sliding object is matched with the gap object, completing the verification process. Therefore, as... Figure 7 As shown, the region to the right of the object region (i.e., region A) – region B – can be identified as a candidate matching region.

[0144] Understandably, if the positional relationship between the sliding object and the gap object changes, such as the gap object being to the left of the sliding object, or the positional relationship between the sliding object, the gap object, and the sliding control changes, it is only necessary to make corresponding adjustments based on the changed positional relationship to determine the correct object area and candidate matching area, thus completing the verification process.

[0145] 105. The target matching region is determined from the candidate matching regions by matching the object region and the candidate matching regions.

[0146] The target matching region is the region containing the notch object corresponding to the sliding object. For example, it can be a process of moving m pixels as a unit, traversing the sub-regions in the candidate matching region, matching the sub-regions with the object region, and obtaining the matching value between the sub-regions and the object region.

[0147] For example, if the length of the object region is 'a' and the height is 'h', and the starting point of the candidate matching region traversal is (0,0), then the obtained sub-region is (0,a,0,h). This sub-region is matched with the object region to obtain the matching value. The traversal starting point is moved m pixels to obtain the second sub-region (m,m+a,0,h). This sub-region is matched with the object region to obtain the matching value, and so on.

[0148] When the matching value is greater than the first preset matching value, the process of obtaining sub-regions from the candidate matching region ends, and the region with the matching value greater than the first preset matching value is determined as the region where the target matching region is located.

[0149] In this area, with n pixels as the moving unit, match by obtaining sub-areas from this area in the above manner. When the matching value is greater than the second preset matching value, stop obtaining sub-areas for matching, and determine the area where the matching value is greater than the second preset matching value as the target matching area.

[0150] The first match is a rough match, aiming to determine the area where the target area is located in the candidate matching area (not to determine the target area). The second match is an accurate match, and the target matching area needs to be determined in this area. Therefore, the moving distance each time should be less than m, that is, n < m; the second matching value is greater than the first matching value.

[0151] When determining the positional relationship between the sliding object and the area to be matched, the sub-areas can be obtained for matching according to the positional relationship with a preset strategy to determine the area position information of the area to be matched. That is, in one embodiment, the step of "matching the object area and the candidate matching area and determining the target matching area from the candidate matching area" can specifically be:

[0152] Obtain the area to be matched in the candidate matching area according to the preset area acquisition strategy;

[0153] Perform feature matching between the object area and the area to be matched to obtain the matching value between the object area and the area to be matched;

[0154] Based on the matching value, determine the target matching area from the candidate matching area.

[0155] Among them, the area to be matched can be a sub-area in the candidate matching area that has the same shape and size as the object area.

[0156] For example, specifically, it can be according to the preset strategy. For example, with 1 element as the moving unit, sequentially obtain the areas to be matched in the candidate matching area from left to right, and perform feature matching between the areas to be matched and the object area.

[0157] Specifically, the matching value between the sub-area and the object area can be calculated by the Mean Absolute Differences (MAD) algorithm, the Sum of Absolute Differences (SAD) algorithm, the Sum of Squared Differences (SSD) algorithm, the Mean Square Differences (MSD) algorithm, or the Normalized Cross Correlation (NCC) algorithm.

[0158] When the matching value is greater than the preset matching value, the process of obtaining sub-regions for matching ends, and the region with the matching value greater than the preset matching value is determined as the target matching region.

[0159] In addition to comparing with a preset matching value, the target candidate matching region corresponding to the maximum value among the multiple target candidate matching regions can also be determined as the region to be matched. That is, in one embodiment, the step "perform feature matching between the object region and the region to be matched to obtain the matching value between the object region and the region to be matched" can specifically be:

[0160] The regions to be matched are matched one by one with the features of the target region to obtain multiple matching values;

[0161] Determining the target matching region from the candidate matching regions based on the matching value can specifically be as follows:

[0162] The region to be matched corresponding to the largest matching value among multiple matching values ​​is determined as the target matching region.

[0163] For example, it can be to obtain multiple regions to be matched from the candidate matching regions according to a preset strategy, match each region to be matched with the object region for features, obtain multiple matching values, and record the region to be matched and the corresponding matching value.

[0164] The matching values ​​of multiple regions to be matched are sorted, and the region to be matched corresponding to the largest matching value is determined as the target matching region.

[0165] 106. Move the sliding object to the target matching area to verify the moved object.

[0166] For example, after determining the target matching area, the sliding object can be moved into the target matching area so that the client application or browser application can verify the sliding object.

[0167] The target matching region may also include region location information, which can be information that identifies the location of the target matching region. For example, it can be coordinate information. For example, if the region location information is (x5, x6, y5, y6), it means that the target matching region is a rectangular region enclosed by the lines x=x5, x=x5, y=y5, and y=y46.

[0168] For example, it can be determined that the sliding control needs to be moved to the position of (x5+x6) / 2 based on the area location information (x5,x6,y5,y6), and the sliding control can be moved from the initial position to the position of x=(x5+x6) / 2 through the interface of the sliding control, so as to move the sliding object to the area to be matched.

[0169] To improve the verification pass rate, the sliding control speed can be slowed down as it approaches the target matching area, taking into account the characteristics of manual movement of the sliding control. In one embodiment, the step "moving the sliding object to the target matching area" can specifically be:

[0170] The sliding speed of the sliding object is determined based on a preset sliding strategy;

[0171] Control the sliding control to move the object to the target matching area at the sliding speed.

[0172] The preset sliding strategy can be a speed variation strategy for the sliding control as it slides to the area to be matched. For example, the sliding distance of the sliding control to the area to be matched can be divided into a constant speed range and a slow speed range proportionally, or the sliding speed can be reduced within a preset distance of the area to be matched.

[0173] For example, specifically, based on the sliding strategy, when the sliding control is at a preset distance (e.g., 2cm) from the area to be matched, the sliding speed is reduced to half of the original speed. When the sliding control is at a constant speed k from the initial position to the preset distance from the area to be matched, it is then slid into the area to be matched at a speed of k / 2.

[0174] It is understandable that the sliding speed can be constant or variable, deceleration or acceleration, and can be flexibly adjusted according to the actual application scenario. No restrictions are imposed here.

[0175] To prevent the slider from being moved to the target position but not held there, causing it to return to its initial position and resulting in a mismatch between the updated CAPTCHA area and the obtained slider area and the area to be matched, leading to verification failure, the slider is held at the target position after being moved to it. After determining the area to be matched, the slider is then moved from the target position to the area to be matched. In one embodiment, the step "moving the slider object to the target matching area" can specifically be:

[0176] Based on the location information of the target matching area and the location information of the target control, the sliding direction and sliding distance of the object are determined by sliding.

[0177] The movement control moves the object a distance along the sliding direction to the target matching area.

[0178] For example, it can specifically be the location information of the region and the location of the target control. It can determine the positional relationship between the sliding control and the target matching region, and determine the direction and distance of the sliding object's movement. For example, if the target position is x=x7, the region location information of the region to be matched (x5,x6,y5,y6) determines that the sliding control needs to move to the position (x5+x6) / 2. If (x5+x6) / 2>x7, it means that the sliding control needs to move to the right, and the moving distance is (x5+x6) / 2-x7.

[0179] Control the slider to move a distance of (x5+x6) / 2-x7 to the right to move the slider object into the area to be matched.

[0180] After the sliding object is moved into the area to be matched, the client application, terminal application, or browser corresponding to the verification page determines whether the verification passes based on the positional relationship between the sliding object and the gap object. If the verification passes, other pages provided by the corresponding application, such as the homepage or other application pages, can be displayed.

[0181] If the verification fails, a message indicating that the verification failed can be returned, and the image of the verification area can be reloaded so that the sliding object can be moved again for verification.

[0182] The rules for determining whether the verification passes or fails in different applications may not be limited to judging the positional relationship between the sliding object and the notch object; they may also be based on judging the position of the sliding control.

[0183] In one embodiment, in order to prevent machine operations from crawling users' private data or maliciously accessing applications, causing application malfunctions, many applications have set up programs to verify user identity. For example, sliding verification codes are one such program. The method provided in this application embodiment can also be used to automatically test the sliding verification codes contained in applications, test the correctness of the sliding verification codes, and improve the security of applications.

[0184] As can be seen from the above, the embodiments of this application obtain a first image and a second image containing a sliding object, as well as the control position information of the sliding control in the first image, and the sliding object moves with the sliding control; feature extraction is performed on the first image to obtain a feature image; image mapping processing is performed based on the first image and the second image to obtain a verification code region in the feature image, the verification code region containing the sliding object; based on the control position information, the object region of the sliding object in the verification code region of the feature image is determined, as well as the candidate matching region corresponding to the object region in the verification code region; the object region and the candidate matching region are matched, and the target matching region is determined from the candidate matching region; the sliding object is moved to the target matching region to verify the moved object. This scheme determines the object region and the candidate matching region in the verification code region through the control position information of the sliding control, and determines the target matching region by matching the object region and the candidate matching region. It can accurately move the sliding object to the target matching region, improving the verification pass rate for the sliding object; and it does not require designing a corresponding algorithm based on the shape of the sliding object to determine the movement position of the sliding object (i.e., the position of the target matching region), and has good versatility.

[0185] Based on the above embodiments, the following examples will provide further detailed explanations.

[0186] This embodiment will consider the data processing device as an example. When a game application is opened, the application's verification page includes a sliding object and a notch object. The position of the sliding control is the initial position (e.g., ...). Figure 3 The following is an example (shown in the image).

[0187] Among them, game applications can be client-based game applications, terminal game applications, or browser game applications, etc.

[0188] Specifically, the data processing device can be integrated into a computer device, which can be a server or a terminal, etc.

[0189] This application provides a data processing method that can be executed by a processor of a computer device, such as... Figure 8 As shown, the specific flow of this data processing method can be as follows:

[0190] 201. Obtain the first image of the verification page of the game application.

[0191] For example, this could involve opening the game application, entering the verification page, taking a screenshot of the verification page once it has finished loading to obtain the first image, determining the sliding control and its position using the element controls in the verification page's code, and calculating the height and width of the first image, which are H-1 and W-1 respectively.

[0192] 202. Determine the sliding controls and their position information on the verification page based on the template matching method.

[0193] For example, the position information of the sliding control in the first image can be determined by multi-scale template matching.

[0194] For example, it could involve acquiring a first image and a pre-stored sliding control image, using the sliding control image as a sub-template; converting the first image and the sliding control image into grayscale images; iterating through the first image to acquire sub-images that match the sliding control image; and matching these sub-images with the sliding control image to find the sub-image most similar to the sliding control from the first image.

[0195] The position information of the sub-image in the first image is determined as the control position information of the sliding control in the first image.

[0196] Since the first image is an image of the verification page, the control position information in the first image can also be the control position information of the sliding control on the verification page. The sliding control in the verification page can be determined based on the sliding control position information.

[0197] At this point, the control position information of the sliding control on the verification page can be (X-min, X-max, Y-min, Y-max). The initial position of the sliding control, that is, the center position of the sliding control, is (X-0, Y-0), X-0=(X-min+X-max) / 2, Y-0=(Y-min+Y-max) / 2.

[0198] The similarity between the sub-image and the sliding control image can be calculated using the Mean Absolute Differences (MAD), Sum of Absolute Differences (SAD), Sum of Squared Differences (SSD), Mean Square Differences (MSD), or Sequential Simplicity Detection Algorithm (NCC).

[0199] 203. Move the slider to the far right of the verification page and obtain the second image of the verification page when the slider is at the far right.

[0200] By obtaining the position information of the sliding control on the verification page, the sliding control can be moved to the far right of the verification page. A screenshot of the verification page with the sliding control at this position can then be taken, resulting in the following: Figure 9 The second image shown is about the verification page.

[0201] In one embodiment, after moving the sliding control to the rightmost position, if the sliding control is released, the sliding control will return to the initial position and trigger a refresh of the verification page. The sliding object and the gap object in the verification code area will change due to the refresh of the verification page. Therefore, after moving the sliding control to the rightmost position, without releasing the sliding control, after determining the target matching area, the sliding control is moved from the rightmost position to the target matching area.

[0202] If the slider returns to its initial position when released, and the verification page does not refresh, then the slider can be moved from its initial position to the target matching area.

[0203] At this point, the rightmost position of the sliding control is recorded as (W, Y-0).

[0204] 204. Perform a subtraction operation on the first image and the second image to obtain the difference image between the first image and the second image.

[0205] For example, it could involve performing a subtraction operation on the first image and the second image, where the color values ​​of two pixels at corresponding positions in the first and second images are subtracted to obtain a new color value, which is then used as the color value of the pixel at the corresponding position in the difference image, in order to remove the background from the first and second images and obtain the difference image.

[0206] 205. Based on the control position information, the difference image is cropped, binarized, and denoised to obtain the target difference image.

[0207] For example, specifically, the position of the verification code area above the line y=Y-max could be determined based on the positional relationship between the sliding control and the verification code area. The image above the line y=Y-max could then be cropped.

[0208] The captured image is converted into a grayscale image. Pixels with a grayscale value greater than a certain threshold are set as grayscale maxima, and pixels with a grayscale value less than this threshold are set as grayscale minima, thus achieving binarization and obtaining a binarized image.

[0209] The binarized image is then subjected to noise reduction processing, such as morphological erosion, to eliminate noise and highlight the outline of the CAPTCHA region, thus obtaining the target difference image.

[0210] 206. Extract the contours of the target difference image to determine the regional location information of the verification code area.

[0211] For example, specifically, contour extraction can be performed on the processed target difference image to obtain contour regions in the target difference image. The target contour region can then be determined based on the size of the contour regions, such as defining contour regions whose size is greater than a preset threshold as target contour regions. The target region information can then be determined based on the length and width values ​​of the target contour region.

[0212] In one embodiment, the extracted contour regions can be filtered to remove non-rectangular contour regions, and the rectangular contour region with the largest contour region can be determined as the target contour region.

[0213] Calculate the minimum bounding rectangle for the target contour region. The width of the minimum bounding rectangle is W-2 and the height is H-2. The coordinates of the lower left corner of the minimum bounding rectangle are (regionX-min, regionY-min).

[0214] Based on the location information of the minimum bounding rectangle, the region location information of the CAPTCHA area can be determined as (regionX-min, regionX-max, regionY-min, regionY-max).

[0215] Where regionX-max = regionX-min + W-2; regionY-max = regionY-min + H-2.

[0216] 207. Perform feature extraction on the first image to obtain the feature image.

[0217] For example, it can be done by obtaining the color values ​​of the red, green, and blue channels of each pixel, averaging the color values ​​of the red, green, and blue channels of each pixel to obtain a gray value, and then replacing the color values ​​of the red, green, and blue channels of each pixel with the corresponding gray values ​​to achieve grayscale conversion of the first image.

[0218] The first image after grayscale conversion can be Gaussian blurred, and then edge detection algorithms, such as the Roberts operator, Prewitt operator, Sobel operator, or Canny operator, can be used to extract edge features from the grayscale image to obtain a feature image.

[0219] Optionally, in addition to averaging the color values ​​of the red, green, and blue channels to obtain a gray color value, the weights of the red, green, and blue channels can be flexibly set according to requirements to obtain a gray color value.

[0220] Optionally, the minimum / maximum value of the red, green, and blue channel colors can be used as the gray value.

[0221] There are other ways to convert the first image to a grayscale image. As long as the color values ​​of the red, green, and blue channels are equal, a grayscale image can be obtained. Therefore, other methods will not be elaborated here.

[0222] 208. Determine the CAPTCHA region in the feature image, as well as the object region and candidate matching region within the CAPTCHA region, based on the region location information and control location information.

[0223] For example, specifically, the object region can be determined as (X-min, X-max, Y-min, Y-max) and the candidate matching region (X-max, regionX-max, regionY-min, regionY-max) based on the control position information (X-min, X-max, regionY-min, regionY-max), the region position information (regionX-min, regionX-max, regionY-min, regionY-max), and the positional relationship between the sliding control and the sliding object.

[0224] 209. Match the target region with the candidate matching regions to determine the target matching region and its location. For example, it could be like this: Figure 10 As shown, by controlling the slider to move the object region to the right, it is matched with the overlapping region (the region that overlaps with the object region) in the candidate matching region. Specifically, the matching value between the overlapping region and the object region can be calculated using the Mean Absolute Differences (MAD), Sum of Absolute Differences (SAD), Sum of Squared Differences (SSD), Mean Square Differences (MSD), or Sequential Similiarity Detection Algorithm (NCC).

[0225] The position of the sliding control is denoted as (X-1, Y-1).

[0226] Where X-1 = X-max + X + (X-min + X-max) / 2 = X-0 + X-max + 1, and X is the distance moved.

[0227] Y-1=(Y-min+Y-max) / 2=Y-0.

[0228] The object region is continuously moved within the candidate matching region to match the overlapping region, resulting in multiple matching values ​​and corresponding movement positions. The matching values ​​are sorted, and the overlapping region corresponding to the largest matching value is determined as the target matching region, and the corresponding movement position is determined as the position of the target matching region, denoted as (X-1=X-max+X-0+L,Y-1).

[0229] 210. Control the slider to move from the rightmost position to the target matching area to verify the slider object.

[0230] For example, the sliding control could be moved from the rightmost position (W, Y-0) to the target matching area (X-1=X-max+X-0+L,Y-1) to verify the sliding object.

[0231] In one embodiment, the actual position of the sliding object and the preset position of the notch object (also known as the preset position) are obtained through a game application. Based on the relationship between the actual position and the preset position, it is determined whether the verification is successful.

[0232] If verification is successful, you will be taken to the game application's main page. After successful verification, the content displayed and the operations performed by the application can be adapted to the actual application scenario and are not limited here.

[0233] As can be seen from the above, the embodiments of this application obtain a first image of the verification page of a game application; determine the sliding control and its position information in the verification page based on a template matching method; move the sliding control to the rightmost position of the verification page to obtain a second image of the verification page when the sliding control is in the rightmost position; perform a subtraction operation on the first image and the second image to obtain a difference image between the first image and the second image; crop the difference image according to the control position information, and perform binarization and denoising processing to obtain a target difference image; extract the contour of the target difference image to determine the region position information of the verification code area; extract features from the first image to obtain a feature image; determine the verification code area in the feature image, as well as the object area and candidate matching area in the verification code area, according to the region position information; match the object area with the candidate matching area to determine the target matching area and its position; control the sliding control to move from the rightmost position to the target area to move the sliding object to the gap position for verification. This solution can determine the object area and the matching area on the verification page by sliding the position of the control. It then performs image matching between the object area and the matching area, and determines the matching area based on the matching result. This allows the sliding object to be accurately moved to the matching area, improving the verification pass rate for sliding object movement. Furthermore, it does not require designing a corresponding algorithm based on the shape of the sliding object to determine its movement position, thus exhibiting good versatility.

[0234] To facilitate better implementation of the data processing method provided in the embodiments of this application, a data processing apparatus is also provided in one embodiment. The meanings of the terms used are the same as in the data processing method described above, and specific implementation details can be found in the description of the method embodiments.

[0235] This data processing device can be integrated into a computer device, such as... Figure 11 As shown, the data processing device may include: an acquisition unit 301, a feature extraction unit 302, a mapping unit 303, a region determination unit 304, a region matching unit 305, and a verification unit 306, as detailed below:

[0236] Acquisition unit 301: used to acquire a first image and a second image containing a sliding object, and control position information of a sliding control in the first image, wherein the sliding object moves following the sliding control.

[0237] For example, when the application's verification page finishes loading, a screenshot of the verification page can be taken to obtain the first image. By using the code related to the sliding control in the verification page's code, the sliding control contained in the first image and the position information of the sliding control in the first image can be determined, that is, the control position information of the sliding control can be determined.

[0238] Once the sliding control in the first image and its position information are determined, the sliding control can be moved on the verification page, and the sliding object will follow the sliding control. At this point, a screenshot of the verification page when the sliding control moves to the target position is taken to obtain the second image.

[0239] In one embodiment, the acquisition unit 301 may include a first acquisition subunit, a control matching subunit, and a second acquisition subunit. Specifically, the first acquisition subunit, the control matching subunit, and the second acquisition subunit may be used for:

[0240] The first acquisition subunit is used to acquire the sliding control image and the first image;

[0241] The control matching subunit is used to match the sliding control image with the first image to determine the control position information of the sliding control in the first image at its initial position;

[0242] The second acquisition subunit is used to move the sliding control from the initial position to the target position to acquire the second image.

[0243] For example, it can be done by matching the characteristics of the sliding control in the first image to determine the position of the sliding control in the first image, and then setting that position as the initial position.

[0244] Matching the sliding control's features in the first image can be done by acquiring the control image and the first image, obtaining the sliding control's features through a feature matching algorithm, and describing the features of key points to obtain a descriptor for the control image. Similarly, key points in the first image are detected and described to obtain a descriptor for the first image.

[0245] Since the distance between descriptors can reflect the similarity between key points in two images, after obtaining the descriptors of the sliding control image and the first image, the key points are determined to be corresponding based on the similarity between the two descriptors, thereby identifying the sliding control in the first image.

[0246] Specifically, the brute-force matching method can be used to calculate the distance between the descriptor of the control image and the descriptor of the first image. Then, the obtained distances are sorted, and the descriptor of the first image with the closest distance is taken as the matching point of the key point corresponding to the descriptor of the sliding control image.

[0247] Alternatively, the KNN matching algorithm can be used to calculate the distance between the descriptor of the sliding control image and the descriptor of the first image to determine the matching point. During matching, K points most similar to the feature point are selected. If the difference between these K points is large enough, the most similar point is selected as the matching point. Usually, K=2 is chosen, which is nearest neighbor matching. For each match, the two nearest neighbor matches are returned. If the ratio of the distance between the first matching point and the second matching point is large enough (the ratio threshold is usually around 2), the descriptor with the closer distance is selected as the matching point.

[0248] By identifying the key points of all key points in the sliding control image that correspond to the key points in the first image, the control position information of the sliding control can be determined.

[0249] Optionally, the position information of the sliding control in the first image can also be determined by a multi-scale template matching algorithm.

[0250] For example, it could involve obtaining a first image and a control image, using the sliding control image as a template, converting the first image and the control image into grayscale images, iterating through the first image, selecting a sub-image of the same size as the control image in the first image and matching it with the control image, and then iterating through the first image to find the sub-image most similar to the sub-template.

[0251] Feature extraction unit 302: used to extract features from the first image to obtain a feature image.

[0252] For example, specifically, it could be done through image recognition to identify the sliding object in the first image and the notch object corresponding to the shape of the sliding object (such as...). Figure 3 Feature extraction is performed on object a) to obtain a feature image that includes only the sliding object and the gap object.

[0253] In one embodiment, the feature extraction unit 302 may include a transformation subunit and an edge feature extraction subunit. The edge feature extraction subunit is used to extract edge features from the first image. In order to extract complete edges, the image may be preprocessed. Specifically, the transformation subunit and the edge feature extraction subunit are used for:

[0254] Conversion subunit: used to convert the first image to grayscale to obtain a grayscale image;

[0255] Edge feature extraction subunit: used to extract edge features of grayscale images based on image edge detection algorithms to obtain feature images.

[0256] For example, each pixel can include a red channel, a green channel, and a blue channel. The color values ​​of the red, green, and blue channels of each pixel in the first image are obtained. The average value of the red, green, and blue channels of each pixel is then calculated to obtain a gray value, i.e., gray value = (color value of red channel + color value of green channel + color value of blue channel) / 3. The color values ​​of the red, green, and blue channels of the pixel are then replaced with the calculated gray value.

[0257] Perform the above operation on all pixels in the first image to replace the color values ​​of the red, green and blue channels of all pixels with the corresponding gray color values, thereby converting the first image to grayscale and obtaining a grayscale image.

[0258] In addition to averaging the color values ​​of the red, green, and blue channels to obtain the gray color value, the weights of the red, green, and blue channels can also be flexibly set according to requirements to obtain the gray color value.

[0259] Optionally, the minimum / maximum value of the red, green, and blue channel colors can be used as the gray value.

[0260] There are other ways to convert the first image to a grayscale image. As long as the color values ​​of the red, green, and blue channels are equal, a grayscale image can be obtained. Therefore, other methods will not be elaborated here.

[0261] After obtaining the grayscale image, edge features can be extracted from the grayscale image using edge detection algorithms, such as the Roberts operator, Prewitt operator, Sobel operator, or Canny operator, to obtain a feature image.

[0262] Mapping unit 303: is used to perform image mapping based on the first image and the second image to obtain the verification code region in the feature image, the verification code region containing the sliding object.

[0263] For example, specifically, an edge feature algorithm can be used to identify the CAPTCHA region in the first image and the CAPTCHA region in the second image, and then a mapping can be performed based on the two CAPTCHA regions to determine the CAPTCHA region of the feature image.

[0264] In one embodiment, the mapping unit 303 may include a background removal subunit and a mapping subunit, specifically:

[0265] Background Removal Subunit: Used to perform background removal processing on the first image and the second image to obtain target region information;

[0266] Mapping subunit: used to perform image mapping processing based on target region information to obtain the verification code region of the feature image.

[0267] For example, image processing can be performed on the first and second images. By processing the color values ​​of each channel of the pixels in the first and second images, a clearer image can be obtained to accurately extract the outline of the verification code area in the image, that is, to remove the background and determine the target area information.

[0268] In one embodiment, the background removal subunit may include a calculation module, an acquisition module, and a determination module, specifically:

[0269] The calculation module is used to perform subtraction operations on the first image and the second image to obtain a target difference image between the first image and the second image. The target difference image includes multiple contour regions.

[0270] Acquisition module: used to acquire target contour regions in the target difference image whose contour regions are greater than a preset threshold;

[0271] Determining module: Used to determine target region information based on the target contour region.

[0272] For example, a subtraction operation can be performed on the first image and the second image. If the values ​​of each color channel of the corresponding pixel in the first image and the second image are the same, then after the subtraction operation, the value of each channel of the pixel will be 0, and it will appear black.

[0273] Contour extraction is performed on the processed target difference image to obtain contour regions. The target contour region is determined based on the size of the contour region; for example, contour regions whose size is greater than a preset threshold are identified as target contour regions. The target region information is then determined based on the length and width values ​​of this target contour region.

[0274] In one embodiment, the operation module includes a subtraction operation submodule, a determination submodule, and a truncation submodule, specifically:

[0275] Subtraction operation submodule: used to perform image subtraction operation on the first image and the second image to obtain the initial difference image between the first image and the second image;

[0276] Determine the submodule: This module is used to determine the cropping position information of the initial difference image based on the control position information.

[0277] The cropping submodule is used to crop the initial difference image based on the cropping location information to obtain the target difference image.

[0278] For example, a subtraction operation can be performed on the first image and the second image to remove the background portion of the first image and the second image, resulting in an initial difference image.

[0279] If the verification code area is located above the sliding control, and the control position information is (x1, x2, y1, y2), then the cropping position information can be determined as the straight line y1 based on the control position information of the sliding control. Based on the cropping position information, the image above the sliding control in the initial difference image is cropped as the target difference image.

[0280] If the verification code area is located below the control, and the control position information is (x1, x2, y1, y2), then the cropping position information can be determined as the straight line y1 based on the control position information. Based on the cropping position information, the image below the sliding control in the initial difference image is cropped as the target difference image.

[0281] It is understandable that the initial difference image is the image obtained by subtracting the first image from the second image. Based on the position information of the sliding control in the first image, the position of the sliding control can be determined in the initial difference image.

[0282] Based on the control position information, the cropping position information can be determined to be the line y=y2, and the image above the line y=y2 can be used as the target difference image.

[0283] In one embodiment, the truncation submodule may include a truncation component, a binarization component, and a noise reduction component, specifically:

[0284] Cropping component: used to crop the initial difference image based on the cropping position information to obtain the cropped difference image;

[0285] Binarization component: Used to binarize the cropped difference image to obtain a binary image;

[0286] Denoising component: Used to denoise binarized images to obtain target difference images.

[0287] For example, the extracted difference image can be converted into a grayscale image first (the conversion process can be referred to in step 102). The grayscale values ​​of pixels in the grayscale image that are greater than a certain critical grayscale value are set as grayscale maxima, and the grayscale values ​​of pixels that are less than this value are set as grayscale minima, thereby achieving binarization and obtaining a binarized image.

[0288] The binarized image is then subjected to noise reduction processing, such as morphological erosion, to eliminate noise and highlight the outline of the CAPTCHA region, thus obtaining the target difference image.

[0289] Then, the target difference image obtained after cropping, binarization and noise reduction is subjected to contour extraction, and the largest contour region is determined as the target contour region.

[0290] The obtained target region information is mapped onto the feature image to determine the CAPTCHA region in the feature image.

[0291] Since the feature image can be the image obtained by extracting features from the first image, and the target region information can be the coordinate information of the verification code region in the first image obtained by removing the background from the first image and the second image, the verification code region in the feature image can be determined by mapping the target region information to the feature image.

[0292] Region determination unit 304: used to determine the object region of the sliding object in the verification code region of the feature image based on the control position information, and the candidate matching region in the verification code region corresponding to the object region.

[0293] For example, specifically, the object area and the candidate matching area can be determined by the position of the sliding control based on the relationship between the sliding control and the sliding object. Figure 7 As shown, region A is the object region, and the regions outside region A in the verification code region are candidate matching regions.

[0294] Generally, the gap object is located to the right of the sliding object. By controlling the sliding control to slide to the right, the sliding object is matched with the gap object to complete the verification process. Therefore, the area to the right of the object area—area A—area B can be identified as the candidate matching area.

[0295] Region matching unit 305: Used to determine the target matching region from the candidate matching regions by matching the object region with the candidate matching regions.

[0296] For example, it can be done by moving m elements at a time, traversing the sub-regions in the candidate matching region, matching the sub-regions with the object region, and obtaining the matching value between the sub-regions and the object region.

[0297] When the matching value is greater than the first preset matching value, the process of obtaining sub-regions for matching ends, and the region where the matching value is greater than the first preset matching value is determined as the region to be matched.

[0298] In this area, with one element as the movement unit, sub-regions are obtained and matched in the same way as above. When the matching value is greater than the second preset matching value, the acquisition and matching of sub-regions ends. The area with the matching value greater than the second preset matching value is determined as the area to be matched, and the location information of the sub-region is determined as the area location information of the area to be matched.

[0299] In one embodiment, the matching unit 305 includes a region acquisition subunit, a matching subunit, and a determination subunit, specifically:

[0300] Region acquisition subunit: used to acquire the region to be matched from the candidate matching regions according to the preset region acquisition strategy;

[0301] Matching subunit: used to perform feature matching between the object region and the region to be matched, and obtain the matching value between the object region and the region to be matched;

[0302] Determine sub-unit: used to determine the target matching region from the candidate matching regions based on the matching value.

[0303] For example, it can be done according to a preset strategy, such as moving one element at a time, sequentially obtaining the regions to be matched from the candidate matching regions from left to right, and then performing feature matching between the regions to be matched and the target regions.

[0304] Specifically, the matching value between the sub-region and the object region can be calculated using the Mean Absolute Differences (MAD), Sum of Absolute Differences (SAD), Sum of Squared Differences (SSD), Mean Square Differences (MSD), or Sequential Similiarity Detection Algorithm (NCC).

[0305] When the matching value is greater than the preset matching value, the acquisition of sub-regions for matching ends, and the region with the matching value greater than the second preset matching value is determined as the region to be matched, and the location information of the sub-region is determined as the region location information of the region to be matched.

[0306] In one embodiment, the matching subunit may include a feature matching module, and the determining subunit may include a region determining module, specifically:

[0307] Feature matching module: Used to perform feature matching between each region to be matched and the target region to obtain multiple matching values;

[0308] Region determination module: used to determine the candidate location information corresponding to the largest matching value among multiple matching values ​​as the region location information.

[0309] For example, it can be to obtain multiple target candidate matching regions from the candidate matching regions according to a preset strategy, match each of them with the object region to obtain a matching value, and record the location information of the target candidate matching region and the corresponding matching value.

[0310] The matching values ​​of multiple sub-regions are sorted, and the target candidate matching region corresponding to the largest matching value is determined as the region to be matched. The location information of the target candidate matching region is determined as the region location information of the region to be matched.

[0311] Verification unit 306: used to move the sliding object into the target matching area to verify the moving object.

[0312] For example, after determining the target matching area, the sliding object can be moved into the target matching area so that the client application or browser application can verify the sliding object.

[0313] In one embodiment, the verification unit 306 may include a speed determination subunit and a movement subunit, specifically:

[0314] Speed ​​determination subunit: used to determine the sliding speed of the sliding object based on a preset sliding strategy;

[0315] The moving sub-unit is used to control the sliding control to move the sliding object to the target matching area at the sliding speed.

[0316] For example, specifically, based on the sliding strategy, when the sliding control is at a preset distance (e.g., 2cm) from the area to be matched, the sliding speed is reduced to half of the original speed. When the sliding control is at a constant speed k from the initial position to the preset distance from the area to be matched, it is then slid into the area to be matched at a speed of k / 2.

[0317] In one embodiment, the region matching unit 306 may include a movement information determination subunit and a movement subunit, specifically:

[0318] Motion information determination subunit: used to determine the sliding distance and sliding direction based on the positional relationship between the area location information and the target location;

[0319] The moving sub-unit is used to control the sliding object to move a sliding distance in the sliding direction according to the area location information, so as to move the sliding object to the area to be matched.

[0320] For example, it can specifically be the location information of the region and the location of the target control. It can determine the positional relationship between the sliding control and the target matching region, and determine the direction and distance of the sliding object's movement. For example, if the target position is x=x7, the region location information of the region to be matched (x5,x6,y5,y6) determines that the sliding control needs to move to the position (x5+x6) / 2. If (x5+x6) / 2>x7, it means that the sliding control needs to move to the right, and the moving distance is (x5+x6) / 2-x7.

[0321] Control the slider to move a distance of (x5+x6) / 2-x7 to the right to move the slider object into the area to be matched.

[0322] After the sliding object is moved into the area to be matched, the client application, terminal application, or browser corresponding to the verification page determines whether the verification passes based on the positional relationship between the sliding object and the gap object. If the verification passes, other pages provided by the corresponding application, such as the homepage or other application pages, can be displayed.

[0323] If the verification fails, a message indicating that the verification failed can be returned, and the image of the verification area can be reloaded so that the sliding object can be moved again for verification.

[0324] As can be seen from the above, in this embodiment, the acquisition unit 301 acquires a first image and a second image containing a sliding object, as well as the control position information of the sliding control in the first image, and the sliding object moves with the sliding control; the feature extraction unit 302 extracts features from the first image to obtain a feature image; the mapping unit 303 performs image mapping based on the first and second images to obtain a verification code region in the feature image, which contains the sliding object; the region determination unit 304 determines the object region of the sliding object in the verification code region of the feature image based on the control position information, and the candidate matching region in the verification code region corresponding to the sliding object; the region matching unit 305 matches the object region and the candidate matching region to determine the target matching region from the candidate matching region; and the verification unit 306 moves the sliding object to the target matching region. This scheme can determine the object region and the region to be matched on the verification page by the position of the sliding control, match the object region and the candidate matching region to determine the target matching region, and accurately move the sliding object to the target matching region, improving the verification pass rate for the sliding object; and it does not require designing a corresponding algorithm based on the shape of the sliding object to determine the movement position of the sliding object, thus having good versatility.

[0325] This application also provides a computer device, which can be a terminal or a server, such as... Figure 12 As shown, it illustrates a structural schematic diagram of the computer device involved in the embodiments of this application, specifically:

[0326] The computer device may include components such as a processor 1001 with one or more processing cores, a memory 1002 with one or more computer-readable storage media, a power supply 1003, and an input unit 1004. Those skilled in the art will understand that... Figure 12The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0327] The processor 1001 is the control center of the computer device. It connects various parts of the computer device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 1002, and by calling data stored in the memory 1002, it performs various functions of the computer device and processes data, thereby performing overall detection of the computer device. Optionally, the processor 1001 may include one or more processing cores; preferably, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1001.

[0328] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1002 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.

[0329] The computer equipment also includes a power supply 1003 that supplies power to the various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1003 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0330] The computer device may also include an input unit 1004, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0331] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 1001 in the computer device loads the executable files corresponding to the processes of one or more application programs into the memory 1002 according to the following instructions, and the processor 1001 runs the application programs stored in the memory 1002 to realize various functions, as follows:

[0332] Obtain a first image and a second image containing the sliding object, as well as the position information of the control in the first image. The sliding object moves following the sliding control.

[0333] Feature extraction is performed on the first image to obtain a feature image;

[0334] Image mapping is performed based on the first image and the second image to obtain the CAPTCHA region in the feature image, which contains the sliding object.

[0335] Based on the control position information, determine the object region of the sliding object in the CAPTCHA region of the feature image, and the candidate matching region in the CAPTCHA region corresponding to the sliding object region;

[0336] The target region to be matched is determined from the candidate regions by matching the object region with the candidate regions to be matched.

[0337] Move the sliding object to the target matching area to validate the sliding object.

[0338] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0339] As can be seen from the above, the embodiments of this application obtain a first image and a second image containing a sliding object, as well as the control position information in the first image, and the sliding object moves with the sliding control; feature extraction is performed on the first image to obtain a feature image; image mapping is performed based on the first and second images to obtain a verification code region in the feature image, the verification code region containing the sliding object; based on the control position information, the object region of the sliding object in the verification code region of the feature image, and the candidate matching region corresponding to the object region in the verification code region; the object region and the region to be matched are matched to determine the target matching region from the candidate matching region, and the sliding object is moved to the target matching region. This scheme can determine the object region and the candidate matching region of the verification page by the control position of the sliding control, and the target matching region can be determined by matching the object region and the candidate matching region, thus improving the verification pass rate for sliding objects; and it does not require designing a corresponding algorithm based on the shape of the sliding object to determine the movement position of the sliding object, and has good versatility.

[0340] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations of the above embodiments.

[0341] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by a computer program, or by a computer program controlling related hardware. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0342] Therefore, embodiments of this application provide a storage medium storing a computer program that can be loaded by a processor to execute the steps of any of the data processing methods provided in embodiments of this application.

[0343] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0344] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0345] Since the computer program stored in the storage medium can execute the steps of any of the data processing methods provided in the embodiments of this application, the beneficial effects that any of the data processing methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0346] The data processing method, apparatus, computer equipment, and storage medium provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A data processing method, characterized in that, include: A first image and a second image containing a sliding object are obtained, along with the control position information of the sliding control in the first image. The sliding object moves following the sliding control. The second image is an image of the verification page, and the second image and the first image are images of the verification page when the sliding control is in different control positions. Feature extraction is performed on the first image to obtain a feature image; Image mapping is performed based on the first image and the second image to obtain the verification code region in the feature image, and the verification code region contains the sliding object; Based on the control position information, the object region of the sliding object in the verification code region of the feature image is determined, as well as the candidate matching region corresponding to the object region in the verification code region; The target matching region is determined from the candidate matching regions by matching the object region with the candidate matching regions; The sliding object is moved to the target matching area to verify the sliding object.

2. The method according to claim 1, characterized in that, The sliding control in the first image is in its initial position. The step of obtaining the first and second images containing the sliding object, and the control position information of the sliding control in the first image, includes: Obtain the first image and the sliding control image; The sliding control image is matched with the first image to determine the control position information of the sliding control in the first image at its initial position; Move the sliding control from the initial position to the target position to obtain the second image.

3. The method according to claim 1, characterized in that, Moving the sliding object to the target matching area includes: The sliding speed of the sliding object is determined based on a preset sliding strategy; Control the sliding control to move the slider to the target matching area at the sliding speed.

4. The method according to claim 2, characterized in that, The target matching area includes area location information, the target location includes target control location information, and moving the sliding object into the target matching area includes: Based on the regional location information of the target matching area and the target control location information of the target location, the sliding direction and sliding distance of the sliding object are determined; The sliding control moves the sliding object by the sliding distance in the sliding direction, so as to move the sliding object into the target matching area.

5. The method according to claim 1, characterized in that, The step of performing image mapping based on the first image and the second image to obtain the verification code region in the feature image includes: Background removal processing is performed on the first image and the second image to obtain target region information; Image mapping processing is performed based on the target region information to obtain the CAPTCHA region of the feature image.

6. The method according to claim 5, characterized in that, The step of performing background removal processing on the first image and the second image to obtain target region information includes: A subtraction operation is performed on the first image and the second image to obtain a target difference image between the first image and the second image, wherein the target difference image includes multiple contour regions; Obtain the target contour region in the target difference image whose contour region is greater than a preset threshold; The target region information is determined based on the target contour region.

7. The method according to claim 6, characterized in that, The step of performing image subtraction on the first image and the second image to obtain a target difference image between the first image and the second image includes: Perform image subtraction on the first image and the second image to obtain an initial difference image between the first image and the second image; The cropping position information of the initial difference image is determined based on the control position information; The initial difference image is cropped based on the cropping location information to obtain the target difference image.

8. The method according to claim 7, characterized in that, The step of cropping the initial difference image based on the cropping location information to obtain the target difference image includes: The initial difference image is cropped based on the cropping location information to obtain the cropped difference image; The cropped difference image is binarized to obtain a binarized image; The binarized image is denoised to obtain the target difference image.

9. The method according to any one of claims 1 to 8, characterized in that, The step of extracting features from the first image to obtain a feature image includes: The first image is converted to grayscale to obtain a grayscale image; Based on the image edge detection algorithm, the edge features of the grayscale image are extracted to obtain the feature image.

10. The method according to any one of claims 1 to 8, characterized in that, The step of matching the object region and the candidate matching regions, and determining the target matching region from the candidate matching regions, includes: According to the preset region acquisition strategy, obtain the region to be matched from the candidate matching regions; The object region is matched with the region to be matched by feature matching to obtain the matching value between the object region and the region to be matched; Based on the matching value, the target matching region is determined from the candidate matching regions.

11. The method according to claim 10, characterized in that, The candidate matching region includes multiple regions to be matched. The step of performing feature matching between the object region and the regions to be matched to obtain a matching value between the object region and the regions to be matched includes: The regions to be matched are matched one by one with the object region to obtain multiple matching values; Determining the target matching region from the candidate matching regions based on the matching value includes: The region to be matched corresponding to the largest matching value among the plurality of matching values ​​is determined as the target matching region.

12. A data processing apparatus, comprising: The acquisition unit is used to acquire a first image and a second image containing a sliding object, as well as control position information of a sliding control in the first image, wherein the sliding object moves following the sliding control; wherein the second image is an image of the verification page, and the second image and the first image are images of the verification page when the sliding control is in different control positions; The feature extraction unit is used to extract features from the first image to obtain a feature image; A mapping unit is used to perform image mapping on the first image and the second image to obtain a verification code region in the feature image, wherein the verification code region contains the sliding object; The region determination unit is used to determine, based on the control position information, the object region of the sliding object in the verification code region of the feature image, and the candidate matching region in the verification code region corresponding to the object region; A region matching unit is used to determine a target matching region from the candidate matching regions by matching the object region and the region to be matched. The verification unit is used to move the sliding object to the target matching area to verify the sliding object.

13. The apparatus according to claim 12, characterized in that, The acquisition unit includes a first acquisition subunit, a control matching subunit, and a second acquisition subunit; The first acquisition subunit is used to acquire the sliding control image and the first image; The control matching subunit is used to match the sliding control image with the first image to determine the control position information of the sliding control in the first image at its initial position; The second acquisition subunit is used to move the sliding control from the initial position to the target position to acquire the second image.

14. The apparatus according to claim 12, characterized in that, The feature extraction unit includes a transformation subunit and an edge feature extraction subunit; Conversion subunit: used to convert the first image to grayscale to obtain a grayscale image; Edge feature extraction subunit: used to extract edge features of grayscale images based on image edge detection algorithms to obtain feature images.

15. The apparatus according to claim 12, characterized in that, The mapping unit includes a background removal subunit and a mapping subunit; Background Removal Subunit: Used to perform background removal processing on the first image and the second image to obtain target region information; Mapping subunit: used to perform image mapping processing based on target region information to obtain the verification code region of the feature image.

16. The apparatus according to claim 12, characterized in that, The background removal subunit includes a calculation module, an acquisition module, and a determination module; The calculation module is used to perform subtraction operations on the first image and the second image to obtain a target difference image between the first image and the second image. The target difference image includes multiple contour regions. Acquisition module: used to acquire target contour regions in the target difference image whose contour regions are greater than a preset threshold; Determining module: Used to determine target region information based on the target contour region.

17. The apparatus according to claim 16, characterized in that, The operation module includes a subtraction operation submodule, a determination submodule, and a truncation submodule; Subtraction operation submodule: used to perform image subtraction operation on the first image and the second image to obtain the initial difference image between the first image and the second image; Determine the submodule: This module is used to determine the cropping position information of the initial difference image based on the control position information. The cropping submodule is used to crop the initial difference image based on the cropping location information to obtain the target difference image.

18. The apparatus according to claim 17, characterized in that, The truncation submodule includes a truncation component, a binarization component, and a noise reduction component; Cropping component: used to crop the initial difference image based on the cropping position information to obtain the cropped difference image; Binarization component: Used to binarize the cropped difference image to obtain a binary image; Denoising component: Used to denoise binarized images to obtain target difference images.

19. The apparatus according to claim 18, characterized in that, The matching unit includes a region acquisition subunit, a matching subunit, and a determination subunit; Region acquisition subunit: used to acquire the region to be matched from the candidate matching regions according to the preset region acquisition strategy; Matching subunit: used to perform feature matching between the object region and the region to be matched, and obtain the matching value between the object region and the region to be matched; Determine sub-unit: used to determine the target matching region from the candidate matching regions based on the matching value.

20. The apparatus according to any one of claims 12 to 19, characterized in that, The matching subunit includes a feature matching module, and the determination subunit includes a region determination module; Feature matching module: Used to perform feature matching between each region to be matched and the target region to obtain multiple matching values; Region determination module: used to determine the candidate location information corresponding to the largest matching value among multiple matching values ​​as the region location information.

21. The apparatus according to any one of claims 12 to 19, characterized in that, The verification unit includes a velocity determination subunit and a movement subunit; Speed ​​determination subunit: used to determine the sliding speed of the sliding object based on a preset sliding strategy; The moving sub-unit is used to control the sliding control to move the sliding object to the target matching area at the sliding speed.

22. The apparatus according to claim 21, characterized in that, The area matching unit includes a movement information determination subunit and a movement subunit; Motion information determination subunit: used to determine the sliding distance and sliding direction based on the positional relationship between the area location information and the target location; The moving sub-unit is used to control the sliding object to move a sliding distance in the sliding direction according to the area location information, so as to move the sliding object to the area to be matched.

23. A computer device, characterized in that, It includes a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to perform the automatic verification method for sliding object movement as described in any one of claims 1 to 11.

24. A storage medium, characterized in that, The storage medium is used to store a computer program, which is loaded by a processor to execute the automatic verification method for sliding object movement as described in any one of claims 1 to 11.

25. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium; the processor of the computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the automatic verification method for the movement of a sliding object as described in any one of claims 1 to 11.