Method for intercepting popup window in software, computer equipment and computer readable storage medium

By responding to pop-up window creation instructions in the Windows system and matching pop-up window feature information, the problems of inefficient and insufficient accuracy of advertising pop-up window blocking in the existing technology are solved, and efficient and accurate pop-up window recognition and interception are achieved, improving user experience.

CN119988763APending Publication Date: 2025-05-13CHENGDU LUYI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411978147.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In the prior art, the advertising pop-up blocking method in Windows system is inefficient and insufficiently accurate, resulting in low user experience.

Method used

By responding to the software's pop-up window creation instructions, determine the handle of the target pop-up window, and obtain pop-up feature information based on the handle. Match these feature information with the local or cloud-based interceptable pop-up window feature set. If the match is successful, execute the preset pop-up blocking strategy.

Benefits of technology

It realizes efficient and accurate identification and intercept of advertising pop-ups in Windows systems, improves user experience, and reduces false blocking of pop-ups.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988763A_ABST
    Figure CN119988763A_ABST
Patent Text Reader

Abstract

The invention provides a method for intercepting a pop-up window in software, computer equipment and a computer readable storage medium, and the method comprises the following steps: in response to a pop-up window creation instruction for any software in a current system, determining a handle of a target pop-up window indicated to be created by the pop-up window creation instruction; determining popup window feature information of the target popup window based on the handle of the target popup window; determining an interceptable popup window feature set corresponding to the software in an interceptable popup window database of the current system; determining whether pre-stored feature information matched with the popup window feature information of the target popup window exists in an interceptable popup window feature set corresponding to the software or not; and if pre-stored feature information matched with the popup window feature information of the target popup window exists in the interceptable popup window feature set corresponding to the software, executing a preset popup window interception strategy to intercept the target popup window. According to the technical scheme, the identification and interception accuracy of the advertisement pop-up window can be effectively improved, and the negative influence of the appearance of the advertisement pop-up window on the normal software use behavior of a user is effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present application relates to the field of computer technology, and in particular to a method for intercepting pop-up windows within software, a computer device, and a computer-readable storage medium. [Background technology]

[0002] When users use software in Windows systems, they are often disturbed by pop-up ads, which distract users' attention. If they accidentally touch a pop-up ad, they may install unknown software. In short, pop-up ads bring a lot of unnecessary troubles to users' work and study.

[0003] In this regard, the related art proposes to set a window process whitelist. If the name of the process where the window is located is not in the whitelist, it means that the window may be an ad pop-up window. At this time, the window is blocked. However, there are many kinds of software that can be installed in the Windows system, and the number of possible window processes is difficult to calculate. Setting a window process whitelist is difficult to fully enumerate all safe processes other than the ad pop-up process of the Windows system, and it is easy to cause the window to be blocked by mistake, resulting in a poor user experience.

[0004] Therefore, how to efficiently and accurately block ad pop-ups in Windows systems has become a technical problem that needs to be solved urgently. [Summary of the invention]

[0005] The embodiments of the present application provide a method for intercepting pop-up windows within software, a computer device, and a computer-readable storage medium, aiming to solve the technical problems in the related art that the method for intercepting advertisement pop-up windows within the Windows system is inefficient and lacks accuracy.

[0006] In a first aspect, an embodiment of the present application provides a method for intercepting pop-up windows in software, comprising:

[0007] In response to a pop-up window creation instruction for any software in the current system, determining a handle of a target pop-up window created as instructed by the pop-up window creation instruction;

[0008] Determine pop-up window feature information of the target pop-up window based on the handle of the target pop-up window, wherein the pop-up window feature information includes multiple items of pop-up window size, pop-up window title, pop-up window class name, pop-up window visibility status, and pop-up window position;

[0009] Determine the interceptable pop-up window feature set corresponding to the software in the interceptable pop-up window database of the current system;

[0010] Determine whether there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software;

[0011] If there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software, a preset pop-up interception strategy is executed to intercept the target pop-up window.

[0012] In one embodiment of the present application, optionally, before the software is started, the method further includes:

[0013] An event hook is created through the SetEventWindowHook function in the user32.dll file of the software, and the event hook is used to intercept a pop-up window creation instruction of any software in the current system and send the handle of the target pop-up window obtained based on the pop-up window creation instruction to a pop-up window verification subprocess used to verify whether the target pop-up window is an advertisement pop-up window;

[0014] Then, in response to a pop-up window creation instruction for any software in the current system, determining a handle of a target pop-up window created as instructed by the pop-up window creation instruction includes:

[0015] Intercepting a pop-up window creation instruction of any software in the current system through the event hook and extracting a handle of the target pop-up window from the pop-up window creation instruction;

[0016] Before determining the pop-up window feature information of the target pop-up window based on the handle of the target pop-up window, the method further includes:

[0017] After establishing or searching the pop-up window verification subprocess through the event hook, the handle of the target pop-up window is sent to the pop-up window verification subprocess, so that the pop-up window verification subprocess can execute the step of determining the pop-up window feature information of the target pop-up window based on the handle of the target pop-up window.

[0018] In one embodiment of the present application, optionally, before responding to a pop-up window creation instruction for any software in the current system and determining a handle of a target pop-up window created as instructed by the pop-up window creation instruction, the method further includes:

[0019] Enumerate all installed software under the specified registry of the current system through the RegEnumKeyEx function, wherein the specified registry is the HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall registry;

[0020] The interceptable pop-up window feature set corresponding to each software in all the installed software in the interceptable pop-up window database in the cloud is synchronized to the interceptable pop-up window database of the current system.

[0021] In one embodiment of the present application, optionally, determining the interceptable pop-up window feature set corresponding to the software in the interceptable pop-up window database of the current system includes:

[0022] Searching the interceptable pop-up window database of the current system to see whether there is a set of interceptable pop-up window features corresponding to the software;

[0023] If the search result shows that the interceptable pop-up window feature set corresponding to the software does not exist in the interceptable pop-up window database of the current system, a pop-up window feature acquisition request for the software is sent to the cloud, so that the cloud can send the interceptable pop-up window feature set corresponding to the software in its own interceptable pop-up window database to the current system;

