Method, apparatus, storage medium and computer equipment for generating pop-up ablation rules

By generating pop-up ablation rules through interface traversal and similarity matching, the problem of time-consuming and laborious manual collection of pop-up information in existing technologies is solved, and efficient and accurate pop-up ablation rule generation is achieved, which is applicable to multiple devices.

CN120012749BActive Publication Date: 2025-11-14SUN YAT SEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510243479.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-11-14
Estimated Expiration
2045-03-03

AI Technical Summary

Technical Problem

In existing technologies, custom screen click applications rely on manual collection of pop-up interface information, which is time-consuming, labor-intensive, and difficult to fully cover all pop-up situations, resulting in low accuracy and efficiency.

Method used

By performing pop-up detection and similarity assessment during interface traversal, the system automatically identifies pop-up component information and uses the interface component tree for similarity matching to generate ablation rules that are adapted to different devices.

Benefits of technology

It improves the efficiency and accuracy of generating pop-up ablation rules, reduces redundant generation, enhances the comprehensiveness of pop-up scene coverage, and adapts to different devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120012749B_ABST
    Figure CN120012749B_ABST
Patent Text Reader

Abstract

The pop-up ablation rule generation method, apparatus, storage medium, and computer device provided in this application detect whether a pop-up exists in the current interface during interface traversal of the target application. If a pop-up exists, the similarity between the current interface and the previously traversed interfaces is evaluated to avoid repeatedly generating ablation rules for similar interfaces and improve generation efficiency. If no set of interfaces with a similarity higher than a preset threshold exists, the component information corresponding to the pop-up ablation event is determined. Considering the differences in screen resolution across different devices, the component information is matched with the interface component tree for similarity. This effectively adapts to various devices and accurately locates the target component. Subsequently, the corresponding pop-up ablation rule is obtained based on the relevant information of the target component, and the traversal continues until the final set of ablation rules for the target application is obtained. In this way, ablation rules can be automatically generated during testing through automated traversal, improving generation efficiency while enhancing the comprehensiveness of pop-up scenario coverage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, storage medium and computer equipment for generating pop-up ablation rules. Background Technology

[0002] In today's mobile internet era, with the booming development of various commercial applications, users frequently encounter various pop-up windows when using these applications, such as permission requests, pop-up ads, update notifications, and so on. To improve user experience, many developers have launched customizable screen-click Android applications, aiming to automatically handle these pop-ups and reduce the user's operational burden.

[0003] However, current custom screen click applications still heavily rely on business users manually collecting pop-up interface information from various applications and then writing corresponding pop-up ablation rules based on this information. This process is not only time-consuming and labor-intensive, but also, due to the diversity and complexity of pop-up scenarios, it is difficult to ensure comprehensive coverage of all possible pop-up situations. Therefore, generating pop-up ablation rules often faces the dual challenges of accuracy and efficiency. Summary of the Invention

[0004] The purpose of this application is to address at least one of the aforementioned technical shortcomings, particularly the fact that existing technologies for custom screen click applications still heavily rely on business personnel manually collecting pop-up interface information from various applications and then writing corresponding pop-up ablation rules. This process is not only time-consuming and labor-intensive, but also, due to the diversity and complexity of pop-up scenarios, it is difficult to ensure comprehensive coverage of all possible pop-up situations. Therefore, generating pop-up ablation rules often faces the dual challenges of accuracy and efficiency.

[0005] Firstly, this application provides a method for generating pop-up ablation rules, the method comprising:

[0006] When the target application traverses the interface according to the preset traversal strategy, pop-up detection is performed on the current interface. When a pop-up is detected in the current interface, the similarity between the current interface and the historically traversed interfaces is evaluated.

[0007] If there is no set of interfaces in the history traversal interface that has a similarity higher than a preset threshold to the current interface, then the component information corresponding to the pop-up disappearance event is determined in the pop-up window of the current interface.

[0008] Obtain the interface component tree of the current interface, and perform similarity matching between the component information and the interface component tree to determine the target component that causes the pop-up in the current interface to disappear;

[0009] After filling the relevant information of the target component into the preset template to obtain the ablation rule corresponding to the pop-up, the interface of the target application is traversed until all interfaces to be traversed are traversed. Then, the ablation rule set of the target application is generated based on the ablation rule obtained during the traversal process.

[0010] In one embodiment, the similarity assessment between the current interface and the historical traversal interfaces includes:

[0011] Obtain the root interface of each interface set in the history traversal interface;

[0012] Based on the component text and component position in the current interface and each root interface, calculate the similarity between the current interface and each root interface to obtain the similarity between the current interface and each root interface.

[0013] If the similarity between the current interface and each root interface is not higher than a preset threshold, then there is no set of interfaces in the history of traversal that have a similarity higher than the preset threshold with the current interface; otherwise, there is a set of interfaces in the history of traversal that have a similarity higher than the preset threshold with the current interface.

[0014] In one embodiment, the pop-up detection of the current interface includes:

[0015] Obtain the preset pop-up detection model;

[0016] Input a screenshot of the current interface into the pop-up detection model. If the output result is empty, it is considered that there is no pop-up in the current interface; otherwise, the position information of the pop-up is obtained.

[0017] Based on the location information, determine the non-pop-up area in the current interface and calculate the proportion of the shadow area in the non-pop-up area. If the proportion of the shadow area is lower than the preset proportion, it is considered that there is no pop-up in the current interface; otherwise, it is considered that there is a pop-up in the current interface.

