Click blocking method and device, electronic device, and storage medium

By determining the region to be matched before the Android application is launched and identifying the target disabled region based on template matching, the method solves the problems of low click blocking efficiency and user operation blockage in the existing technology, and achieves a balance between efficient click blocking and normal operation.

CN115934021BActive Publication Date: 2026-01-23WEBANK (CHINA)
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211647211.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-21
Publication Date
2026-01-23
Estimated Expiration
2042-12-21

AI Technical Summary

Technical Problem

Existing technologies are inefficient at identifying and blocking clickable elements in Android applications, and blocking clicks via hooking techniques can disrupt normal user operations.

Method used

By sending the display resolution to the terminal before the application is launched, the area to be matched is determined, and the target disabled area is identified based on the template matching results. Click blocking is only performed when the click location is within the target disabled area, thus avoiding the use of HOOK technology.

Benefits of technology

It improves the efficiency of click blocking, ensuring that users can use other application functions normally. It reduces the amount of computation for image matching, is universal, and is suitable for click event blocking in Android apps and nested Webviews.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115934021B_ABST
    Figure CN115934021B_ABST
Patent Text Reader

Abstract

The application provides a click blocking method and device, an electronic device and a storage medium. The method comprises the following steps: when an application is started, sending a display resolution of the application to a terminal, wherein a pixel width of the application when the application is displayed is a preset pixel width, and a pixel height of the application when the application is displayed is determined according to a terminal resolution and the preset pixel width; determining a to-be-matched region of the application when the application is displayed according to the pixel width of the application when the application is displayed, the pixel height of the application when the application is displayed and vertex coordinates of a pre-disabled region; when the application is started, determining a target disabled region of the application based on a template matching result between the to-be-matched region and the pre-disabled region; and when it is determined that a click position is in the target disabled region, performing click blocking. The method can solve the problem of how to improve the efficiency of click blocking for a remote Android application while guaranteeing normal operation of a user.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to a click blocking technology of an Android application, in particular to a click blocking method and device, an electronic device and a storage medium. BACKGROUND

[0002] Android is a free and open-source operating system based on the Linux kernel (not including GNU components), mainly used in mobile devices such as smartphones and tablets. Android application refers to an application program used based on the Android system. In the use of the Android application, sometimes the clicks on the application need to be blocked to ensure the normal use of the application.

[0003] The current way of blocking clicks is to modify the element click event through the HOOK technology (dynamic insertion technology), so as to achieve click blocking. The key to blocking clicks on the application is how to identify the click element and achieve click blocking without blocking the normal operation of the user. In terms of how to identify the click element of the remote Android application, the existing technology obtains the path xpath of the element based on the automatic test framework such as Appium to achieve the effect of identification, or uses the image recognition method to locate the click element. However, this method of identifying the click element needs to be matched many times to identify the click element, which is low in efficiency, and thus causes low efficiency of click blocking. In terms of implementing click blocking, the existing technology uses the HOOK technology to block clicks, which causes the application to be unable to normally use other functions and has the problem of blocking the normal operation of the user.

[0004] Therefore, how to improve the efficiency of click blocking for the remote Android application while ensuring the normal operation of the user is still a problem to be considered. SUMMARY

[0005] The present application provides a click blocking method, device, electronic device and storage medium to solve the problem of how to improve the efficiency of click blocking for the remote Android application while ensuring the normal operation of the user.

[0006] In one aspect, the present application provides a click blocking method, comprising:

[0007] Before the application is started, the display resolution of the application is sent to the terminal, wherein the pixel width of the application display is a preset pixel width, and the pixel height of the application display is determined according to the terminal resolution and the preset pixel width;

[0008] Determine a to-be-matched region according to a pixel width when the application is displayed, a pixel height when the application is displayed, and a vertex coordinate of the pre-disabled region, determine a target disabled region of the application based on a template matching result between the to-be-matched region and the pre-disabled region when the application is started, and perform click blocking when it is determined that the click position is in the target disabled region.

[0009] In one embodiment, the method further includes:

[0010] Obtain a template image, each pixel point in the template image having a pixel value;

[0011] Segment the template image based on a first direction to obtain a first image and a second image, and segment the template image based on a second direction to obtain a third image and a fourth image, wherein the first direction and the second direction are perpendicular to each other;

[0012] Determine a first feature pixel point in the first image, a second feature pixel point in the second image, a third feature pixel point in the third image, and a fourth feature pixel point in the fourth image based on a pixel value of each pixel point in the first image, the second image, the third image, and the fourth image, respectively;

[0013] Based on the first feature pixel point, the second feature pixel point, the third feature pixel point, and the fourth feature pixel point, an initial pre-disabled region is constructed;

[0014] Determine a vertex coordinate of the pre-disabled region according to the initial pre-disabled region, a preset pixel width, and a preset pixel height.

[0015] In one embodiment, the determination of the vertex coordinate of the pre-disabled region according to the initial pre-disabled region, the preset pixel width, and the preset pixel height includes:

[0016] Construct a simulated terminal interface according to the preset pixel width and the preset pixel height;

[0017] Select one pixel point in the simulated terminal interface as a first reference pixel point, select one pixel point in the initial pre-disabled region as a first fixed pixel point, and make the first fixed pixel point coincide with the first reference pixel point to obtain an image region in the simulated terminal interface covered by the initial pre-disabled region;

[0018] When a plurality of pixel points in the simulated terminal interface are updated to the first reference pixel point and a lower right vertex of the initial pre-disabled region coincides with a lower right vertex of the simulated terminal interface, N image regions are obtained;

[0019] obtaining a sum of squares of pixel differences between each of the N image regions and the initial pre-disabled region, to obtain N sum of squares values, wherein the sum of squares of pixel differences is determined according to pixel value differences between two pixels at the same relative position in each pair of the image region and the initial pre-disabled region, and is a sum of squares of the pixel value differences of each pair of pixels;

[0020] obtaining a minimum value in the N sum of squares values, taking the Lth image region corresponding to the minimum value as the pre-disabled region, and obtaining vertex coordinates of the Lth image region as vertex coordinates of the pre-disabled region.

[0021] In one embodiment, the determining of the to-be-matched region according to the pixel width when the application is displayed, the pixel height when the application is displayed, and the vertex coordinates of the pre-disabled region comprises:

[0022] determining the top-left vertex coordinates of the to-be-matched region according to the pixel width when the application is displayed, the pixel height when the application is displayed, the preset pixel height, and the top-left vertex coordinates of the pre-disabled region;

[0023] determining the top-right vertex coordinates of the to-be-matched region according to the pixel width when the application is displayed, the pixel height when the application is displayed, the preset pixel height, and the top-right vertex coordinates of the pre-disabled region;

[0024] determining the bottom-left vertex coordinates of the to-be-matched region according to the pixel width when the application is displayed, the pixel height when the application is displayed, the preset pixel height, and the bottom-left vertex coordinates of the pre-disabled region;

[0025] determining the bottom-right vertex coordinates of the to-be-matched region according to the pixel width when the application is displayed, the pixel height when the application is displayed, the preset pixel height, and the bottom-right vertex coordinates of the pre-disabled region;

[0026] constructing the to-be-matched region when the application is displayed based on the top-left vertex coordinates of the to-be-matched region, the top-right vertex coordinates of the to-be-matched region, the bottom-left vertex coordinates of the to-be-matched region, and the bottom-right vertex coordinates of the to-be-matched region.

[0027] In one embodiment, the determining of the first feature pixel point in the first image, the second feature pixel point in the second image, the third feature pixel point in the third image, and the fourth feature pixel point in the fourth image based on pixel values of each pixel point in the first image, the second image, the third image, and the fourth image respectively comprises:

[0028] for each pixel point in the first image, obtaining a pixel difference value determined based on a pixel value of the pixel point and pixel values of a plurality of adjacent pixel points, and taking a pixel point with a maximum absolute value of the pixel difference value in the first image as the first feature pixel point;

[0029] For each pixel point in the second image, a pixel difference value determined based on a pixel value of the pixel point and pixel values of a plurality of adjacent pixel points is obtained, and a pixel point with a maximum absolute value of the pixel difference value in the second image is taken as a second feature pixel point;

[0030] For each pixel point in the third image, a pixel difference value determined based on a pixel value of the pixel point and pixel values of a plurality of adjacent pixel points is obtained, and a pixel point with a maximum absolute value of the pixel difference value in the third image is taken as a third feature pixel point;

[0031] For each pixel point in the fourth image, a pixel difference value determined based on a pixel value of the pixel point and pixel values of a plurality of adjacent pixel points is obtained, and a pixel point with a maximum absolute value of the pixel difference value in the fourth image is taken as a fourth feature pixel point.

[0032] In one embodiment, the obtaining of the pixel difference value determined based on the pixel value of the pixel point and the pixel values of the plurality of adjacent pixel points comprises:

[0033] determining the pixel difference value corresponding to the pixel point according to the pixel value of the pixel point, the pixel values of the plurality of adjacent pixel points, and the number of the adjacent pixel points.

[0034] In one embodiment, the determining of the target disabled region to be applied based on the template matching result between the to-be-matched region and the pre-disabled region comprises:

[0035] matching a region with a minimum pixel difference value between the to-be-matched region and the pre-disabled region to obtain an initial target disabled region;

[0036] expanding the initial target disabled region according to a predetermined expansion value to obtain the target disabled region to be applied.

[0037] In one embodiment, before the expanding of the initial target disabled region according to the predetermined expansion value to obtain the target disabled region to be applied, the method further comprises:

[0038] determining a first horizontal expansion value according to a difference between a maximum horizontal coordinate value in the template image and a maximum horizontal coordinate value in the initial pre-disabled region;

[0039] determining a second horizontal expansion value according to a difference between a minimum horizontal coordinate value in the initial pre-disabled region and a minimum horizontal coordinate value in the template image;

[0040] determining a first vertical expansion value according to a difference between a minimum vertical coordinate value in the template image and a minimum vertical coordinate value in the initial pre-disabled region;

[0041] determining a second longitudinal expansion value according to a difference between a maximum longitudinal coordinate value in the initial pre-inhibition region and a minimum longitudinal coordinate value in the template image;

[0042] the expanding the initial target inhibition region according to the initial target inhibition region and the predetermined expansion value to obtain the applied target inhibition region includes:

[0043] expanding the initial target inhibition region according to the first lateral expansion value, the second lateral expansion value, the first longitudinal expansion value and the second longitudinal expansion value to obtain the applied target inhibition region.

[0044] In one embodiment, the matching a region with a minimum pixel difference value between the pre-inhibition region from the to-be-matched region as the initial target inhibition region includes:

[0045] selecting one pixel point in the to-be-matched region as a second reference pixel point, and selecting one pixel point in the pre-inhibition region as a second fixed pixel point, and superimposing the second fixed pixel point and the second reference pixel point to obtain one image region in the to-be-matched region covered by the pre-inhibition region;

[0046] when a plurality of pixel points in the to-be-matched region are updated as the second reference pixel point, the lower right vertex of the pre-inhibition region coincides with the lower right vertex of the to-be-matched region, M image regions are obtained;

[0047] obtaining a sum of squares of pixel differences between each image region in the M image regions and the pre-inhibition region to obtain M sum of squares values, wherein the sum of squares of pixel differences is determined according to a pixel value difference between each pair of two pixel points in the image region and the initial pre-inhibition region in the same relative position, and is a sum of square values of the pixel value difference of each pair of pixel points;

[0048] obtaining a minimum value in the M sum of squares values, and the Pth image region corresponding to the minimum value is the initial target inhibition region.

[0049] On the other hand, the application provides a click blocking device, comprising:

[0050] The communication module is configured to send the display resolution of the application to the terminal before the application is started, wherein the pixel width when the application is displayed in the display resolution of the application is a preset pixel width, and the pixel height when the application is displayed is determined according to the terminal resolution and the preset pixel width.

[0051] The processing module is configured to determine a to-be-matched region according to a pixel width when the application is displayed, a pixel height when the application is displayed, and a vertex coordinate of the pre-banned region, and determine a target banned region of the application based on a template matching result between the to-be-matched region and the pre-banned region when the application is started. The blocking module is configured to perform click blocking when it is determined that the click position is in the target banned region.

[0052] In another aspect, the present application provides an electronic device, comprising: a processor, and a memory connected to the processor in communication;

[0053] The memory stores computer execution instructions.

[0054] The processor executes the computer execution instructions stored in the memory to implement the click blocking method according to the first aspect.

[0055] In another aspect, the present application provides a computer readable storage medium, which stores computer execution instructions, and when the instructions are executed, the computer executes the click blocking method according to the first aspect.

[0056] In another aspect, the present application provides a computer program product, which comprises a computer program, and when the computer program is executed by a processor, the click blocking method according to the first aspect is implemented.

[0057] The click blocking method provided by the embodiments of the present application first sends display parameters (including a pixel width and a pixel height when the application is displayed) of the application to the terminal when performing click blocking, and unifies the display standards of the application. Then, the initial target banned region of the application when displayed is determined according to the pre-banned region, and the target banned region of the application when displayed is obtained by expanding the initial target banned region. When the user clicks the interface of the application, the terminal sends the information of the click position to the server in real time, and click blocking is performed when it is determined that the click position is in the target banned region. The click blocking method provided by the embodiments of the present application does not need to implement click blocking through the hook technology, but determines the target banned region of the application when displayed through the image matching method, and then determines whether to perform click blocking according to whether the click position is in the target banned region. Therefore, the normal use of other functions of the application is not blocked throughout the process, and only the click is blocked, which ensures that the user can normally use the application when click blocking.

[0058] In addition, according to the pixel width when the application is displayed, the pixel height when the application is displayed, and the vertex coordinates of the pre-disabled area, a to-be-matched area when the application is displayed is determined, and when the application is opened, a region with the smallest pixel difference between the pre-disabled area and the to-be-matched area is matched as an initial target disabled area. Compared with the traditional method of identifying the clicked element, the method provided in the embodiment only needs to perform image matching between the pre-disabled area and the to-be-matched area, does not need to perform image matching on the full interface of the application, greatly reduces the operation amount of image matching, and improves the efficiency of the click blocking for the remote Android application.

[0059] In addition, whether it is for the bottom layer of the Android APP or the nested Webview, the click blocking method provided in the embodiment can realize the blocking of the click event based on the communication blocking of the H5 side, and has universality. BRIEF DESCRIPTION OF DRAWINGS

[0060] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the specification, serve to explain the principles of the present disclosure.

[0061] Figure 1 An application scenario diagram of the click blocking method provided in the present application;

[0062] Figure 2 A flowchart of the click blocking method provided in an embodiment of the present application;

[0063] Figure 3 A schematic diagram of the interaction between the server and the front end provided in an embodiment of the present application;

[0064] Figure 4 A cutting schematic diagram of a template image provided in an embodiment of the present application;

[0065] Figure 5 A confirmation schematic diagram of the pixel difference of a pixel point in a first image provided in an embodiment of the present application;

[0066] Figure 6 A template matching schematic diagram between the initial pre-disabled area and the simulated terminal interface provided in an embodiment of the present application;

[0067] Figure 7 A schematic diagram of determining the target disabled area of the application provided in an embodiment of the present application;