[0024] Receive a pop-up window interceptable feature set corresponding to the software provided by the cloud.

[0025] In one embodiment of the present application, optionally, it further includes:

[0026] If there is no pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up window feature set corresponding to the software, setting the target pop-up window as a pending pop-up window;

[0027] When the current system is in a manual recognition state, all pending pop-up windows to be manually recognized are redrawn through a WM_PAINT message;

[0028] In response to a user selection instruction for any pending pop-up window among all the pending pop-up windows, determining that the pending pop-up window targeted by the user selection instruction is a first pop-up window, and obtaining a handle of the first pop-up window;

[0029] Determining pop-up window feature information of the first pop-up window based on the handle of the first pop-up window;

[0030] The pop-up window feature information of the first pop-up window is stored in the interceptable pop-up window database of the current system.

[0031] In one embodiment of the present application, optionally, determining whether there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software includes:

[0032] Determine a second pop-up window having the same pop-up window class name and the same pop-up window visibility status as the target pop-up window in the interceptable pop-up window feature set corresponding to the software;

[0033] Determining a matching degree between the target pop-up window and the second pop-up window based on a pop-up window size, a pop-up window title, and a pop-up window position of the target pop-up window, and a pop-up window size, a pop-up window title, and a pop-up window position of the second pop-up window;

[0034] If the matching degree between the target pop-up window and the second pop-up window is greater than or equal to a preset matching threshold, it is determined that there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software.

[0035] In one embodiment of the present application, optionally, determining the degree of matching between the target pop-up window and the second pop-up window based on the pop-up window size, pop-up window title and pop-up window position of the target pop-up window, and the pop-up window size, pop-up window title and pop-up window position of the second pop-up window includes:

[0036] Based on the pop-up window size of the target pop-up window and the pop-up window size of the second pop-up window, determining the sum of the length ratio, width ratio and area ratio of the target pop-up window to the second pop-up window as the size similarity between the target pop-up window and the second pop-up window;

[0037] Determining the semantic similarity between the pop-up window title of the target pop-up window and the pop-up window title of the second pop-up window;

[0038] Determine the reciprocal of the distance between the pop-up window center points of the target pop-up window and the second pop-up window as the pop-up window position similarity between the target pop-up window and the second pop-up window;

[0039] The size similarity, the semantic similarity and the pop-up window position similarity are normalized and then weighted summed to obtain a matching degree between the target pop-up window and the second pop-up window.

[0040] In one embodiment of the present application, optionally, executing a preset pop-up window interception strategy to intercept the target pop-up window includes:

[0041] Sending a pop-up window closing message to the target pop-up window;

[0042] If the target pop-up window does not respond to the pop-up window closing message, sending a forced exit message to the target pop-up window;

[0043] If the target pop-up window does not respond to the forced exit message, create a third pop-up window, set the third pop-up window as the parent window of the target pop-up window, and send a pop-up window close message to the third pop-up window;

[0044] If the target pop-up window is not closed after the third pop-up window is closed in response to the pop-up window closing message, sending a hiding instruction to the target pop-up window;

[0045] If the target pop-up window does not respond to the hiding instruction, sending a moving instruction to the target pop-up window, wherein the moving instruction is used to change the pop-up window position of the target pop-up window to a position in the window of the current system that cannot be observed by the user;

[0046] If the target pop-up window does not respond to the move instruction, close the process where the target pop-up window is located.

[0047] In a second aspect, an embodiment of the present application provides a pop-up window interception device in software, comprising:

[0048] A handle determination unit, configured to determine, in response to a pop-up window creation instruction for any software in the current system, a handle of a target pop-up window created as instructed by the pop-up window creation instruction;

[0049] A pop-up window feature determination unit, configured to determine pop-up window feature information of the target pop-up window based on the handle of the target pop-up window, wherein the pop-up window feature information includes multiple items of pop-up window size, pop-up window title, pop-up window class name, pop-up window visible state, and pop-up window position;

[0050] A software corresponding feature set determining unit, configured to determine a pop-up window interceptable feature set corresponding to the software in a pop-up window interceptable database of the current system;

[0051] A feature verification unit, used to determine whether there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software;

[0052] The pop-up window interception unit is used to execute a preset pop-up window interception strategy to intercept the target pop-up window if there is pre-stored feature information matching the pop-up window feature information of the target pop-up window in the interceptable pop-up window feature set corresponding to the software.

[0053] In one embodiment of the present application, optionally, the device further includes:

[0054] A hook function creation unit, used for creating an event hook through the SetEventWindowHook function in the user32.dll file of the software before the software is started, wherein the event hook is used to intercept a pop-up window creation instruction of any software in the current system and send a handle of a target pop-up window obtained based on the pop-up window creation instruction to a pop-up window verification subprocess used for verifying whether the target pop-up window is an advertisement pop-up window;

[0055] Then the handle determination unit is specifically used to: intercept the pop-up window creation instruction of any software in the current system through the event hook and extract the handle of the target pop-up window in the pop-up window creation instruction;

[0056] The device also includes:

[0057] A handle transfer unit is used to send the handle of the target pop-up window to the pop-up window verification sub-process after establishing or searching the pop-up window verification sub-process through the event hook before the pop-up window feature determination unit determines the pop-up window feature information of the target pop-up window, so that the pop-up window feature determination unit can execute the step of determining the pop-up window feature information of the target pop-up window based on the handle of the target pop-up window in the pop-up window verification sub-process.

[0058] In one embodiment of the present application, optionally, the device further includes:

[0059] A local software enumeration unit, used for enumerating all installed software under a specified registry of the current system by using a RegEnumKeyEx function before the handle determination unit determines the handle of the target pop-up window created as instructed by the pop-up window creation instruction, wherein the specified registry is the HKEY_LOCAL_MAC HINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall registry;

[0060] The cloud data synchronization unit is used to synchronize the interceptable pop-up feature set corresponding to each software in all the installed software in the cloud interceptable pop-up database to the interceptable pop-up database of the current system.