[0018] In one embodiment, determining the component information corresponding to the pop-up dissolution event in the pop-up window of the current interface includes:

[0019] Obtain the position information of the pop-up window to determine the pop-up window area in the current interface;

[0020] Identify the clickable components in the pop-up area, and determine the user preference options and application preference options in each clickable component by combining the component text and component contrast.

[0021] The user preference options and the application preference options are taken as the optimal interaction objects, and the components among the clickable components other than the user preference options and the application preference options are taken as the second-best interaction objects;

[0022] Click each clickable component in sequence according to priority until a clickable component that causes the pop-up to disappear is determined. Then, the component information of the clickable component is determined as the component information corresponding to the pop-up disappearance event. If the priorities are the same, the clickable component to be clicked is randomly determined.

[0023] In one embodiment, obtaining the interface component tree of the current interface and performing similarity matching between the component information and the interface component tree includes:

[0024] Obtain the interface component tree of the current interface, and calculate the Euclidean distance between the component information and each component in the interface component tree;

[0025] The component with the smallest Euclidean distance from the component information is determined as the target component that causes the pop-up in the current interface to melt away.

[0026] In one embodiment, the step of filling the relevant information of the target component into a preset template to obtain the ablation rule corresponding to the pop-up includes:

[0027] Obtain the path of the target component in the interface component tree, the text information of the target component, the click attribute of the target component, and its associated interface identifier, and determine the obtained information as the relevant information of the target component;

[0028] Obtain a preset template and fill in the relevant information of the target component into the corresponding position in the preset template to obtain the ablation rule corresponding to the pop-up.

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

[0030] The type of pop-up window corresponding to the ablation rule is determined based on the current interface and the component information.

[0031] When the pop-up type of the ablation rule obtained during the traversal is determined, the ablation rules in the ablation rule set are classified according to the pop-up type to obtain at least one rule set;

[0032] When a user's type adjustment instruction is received, a target set is determined from each rule set according to the type adjustment instruction, and the corresponding ablation rule in the target set is turned on or off according to the type adjustment instruction.

[0033] Secondly, this application provides a pop-up ablation rule generation device, the device comprising:

[0034] The pop-up detection module is used to detect pop-ups on the current screen when the target application traverses the screen according to a preset traversal strategy. When a pop-up is detected on the current screen, the similarity between the current screen and the historically traversed screens is evaluated.

[0035] The information determination module is used to determine the component information corresponding to the pop-up ablation event in the pop-up window of the current interface if there is no set of interfaces with a similarity higher than a preset threshold in the historical traversal interface.

[0036] The component determination module is used to obtain the interface component tree of the current interface and perform similarity matching between the component information and the interface component tree to determine the target component that causes the pop-up in the current interface to disappear.

[0037] The rule generation module is used to fill the relevant information of the target component into a preset template to obtain the ablation rule corresponding to the pop-up, and then continue to traverse the interface of the target application until all interfaces to be traversed are traversed. At that time, the ablation rule set of the target application is generated based on the ablation rule obtained during the traversal process.

[0038] Thirdly, this application provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the pop-up ablation rule generation method as described in any of the above embodiments.

[0039] Fourthly, this application provides a computer device, including: one or more processors, and a memory;

[0040] The memory stores computer-readable instructions, and when the one or more processors execute the computer-readable instructions, they perform the steps of the pop-up ablation rule generation method as described in any of the above embodiments.

[0041] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0042] The pop-up ablation rule generation method, apparatus, storage medium, and computer device provided in this application, during the pop-up ablation rule generation process, perform pop-up detection on the current interface when the target application traverses the interface according to a preset traversal strategy. If a pop-up is detected in the current interface, the similarity between the current interface and the previously traversed interfaces is evaluated. This avoids repeatedly generating ablation rules for similar interface pop-ups, thereby improving the efficiency of ablation rule generation. When there is no set of interfaces in the previously traversed interfaces with a similarity higher than a preset threshold to the current interface, the component information corresponding to the pop-up ablation event is determined in the pop-up of the current interface. Then, considering the differences in screen resolution between different devices, the interface component tree of the current interface can be obtained, and the component information is matched with the interface component tree for similarity. Since the interface component tree of the same application is generally stable on different devices, it can effectively adapt to different devices and accurately locate the target component causing the pop-up ablation. Afterwards, the relevant information of the target component is filled into a preset template to obtain the ablation rule corresponding to the pop-up, and the interface traversal of the target application continues until all interfaces to be traversed are traversed, forming a set of ablation rules for the target application. This automated traversal allows for the automatic generation of application pop-up ablation rules during the testing process, saving manpower, improving generation efficiency, and enhancing the comprehensiveness of pop-up scenario coverage. Attached Figure Description

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

[0044] Figure 1 A flowchart illustrating a method for generating ablation rules in a pop-up window, as provided in an embodiment of this application;

[0045] Figure 2 A flowchart illustrating the process of evaluating the similarity between the current interface and the historical traversal interfaces, provided for an embodiment of this application;

[0046] Figure 3 This is a schematic diagram illustrating the process of detecting pop-up windows on the current interface, provided in an embodiment of this application.

[0047] Figure 4 A flowchart illustrating the process of determining component information corresponding to a pop-up ablation event in the current interface, as provided in an embodiment of this application.