[0068] Figure 8 A schematic diagram of a click blocking device provided in an embodiment of the present application;

[0069] Figure 9 A schematic diagram of an electronic device provided in an embodiment of the present application.

[0070] The specific embodiments of the present disclosure have been shown by the above-described drawings, and will be described in more detail hereinafter. These drawings and written descriptions are not intended to limit the scope of the concept of the present disclosure in any way, but to illustrate the concept of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0071] The exemplary embodiments will be described in detail herein with reference to the accompanying drawings. In the following description, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments are not representative of all embodiments consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0072] In the description of the present application, it should be understood that the terms "first", "second" are used only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise specifically limited.

[0073] First, the terms related to the present application are explained:

[0074] Hook: dynamic instrumentation technology, which can insert code into the memory space of the original Android application, dynamically monitor or modify the behavior of the Android application.

[0075] Template matching: a method for searching and finding the position of a template image in a larger image. The basic principle is to calculate the matching degree of the template image and the overlapping sub-image from left to right and from top to bottom in the image to be detected. The greater the matching degree, the greater the possibility of the two being the same.

[0076] In the use of Android applications (Application, APP for short), sometimes it is necessary to block the clicks on the application to ensure the normal use of the application. The key to blocking the clicks on the application is how to identify the click elements and implement click blocking without blocking the normal operation of the user.

[0077] Since the mode of the Android application is C / S architecture, it is not possible to inject js into the element click event to achieve blocking as in the B / S architecture of the web application. Therefore, there are few ways to achieve click blocking for third-party apps on the market, and currently only the element click event can be modified by using the hook technology to achieve click blocking.

[0078] In the aspect of how to identify the click element of the remote Android application, the existing technology obtains the path xpath of the element based on the automation test framework such as Appium to achieve the identification effect, or positions the click element based on the image recognition method. However, this method of identifying the click element needs to be matched many times to identify the click element, which is low in efficiency, and thus causes low efficiency of the click blocking. In the aspect of implementing the click blocking, the existing technology uses the hook technology to perform the click blocking, which causes that the application cannot be normally used for other functions, and has the problem of blocking the normal operation of the user.

[0079] Therefore, the click blocking method, device, electronic equipment and storage medium are provided. The click blocking method comprises the following steps: when an application is started, sending a display resolution of the application to a terminal, wherein a pixel width when the application is displayed is a preset pixel width, and a pixel height when the application is displayed is determined according to a terminal resolution and the preset pixel width; determining a to-be-matched region when the application is displayed according to the pixel width when the application is displayed, the pixel height when the application is displayed and vertex coordinates of a pre-disabled region; when the application is started, determining a target disabled region of the application based on a template matching result between the to-be-matched region and the pre-disabled region; and when a click position is in the target disabled region, performing click blocking.

[0080] That is, when the click blocking is performed, the click blocking is not implemented by using the hook technology, but the target disabled region of the application when the application is displayed on the terminal is determined by using the image matching method, and then it is determined whether the click blocking is performed according to whether the click position is in the target disabled region. Therefore, the normal use of other functions of the application is not blocked throughout the process, and only the click is blocked, so that the user can normally use the application during the click blocking. In addition, the to-be-matched region when the application is displayed is determined according to the pixel width when the application is displayed, the pixel height when the application is displayed and the vertex coordinates of the pre-disabled region, and the target disabled region of the application is determined based on the template matching result between the to-be-matched region and the pre-disabled region when the application is started. Compared with the traditional method of identifying the click element, the image matching is not performed on the whole interface of the application, the operation amount of the image matching is greatly reduced, and the efficiency of the click blocking for the remote Android application is improved.

[0081] The click blocking method provided in the application is applied to an electronic equipment such as a computer, a server for supporting the running of an Android system and the like. Figure 1 For the application of the click blocking method provided in the application, in the figure, the electronic equipment sends the display resolution of the application to a terminal equipment (such as a mobile phone), including the pixel width and the pixel height when the application is displayed. Then, the to-be-matched region when the application is displayed is determined based on the pixel width when the application is displayed, the pixel height and the vertex coordinates of the pre-disabled region. The to-be-matched region is, for example, Figure 1A rectangular region identified by the middle A region. When the application is opened, the target disabled region of the application is determined based on the template matching result between the to-be-matched region and the pre-disabled region, and the target disabled region is determined as Figure 1 A rectangular region identified by the middle B region. When it is determined according to the click position feedback of the terminal that the click position is in the target disabled region, click blocking is performed.

[0082] Please refer to Figure 2 An embodiment of the present application provides a click blocking method applied to a server, comprising the following steps:

[0083] In S210, before the application is opened, the display resolution of the application is sent to the terminal, wherein the pixel width when the application is displayed is a preset pixel width, and the pixel height when the application is displayed is determined according to the terminal resolution and the preset pixel width.

[0084] As shown in Figure 3 The server transmits image data of an Android page to an H5 front end based on a Websocket connection to provide remote access of an H5 to an Android system. By listening to an OnTouch event of the H5 front end, click, scroll and input events of a user on the page are transmitted to the Android system to realize remote operation of the Android system.

[0085] Different terminal devices (mobile phones) of different users have different resolutions, for example, some users use terminal devices with a resolution of 720x1280, and some users use terminal devices with a resolution of 600x1020. Although the resolutions of the application on different terminal devices are different, the positions of the click elements when the application is displayed are relatively close. At this time, the pixel width when the application is displayed can be fixed, and the pixel height when the application is displayed can be determined according to the resolution of the terminal device.

[0086] For example, the pixel width when the application is displayed output to the terminal device is fixed as 720 (W), and the resolution of the terminal device is 600x1020, so that the pixel height when the application is displayed obtained after conversion is 1224 (W). The display resolution of the application output to the terminal is 720x1224.

[0087] In S220, according to the pixel width when the application is displayed, the pixel height when the application is displayed and the vertex coordinates of the pre-disabled region, the to-be-matched region when the application is displayed is determined, and when the application is opened, the target disabled region of the application is determined based on the template matching result between the to-be-matched region and the pre-disabled region.

[0088] In the conventional scheme, when determining the disabled area of an application by template matching, all the images displayed by the application need to be traversed to determine the disabled area. The closer the template image is to the image area in the overlaid application display image, the more likely the overlaid image area is a disabled area. The finally determined disabled area is the image area that is closest to the template image among all the overlaid image areas.

[0089] In the conventional scheme, when performing template matching, the starting coordinate in the horizontal direction is the pixel point at the top-left corner of the application display image as the first pixel point to be traversed. Then the pixel points in the application display image are traversed in the order of from top to bottom and from left to right until the template image is located at the bottom-right corner of the application display image, i.e., the bottom-right corner coordinate of the template image coincides with the bottom-right corner coordinate of the application display image.

[0090] Suppose the resolution of the application display image is W x H = 720 x 1280 and the resolution of the template image is w x h = 48 x 48. At this time, the comparison times of the template image in the horizontal direction is W - w + 1 = 673 and the comparison times in the vertical direction is H - h + 1 = 1233, and the total comparison times is 673 x 1233 = 829809. It can be seen that the times of the conventional scheme in matching the disabled area is very large and the efficiency is very low.

[0091] In the embodiment, before the application is started, the to-be-matched area when the application is displayed is determined according to the pixel width when the application is displayed, the pixel height when the application is displayed and the vertex coordinates of the pre-disabled area. The target disabled area of the application is determined based on the to-be-matched area when the application is started or after the application is started. That is, in the offline state, the to-be-matched area when the application is displayed is determined first, and in the online state, the target disabled area of the application is determined based on the to-be-matched area when the application is used by the user. In the offline state, the user is not faced and there is no problem of large matching workload when the user uses the application.