[0061] In one embodiment of the present application, optionally, the software corresponding feature set determination unit is specifically used to: search whether there is an interceptable pop-up feature set corresponding to the software in the interceptable pop-up database of the current system; if the search result is that the interceptable pop-up feature set corresponding to the software does not exist in the interceptable pop-up database of the current system, send a pop-up feature acquisition request for the software to the cloud, so that the cloud can send the interceptable pop-up feature set corresponding to the software in its own interceptable pop-up database to the current system, and receive the interceptable pop-up feature set corresponding to the software provided by the cloud.

[0062] In one embodiment of the present application, optionally, the device further includes:

[0063] a mismatch processing unit, configured to set the target pop-up window as a pending pop-up window if there is no pre-stored feature information matching the pop-up window feature information of the target pop-up window in the interceptable pop-up window feature set corresponding to the software;

[0064] A pop-up window redrawing unit, used for redrawing all pending pop-up windows to be manually identified through a WM_PAINT message when the current system is in a manual identification state;

[0065] A first pop-up window determining unit, configured to respond to a user selection instruction for any pending pop-up window among all the pending pop-up windows and determine that the pending pop-up window targeted by the user selection instruction is a first pop-up window;

[0066] A local data update unit is used to obtain the handle of the first pop-up window, determine the pop-up window feature information of the first pop-up window based on the handle of the first pop-up window, and store the pop-up window feature information of the first pop-up window in the interceptable pop-up window database of the current system.

[0067] In one embodiment of the present application, optionally, the feature verification unit includes:

[0068] A second pop-up window determining unit is used to determine a second pop-up window having the same pop-up window class name and the same pop-up window visibility state as the target pop-up window in the interceptable pop-up window feature set corresponding to the software;

[0069] a matching degree calculation unit, configured to determine a matching degree between the target pop-up window and the second pop-up window based on a pop-up window size, a pop-up window title and a pop-up window position of the target pop-up window, and a pop-up window size, a pop-up window title and a pop-up window position of the second pop-up window;

[0070] A matching determination unit is used to determine whether there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software if the matching degree between the target pop-up window and the second pop-up window is greater than or equal to a preset matching threshold.

[0071] In one embodiment of the present application, optionally, the matching degree calculation unit is specifically used to: determine the sum of the length ratio, width ratio and area ratio of the target pop-up window and the second pop-up window based on the pop-up window size of the target pop-up window and the pop-up window size of the second pop-up window, as the size similarity between the target pop-up window and the second pop-up window; determine the semantic similarity between the pop-up window title of the target pop-up window and the pop-up window title of the second pop-up window; determine the inverse of the distance between the pop-up center points of the target pop-up window and the second pop-up window, as the pop-up window position similarity between the target pop-up window and the second pop-up window; normalize the size similarity, the semantic similarity and the pop-up window position similarity and then weighted sum them to obtain the matching degree between the target pop-up window and the second pop-up window.

[0072] In one embodiment of the present application, optionally, the pop-up window interception unit is used to: send a pop-up window close message to the target pop-up window; if the target pop-up window does not respond to the pop-up window close message, send a force exit message to the target pop-up window; if the target pop-up window does not respond to the force exit message, create a third pop-up window, set the third pop-up window as the parent window of the target pop-up window, and send a pop-up window close message to the third pop-up window; if the target pop-up window is not closed after the third pop-up window is closed in response to the pop-up window close message, send a hide instruction to the target pop-up window; if the target pop-up window does not respond to the hide instruction, send a move instruction to the target pop-up window, and the move instruction is used to change the pop-up window position of the target pop-up window to a position that cannot be observed by the user within the window of the current system; if the target pop-up window does not respond to the move instruction, close the process where the target pop-up window is located.

[0073] In a third aspect, an embodiment of the present application provides a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method described in the first aspect above.

[0074] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the method described in the first aspect above.

[0075] The above technical solution, in order to solve the technical problem that the advertisement pop-up interception method in the Windows system in the related art is inefficient and inaccurate, can intercept any window creation instruction in any software, and match the pop-up feature information corresponding to the handle shown in the window creation instruction with the locally stored interceptable pop-up feature set of the software to determine whether the target pop-up is an advertisement pop-up that needs to be intercepted. Specifically, any window creation instruction in any software can be intercepted through an event hook, and the handle of the target pop-up required to be created by the window creation instruction is sent to the pop-up verification subprocess through the event hook, and the pop-up verification subprocess matches the pop-up feature information corresponding to the handle with the locally stored interceptable pop-up feature set of the software. If the pre-stored feature information is matched in the interceptable pop-up feature set of the software, it means that the target pop-up is an advertisement pop-up that needs to be intercepted. At this time, a preset pop-up interception strategy can be adopted to intercept the target pop-up. Through the above technical solution, advertising pop-up recognition and interception can be uniformly implemented for all software in the Windows system, which improves the compatibility of advertising pop-up recognition and interception between different software. At the same time, by comparing and identifying the pop-up feature information of the pop-up window obtained through the handle, the accuracy of pop-up recognition can be effectively improved, thereby reducing the false interception of pop-up windows and effectively avoiding the negative impact of the appearance of advertising pop-up windows on users' normal software usage behavior.

Brief Description of the Drawings

[0076] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0077] Figure 1 A flowchart of a method for intercepting pop-up windows in software according to an embodiment of the present application is shown;

[0078] Figure 2 A schematic diagram of the operation of a hook module according to an embodiment of the present application is shown;

[0079] Figure 3 A block diagram of a computer device according to an embodiment of the present application is shown;

[0080] Figure 4 A block diagram of a computer device according to another embodiment of the present application is shown. [Specific implementation method]

[0081] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0082] Figure 1 A flowchart of a method for intercepting pop-up windows within software according to an embodiment of the present application is shown.

[0083] like Figure 1 As shown, according to an embodiment of the present application, a method for intercepting pop-up windows in software includes:

[0084] Step 102, in response to a pop-up window creation instruction for any software in the current system, determining a handle of a target pop-up window to be created as instructed by the pop-up window creation instruction.

[0085] The current system is a Windows system. The software is installed in the Windows system and displayed in the display interface of the Windows system. During the working process of the software, new windows will be opened. These new windows may be windows normally started by the user when using the software, or they may be advertising windows attached to the software. Therefore, after receiving the pop-up window creation instruction of the software, it is necessary to judge whether the target pop-up window created by the pop-up window creation instruction is an advertising pop-up window, so as to effectively identify the advertising pop-up window.