[0048] Figure 5 An example diagram illustrating a method for generating ablation rules in a pop-up window, as provided in an embodiment of this application;

[0049] Figure 6 A schematic diagram of a pop-up ablation rule generation device provided in an embodiment of this application;

[0050] Figure 7 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation

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

[0052] like Figure 1 As shown, this application provides a method for generating pop-up ablation rules, the method comprising:

[0053] S101: When the target application traverses the interface according to the preset traversal strategy, pop-up detection is performed on the current interface.

[0054] The preset traversal strategy refers to the method of traversing the interface using an adaptive depth-first search algorithm. Specifically, the adaptive depth-first search (ADFS) algorithm can perform interface traversal in a depth-first manner. This algorithm optimizes the exploration process by dynamically adjusting the maximum traversal depth. Initially, the maximum traversal depth is set to 1, and depth-first search (DFS) is performed at this depth. When the proportion of explored clickable components reaches a preset coverage threshold, the algorithm increases the maximum traversal depth (e.g., from 1 to 2) to further explore deeper layers of the interface. If the traversal in a certain direction reaches the current maximum depth, the algorithm will backtrack and try exploring in other directions. When the traversal in all directions reaches the current maximum depth, the algorithm will increase the maximum traversal depth again and continue to explore deeper until the time budget or coverage requirement is met. This adaptive mechanism ensures efficient coverage of more interface layers within a limited time. In the scenario of ablation rule generation, using this traversal method can quickly broaden the horizontal interface range for rule generation. Moreover, since shallower interfaces are used more frequently by users, this method can also prioritize the generation of ablation rules that are used more frequently.

[0055] Furthermore, a UI transition graph is used during UI traversal to ensure proper UI back operations. Specifically, when the maximum traversal depth is reached and back is needed, for Activity UIs, a stack is maintained to store UIs, and the back operation follows the FILO (Last-In-First-Out) rule to return to the previous Activity UI. However, many application UIs use Fragment UI layouts. Since Fragment UIs are not stored in a stack, a single back operation may destroy all previously traversed Fragment UIs. These Fragment UIs may still contain unclicked components, i.e., insufficiently traversed UIs. Therefore, to ensure proper back operation, a dynamically maintained UI transition graph is used during UI traversal. This UI transition graph records the traversed UI paths. In the event of application restart or destruction of traversed UIs during traversal, the path can be restored through the UI transition graph. This ensures that ablation rule generation proceeds correctly.

[0056] Furthermore, for the interfaces being traversed, if an interface has a cyclic relationship with other interfaces or its corresponding interface sequence remains in the same pattern for a long time, then that interface is marked as a faulty interface and will be avoided during traversal. This further ensures the smooth progress of the ablation rule generation process.

[0057] In this step, when the user needs to generate pop-up ablation rules for the target application, these rules can be generated during automated testing of the target application. The automated testing process itself executes the pop-up ablation rule generation method, saving resources and improving rule generation efficiency. Then, during the target application's interface traversal according to a preset traversal strategy, the presence of pop-ups on the current interface is detected. Specifically, a pop-up is an overlay prominently displayed on the application interface during user interaction, used to provide information or request actions to guide user behavior and improve user experience.

[0058] S102: Determine if there is a pop-up window in the current interface.

[0059] S103: When a pop-up is detected in the current interface, the similarity between the current interface and the historical traversal interface is evaluated.

[0060] The history traversal interface comprises multiple interface sets, which are collections of similar interfaces traversed throughout the history. It's important to note that the history traversal interface refers to the interface that includes pop-up windows during the traversal.

[0061] In this step, when a pop-up is detected on the current screen, a similarity assessment can be performed between the current screen and each screen set in the historical traversal. This assessment determines whether pop-up ablation rules need to be generated for the current screen's pop-up. In essence, similarity assessment evaluates the similarity between two screens containing pop-ups.

[0062] Specifically, due to the large number of pages in complex business applications, and the fact that pages related to the same business may only have slight differences (e.g., different product interfaces in an e-commerce app are largely similar), traversing all interfaces without filtering would lead to path explosion and significantly reduce the efficiency of interface traversal. Therefore, the similarity between the current interface and previously traversed interfaces is calculated. If there is a set of interfaces in the previously traversed interfaces whose similarity to the current interface is higher than a preset threshold, then there is no need to generate ablation rules for the current interface's pop-up, thus saving computational resources and improving generation efficiency.

[0063] Furthermore, the root interface of each interface set in the historical traversal interface is used for similarity evaluation. This avoids evaluating and comparing all historically traversed interfaces one by one, thereby further improving the efficiency of ablation rule generation.

[0064] S104: Determine whether there is a set of interfaces in the history traversal interface that has a similarity to the current interface that is higher than a preset threshold.

[0065] S105: If there is no set of interfaces in the history traversal interface that has a similarity higher than the preset threshold with the current interface, then determine the component information corresponding to the pop-up disappearance event in the pop-up window of the current interface.

[0066] The preset threshold is an empirical value and can be adjusted according to actual needs. Similarity is used to measure the degree of similarity between two interfaces.

[0067] When there is no set of interfaces in the history traversal that have a similarity higher than a preset threshold to the current interface, it indicates that there is no interface similar to the current interface in the history traversal. Therefore, a pop-up dissolution rule can be generated for the current interface. First, the component information corresponding to the pop-up dissolution event can be determined in the pop-up of the current interface. Here, component information refers to the component information corresponding to the component that can cause the pop-up to dissolve in the pop-up of the current interface.