[0092] The following describes in detail how to construct the pre-disabled area and determine the vertex coordinates of the pre-disabled area in the offline state.

[0093] The pre-disabled area is a simulated constructed area that is intended to be disabled. In the construction, an arbitrary image is acquired and a template image is constructed based on the arbitrary image, and the resolution of the template image is 48 x 48. That is, a region with a pixel width of 48 (W) and a pixel height of 48 (W) is taken from the arbitrary image to obtain the template image. Since the pixel value of each pixel point in the arbitrary image is known, each pixel point in the template image constructed based on the arbitrary image has a pixel value. The coordinate of each pixel point in the template image is (x, y). The coordinates of the top-left corner of the template image include x min , x max, y min , y max .

[0094] As shown in Figure 4 , the first direction and the second direction are perpendicular to each other, the first direction can be considered as the vertical direction, and the second direction is the horizontal direction. The template image is divided based on the first direction to obtain a first image a1 and a second image a2, and the template image b1 is divided based on the second direction to obtain a third image and a fourth image b2.

[0095] Then, based on the pixel value of each pixel point in the first image, the second image, the third image and the fourth image respectively, the first feature pixel point in the first image, the second feature pixel point in the second image, the third feature pixel point in the third image and the fourth feature pixel point in the fourth image are determined. Specifically, for each pixel point in the first image, the pixel difference value determined based on the pixel value of the pixel point and the pixel value of a plurality of adjacent pixel points is obtained, and the pixel point with the maximum absolute value of the pixel difference value in the first image is taken as the first feature pixel point. For each pixel point in the second image, the pixel difference value determined based on the pixel value of the pixel point and the pixel value of a plurality of adjacent pixel points is obtained, and the pixel point with the maximum absolute value of the pixel difference value in the second image is taken as the second feature pixel point. For each pixel point in the third image, the pixel difference value determined based on the pixel value of the pixel point and the pixel value of a plurality of adjacent pixel points is obtained, and the pixel point with the maximum absolute value of the pixel difference value in the third image is taken as the third feature pixel point. For each pixel point in the fourth image, the pixel difference value determined based on the pixel value of the pixel point and the pixel value of a plurality of adjacent pixel points is obtained, and the pixel point with the maximum absolute value of the pixel difference value in the fourth image is taken as the fourth feature pixel point.

[0096] The determination of the feature pixel point is described by taking the first image as an example. As shown in Figure 5 (a) is the pixel value of each pixel point in the first image, Figure 5 (b) is a schematic diagram of the position of each pixel point in the first image. When determining the pixel difference value corresponding to the pixel point, the pixel value of the pixel point, the pixel value of a plurality of adjacent pixel points and the number of adjacent pixel points are determined. Taking P5 as an example, when determining the pixel difference value corresponding to the pixel point, the pixel difference value corresponding to P5 is (P2+P4+P6+P8)-n×P5= (10+10+10+40)-4×10=30. In the formula, n is equal to the number of adjacent pixel points, such as when determining the pixel difference value corresponding to P9, n is equal to 3. As shown in Figure 5 (c), after determining the pixel difference value corresponding to each pixel point in the first image, the pixel point with the maximum absolute value of the pixel difference value is taken as the first feature pixel point, and the pixel point with the maximum absolute value of the pixel difference value in the first image is P9, so P9 is taken as the first feature pixel point.

[0097] The same method can be used to determine the second feature pixel point of the second image, the third feature pixel point of the third image, and the fourth feature pixel point of the fourth image.

[0098] In an optional embodiment, for the first image, the second image, the third image, or the fourth image, when the maximum pixel difference absolute value in the image is 0, the bisection method is continued to be used for operation until a result with a maximum pixel difference absolute value not being 0 is obtained. When the maximum pixel difference absolute value in the image is 0, it is proved that the image does not include a feature pixel point, and then the other half of the image is cut again, until the two half images obtained by cutting both include feature pixel points.

[0099] For example, when the maximum pixel difference absolute value in the first image is 0, i.e., the first image does not include a feature pixel point, the second image is cut in half to obtain two images after the second image is cut in half. If both of the two images include feature pixel points (the maximum pixel difference absolute value is not 0), the first feature pixel point and the second feature pixel point are obtained. If one of the two images does not include a feature pixel point, the other image of the two images is cut in half until the two images obtained by cutting both include feature pixel points.

[0100] After the first feature pixel point, the second feature pixel point, the third feature pixel point, and the fourth feature pixel point are obtained, an initial pre-ban area is constructed based on the first feature pixel point, the second feature pixel point, the third feature pixel point, and the fourth feature pixel point.

[0101] In an optional embodiment, when the initial pre-ban area is constructed, the first feature pixel point, the second feature pixel point, the third feature pixel point, and the fourth feature pixel point need to be compared and processed, and the initial pre-ban area is constructed based on the four feature pixel points after the comparison and processing.

[0102] Specifically, the first direction is the vertical direction (cutting the template image in half along the vertical direction), the maximum value coordinate p max-left of the first feature element point in the horizontal direction is obtained, and the maximum value coordinate p max-right of the second feature element point in the horizontal direction is obtained. When p max-left > p max-right , p max-left = p max-right , i.e., the maximum coordinate value p max-left of the second feature element point in the vertical direction is increased. When p max-right > p max-left , p max-left = p max-right , i.e., the maximum coordinate value pmax-right .

[0103] Similarly, the second direction is the horizontal direction (cutting the template image in half along the horizontal direction), and the maximum coordinate p max-top of the fourth feature element point in the vertical direction is obtained max-bottom When p max-top >p max-bottom , p max-top =p max-bottom , that is, the maximum coordinate value of the fourth feature element point in the vertical direction is increased to p max-top . When p max-bottom >p max-top , p max-top =p max-bottom , that is, the maximum coordinate value of the third feature element point in the vertical direction is increased to p max-bottom .

[0104] After determining the coordinates of the first feature pixel point, the coordinates of the second feature pixel point, the coordinates of the third feature pixel point, and the coordinates of the fourth feature pixel point after comparison processing, the four vertices of the initial pre-inhibition region obtained are: p key-left-top =(p max-left .x, p max-top .y), p key-left-bottom =(p max-left .x, p max-bottom .y), p key-right-top =(p max-right .x, p max-top .y), and p key-right-bottom =(p max-right .x, p max-bottom .y).

[0105] In an optional embodiment, after the initial pre-inhibition region is constructed and the vertex coordinates of the initial pre-inhibition region are obtained, the predetermined expansion value described below can be determined. As described above, the vertex coordinates of the template image are x min , x max , y min , and y max . d left =p key-left-top , x-x min , d right =x max -p key-right-top , x, d top =p key-right-top , y-y max , d bottom =y min -p key-right-top ·y. dleft is a first lateral expansion value, d right is a second lateral expansion value, d top is a first longitudinal expansion value, d bottom is a second longitudinal expansion value.

[0106] After the initial pre-ban area is constructed and the vertex coordinates of the initial pre-ban area are obtained, the vertex coordinates of the pre-ban area are determined according to the initial pre-ban area, the preset pixel width and the preset pixel height.

[0107] Specifically, a simulation terminal interface is first constructed according to the preset pixel width (720) and the preset pixel height (1280), and the resolution of the simulation terminal interface is 720x1280. It is assumed that the size of the initial pre-ban area constructed is 20x20.

[0108] When the pre-ban area is determined in the offline state, a pixel point in the simulation terminal interface is selected as a first reference pixel point, and a pixel point in the initial pre-ban area is selected as a first fixed pixel point. The first fixed pixel point is overlapped with the first reference pixel point to obtain an image area in the simulation terminal interface covered by the initial pre-ban area.