[0086] The handle is the unique identification information of the target pop-up window in the current system and is an important part of pop-up window management. When the user creates, closes, moves or resizes a pop-up window in the current system, the current system performs these operations through the pop-up window handle. Specifically, the pop-up window handle is an integer or pointer that points to a structure data inside the current system. This structure data contains the pop-up window feature information. Therefore, obtaining the handle of the target pop-up window actually provides an effective basis for obtaining the pop-up window feature information.

[0087] Step 104: determine pop-up window feature information of the target pop-up window based on the handle of the target pop-up window.

[0088] The handle of the target pop-up window points to the structure data storing the pop-up window characteristic information of the target pop-up window, and the structure data is located in the directory of the software to which the target pop-up window belongs in the current system.

[0089] Among them, the pop-up window feature information includes multiple items of pop-up window size, pop-up window title, pop-up window class name, pop-up window visible state and pop-up window position. The pop-up window size refers to the size of the pop-up window on the display interface of the current system. The pop-up window title reflects the type and / or specific content of the information in the pop-up window. The pop-up window class name is the developer's personalized identification of the target pop-up window. The pop-up window visible state is a Boolean type variable. When the variable is true, the target pop-up window is displayed. When the variable is false, the target pop-up window is hidden. The pop-up window position refers to the specific coordinate range of the pop-up window on the display interface of the current system.

[0090] It can be said that each pop-up window feature information reflects the specific performance characteristics of the target pop-up window in a single dimension, and these specific performance characteristics can be used to determine whether the target pop-up window is an advertising pop-up window that needs to be blocked or a normal window during the software operation process.

[0091] In a possible design, before step 102, an event hook can be created through the SetEventWindowHook function in the user32.dll file of the software. The event hook is used to intercept the pop-up window creation instruction of any software in the current system and send the handle of the target pop-up window obtained based on the pop-up window creation instruction to a pop-up window verification subprocess used to verify whether the target pop-up window is an advertising pop-up window.

[0092] Among them, the user32.dll file of the software is a dynamic link library file, which is part of the application programming interface in the windows system and is responsible for processing functions related to the user interface, including window management and message passing. The SetEventWindowHook function is a necessary condition for creating an event hook, which is used to monitor events and register various hook functions. Specifically, an event hook can be registered through the SetEventWindowHook function to monitor the pop-up window creation instructions of any software in the current system. Further, after monitoring the pop-up window creation instructions of any software in the current system, the event hook is triggered to send the handle of the target pop-up window obtained by the pop-up window creation instruction to the pop-up window verification subprocess, and the pop-up window verification subprocess executes step 104 and subsequent steps to realize the identification and interception of advertising pop-ups.

[0093] Figure 2 FIG. 4 shows a schematic diagram of the operation of the hook module according to an embodiment of the present application. Figure 2 As shown, for an unknown advertising process, after the pop-up window creation instruction of the software is monitored, the hook function module (i.e., event hook) in the user32.dll file is loaded, the pop-up window creation instruction is intercepted by the hook function module, and the handle carried in the pop-up window creation instruction is identified, and the handle is sent to the block.dll module. The block.dll module, as a specific execution module, can execute step 104 and subsequent steps. After determining that the target pop-up window is indeed an advertising pop-up window in the advertising process, the target pop-up window can be intercepted.

[0094] On this basis, step 104 includes: intercepting the pop-up window creation instruction of any software in the current system through the event hook and extracting the handle of the target pop-up window in the pop-up window creation instruction. And, after step 104 and before step 106, the handle of the target pop-up window can be sent to the pop-up window verification sub-process after establishing or searching the pop-up window verification sub-process through the event hook, so as to determine the pop-up window feature information of the target pop-up window in the pop-up window verification sub-process.

[0095] Step 106, determining the interceptable pop-up window feature set corresponding to the software in the interceptable pop-up window database of the current system.

[0096] Before determining whether the target pop-up window needs to be intercepted, it is necessary to obtain in advance the basis for comparison with the target pop-up window. Specifically, an interceptable pop-up window database can be set in advance in the current system, and the interceptable pop-up window feature set corresponding to each software is stored in the interceptable pop-up window database. The interceptable pop-up window feature set enumerates the pop-up window feature information of each advertising pop-up window that the software needs to intercept.

[0097] In a possible design, before step 102, the corresponding interceptable pop-up feature set is determined in advance for all software in the current system and stored in the interceptable pop-up database of the current system. Specifically, all installed software under the specified registry of the current system is enumerated by the RegEnumKeyEx function, wherein the specified registry is the HKEY_LOCAL_MACHINESOFTWARE\Microsoft\Wi ndows\CurrentVersion\Uninstall registry; the interceptable pop-up feature set corresponding to each software in the interceptable pop-up database of all installed software in the cloud is synchronized to the interceptable pop-up database of the current system.

[0098] In this way, the interceptable pop-up window data that is updated in real time in the cloud as the software is updated can be synchronized to the current system, providing a basis for the pop-up window recognition operation in each software in the current system.

[0099] In another possible design, during the pop-up window recognition operation of any software, it is possible to search whether there is a pop-up window feature set corresponding to the software in the pop-up window database of the current system. If the search result is that there is no pop-up window feature set corresponding to the software in the pop-up window database of the current system, a pop-up window feature acquisition request for the software is sent to the cloud, and the pop-up window feature set corresponding to the software is downloaded in real time, even if the cloud sends the pop-up window feature set corresponding to the software in its own pop-up window database to the current system. Finally, the current system receives the pop-up window feature set corresponding to the software provided by the cloud.

[0100] Therefore, during the pop-up recognition operation of any software, it is possible to determine in real time whether the software has a set of interceptable pop-up feature information cached locally. If so, directly proceed to the subsequent steps to match the pop-up feature information of the current target pop-up with the set of interceptable pop-up feature information. If not, it means that the current system lacks a basis for determining whether the target pop-up is an advertising pop-up, so the latest set of interceptable pop-up feature information of the software can be downloaded from the cloud in real time.