[0068] S106: Obtain the interface component tree of the current interface, and perform similarity matching between the component information and the interface component tree to determine the target component that will cause the pop-up in the current interface to disappear.

[0069] The UI component tree refers to viewing the user interface as a tree structure composed of various components. In this structure, each component is a node in the tree, and the relationships between the components form the tree structure.

[0070] In this step, since the resolution of different devices generally varies, the coordinate information in the obtained component information will also be inconsistent. Simply using the component information corresponding to the component that can cause the pop-up to disappear may not be able to accurately locate the target component. However, the interface component tree of the same application is generally stable on different devices. Therefore, in order for the generated ablation rules to be reusable on multiple devices, the interface component tree of the current interface can be obtained, and the component information can be matched with the interface component tree to determine the node that is closest to the component information in the interface component tree. Then, the component corresponding to that interface is determined as the target component that causes the pop-up in the current interface to disappear.

[0071] S107: After filling the relevant information of the target component into the preset template to obtain the ablation rule corresponding to the pop-up, continue to traverse the interface of the target application until all interfaces to be traversed are traversed. Then, generate the ablation rule set of the target application based on the ablation rule obtained during the traversal process.

[0072] The relevant information includes, but is not limited to, the path information of the target component in the interface component tree, the interface identifier to which the target component belongs, etc.

[0073] In this step, when the target component is identified, ablation rules for the pop-up in the current interface can be generated. This is done by obtaining relevant information about the target component and filling it into the corresponding positions in a preset template, thus obtaining the ablation rules for the pop-up in the current interface. Then, the interface of the target application is traversed again until all interfaces determined by the preset traversal strategy have been traversed. Finally, an ablation rule set for the target application is generated based on the ablation rules obtained during the traversal.

[0074] Understandably, during the ablation rule application phase, the ablation rule set of the target application can be imported into the preset ablation rule matching module. When the user uses the target application, if the interface changes, the current interface component tree will be obtained and then matched with the ablation rules in the ablation rule set. When a certain ablation rule is matched, the ablation rule will be executed to ablate the pop-up of the current interface.

[0075] S108: If there is no pop-up in the current interface or there is a set of interfaces in the history traversal that have a similarity to the current interface that is higher than a preset threshold, then continue to traverse the interfaces of the target application until all interfaces to be traversed are traversed. At that time, generate a set of ablation rules for the target application based on the ablation rules obtained during the traversal process.

[0076] The pop-up ablation rule generation method, apparatus, storage medium, and computer device provided in this application, during the pop-up ablation rule generation process, perform pop-up detection on the current interface when the target application traverses the interface according to a preset traversal strategy. If a pop-up is detected in the current interface, the similarity between the current interface and the previously traversed interfaces is evaluated. This avoids repeatedly generating ablation rules for similar interface pop-ups, thereby improving the efficiency of ablation rule generation. When there is no set of interfaces in the previously traversed interfaces with a similarity higher than a preset threshold to the current interface, the component information corresponding to the pop-up ablation event is determined in the pop-up of the current interface. Then, considering the differences in screen resolution between different devices, the interface component tree of the current interface can be obtained, and the component information is matched with the interface component tree for similarity. Since the interface component tree of the same application is generally stable on different devices, it can effectively adapt to different devices and accurately locate the target component causing the pop-up ablation. Afterwards, the relevant information of the target component is filled into a preset template to obtain the ablation rule corresponding to the pop-up, and the interface traversal of the target application continues until all interfaces to be traversed are traversed, forming a set of ablation rules for the target application. This automated traversal allows for the automatic generation of application pop-up ablation rules during the testing process, saving manpower, improving generation efficiency, and enhancing the comprehensiveness of pop-up scenario coverage.

[0077] like Figure 2 As shown, in one embodiment, a similarity assessment is performed between the current interface and the history traversal interface, including:

[0078] S201: Get the root interface of the collection of interfaces in the history traversal interface.

[0079] Each set of interfaces corresponds to a root interface, which is the interface that shares the same interface framework with all the interfaces in its set.

[0080] S202: Based on the component text and component position in the current interface and each root interface, calculate the similarity between the current interface and each root interface to obtain the similarity between the current interface and each root interface.

[0081] Here, component text refers to the text content displayed by the component, and component position refers to the layout and positioning of the component on the interface.

[0082] In this step, the longest common subsequence algorithm can be used to calculate the similarity between the current interface and each root interface in terms of component text and component position. Then, by weighting the similarity of different components in terms of component text and component position, the similarity between the current interface and each root interface can be obtained.

[0083] S203: Determine whether there is a root interface in each root interface that has a similarity to the current interface that is higher than a preset threshold.

[0084] S204: If the similarity between the current interface and each root interface is not higher than the preset threshold, then there is no set of interfaces in the history traversal that have a similarity higher than the preset threshold with the current interface.

[0085] S205: If there is a root interface in each root interface that has a similarity to the current interface that is higher than a preset threshold, then there is a set of interfaces in the history traversal interface that have a similarity to the current interface that is higher than a preset threshold.