[0109] As shown in (a), the top-left vertex pixel point in the simulation terminal interface is selected as the first reference pixel point, and the top-left vertex pixel point in the initial pre-ban area is selected as the first fixed pixel point to obtain an image area in the simulation terminal interface covered by the initial pre-ban area. When a plurality of pixel points in the simulation terminal interface are updated as the first reference pixel point, the bottom-right vertex of the initial pre-ban area coincides with the bottom-right vertex of the simulation terminal interface (as shown in (b)), N image areas are obtained. At this time, the initial pre-ban area has covered all the image areas in the simulation terminal interface. Figure 6 Figure 6 (b) shows).

[0110] The sum of squares of pixel differences between each of the N image areas and the initial pre-ban area is obtained to obtain N sum of squares values. The sum of squares of pixel differences is determined according to the pixel value difference between each pair of two pixel points in the image area and the initial pre-ban area at the same relative position, and is the sum of the square values of the pixel value differences of each pair of pixel points. As described above, the size of the initial pre-ban area is 20x20, so there are 400 pixel value differences, and a sum of squares value is obtained based on the 400 pixel value differences.

[0111] ​That is, assuming that the image matrix in the simulation terminal interface is T(x', y'), the image matrix of the initial pre-inhibited area is I(x, y), when comparing the initial pre-inhibited area and the simulation terminal interface, a comparison matrix R(x, y) is generated. Comparing N image areas as described above, the comparison matrix R(x, y) includes N values, each of which is a sum of squares value, each sum of squares value is calculated based on 400 pixel difference values. That is, R(x, y) = ∑ x′,y′ (T(x', y') - I(x + x', y + y')) 2 , wherein I(x + x', y + y') refers to the image matrix of the initial pre-inhibited area when the image area is covered, and T(x', y') is the image matrix of the image area covered by the initial pre-inhibited area.

[0112] The minimum value in the N sum of squares values is obtained, and the Lth image area corresponding to the minimum value is the pre-inhibited area, and the vertex coordinates of the Lth image area are obtained as the vertex coordinates of the pre-inhibited area. That is, each value in the R(x, y) matrix is traversed to obtain the minimum value, and the Lth image area corresponding to the minimum value is the pre-inhibited area. The minimum value is the value closest to 0, and the closer the minimum value is to 0, the higher the similarity between the Lth image area and the initial pre-inhibited area, and therefore the Lth image area corresponding to the minimum value is the pre-inhibited area.

[0113] Assuming that the coordinate value of the top left vertex of the Lth image area is (100, 500), the coordinate values of the four vertices of the pre-inhibited area are determined according to (x offline ,y offline ) corresponding to the minimum value and the coordinate values of the four vertices of the Lth image area. Assuming that (x offline ,y offline ) is infinitely close to 0, then the coordinate values of the four vertices of the pre-inhibited area are p left-top = (100, 500), p right-top = (120, 500), p left-bottom = (100, 480), and p right-bottom = (120, 480).

[0114] The above is a detailed description of how to construct a pre-inhibited area and determine the vertex coordinates of the pre-inhibited area in an offline state. The following describes in detail how to determine the to-be-matched area M when the application is displayed.

[0115] According to the pixel width when the application is displayed, the pixel height when the application is displayed, and the vertex coordinates of the pre-inhibited area, the to-be-matched area when the application is displayed is determined. Specifically, p left-top , p right-top , p left-bottomp right-bottom The coordinates of the four vertices of the region M to be matched are determined as follows:

[0116] Where w refers to the pixel width when the application is displayed, which is also the preset pixel width, and can be 720. h refers to the pixel height when the application is displayed, which is determined based on the terminal resolution and the preset pixel width, such as h = 1224 in the example above. p left-top (x) refers to p left-top The x-coordinate in p left-top (y) refers to p left-top The ordinate in p. right-top (x) refers to p right-top The x-coordinate in p right-top (y) refers to p right-top The ordinate in p. left-bottom (x) refers to p left-botto The x-coordinate in p left-bottom (y) refers to p left-bottom The ordinate in p. right-bottom (x refers to p) right-bottom The x-coordinate in p right-bottom (y) refers to p right-bottom The vertical coordinate in the diagram.

[0117] The obtained region M to be matched is as follows Figure 7 (a) The rectangular area marked by region A.

[0118] The following section provides a detailed description of how to determine the target disabled region for an application based on the region to be matched.

[0119] When the application starts (when the application page loads), it is based on the region to be matched and the pre-disabled region (such as...). Figure 7 The template matching results between the rectangular area identified by region C in the middle determine the target disabled area of ​​the application (such as...). Figure 7 (a) The rectangular area marked by region B.

[0120] Specifically, the region with the smallest pixel difference between the region to be matched and the pre-disabled region is selected as the initial target disabled region. Similar to the method for determining the vertex coordinates of the pre-disabled region, template matching is also used to determine the initial target disabled region.

[0121] A pixel point in the to-be-matched region is selected as a second reference pixel point, and a pixel point in the pre-disabled region is selected as a second fixed pixel point, the second fixed pixel point is overlapped with the second reference pixel point, and an image region in the to-be-matched region covered by the pre-disabled region is obtained. The second reference pixel point is, for example, the top-left vertex of the to-be-matched region, and the second fixed pixel point is, for example, the top-left vertex of the pre-disabled region. When the two top-left vertices are overlapped, as shown in Figure 7 (b).

[0122] When the bottom-right vertex of the pre-disabled region is overlapped with the bottom-right vertex of the to-be-matched region, M image regions are obtained. The pixel points in the to-be-matched region can be traversed in the order from top to bottom and then from left to right, until the bottom-right vertex of the pre-disabled region is overlapped with the bottom-right vertex of the to-be-matched region, as shown in Figure 7 (c).

[0123] The sum of squares of pixel differences between each image region and the pre-disabled region is obtained, and M sum of squares are obtained. The sum of squares of pixel differences is determined according to the pixel value difference between each pair of two pixel points in the same relative position in the image region and the initial pre-disabled region, and is the sum of squares of the pixel value difference of each pair of pixel points. The minimum value in the M sum of squares is obtained, and the Pth image region corresponding to the minimum value is the initial target disabled region.

[0124] That is, assuming that the image matrix in the to-be-matched region is T(x', y'), and the image matrix of the pre-disabled region is I(x, y), when the pre-disabled region and the to-be-matched region are compared, a comparison matrix R(x, y) is generated. As described above, the comparison of M image regions is performed, and the comparison matrix R(x, y) includes M values, each of which is the value of a sum of squares. That is, R(x, y)=∑ x′,y′ (T(x', y')-I(x+x', y+y')) 2 where I(x+x', y+y') refers to the image matrix of the pre-disabled region when the image region is covered, and T(x', y') is the image matrix of the image region covered by the pre-disabled region.

[0125] The minimum value in the M square sum values is obtained, and the Pth image region corresponding to the minimum value is the pre-disabled region. The vertex coordinates of the Pth image region are obtained as the vertex coordinates of the initial target disabled region. That is, each value in the R(x, y) matrix is traversed, and the minimum value is obtained. The Lth image region corresponding to the minimum value is the initial target disabled region. The minimum value is the value closest to 0. The closer the minimum value is to 0, the higher the similarity between the Pth image region and the pre-disabled region. Therefore, the Pth image region corresponding to the minimum value is the initial target disabled region.

[0126] At this time, since the template region is between the pre-disabled region and the to-be-matched region, the area of the to-be-matched region is much smaller than the area of the application display image. Compared with the traditional scheme, the number of matching times is also reduced when matching, and therefore the efficiency of template matching can be improved. For example, if the application display resolution is 720x1224 and the initial pre-disabled region size is 20x20, the experimental determination of the number of comparison times of the template matching of the application page loading (after the application is started) is 1600, which is much lower than the 829,809 times in the traditional scheme.