[0101] In this way, the corresponding ad pop-up judgment basis can be obtained in real time for different software, which improves the personalized configuration of ad pop-up recognition in different software. In other words, the ad pop-up recognition and interception solution of the present application is compatible with different software in the Windows operating system, and developers do not need to customize personalized pop-up recognition and interception solutions for individual software.

[0102] Step 108, determining whether there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software.

[0103] If there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software, that is, the pop-up feature information of the target pop-up window matches the pop-up feature information of at least one advertisement pop-up window that the software needs to intercept, this means that the target pop-up window may be one of the at least one advertisement pop-up window, that is, it has the possibility of being an advertisement pop-up window. At this time, in order to maximize the protection of the normal operation of the software and prevent pop-ups from interfering with the normal use of the software by users, the target pop-up window can be intercepted.

[0104] On the contrary, if there is no pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software, that is, the pop-up feature information of the target pop-up window does not match the pop-up feature information of the advertising pop-up window that the software needs to intercept, this indicates that the target pop-up window is not one of the known advertising pop-up windows corresponding to the software. At this time, the target pop-up window can be allowed to pop up without being intercepted.

[0105] Specifically, first, a second pop-up window having the same pop-up window class name and the same pop-up window visibility status as the target pop-up window is determined in the interceptable pop-up window feature set corresponding to the software.

[0106] That is to say, firstly, the second pop-up windows with the same pop-up window class name and the same pop-up window visible state are screened in the interceptable pop-up window feature set corresponding to the software, and then it is further determined whether the target pop-up window matches each second pop-up window.

[0107] Next, based on the pop-up window size, pop-up window title and pop-up window position of the target pop-up window, and the pop-up window size, pop-up window title and pop-up window position of the second pop-up window, the matching degree between the target pop-up window and the second pop-up window is determined. Specifically, based on the pop-up window size of the target pop-up window and the pop-up window size of the second pop-up window, the sum of the length ratio, width ratio and area ratio between the target pop-up window and the second pop-up window can be determined as the size similarity between the target pop-up window and the second pop-up window; the semantic similarity between the pop-up window title of the target pop-up window and the pop-up window title of the second pop-up window can be determined; the inverse of the distance between the pop-up center points of the target pop-up window and the second pop-up window can be determined as the pop-up window position similarity between the target pop-up window and the second pop-up window, and then the size similarity, the semantic similarity and the pop-up window position similarity are normalized and weighted summed to obtain the matching degree between the target pop-up window and the second pop-up window.

[0108] The size similarity, the semantic similarity and the pop-up window position similarity respectively reflect the feature similarity levels of the target pop-up window and the second pop-up window in terms of pop-up window size, pop-up window title and pop-up window position. For this, the preset matching threshold can be set as the minimum value of the matching degree between the target pop-up window and the second pop-up window when they are pop-ups of the same nature. On this basis, if the matching degree between the target pop-up window and the second pop-up window is greater than or equal to the preset matching threshold, it means that the target pop-up window and the second pop-up window are likely to be pop-ups of the same nature. At this time, it can be determined that there is pre-stored feature information matching the pop-up window feature information of the target pop-up window in the interceptable pop-up window feature set corresponding to the software. On the contrary, if the matching degree between the target pop-up window and the second pop-up window is lower than the preset matching threshold, it means that the feature difference between the target pop-up window and the second pop-up window is large, and they are not pop-ups of the same nature, so there is no need to intercept the target pop-up window.

[0109] Step 110: If there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software, a preset pop-up interception strategy is executed to intercept the target pop-up window.

[0110] The method of intercepting the target pop-up window includes but is not limited to closing the target pop-up window, hiding the target pop-up window, moving the target pop-up window to a position where the user cannot observe, and any other method that can prevent the user from paying attention to the target pop-up window.

[0111] The above technical solution, in order to solve the technical problem that the advertisement pop-up interception method in the Windows system in the related art is inefficient and inaccurate, can intercept any window creation instruction in any software, and match the pop-up feature information corresponding to the handle shown in the window creation instruction with the locally stored interceptable pop-up feature set of the software to determine whether the target pop-up is an advertisement pop-up that needs to be intercepted. Specifically, any window creation instruction in any software can be intercepted through an event hook, and the handle of the target pop-up required to be created by the window creation instruction is sent to the pop-up verification subprocess through the event hook, and the pop-up verification subprocess matches the pop-up feature information corresponding to the handle with the locally stored interceptable pop-up feature set of the software. If the pre-stored feature information is matched in the interceptable pop-up feature set of the software, it means that the target pop-up is an advertisement pop-up that needs to be intercepted. At this time, a preset pop-up interception strategy can be adopted to intercept the target pop-up. Through the above technical solution, advertising pop-up recognition and interception can be uniformly implemented for all software in the Windows system, which improves the compatibility of advertising pop-up recognition and interception between different software. At the same time, by comparing and identifying the pop-up feature information of the pop-up window obtained through the handle, the accuracy of pop-up recognition can be effectively improved, thereby reducing the false interception of pop-up windows and effectively avoiding the negative impact of the appearance of advertising pop-up windows on users' normal software usage behavior.

[0112] Specifically, the process of executing the preset pop-up window interception strategy to intercept the target pop-up window is as follows.

[0113] First, a pop-up window closing message is sent to the target pop-up window, that is, a WM_CLOSE message is sent. If the target pop-up window does not respond to the pop-up window closing message, it means that the pop-up window closing fails. At this time, the next method can be adopted.

[0114] Next, a forced exit message is sent to the target pop-up window, that is, a WM_QUIT message is sent. If the target pop-up window does not respond to the forced exit message, it means that the pop-up window fails to be forced to exit. At this time, the next method can be used, that is, creating a parent window of the target pop-up window.

[0115] Specifically, a third pop-up window is created, and the third pop-up window is set as the parent window of the target pop-up window, and a pop-up window closing message is sent to the third pop-up window. If the target pop-up window can be closed by closing the parent window, it means that the target pop-up window is successfully intercepted. On the contrary, if the target pop-up window is not closed after the third pop-up window is closed in response to the pop-up window closing message, the next method is used again.