[0086] Specifically, when the similarity between the current interface and each root interface is no higher than a preset threshold, it means that the current interface has no similar interfaces in the historical traversal, i.e., there is no set of interfaces in the historical traversal that have a similarity higher than the preset threshold with the current interface. Conversely, when one or more root interfaces have a similarity higher than the preset threshold with the current interface, it means that the current interface has at least one similar interface in the historical traversal, i.e., there is a set of interfaces in the historical traversal that have a similarity higher than the preset threshold with the current interface.

[0087] In this embodiment, since similar interfaces have been pre-divided into an interface set in the history traversal interface, the root interface can be used to represent the interface set and perform similarity evaluation with the current interface during similarity evaluation. This avoids the need to evaluate each interface in the history traversal interface one by one during similarity evaluation, thereby avoiding repeated evaluation of similar interfaces, saving computing resources, and improving the efficiency of ablation rule generation.

[0088] like Figure 3 As shown, in one embodiment, pop-up detection of the current interface includes:

[0089] S301: Obtain the preset pop-up detection model.

[0090] The pop-up detection model is used to detect whether a pop-up exists on the interface. When a pop-up exists on the interface, it outputs the position information of the pop-up on the interface; when no pop-up exists on the interface, it outputs nothing.

[0091] In one example, the YOLO model can be used as a pre-trained model. This pre-trained model is then iteratively trained using an interface sample set and the corresponding pop-up annotations for each interface sample in the set. The resulting model is then determined as the pop-up detection model. It's understandable that the high performance of the YOLO model allows the pop-up detection model to possess high detection performance and efficiency.

[0092] S302: Input a screenshot of the current interface into the pop-up detection model and determine whether the output result is empty.

[0093] S303: If the output result is empty, it is assumed that there is no pop-up in the current interface.

[0094] S304: If the output result is not empty, obtain the position information of the pop-up window.

[0095] When the output is not empty, it means that the pop-up detection model has detected a pop-up on the current screen. At this point, the position information of the pop-up output by the pop-up detection model is obtained. Then, to avoid false alarms in pop-up detection, further detection and judgment can be performed, namely the subsequent processes S305-S308.

[0096] S305: Determine the non-pop-up area in the current interface based on the location information, and calculate the proportion of the shadow area in the non-pop-up area.

[0097] The non-popup area refers to the remaining area of ​​the interface excluding the popup area. The shadow area ratio refers to the proportion of the shadow area within the non-popup area.

[0098] In this step, since the non-popup areas of an interface with a popup are generally covered with a semi-transparent gray mask to highlight the popup content, when there is no popup on the interface but the popup detection model outputs the popup's position information, the shadow area ratio of the non-popup area should be 0. When there is a popup on the interface, but the popup detection model outputs a popup's position information that differs significantly from the actual popup location, the shadow area ratio of the non-popup area should be a relatively small value (less than 100%). Therefore, the accuracy of the popup detection results can be further checked by determining whether the shadow area ratio of the non-popup area is higher than a preset ratio.

[0099] S306: Determine whether the proportion of the shadow area is lower than the preset proportion.

[0100] The preset ratio is an empirical value and can be adjusted according to the actual situation.

[0101] S307: If the proportion of the shadow area is lower than the preset proportion, it is assumed that there is no pop-up in the current interface or the position information of the detected pop-up is too inaccurate.

[0102] S308: If the proportion of the shadow area is not lower than the preset proportion, then a pop-up window is considered to exist in the current interface.

[0103] In this embodiment, a high-performance pop-up detection model is used to achieve the goal of fast pop-up detection. On the other hand, a shadow area ratio judgment strategy is also set to further ensure the reliability of the output results of the pop-up detection model, reduce the possibility of false alarms, and thus improve the accuracy of pop-up recognition.

[0104] like Figure 4As shown, in one embodiment, determining the component information corresponding to the pop-up ablation event in the pop-up window of the current interface includes:

[0105] S401: Obtain the position information of the pop-up to determine the pop-up area in the current interface.

[0106] The pop-up area refers to the area occupied by the pop-up in the interface.

[0107] S402: Identify clickable components in the pop-up area, and determine user preference options and application preference options in each clickable component by combining component text and component contrast.

[0108] In this context, user preference options refer to the option components that a user wishes to select, while application preference options refer to the option components that the application wants the user to select. For example, user preference options include, but are not limited to, buttons such as cross markers, skip, and cancel, while application preference options include, but are not limited to, buttons such as confirm and claim. Generally, application preference options have higher contrast than user preference options.

[0109] In this step, clickable components in the pop-up area are identified. Since user preference options and application preference options generally differ significantly in component text and component contrast, user preference options and application preference options can be determined in each clickable component by combining the component text and component contrast corresponding to each clickable component.

[0110] Specifically, this process can also be achieved by training a deep learning model. When a third-party framework renders a pop-up, the information contained in the interface component tree can be quite cluttered. If the clickable components within the pop-up area are determined directly through the interface component tree, it may result in the final identified clickable components including those outside the pop-up area. Therefore, a trained deep learning model can be used to identify the clickable components within the pop-up area to solve this problem. In one example, preferably, a YOLO model can be used as a pre-trained model for training the deep learning model.

[0111] S403: Use user preference options and application preference options as the optimal interaction objects, and use the other clickable components besides user preference options and application preference options as the suboptimal interaction objects.

[0112] It is understandable that the priority of the optimal interaction object is higher than that of the second-best interaction object.

[0113] In this step, since the user preference options and application preference options are the components most likely to close the pop-up, their priority is set higher than that of other components.