[0127] Suppose the coordinate value of the top-left vertex of the Pth image region is (100, 600). According to the (x offline ,y offline ) corresponding to the minimum value and the coordinate values of the four vertices of the Pth image region, the coordinate values of the four vertices of the initial target disabled region are determined. Suppose (x offline ,y offline ) is infinitely close to 0, then in the coordinate values of the four vertices of the initial target disabled region, p′ left-top =(100, 600), p′ right-top =(120, 600), p′ left-bottom =(100, 580), and p′ right-bottom =(120, 580).

[0128] After the initial target disabled region is determined, the initial target disabled region is expanded according to the initial target disabled region and the predetermined expansion value, and the target disabled region of the application (such as the rectangular region identified by the B region in (d)) is obtained. Figure 7 Figure 7 The identification of the B region in (a) is only to indicate in advance the target disabled region to be finally obtained, and does not mean that the range of the target disabled region has been known after the to-be-matched region is determined.

[0129] Specifically, the predetermined expansion value includes a first horizontal expansion value, a second horizontal expansion value, a third horizontal expansion value, and a fourth horizontal expansion value.

[0130] ​The first lateral expansion value is determined based on the difference between the maximum horizontal coordinate value in the template image and the maximum horizontal coordinate value in the initial pre-disabled region. left =p key-left-top ,xx min d left This is the first lateral expansion value.

[0131] The second lateral expansion value, d, is determined based on the difference between the minimum abscissa value in the initial pre-disabled region and the minimum abscissa value in the template image. right =x max -p key-right-top ,x,d right This is the second lateral expansion value.

[0132] The first vertical expansion value is determined based on the difference between the minimum ordinate value in the template image and the minimum ordinate value in the initial pre-disabled region. top =p key-right-top yy max d top This is the first longitudinal expansion value.

[0133] The second vertical expansion value is determined based on the difference between the maximum ordinate value in the initial pre-disabled region and the minimum ordinate value in the template image. bottom =y min -p key-right-top ·y,d bottom This is the second longitudinal expansion value.

[0134] When expanding the initial target restricted area based on the initial target restricted area and the predetermined expansion value to obtain the target restricted area of ​​the application, the initial target restricted area is actually expanded based on the first horizontal expansion value, the second horizontal expansion value, the first vertical expansion value, and the second vertical expansion value to obtain the target restricted area of ​​the application.

[0135] The coordinates of the four vertices of the initial target disabled region are p′. left-top

[0136] (100, 600), p′ right-top = (120, 600), p′ left-bottom = (100, 580), p′ right-bottom = (120, 580). Therefore, the final vertex coordinates of the target restricted region are: p′ disable-left-top =(100-d) left 600-d top ), p′ disable-right-top =(120)

[0137] d right, 600-d top ), p' diable-left-bottom = (100-d left , 620+d bottom ), p' disbale-right-bottom = (120+d right , 620+d bottom ).

[0138] S230, when it is determined that the click position is in the target disabled area, performing click blocking.

[0139] After adding the OnTouch event listener of the front end H5, the click position when the user clicks the application page can be obtained.

[0140] For example, the click position is p, and it is judged whether p is in the range of p' disable-left-top , p' disbale-right-top , p' disbale-left-bottom , p' disable-right-bottom . If p' disbale-left-top ·x≤p.x≤p' disable-right-top .x, and p' disable-left-top .y≤p.y≤p' disable-right-bottom ·y, it is determined that the click position is in the target disabled area, and click blocking is performed.

[0141] To sum up, the click blocking method provided in the embodiment comprises: when an application is started, the display resolution of the application is sent to a terminal, in the display resolution of the application, the pixel width when the application is displayed is a preset pixel width, and the pixel height when the application is displayed is determined according to the terminal resolution and the preset pixel width; according to the pixel width when the application is displayed, the pixel height when the application is displayed, and the vertex coordinates of the pre-disabled area, the to-be-matched area when the application is displayed is determined, when the application is started, the target disabled area of the application is determined based on the template matching result between the to-be-matched area and the pre-disabled area; when it is determined that the click position is in the target disabled area, click blocking is performed.

[0142] That is, when performing click blocking, the click blocking does not need to be realized by the hook technology, but the target disabled area of the application when displayed on the terminal is determined in advance by image matching, and then it is determined whether to perform click blocking according to whether the click position is in the target disabled area. Therefore, the normal use of other functions of the application is not blocked throughout the process, and only the click is blocked, which ensures that the user can normally use the application when the click is blocked. In addition, according to the pixel width when the application is displayed, the pixel height when the application is displayed, and the vertex coordinates of the pre-disabled area, the to-be-matched area when the application is displayed is determined, and when the application is started, the target disabled area of the application is determined based on the template matching result between the to-be-matched area and the pre-disabled area. Compared with the traditional method of identifying click elements, image matching is not needed on the full interface of the application, which greatly reduces the operation amount of image matching and improves the efficiency of click blocking for remote Android applications.

[0143] In addition, whether it is for the underlying of the Android APP or the nested Webview, the click blocking method provided by the embodiment can realize the blocking of the click event based on the communication blocking of the H5 side, and has universality.

[0144] Please refer to Figure 8 One embodiment of the present application also provides a click blocking device 10, comprising:

[0145] The communication module 11 is configured to send the display resolution of the application to the terminal before the application is started, wherein the pixel width when the application is displayed is a preset pixel width, and the pixel height when the application is displayed is determined according to the terminal resolution and the preset pixel width.

[0146] The processing module 12 is configured to determine the to-be-matched area when the application is displayed according to the pixel width when the application is displayed, the pixel height when the application is displayed, and the vertex coordinates of the pre-disabled area, and determine the target disabled area of the application based on the template matching result between the to-be-matched area and the pre-disabled area when the application is started.

[0147] The blocking module 13 is configured to perform click blocking when it is determined that the click position is in the target disabled area.

[0148] The processing module 12 is also configured to obtain a template image, each pixel point of the template image having a pixel value; segment the template image based on a first direction to obtain a first image and a second image, and segment the template image based on a second direction to obtain a third image and a fourth image, wherein the first direction and the second direction are perpendicular to each other; determine a first feature pixel point in the first image, a second feature pixel point in the second image, a third feature pixel point in the third image, and a fourth feature pixel point in the fourth image based on the pixel value of each pixel point in the first image, the second image, the third image, and the fourth image respectively; construct an initial pre-ban area based on the first feature pixel point, the second feature pixel point, the third feature pixel point, and the fourth feature pixel point; and determine the vertex coordinates of the pre-ban area according to the initial pre-ban area, a preset pixel width, and a preset pixel height.

[0149] The processing module 12 is specifically configured to: construct a simulated terminal interface according to the preset pixel width and the preset pixel height; select a pixel point in the simulated terminal interface as a first reference pixel point, and select a pixel point in the initial pre-ban area as a first fixed pixel point, overlap the first fixed pixel point and the first reference pixel point to obtain an image area in the simulated terminal interface covered by the initial pre-ban area; when a plurality of pixel points in the simulated terminal interface are updated to the first reference pixel point, the lower right vertex of the initial pre-ban area coincides with the lower right vertex of the simulated terminal interface, N image areas are obtained; obtain a sum of squares of pixel differences between each image area in the N image areas and the initial pre-ban area to obtain N sum of squares, wherein the sum of squares of pixel differences is determined according to the pixel value difference between each pair of pixel points in the image area and the initial pre-ban area that are at the same relative position, and is the sum of the square values of the pixel value difference of each pair of pixel points; obtain the minimum value in the N sum of squares, and take the Lth image area corresponding to the minimum value as the pre-ban area, and obtain the vertex coordinates of the Lth image area as the vertex coordinates of the pre-ban area.