[0116] At this time, a hiding instruction is sent to the target pop-up window. If the target pop-up window responds to the hiding instruction, the window can be hidden. By hiding the target window, the user is prevented from paying attention to the target pop-up window. On the contrary, if the target pop-up window does not respond to the hiding instruction, a moving instruction is sent to the target pop-up window. The pop-up window position of the target pop-up window is changed to a position in the window of the current system that cannot be observed by the user through the moving instruction. If the target pop-up window still does not respond to the moving instruction, the process where the target pop-up window is located is closed.

[0117] In addition, if the target window is the taskbar window CLSID_TASKBARLIST, the deletetab function provided by the taskbar window will directly close the target window.

[0118] It should be added that if the interceptable pop-up window feature set corresponding to the software does not contain pre-stored feature information that matches the pop-up window feature information of the target pop-up window, the target pop-up window is set as a pending pop-up window. In other words, even if the interceptable pop-up window feature set corresponding to the software does not contain content that matches the pop-up window feature information of the target pop-up window, the target pop-up window is not necessarily not an advertising pop-up window. In this case, the target pop-up window can be set as a pending pop-up window first, and then a secondary recognition can be performed when the current system is in a manual recognition state.

[0119] In one possible design, the current system may enter a manual recognition state once every predetermined period of time, so as to perform a batch secondary recognition on all pending pop-up windows within the predetermined period of time.

[0120] In another possible design, the manual recognition state can be manually entered based on the user's secondary recognition instruction, so as to perform immediate secondary recognition on the pending pop-up window based on the user's actual needs.

[0121] Specifically, when the current system is in the manual recognition state, all pending pop-up windows to be manually recognized are redrawn through the WM_PAINT message.

[0122] In a possible design, the WM_PAINT message does not redraw the entire content of the pending pop-up window, but only needs to redraw the pop-up window border and pop-up window title.

[0123] Next, in response to a user selection instruction for any pending pop-up window among all the pending pop-up windows, determine that the pending pop-up window targeted by the user selection instruction is the first pop-up window, and obtain the handle of the first pop-up window; based on the handle of the first pop-up window, determine the pop-up feature information of the first pop-up window; store the pop-up feature information of the first pop-up window in the interceptable pop-up window database of the current system.

[0124] That is to say, all pending pop-up windows can be displayed on the display interface of the current system, so that users can manually select the first pop-up window to be intercepted. Then, based on the handle of the first pop-up window manually selected by the user, its pop-up feature information is determined and stored in the interceptable pop-up feature set of the software to which it belongs in the interceptable pop-up window database of the current system.

[0125] Optionally, EnumWindow can be used to enumerate all pending pop-up windows. When all pending pop-up windows are displayed on the display interface of the current system, all pending pop-up windows can be displayed overlappingly in the order of their historical pop-up time to ensure that each pending pop-up window is visible and selectable.

[0126] Therefore, the advertising pop-up windows that are not included in the interceptable pop-up window feature set of the software to which they belong can be further included in the current system's interceptable pop-up window database, thereby expanding the effective scope of pop-up window recognition and interception and improving the accuracy of pop-up window recognition and interception.

[0127] The present application embodiment provides a device for intercepting pop-up windows in software, including:

[0128] A handle determination unit, configured to determine, in response to a pop-up window creation instruction for any software in the current system, a handle of a target pop-up window created as instructed by the pop-up window creation instruction;

[0129] A pop-up window feature determination unit, configured to determine pop-up window feature information of the target pop-up window based on the handle of the target pop-up window, wherein the pop-up window feature information includes multiple items of pop-up window size, pop-up window title, pop-up window class name, pop-up window visible state, and pop-up window position;

[0130] A software corresponding feature set determining unit, configured to determine a pop-up window interceptable feature set corresponding to the software in a pop-up window interceptable database of the current system;

[0131] A feature verification unit, used to determine whether there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software;

[0132] The pop-up window interception unit is used to execute a preset pop-up window interception strategy to intercept the target pop-up window if there is pre-stored feature information matching the pop-up window feature information of the target pop-up window in the interceptable pop-up window feature set corresponding to the software.

[0133] In one embodiment of the present application, optionally, the device further includes:

[0134] A hook function creation unit, used for creating an event hook through the SetEventWindowHook function in the user32.dll file of the software before the software is started, wherein the event hook is used to intercept a pop-up window creation instruction of any software in the current system and send a handle of a target pop-up window obtained based on the pop-up window creation instruction to a pop-up window verification subprocess used for verifying whether the target pop-up window is an advertisement pop-up window;

[0135] Then the handle determination unit is specifically used to: intercept the pop-up window creation instruction of any software in the current system through the event hook and extract the handle of the target pop-up window in the pop-up window creation instruction;

[0136] The device also includes:

[0137] A handle transfer unit is used to send the handle of the target pop-up window to the pop-up window verification sub-process after establishing or searching the pop-up window verification sub-process through the event hook before the pop-up window feature determination unit determines the pop-up window feature information of the target pop-up window, so that the pop-up window feature determination unit can execute the step of determining the pop-up window feature information of the target pop-up window based on the handle of the target pop-up window in the pop-up window verification sub-process.

[0138] In one embodiment of the present application, optionally, the device further includes:

[0139] A local software enumeration unit, used for enumerating all installed software under a specified registry of the current system by using a RegEnumKeyEx function before the handle determination unit determines the handle of the target pop-up window created as instructed by the pop-up window creation instruction, wherein the specified registry is the HKEY_LOCAL_MACHINE SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall registry;

[0140] The cloud data synchronization unit is used to synchronize the interceptable pop-up feature set corresponding to each software in all the installed software in the cloud interceptable pop-up database to the interceptable pop-up database of the current system.

[0141] In one embodiment of the present application, optionally, the software corresponding feature set determination unit is specifically used to: search whether there is an interceptable pop-up feature set corresponding to the software in the interceptable pop-up database of the current system; if the search result is that the interceptable pop-up feature set corresponding to the software does not exist in the interceptable pop-up database of the current system, send a pop-up feature acquisition request for the software to the cloud, so that the cloud can send the interceptable pop-up feature set corresponding to the software in its own interceptable pop-up database to the current system, and receive the interceptable pop-up feature set corresponding to the software provided by the cloud.