[0114] S404: Click each clickable component in order of priority until the clickable component that causes the pop-up to disappear is determined. Then, determine the component information of the clickable component as the component information corresponding to the pop-up disappearance event.

[0115] Among them, when the priorities are the same, the clickable component to be clicked is randomly determined.

[0116] In this embodiment, by setting a priority, the component information that corresponds to the pop-up ablation event can be determined as quickly as possible, thereby improving the efficiency of ablation rule generation.

[0117] In one embodiment, the interface component tree of the current interface is obtained, and the component information is matched with the interface component tree for similarity, including:

[0118] S1: Obtain the interface component tree of the current interface and calculate the Euclidean distance between the component information and each component in the interface component tree.

[0119] Euclidean distance is used to measure the degree of matching between component information and nodes in the interface component tree.

[0120] S2: The component with the smallest Euclidean distance from the component information is identified as the target component that causes the pop-up in the current interface to melt away.

[0121] In this embodiment, the component information is matched with each node in the interface component tree to determine the node with the highest matching degree, and the component corresponding to that node is determined as the target component. This can be compatible with the positional differences caused by resolution differences between different devices, so that the generated ablation rules can be applied in multiple devices to improve the reusability of ablation rules.

[0122] In one embodiment, the relevant information of the target component is filled into a preset template to obtain the ablation rule corresponding to the pop-up window, including:

[0123] S1: Obtain the path of the target component in the interface component tree, the text information of the target component, the click attribute of the target component, and the interface identifier to which it belongs, and determine the obtained information as the relevant information of the target component.

[0124] The click attribute of the target component indicates whether the component is clickable, and the class identifier of the target component refers to the identifier of the Activity to which the component belongs. An Activity is a component with a user interface used to implement specific user interaction functions.

[0125] S2: Obtain the preset template and fill the relevant information of the target component into the corresponding position in the preset template to obtain the ablation rule corresponding to the pop-up.

[0126] In this implementation, multiple pieces of information about the target component are used as relevant information about the target component. This improves the fineness of the matching and enhances the matching accuracy during the ablation rule application phase.

[0127] In one embodiment, the method for generating dialog box ablation rules further includes:

[0128] S1: Determine the type of pop-up corresponding to the ablation rule based on the current interface and component information.

[0129] One pop-up corresponds to one ablation rule, meaning one ablation rule corresponds to one pop-up type. Pop-up type refers to the classification based on the pop-up's purpose. Pop-up types include, but are not limited to, advertising pop-ups, permission pop-ups, and prompt pop-ups.

[0130] In this step, the purpose of the pop-up is determined by analyzing the current interface and component information, thereby determining the type of pop-up corresponding to the ablation rule of the pop-up.

[0131] S2: When the pop-up type of the ablation rule obtained during the traversal is determined, the ablation rules in the ablation rule set are classified according to the pop-up type to obtain at least one rule set.

[0132] S3: When a user's type adjustment instruction is received, the target set is determined from each rule set according to the type adjustment instruction, and the corresponding ablation rule in the target set is turned on or off according to the type adjustment instruction.

[0133] The target set refers to the set of rules corresponding to the type of pop-up that the user wants to adjust for whether to enable or disable.

[0134] In this embodiment, the ablation rules in the ablation rule set are categorized according to the type of the pop-up window. This allows users to enable or disable the application of ablation rules with different pop-up window types according to their personal preferences, thereby improving the flexibility of ablation rule application.

[0135] like Figure 5 As shown, Figure 5 This is an example diagram illustrating a method for generating ablation rules in a pop-up window, as provided in an embodiment of this application. Figure 5In this method, the execution module for generating pop-up ablation rules can be divided into a pop-up recognition module, a pop-up ablation detection module, a pop-up ablation rule generation module, and a dynamic testing agent. Specifically, the target detection module in the pop-up recognition module identifies pop-up areas on the interface, and opacity analysis determines the proportion of shadow areas. The pop-up ablation detection module identifies clickable components within the pop-up area and determines user preference options and application preference options within the pop-up area. The pop-up classification module in the pop-up ablation rule generation module categorizes ablation rules according to pop-up type, and the UI element matching module matches and determines target components. The state abstraction strategy in the dynamic testing agent divides the historical traversal interface into multiple interface sets to avoid repeatedly generating ablation rules, and the fault tolerance strategy refers to maintaining interface transition graphs and other means to ensure smooth rule generation. Additionally, the pop-up context includes the component information corresponding to the pop-up and the interface component tree.

[0136] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0137] The following describes the device for generating ablation rules for pop-up frames provided in the embodiments of this application. The device for generating ablation rules for pop-up frames described below can be referred to in correspondence with the method for generating ablation rules for pop-up frames described above.

[0138] like Figure 6 As shown, this application provides a pop-up ablation rule generation device 500, the device comprising:

[0139] The pop-up detection module 501 is used to detect pop-ups on the current interface when the target application traverses the interface according to a preset traversal strategy. When a pop-up is detected on the current interface, the similarity between the current interface and the historically traversed interfaces is evaluated.

[0140] The information determination module 502 is used to determine the component information corresponding to the pop-up ablation event in the pop-up window of the current interface if there is no set of interfaces with a similarity higher than a preset threshold in the historical traversal interface.

[0141] The component determination module 503 is used to obtain the interface component tree of the current interface and perform similarity matching between the component information and the interface component tree to determine the target component that causes the pop-up in the current interface to disappear.