[0150] The processing module 12 is specifically configured to determine the top-left vertex coordinate of the to-be-matched region according to the pixel width during application display, the pixel height during application display, the preset pixel height, and the top-left vertex coordinate of the pre-disabled region; determine the top-right vertex coordinate of the to-be-matched region according to the pixel width during application display, the pixel height during application display, the preset pixel height, and the top-right vertex coordinate of the pre-disabled region; determine the bottom-left vertex coordinate of the to-be-matched region according to the pixel width during application display, the pixel height during application display, the preset pixel height, and the bottom-left vertex coordinate of the pre-disabled region; determine the bottom-right vertex coordinate of the to-be-matched region according to the pixel width during application display, the pixel height during application display, the preset pixel height, and the bottom-right vertex coordinate of the pre-disabled region; and construct the to-be-matched region during application display based on the top-left vertex coordinate of the to-be-matched region, the top-right vertex coordinate of the to-be-matched region, the bottom-left vertex coordinate of the to-be-matched region, and the bottom-right vertex coordinate of the to-be-matched region.

[0151] The processing module 12 is specifically configured to, for each pixel point in the first image, acquire a pixel difference value determined based on a pixel value of the pixel point and pixel values of a plurality of adjacent pixel points, and take a pixel point with a maximum absolute value of the pixel difference value in the first image as a first feature pixel point; for each pixel point in the second image, acquire a pixel difference value determined based on a pixel value of the pixel point and pixel values of a plurality of adjacent pixel points, and take a pixel point with a maximum absolute value of the pixel difference value in the second image as a second feature pixel point; for each pixel point in the third image, acquire a pixel difference value determined based on a pixel value of the pixel point and pixel values of a plurality of adjacent pixel points, and take a pixel point with a maximum absolute value of the pixel difference value in the third image as a third feature pixel point; and for each pixel point in the fourth image, acquire a pixel difference value determined based on a pixel value of the pixel point and pixel values of a plurality of adjacent pixel points, and take a pixel point with a maximum absolute value of the pixel difference value in the fourth image as a fourth feature pixel point.

[0152] The processing module 12 is specifically configured to determine the pixel difference value corresponding to the pixel point according to the pixel value of the pixel point, the pixel values of the plurality of adjacent pixel points, and the number of the adjacent pixel points.

[0153] The processing module 12 is specifically configured to match a region with a minimum pixel difference value between the to-be-matched region and the pre-disabled region from the to-be-matched region as an initial target disabled region; and expand the initial target disabled region according to a predetermined expansion value, to obtain the target disabled region of the application.

[0154] The processing module 12 is further configured to determine a first horizontal expansion value according to a difference between a maximum horizontal coordinate value in the template image and a maximum horizontal coordinate value in the initial pre-ban region; determine a second horizontal expansion value according to a difference between a minimum horizontal coordinate value in the initial pre-ban region and a minimum horizontal coordinate value in the template image; determine a first vertical expansion value according to a difference between a minimum vertical coordinate value in the template image and a minimum vertical coordinate value in the initial pre-ban region; and determine a second vertical expansion value according to a difference between a maximum vertical coordinate value in the initial pre-ban region and a minimum vertical coordinate value in the template image. The processing module 12 is specifically configured to expand the initial target ban region according to the first horizontal expansion value, the second horizontal expansion value, the first vertical expansion value and the second vertical expansion value to obtain the applied target ban region.

[0155] The processing module 12 is specifically configured to select a pixel point in the to-be-matched region as a second reference pixel point, and select a pixel point in the pre-ban region as a second fixed pixel point, and superimpose the second fixed pixel point and the second reference pixel point to obtain an image region in the to-be-matched region covered by the pre-ban region; when a plurality of pixel points in the to-be-matched region are updated as the second reference pixel point, and a lower right vertex of the pre-ban region coincides with a lower right vertex of the to-be-matched region, M image regions are obtained; obtain a sum of squares of pixel differences between each of the M image regions and the pre-ban region to obtain M sum of squares values, wherein the sum of squares of pixel differences is determined according to a pixel value difference between each pair of two pixel points in the image region and the initial pre-ban region in the same relative position, and is a sum of square values of the pixel value difference of each pair of pixel points; and obtain a minimum value in the M sum of squares values, and take a Pth image region corresponding to the minimum value as the initial target ban region.

[0156] See Figure 9 The application further provides an electronic device 20, which comprises a processor 21 and a memory 22 connected with the processor 21. The memory 22 stores computer execution instructions, and the processor 21 executes the computer execution instructions stored in the memory to implement the click blocking method provided in any one of the above embodiments.

[0157] The application further provides a computer readable storage medium, which stores computer execution instructions, and when the instructions are executed, the computer execution instructions are executed by the processor to implement the click blocking method provided in any one of the above embodiments.

[0158] The application further provides a computer program product, which comprises a computer program, and when the computer program is executed by the processor, the click blocking method provided in any one of the above embodiments is implemented.

[0159] It should be noted that the computer readable storage medium above can be a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Ferromagnetic Random Access Memory (FRAM), a Flash Memory, a magnetic surface memory, an optical disc, or a Compact Disc Read-Only Memory (CD-ROM) memory, etc. It can also be various electronic devices including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.

[0160] It should be noted that in this paper, the term "include", "contain" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.

[0161] The above sequence number of the embodiments of the present application is only for description, not representing the advantages and disadvantages of the embodiments.

[0162] Through the above description of the embodiments, those skilled in the art can clearly understand that the above embodiment method can be realized by software plus the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disc, optical disc) and includes a plurality of instructions for making a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the methods described in various embodiments of the present application.

[0163] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks. Figure 1 one or more flow or blocks.

[0164] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks. Figure 1 one or more flow or blocks.

[0165] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks. Figure 1 one or more flow or blocks.

[0166] The above merely provides the preferred embodiment of the present application, and is not intended to limit the patent scope of the present application, and any equivalent structure or equivalent flow transformation according to the content of the present application specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A click blocking method, characterized in that, Applied to servers, including: Before the application is launched, the application's display resolution is sent to the terminal. In the application's display resolution, the pixel width when the application is displayed is a preset pixel width, and the pixel height when the application is displayed is determined according to the terminal resolution and the preset pixel width. Obtain a template image, wherein each pixel in the template image has a pixel value; The template image is segmented based on a first direction to obtain a first image and a second image, and the template image is segmented based on a second direction to obtain a third image and a fourth image, wherein the first direction and the second direction are perpendicular to each other; Based on the pixel value of each pixel in the first image, the second feature pixel in the second image, the third feature pixel in the third image, and the fourth feature pixel in the fourth image, respectively, determine the first feature pixel in the first image, the second feature pixel in the second image, the third feature pixel in the third image, and the fourth feature pixel in the fourth image. Based on the first feature pixel, the second feature pixel, the third feature pixel, and the fourth feature pixel, an initial pre-disabled region is constructed; The vertex coordinates of the pre-disabled region are determined based on the initial pre-disabled region, the preset pixel width, and the preset pixel height. Before the application is launched, the area to be matched when the application is displayed is determined based on the pixel width and pixel height when the application is displayed and the vertex coordinates of the pre-disabled area. When the application is launched, the target disabled area of ​​the application is determined based on the template matching result between the area to be matched and the pre-disabled area. When it is determined that the click position is within the target disabled area, the click is blocked.