[0142] In one embodiment of the present application, optionally, the device further includes:

[0143] a mismatch processing unit, configured to set the target pop-up window as a pending pop-up window if there is no pre-stored feature information matching the pop-up window feature information of the target pop-up window in the interceptable pop-up window feature set corresponding to the software;

[0144] A pop-up window redrawing unit, used for redrawing all pending pop-up windows to be manually identified through a WM_PAINT message when the current system is in a manual identification state;

[0145] A first pop-up window determining unit, configured to respond to a user selection instruction for any pending pop-up window among all the pending pop-up windows and determine that the pending pop-up window targeted by the user selection instruction is a first pop-up window;

[0146] A local data update unit is used to obtain the handle of the first pop-up window, determine the pop-up window feature information of the first pop-up window based on the handle of the first pop-up window, and store the pop-up window feature information of the first pop-up window in the interceptable pop-up window database of the current system.

[0147] In one embodiment of the present application, optionally, the feature verification unit includes:

[0148] A second pop-up window determining unit is used to determine a second pop-up window having the same pop-up window class name and the same pop-up window visibility state as the target pop-up window in the interceptable pop-up window feature set corresponding to the software;

[0149] a matching degree calculation unit, configured to determine a matching degree between the target pop-up window and the second pop-up window based on a pop-up window size, a pop-up window title and a pop-up window position of the target pop-up window, and a pop-up window size, a pop-up window title and a pop-up window position of the second pop-up window;

[0150] A matching determination unit is used to determine whether there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software if the matching degree between the target pop-up window and the second pop-up window is greater than or equal to a preset matching threshold.

[0151] In one embodiment of the present application, optionally, the matching degree calculation unit is specifically used to: determine the sum of the length ratio, width ratio and area ratio of the target pop-up window and the second pop-up window based on the pop-up window size of the target pop-up window and the pop-up window size of the second pop-up window, as the size similarity between the target pop-up window and the second pop-up window; determine the semantic similarity between the pop-up window title of the target pop-up window and the pop-up window title of the second pop-up window; determine the inverse of the distance between the pop-up center points of the target pop-up window and the second pop-up window, as the pop-up window position similarity between the target pop-up window and the second pop-up window; normalize the size similarity, the semantic similarity and the pop-up window position similarity and then weighted sum them to obtain the matching degree between the target pop-up window and the second pop-up window.

[0152] In one embodiment of the present application, optionally, the pop-up window interception unit is used to: send a pop-up window close message to the target pop-up window; if the target pop-up window does not respond to the pop-up window close message, send a force exit message to the target pop-up window; if the target pop-up window does not respond to the force exit message, create a third pop-up window, set the third pop-up window as the parent window of the target pop-up window, and send a pop-up window close message to the third pop-up window; if the target pop-up window is not closed after the third pop-up window is closed in response to the pop-up window close message, send a hide instruction to the target pop-up window; if the target pop-up window does not respond to the hide instruction, send a move instruction to the target pop-up window, and the move instruction is used to change the pop-up window position of the target pop-up window to a position that cannot be observed by the user within the window of the current system; if the target pop-up window does not respond to the move instruction, close the process where the target pop-up window is located.

[0153] The device uses any one of the solutions described in the above embodiments, and therefore has all the above technical effects, which will not be repeated here.

[0154] In addition, in one embodiment, the present application provides a computer device, which may be a server, and its internal structure diagram may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, the method described in any of the above embodiments can be implemented.

[0155] In one embodiment, the present application further provides a computer device, which may be a client, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, the method described in any of the above embodiments can be implemented.

[0156] Any of the above-mentioned computer devices in the embodiments of the present application may exist in various forms, including but not limited to:

[0157] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.

[0158] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.

[0159] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, as well as smart toys, wearable devices, and portable car navigation devices.

[0160] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.

[0161] (5) Other electronic devices with data interaction functions.

[0162] In addition, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to perform the following steps:

[0163] In response to a pop-up window creation instruction for any software in the current system, determining a handle of a target pop-up window created as instructed by the pop-up window creation instruction;

[0164] Determine pop-up window feature information of the target pop-up window based on the handle of the target pop-up window, wherein the pop-up window feature information includes multiple items of pop-up window size, pop-up window title, pop-up window class name, pop-up window visibility status, and pop-up window position;

[0165] Determine the interceptable pop-up window feature set corresponding to the software in the interceptable pop-up window database of the current system;

[0166] Determine whether there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software;

[0167] If there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software, a preset pop-up interception strategy is executed to intercept the target pop-up window.

[0168] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant description in the aforementioned method embodiment. In order to avoid repetition, they will not be described one by one here.

[0169] The technical solution of the present application is described in detail above in conjunction with the accompanying drawings. Through the technical solution of the present application, any window creation instruction in any software can be intercepted, and the pop-up feature information corresponding to the handle shown in the window creation instruction is matched with the locally stored pop-up feature set of the software that can be intercepted to determine whether the target pop-up is an advertisement pop-up that needs to be intercepted. Through the above technical solution, advertisement pop-up recognition and interception can be uniformly realized for all software in the Windows system, which improves the compatibility of advertisement pop-up recognition and interception between different software. At the same time, the pop-up feature information of the pop-up obtained by the handle is compared and identified, which can effectively improve the accuracy of pop-up recognition, thereby reducing the false interception of pop-ups and effectively avoiding the negative impact of the appearance of advertisement pop-ups on the normal software usage behavior of users.

[0170] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0171] It should be understood that although the terms first, second, etc. may be used to describe pop-up windows in the embodiments of the present application, these pop-up windows should not be limited to these terms. These terms are only used to distinguish pop-up windows from each other. For example, without departing from the scope of the embodiments of the present application, the first pop-up window may also be referred to as the second pop-up window, and similarly, the second pop-up window may also be referred to as the first pop-up window.