[0142] The rule generation module 504 is used to fill the relevant information of the target component into the preset template to obtain the ablation rule corresponding to the pop-up, and then continue to traverse the interface of the target application until all interfaces to be traversed are traversed. At that time, the ablation rule set of the target application is generated based on the ablation rule obtained during the traversal process.

[0143] In one embodiment, the pop-up detection module includes:

[0144] The Interface Acquisition submodule is used to retrieve the root interface of each interface set in the history traversal interface.

[0145] The similarity calculation submodule is used to calculate the similarity between the current interface and each root interface based on the component text and component position in the current interface and each root interface, and obtain the similarity between the current interface and each root interface.

[0146] The judgment submodule is used to determine if the similarity between the current interface and each root interface is not higher than a preset threshold, then there is no set of interfaces in the historical traversal interface that has a similarity higher than the preset threshold with the current interface; otherwise, there is a set of interfaces in the historical traversal interface that has a similarity higher than the preset threshold with the current interface.

[0147] In one embodiment, the pop-up detection module includes:

[0148] The model acquisition submodule is used to acquire a preset pop-up detection model;

[0149] The pop-up detection submodule is used to input a screenshot of the current interface into the pop-up detection model. If the output result is empty, it is assumed that there is no pop-up in the current interface; otherwise, the position information of the pop-up is obtained.

[0150] The pop-up check submodule is used to determine the non-pop-up area in the current interface based on the location information, and calculate the proportion of the shadow area in the non-pop-up area. If the proportion of the shadow area is lower than the preset proportion, it is considered that there is no pop-up in the current interface; otherwise, it is considered that there is a pop-up in the current interface.

[0151] In one embodiment, the information determination module includes:

[0152] The region determination submodule is used to obtain the position information of the pop-up window in order to determine the pop-up window region in the current interface;

[0153] The component recognition submodule is used to identify clickable components in the pop-up area, and combine component text and component contrast to determine user preference options and application preference options in each clickable component.

[0154] The priority determination submodule is used to determine the user preference options and application preference options as the optimal interaction objects, and to determine the clickable components other than the user preference options and application preference options as the second-best interaction objects.

[0155] The component click submodule is used to click each clickable component in sequence according to priority until a clickable component that causes the pop-up to disappear is determined. At that time, the component information of the clickable component is determined to be the component information corresponding to the pop-up disappearance event. When the priorities are the same, the clickable component to be clicked is randomly determined.

[0156] In one embodiment, the component determination module includes:

[0157] The distance calculation submodule is used to obtain the interface component tree of the current interface and calculate the Euclidean distance between the component information and each component in the interface component tree.

[0158] The component determination submodule is used to determine the component with the smallest Euclidean distance from the component information as the target component that will cause the pop-up in the current interface to disappear.

[0159] In one embodiment, the rule generation module includes:

[0160] The information acquisition submodule is used to acquire the path of the target component in the interface component tree, the text information of the target component, the click attributes of the target component, and the interface identifier to which it belongs, and to determine the acquired information as the relevant information of the target component.

[0161] The rule generation submodule is used to obtain a preset template and fill the relevant information of the target component into the corresponding position in the preset template to obtain the ablation rule corresponding to the pop-up.

[0162] In one embodiment, the pop-up ablation rule generation device further includes:

[0163] The type determination module is used to determine the type of pop-up corresponding to the ablation rule based on the current interface and component information.

[0164] The rule classification module is used to classify the ablation rules in the ablation rule set according to the pop-up type when the type of the ablation rule obtained during the traversal is determined, so as to obtain at least one rule set.

[0165] The rule switch module is used to determine the target set in each rule set according to the type adjustment instruction received from the user, and to turn on or off the corresponding ablation rules in the target set according to the type adjustment instruction.

[0166] The division of modules in the above-described pop-up ablation rule generation device is merely illustrative. In other embodiments, the pop-up ablation rule generation device can be divided into different modules as needed to complete all or part of its functions. Each module in the above-described pop-up ablation rule generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0167] In one embodiment, this application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the pop-up ablation rule generation method as described in any of the above embodiments.

[0168] In one embodiment, this application also provides a computer device storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the pop-up ablation rule generation method as described in any of the above embodiments.

[0169] Indicatively, such as Figure 7 As shown, Figure 7 This is a schematic diagram of the internal structure of a computer device 600 provided in an embodiment of this application. The computer device 600 can be provided as a server. (Refer to...) Figure 7 The computer device 600 includes a processing component 602, which further includes one or more processors, and memory resources represented by memory 601 for storing instructions, such as application programs, that can be executed by the processing component 602. The application programs stored in memory 601 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 602 is configured to execute instructions to perform the pop-up ablation rule generation method of any of the above embodiments.

[0170] The computer device 600 may also include a power supply component 603 configured to perform power management of the computer device 600, a wired or wireless network interface 604 configured to connect the computer device 600 to a network, and an input / output (I / O) interface 605. The computer device 600 may operate on an operating system stored in memory 601, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.

[0171] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0172] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising a…" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. In this document, the singular forms "a," "an," and "the" may also include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “comprising / including” or “having” specify the presence of the stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof. Meanwhile, the term “and / or” as used in this specification includes any and all combinations of the associated listed items.

[0173] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.