2. The method according to claim 1, characterized in that, The step of determining the vertex coordinates of the pre-disabled region based on the initial pre-disabled region, the preset pixel width, and the preset pixel height includes: A simulated terminal interface is constructed based on the preset pixel width and preset pixel height; A pixel in the simulated terminal interface is selected as a first reference pixel, and a pixel in the initial pre-disabled area is selected as a first fixed pixel. The first fixed pixel is overlapped with the first reference pixel to obtain an image area in the simulated terminal interface covered by the initial pre-disabled area. When multiple pixels in the simulated terminal interface are updated to the first reference pixel, and the lower right vertex of the initial pre-disabled region coincides with the lower right vertex of the simulated terminal interface, N image regions are obtained. Obtain the sum of squares of the pixel differences between each of the N image regions and the initial pre-disabled region, resulting in N sums of squares. The sum of squares of the pixel differences is determined based on the pixel value difference between each pair of pixels in the same relative position in the image region and the initial pre-disabled region, and is the sum of the squares of the pixel value differences between each pair of pixels. Obtain the minimum value among the N sums of squares, and take the Lth image region corresponding to the minimum value as the pre-disabled region. Obtain the vertex coordinates of the Lth image region as the vertex coordinates of the pre-disabled region.

3. The method according to claim 2, characterized in that, The step of determining the region to be matched when the application is displayed, based on the pixel width, pixel height, and vertex coordinates of the pre-disabled region, includes: The coordinates of the top left vertex of the region to be matched are determined based on the pixel width when the application is displayed, the pixel height when the application is displayed, the preset pixel height, and the coordinates of the top left vertex of the pre-disabled region. The coordinates of the upper right vertex of the region to be matched are determined based on the pixel width when the application is displayed, the pixel height when the application is displayed, the preset pixel height, and the coordinates of the upper right vertex of the pre-disabled region. The coordinates of the lower left vertex of the region to be matched are determined based on the pixel width when the application is displayed, the pixel height when the application is displayed, the preset pixel height, and the coordinates of the lower left vertex of the pre-disabled region. The coordinates of the lower right vertex of the region to be matched are determined based on the pixel width when the application is displayed, the pixel height when the application is displayed, the preset pixel height, and the coordinates of the lower right vertex of the pre-disabled region. Based on the coordinates of the top left vertex, top right vertex, bottom left vertex, and bottom right vertex of the region to be matched, the region to be matched when displayed by the application is constructed.

4. The method according to claim 1, characterized in that, The step of determining the first feature pixel in the first image, the second feature pixel in the second image, the third feature pixel in the third image, and the fourth feature pixel in the fourth image based on the pixel value of each pixel in the first image, the second image, the third image, and the fourth image respectively includes: For each pixel in the first image, obtain the pixel difference determined by the pixel value of this pixel and the pixel values ​​of multiple neighboring pixels, and take the pixel with the largest absolute value of the pixel difference in the first image as the first feature pixel. For each pixel in the second image, obtain the pixel difference determined by the pixel value of this pixel and the pixel values ​​of multiple neighboring pixels, and take the pixel with the largest absolute value of the pixel difference in the second image as the second feature pixel. For each pixel in the third image, obtain the pixel difference determined by the pixel value of this pixel and the pixel values ​​of multiple neighboring pixels, and take the pixel with the largest absolute value of the pixel difference in the third image as the third feature pixel. For each pixel in the fourth image, obtain the pixel difference determined by the pixel value of this pixel and the pixel values ​​of multiple neighboring pixels, and take the pixel with the largest absolute value of the pixel difference in the fourth image as the fourth feature pixel.

5. The method according to claim 4, characterized in that, The step of obtaining the pixel difference determined based on the pixel value of this pixel and the pixel values ​​of multiple neighboring pixels includes: The pixel difference corresponding to this pixel is determined based on the pixel value of this pixel, the pixel values ​​of multiple adjacent pixels, and the number of adjacent pixels.

6. The method according to claim 1, characterized in that, The target disabled region for the application is determined based on the template matching result between the region to be matched and the pre-disabled region, including: The region with the smallest pixel difference between the region to be matched and the pre-disabled region is the initial target disabled region. The initial target disabled region is expanded based on the initial target disabled region and a predetermined expansion value to obtain the applied target disabled region.

7. The method according to claim 6, characterized in that, Before expanding the initial target disabled region based on the initial target disabled region and a predetermined expansion value to obtain the applied target disabled region, the method further includes: The first horizontal expansion value is determined based on the difference between the maximum horizontal coordinate value in the template image and the maximum horizontal coordinate value in the initial pre-disabled region; The second horizontal expansion value is determined based on the difference between the minimum horizontal coordinate value in the initial pre-disabled region and the minimum horizontal coordinate value in the template image; The first vertical expansion value is determined based on the difference between the minimum ordinate value in the template image and the minimum ordinate value in the initial pre-disabled region; The second vertical expansion value is determined based on the difference between the maximum ordinate value in the initial pre-disabled region and the minimum ordinate value in the template image; The step of expanding the initial target disabled region based on the initial target disabled region and a predetermined expansion value to obtain the applied target disabled region includes: Based on the first horizontal expansion value, the second horizontal expansion value, the first vertical expansion value, and the second vertical expansion value, the initial target disabled region is expanded to obtain the applied target disabled region.

8. The method according to claim 6 or 7, characterized in that, The step of selecting the region with the smallest pixel difference between the region to be matched and the pre-disabled region as the initial target disabled region includes: A pixel in the region to be matched is selected as a second reference pixel, and a pixel in the pre-disabled region is selected as a second fixed pixel. The second fixed pixel is overlapped with the second reference pixel to obtain an image region in the region to be matched covered by the pre-disabled region. When multiple pixels in the region to be matched are updated to second reference pixels, and the lower right vertex of the pre-disabled region coincides with the lower right vertex of the region to be matched, M image regions are obtained. Obtain the sum of squares of the pixel differences between each of the M image regions and the pre-disabled region, resulting in M ​​sums of squares. The sum of squares of the pixel differences is determined based on the pixel value difference between each pair of two pixels in the same relative position in the image region and the initial pre-disabled region, and is the sum of the squares of the pixel value differences between each pair of pixels. Find the minimum value among the M sums of squares, and use the Pth image region corresponding to the minimum value as the initial target disabled region.

9. A click blocking device, characterized in that, include: The communication module is used to send the display resolution of the application to the terminal before the application is started. In the display resolution of the application, the pixel width when the application is displayed is a preset pixel width, and the pixel height when the application is displayed is determined according to the terminal resolution and the preset pixel width. The processing module is used to determine the region to be matched when the application is displayed based on the pixel width and pixel height when the application is displayed and the vertex coordinates of the pre-disabled region before the application is started. When the application is started, the target disabled region of the application is determined based on the template matching result between the region to be matched and the pre-disabled region. The blocking module is used to block clicks when the click location is determined to be within the target disabled area; The processing module is further configured to: acquire a template image, wherein each pixel in the template image has a pixel value; The template image is segmented according to a first direction to obtain a first image and a second image, and the template image is segmented according to a second direction to obtain a third image and a fourth image, wherein the first direction and the second direction are perpendicular to each other; based on the pixel value of each pixel in the first image, the second feature pixel in the second image, the third feature pixel in the third image, and the fourth feature pixel in the fourth image, respectively, a first feature pixel in the first image, a second feature pixel in the second image, a third feature pixel in the third image, and a fourth feature pixel in the fourth image are determined; based on the first feature pixel, the second feature pixel, the third feature pixel, and the fourth feature pixel, an initial pre-disabled region is constructed; the vertex coordinates of the pre-disabled region are determined according to the initial pre-disabled region, a preset pixel width, and a preset pixel height.

10. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the click blocking method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed, cause the computer to perform the click blocking method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Resolution adaptation method of client storage medium and terminal

    CN110765384A

  • Operation key identification method and device, equipment and medium

    CN113221912A

  • Trigger instruction interception method and device

    CN113590011A