[0172] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0173] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0174] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0175] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0176] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0177] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for intercepting pop-up windows in software, characterized in that: include: In response to a pop-up window creation instruction for any software in the current system, determining a handle of a target pop-up window created as instructed by the pop-up window creation instruction; Determine pop-up window feature information of the target pop-up window based on the handle of the target pop-up window, wherein the pop-up window feature information includes multiple items of pop-up window size, pop-up window title, pop-up window class name, pop-up window visibility status, and pop-up window position; Determine the interceptable pop-up window feature set corresponding to the software in the interceptable pop-up window database of the current system; Determine whether there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software; If there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software, a preset pop-up interception strategy is executed to intercept the target pop-up window.

2. The method according to claim 1, characterized in that Before the software is started, it also includes: An event hook is created through the SetEventWindowHook function in the user32.dll file of the software, and the event hook is used to intercept a pop-up window creation instruction of any software in the current system and send the handle of the target pop-up window obtained based on the pop-up window creation instruction to a pop-up window verification subprocess used to verify whether the target pop-up window is an advertisement pop-up window; Then, in response to a pop-up window creation instruction for any software in the current system, determining a handle of a target pop-up window created as instructed by the pop-up window creation instruction includes: Intercepting a pop-up window creation instruction of any software in the current system through the event hook and extracting a handle of the target pop-up window from the pop-up window creation instruction; Before determining the pop-up window feature information of the target pop-up window based on the handle of the target pop-up window, the method further includes: After establishing or searching the pop-up window verification subprocess through the event hook, the handle of the target pop-up window is sent to the pop-up window verification subprocess, so that the pop-up window verification subprocess can execute the step of determining the pop-up window feature information of the target pop-up window based on the handle of the target pop-up window.

3. The method according to claim 1, characterized in that Before determining the handle of the target pop-up window created as instructed by the pop-up window creation instruction in response to the pop-up window creation instruction for any software in the current system, the method further includes: Enumerate all installed software under the specified registry of the current system through the RegEnumKeyEx function, wherein the specified registry is the HKEY_LOCAL_MACHINESOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall registry; The interceptable pop-up window feature set corresponding to each software in all the installed software in the interceptable pop-up window database in the cloud is synchronized to the interceptable pop-up window database of the current system.

4. The method according to claim 1, characterized in that: Determining the interceptable pop-up window feature set corresponding to the software in the interceptable pop-up window database of the current system includes: Searching the interceptable pop-up window database of the current system to see whether there is a set of interceptable pop-up window features corresponding to the software; If the search result shows that the interceptable pop-up window feature set corresponding to the software does not exist in the interceptable pop-up window database of the current system, a pop-up window feature acquisition request for the software is sent to the cloud, so that the cloud can send the interceptable pop-up window feature set corresponding to the software in its own interceptable pop-up window database to the current system; Receive a pop-up window interceptable feature set corresponding to the software provided by the cloud.

5. The method according to claim 3 or 4, characterized in that: Also includes: If there is no pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software, setting the target pop-up window as a pending pop-up window; When the current system is in a manual recognition state, all pending pop-up windows to be manually recognized are redrawn through a WM_PAINT message; In response to a user selection instruction for any pending pop-up window among all the pending pop-up windows, determining that the pending pop-up window targeted by the user selection instruction is a first pop-up window, and obtaining a handle of the first pop-up window; Determining pop-up window feature information of the first pop-up window based on the handle of the first pop-up window; The pop-up window feature information of the first pop-up window is stored in the interceptable pop-up window database of the current system.

6. The method according to any one of claims 1 to 4, characterized in that The determining whether there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software includes: Determine a second pop-up window having the same pop-up window class name and the same pop-up window visibility status as the target pop-up window in the interceptable pop-up window feature set corresponding to the software; Determining a matching degree between the target pop-up window and the second pop-up window based on a pop-up window size, a pop-up window title, and a pop-up window position of the target pop-up window, and a pop-up window size, a pop-up window title, and a pop-up window position of the second pop-up window; If the matching degree between the target pop-up window and the second pop-up window is greater than or equal to a preset matching threshold, it is determined that there is pre-stored feature information matching the pop-up feature information of the target pop-up window in the interceptable pop-up feature set corresponding to the software.

7. The method according to claim 6, characterized in that The determining the matching degree between the target pop-up window and the second pop-up window based on the pop-up window size, pop-up window title and pop-up window position of the target pop-up window and the pop-up window size, pop-up window title and pop-up window position of the second pop-up window includes: Based on the pop-up window size of the target pop-up window and the pop-up window size of the second pop-up window, determining the sum of the length ratio, width ratio and area ratio of the target pop-up window to the second pop-up window as the size similarity between the target pop-up window and the second pop-up window; Determining the semantic similarity between the pop-up window title of the target pop-up window and the pop-up window title of the second pop-up window; Determine the reciprocal of the distance between the pop-up window center points of the target pop-up window and the second pop-up window as the pop-up window position similarity between the target pop-up window and the second pop-up window; The size similarity, the semantic similarity and the pop-up window position similarity are normalized and then weighted summed to obtain a matching degree between the target pop-up window and the second pop-up window.

8. The method according to claim 1, characterized in that The executing a preset pop-up window interception strategy to intercept the target pop-up window includes: Sending a pop-up window closing message to the target pop-up window; If the target pop-up window does not respond to the pop-up window closing message, sending a forced exit message to the target pop-up window; If the target pop-up window does not respond to the forced exit message, create a third pop-up window, set the third pop-up window as the parent window of the target pop-up window, and send a pop-up window close message to the third pop-up window; If the target pop-up window is not closed after the third pop-up window is closed in response to the pop-up window closing message, sending a hiding instruction to the target pop-up window; If the target pop-up window does not respond to the hiding instruction, sending a moving instruction to the target pop-up window, wherein the moving instruction is used to change the pop-up window position of the target pop-up window to a position in the window of the current system that cannot be observed by the user; If the target pop-up window does not respond to the move instruction, close the process where the target pop-up window is located.

9. A computer device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions executable by the at least one processor, and the instructions are configured to enable the processor to execute the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are configured to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Window interception method, device and terminal device

    CN105468674A

  • Advertisement popup window interception method and device, electronic equipment and storage medium

    CN111753191A

  • Popup window interception method and device, equipment and medium

    CN114861166A

  • Method and device for intelligently identifying and intercepting advertisement window and electronic equipment

    CN115080957A

  • Popup window interception method and device, electronic equipment and storage medium

    CN116088986A