[0174] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating pop-up ablation rules, characterized in that, The method includes: When the target application traverses the interface according to the preset traversal strategy, pop-up detection is performed on the current interface. When a pop-up is detected in the current interface, the similarity between the current interface and the historically traversed interfaces is evaluated. If there is no set of interfaces in the history traversal interface that has a similarity higher than a preset threshold to the current interface, then the component information corresponding to the pop-up disappearance event is determined in the pop-up window of the current interface. Obtain the interface component tree of the current interface, and perform similarity matching between the component information and the interface component tree to determine the target component that causes the pop-up in the current interface to disappear; After filling the relevant information of the target component into the preset template to obtain the ablation rule corresponding to the pop-up, the interface of the target application is traversed until all interfaces to be traversed are traversed. Then, the ablation rule set of the target application is generated based on the ablation rule obtained during the traversal process.

2. The method for generating ablation rules for pop-up windows according to claim 1, characterized in that, The step of evaluating the similarity between the current interface and the historical traversal interfaces includes: Obtain the root interface of each interface set in the history traversal interface; Based on the component text and component position in the current interface and each root interface, calculate the similarity between the current interface and each root interface to obtain the similarity between the current interface and each root interface. If the similarity between the current interface and each root interface is not higher than a preset threshold, then there is no set of interfaces in the history of traversal that have a similarity higher than the preset threshold with the current interface; otherwise, there is a set of interfaces in the history of traversal that have a similarity higher than the preset threshold with the current interface.

3. The method for generating ablation rules for pop-up windows according to claim 1, characterized in that, The pop-up detection of the current interface includes: Obtain the preset pop-up detection model; Input a screenshot of the current interface into the pop-up detection model. If the output result is empty, it is considered that there is no pop-up in the current interface; otherwise, the position information of the pop-up is obtained. Based on the location information, determine the non-pop-up area in the current interface and calculate the proportion of the shadow area in the non-pop-up area. If the proportion of the shadow area is lower than the preset proportion, it is considered that there is no pop-up in the current interface; otherwise, it is considered that there is a pop-up in the current interface.

4. The method for generating ablation rules for pop-up windows according to claim 1, characterized in that, The step of determining the component information corresponding to the pop-up dissolve event in the current interface includes: Obtain the position information of the pop-up window to determine the pop-up window area in the current interface; Identify the clickable components in the pop-up area, and determine the user preference options and application preference options in each clickable component by combining the component text and component contrast. The user preference options and the application preference options are taken as the optimal interaction objects, and the components among the clickable components other than the user preference options and the application preference options are taken as the second-best interaction objects; Click each clickable component in sequence according to priority until a clickable component that causes the pop-up to disappear is determined. Then, the component information of the clickable component is determined as the component information corresponding to the pop-up disappearance event. If the priorities are the same, the clickable component to be clicked is randomly determined.

5. The method for generating ablation rules for pop-up windows according to claim 1, characterized in that, The step of obtaining the interface component tree of the current interface and performing similarity matching between the component information and the interface component tree includes: Obtain the interface component tree of the current interface, and calculate the Euclidean distance between the component information and each component in the interface component tree; The component with the smallest Euclidean distance from the component information is determined as the target component that causes the pop-up in the current interface to melt away.

6. The method for generating ablation rules for pop-up windows according to claim 1, characterized in that, The step of filling the relevant information of the target component into a preset template to obtain the ablation rule corresponding to the pop-up includes: Obtain the path of the target component in the interface component tree, the text information of the target component, the click attribute of the target component, and its associated interface identifier, and determine the obtained information as the relevant information of the target component; Obtain a preset template and fill in the relevant information of the target component into the corresponding position in the preset template to obtain the ablation rule corresponding to the pop-up.

7. The method for generating ablation rules for pop-up frames according to any one of claims 1 to 6, characterized in that, The method further includes: The type of pop-up window corresponding to the ablation rule is determined based on the current interface and the component information. When the pop-up type of the ablation rule obtained during the traversal is determined, the ablation rules in the ablation rule set are classified according to the pop-up type to obtain at least one rule set; When a user's type adjustment instruction is received, a target set is determined from each rule set according to the type adjustment instruction, and the corresponding ablation rule in the target set is turned on or off according to the type adjustment instruction.

8. A device for generating rules for ablation of pop-up frames, characterized in that, The device includes: The pop-up detection module is used to detect pop-ups on the current screen when the target application traverses the screen according to a preset traversal strategy. When a pop-up is detected on the current screen, the similarity between the current screen and the historically traversed screens is evaluated. The information determination module is used to determine the component information corresponding to the pop-up ablation event in the pop-up window of the current interface if there is no set of interfaces with a similarity higher than a preset threshold in the historical traversal interface. The component determination module is used to obtain the interface component tree of the current interface and perform similarity matching between the component information and the interface component tree to determine the target component that causes the pop-up in the current interface to disappear. The rule generation module is used to fill the relevant information of the target component into a preset template to obtain the ablation rule corresponding to the pop-up, and then continue to traverse the interface of the target application until all interfaces to be traversed are traversed. At that time, the ablation rule set of the target application is generated based on the ablation rule obtained during the traversal process.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the pop-up ablation rule generation method as described in any one of claims 1 to 7.

10. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the pop-up ablation rule generation method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Popup window processing method and device for automated case test, equipment and storage medium

    CN111258914A

  • Application program pop-up box control method and device, equipment, medium and product

    CN115309490A