Control visibility detection processing method and device, equipment and storage medium
By determining the visibility detection scenario of the control in the application and generating a visibility detection trigger, the problem that the existing technology cannot meet the business needs is solved, and flexible and efficient processing of control visibility detection is achieved.
Patent Information
- Application Number
- CN202311436463.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2025-05-06
AI Technical Summary
The existing control visibility detection framework cannot meet the diverse needs of business personnel for control visibility detection, especially when handling controls are covered or visible window sizes.
By determining the visibility detection scenario corresponding to the target control in the target application and receiving relevant visibility detection configuration information, a visibility detection trigger is generated to perform control visibility detection when a specific trigger condition is met.
It realizes flexible configuration of control visibility detection scenarios, meets the diversified needs of business personnel, and improves the accuracy and efficiency of control visibility detection.
Smart Images

Figure CN119938504A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a processing method, device, equipment and storage medium for control visibility detection. Background Art
[0002] Control visibility detection refers to the detection of the visibility of page controls. Control visibility detection can be used to process page logic based on the detection results. Most of the current control visibility detection frameworks trigger the detection of control visibility by determining the timing of control drawing, sliding, and control focus change. In addition, when detecting control visibility, most control visibility detection frameworks detect control visibility by detecting the width and height of the control, whether it is displayed, and whether it is on the screen. However, the above control visibility detection frameworks can no longer meet the needs of business personnel for control visibility detection. Summary of the invention
[0003] In order to solve the above technical problems, an embodiment of the present disclosure provides a method for processing control visibility detection.
[0004] In a first aspect, the present disclosure provides a method for processing control visibility detection, the method comprising:
[0005] Determine at least one visibility detection scenario corresponding to a target control in a target application; wherein the at least one visibility detection scenario respectively has a visibility detection trigger condition;
[0006] Receiving visibility detection configuration information for a first visibility detection scenario; wherein the visibility detection configuration information includes whether to perform visibility detection on the target control in the first visibility detection scenario;
[0007] Based on the visibility detection configuration information for the first visibility detection scenario, a visibility detection trigger for the target control is generated; wherein the visibility detection trigger is used to trigger visibility detection of the target control when the visibility detection trigger condition corresponding to the visibility detection scenario of the target control is determined.
[0008] In an optional implementation, the visibility detection trigger is specifically used to call a visibility detector when determining a visibility detection trigger condition corresponding to the visibility detection scenario of the target control during the running phase of the target application, and the visibility detector is used to perform visibility detection on the target control.
[0009] In an optional implementation manner, the method further includes:
[0010] Receive a parameter value configured for a first visibility detection parameter in the visibility detector; wherein the first visibility detection parameter includes a minimum visible ratio of a control's width to height and / or a minimum invisible ratio of a control's width to height, and the first visibility detection parameter is used by the visibility detector to determine whether the target control is visible by detecting the ratio of the target control's width to height.
[0011] In an optional implementation manner, the method further includes:
[0012] Receive a parameter value configured for a second visibility detection parameter in the visibility detector; wherein the second visibility detection parameter includes a minimum visible duration of a control and / or a minimum invisible duration of a control, and the second visibility detection parameter is used by the visibility detector to determine whether the target control is visible by detecting a single display duration of the target control.
[0013] In an optional implementation manner, the method further includes:
[0014] Receive a cover control configured for the target control; wherein the cover control is used by the visibility detector to determine whether the target control is visible by detecting visible areas respectively corresponding to the cover control and the target control.
[0015] In an optional implementation manner, the method further includes:
[0016] Receive a parameter value configured for a third visibility detection parameter in the visibility detector; wherein the third visibility detection parameter includes a visible window size, and the third visibility detection parameter is used by the visibility detector to determine whether the target control is visible by detecting an intersection area between the visible area of the target control and the visible window size.
[0017] In an optional implementation manner, determining at least one visibility detection scenario corresponding to a target control in a target application includes:
[0018] Obtaining a page control tree of a target control in a target application, and determining an ancestor control of the target control from the page control tree;
[0019] If it is determined that the ancestor control belongs to a preset control type, the scene corresponding to the ancestor control is determined as the visibility detection scene of the target control.
[0020] In an optional implementation manner, determining at least one visibility detection scenario corresponding to a target control in a target application includes:
[0021] The page switching scene and / or the foreground and background switching scene corresponding to the target control is determined as the visibility detection scene of the target control.
[0022] In an optional implementation manner, determining at least one visibility detection scenario corresponding to a target control in a target application includes:
[0023] A visibility detection scenario configured for a target control in a target application and a visibility detection trigger condition configured for the visibility detection scenario are received.
[0024] In an optional implementation manner, the method further includes:
[0025] Generate a visibility detection manager; wherein the visibility detection manager is used to adjust the visibility detection trigger of the target control and / or the visibility detector.
[0026] In a second aspect, the present disclosure provides a processing device for detecting visibility of a control, the device comprising:
[0027] A determination module, configured to determine at least one visibility detection scenario corresponding to a target control in a target application; wherein the at least one visibility detection scenario has a visibility detection trigger condition;
[0028] A first receiving module, configured to receive visibility detection configuration information for a first visibility detection scenario; wherein the visibility detection configuration information includes whether to perform visibility detection on the target control in the first visibility detection scenario;
[0029] The first generation module is used to generate a visibility detection trigger for the target control based on the visibility detection configuration information for the first visibility detection scenario; wherein the visibility detection trigger is used to call the visibility detector when any visibility detection trigger condition corresponding to the target control is determined during the running of the target application, and the visibility detector is used to perform visibility detection on the target control.
[0030] In a third aspect, the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the above method.
[0031] In a fourth aspect, the present disclosure provides a processing device for control visibility detection, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.
[0032] In a fifth aspect, the present disclosure provides a computer program product, wherein the computer program product comprises a computer program / instructions, and the computer program / instructions implement the above method when executed by a processor.
[0033] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has at least the following advantages:
[0034] The disclosed embodiment provides a method for processing control visibility detection, first, determining at least one visibility detection scenario corresponding to a target control in a target application, wherein at least one visibility detection scenario has a visibility detection trigger condition, receiving visibility detection configuration information for a first visibility detection scenario, wherein the visibility detection configuration information includes whether to perform visibility detection on the target control in the first visibility detection scenario, and then, based on the visibility detection configuration information for the first visibility detection scenario, generating a visibility detection trigger for the target control, wherein the visibility detection trigger is used to trigger visibility detection on the target control when the visibility detection trigger condition corresponding to the visibility detection scenario of the target control is determined. After determining the visibility detection scenario of the target control, the disclosed embodiment can also receive further configuration of the visibility detection scenario by the user, and then generate a visibility detection trigger for the target control, which is used to perform visibility detection on the target control once the visibility detection trigger condition is determined during the application running stage. It can be seen that the disclosed embodiment supports the configuration function of the visibility detection scenario of the target control, which meets the needs of business personnel for control visibility detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0037] Figure 1 A flow chart of a processing method for control visibility detection provided by an embodiment of the present disclosure;
[0038] Figure 2 A schematic diagram of a page control tree provided in an embodiment of the present disclosure;
[0039] Figure 3 A schematic diagram of a target control display area provided in an embodiment of the present disclosure;
[0040] Figure 4 A schematic diagram of the structure of a processing device for control visibility detection provided by an embodiment of the present disclosure;
[0041] Figure 5 A schematic diagram of the structure of a control visibility detection processing device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0042] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0043] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0044] Currently, most of the existing Android control visibility detection frameworks detect the visibility of controls by determining the timing of control drawing, sliding, and control focus change. In addition, when detecting control visibility, most control visibility detection frameworks detect control visibility by methods such as control width and height, display or not, and whether it is on the screen.
[0045] However, the relevant Android control visibility detection framework does not consider the situation where the control is covered, the size of the visible window, etc. In addition, the relevant Android control visibility detection framework generally detects the visibility of the control from the user's perspective, but the business definition may not be the same. Therefore, there may be situations where the control visibility detection does not meet the actual business needs. For example, the actual business demand is that the control is not hidden and visible again when switching between the foreground and background scenes, but that the control is always visible in this scene. If it is implemented based on the above control visibility detection framework, it cannot meet the above actual business needs.
[0046] In fact, the above control visibility detection framework can no longer meet the diverse needs of business personnel for control visibility detection.
[0047] To this end, the embodiment of the present disclosure provides a method for processing control visibility detection. Specifically, first, at least one visibility detection scenario corresponding to a target control in a target application is determined, wherein at least one visibility detection scenario has a visibility detection trigger condition, and visibility detection configuration information for a first visibility detection scenario is received, wherein the visibility detection configuration information includes whether to perform visibility detection on the target control under the first visibility detection scenario, and then, based on the visibility detection configuration information for the first visibility detection scenario, a visibility detection trigger for the target control is generated, wherein the visibility detection trigger is used to trigger visibility detection on the target control when the visibility detection trigger condition corresponding to the visibility detection scenario of the target control is determined. After determining the visibility detection scenario of the target control, the embodiment of the present disclosure can also receive further configuration of the visibility detection scenario by the user, and then generate a visibility detection trigger for the target control, which is used to perform visibility detection on the target control once the visibility detection trigger condition is determined during the application running stage. It can be seen that the embodiment of the present disclosure supports the configuration function of the visibility detection scenario of the target control, which meets the needs of business personnel for control visibility detection.
[0048] Specifically, the present disclosure provides a method for processing control visibility detection, referring to Figure 1 , is a flow chart of a processing method for control visibility detection provided by an embodiment of the present disclosure, the method specifically comprising:
[0049] S101: Determine at least one visibility detection scenario corresponding to a target control in a target application.
[0050] Wherein, the at least one visibility detection scenario respectively has a visibility detection trigger condition.
[0051] The processing method for control visibility detection provided by the embodiment of the present disclosure can be applied to the client, and can be specifically deployed in a software development program installed on the client, for example, in the form of an SDK (software development kit) product in the software development program.
[0052] In the disclosed embodiment, the target application may be any application that needs to perform control visibility detection, and the target control may be any page control that needs to perform visibility detection in the target application, such as a button control, a list control, a card control, or other types of controls.
[0053] In practical applications, by determining the visibility detection scenario of the target control, it is possible to detect the visibility of the target control in the visibility detection scenario. The target control may correspond to one or more visibility detection scenarios, and specifically, there is a need to detect the visibility of the target control in the one or more visibility detection scenarios.
[0054] In addition, each visibility detection scenario of the target control has a visibility detection trigger condition, which is used to determine when to trigger the detection of the visibility of the target control.
[0055] The visibility detection scenarios corresponding to the target control may include page switching scenarios, foreground and background switching scenarios, scenarios related to ancestor controls of the target control on the control page tree, and the like.
[0056] In an optional implementation, at least one visibility detection scenario corresponding to the target control may include a scenario related to an ancestor control of the target control on the control page tree. In order to determine the above visibility detection scenario, the disclosed embodiment may obtain a page control tree of the target control in the target application, and determine the ancestor control of the target control from the page control tree, and then determine the control type to which the ancestor control belongs. When it is determined that the ancestor control belongs to a preset control type, the scenario corresponding to the ancestor control is determined as the visibility detection scenario of the target control.
[0057] like Figure 2 As shown, it is a schematic diagram of a page control tree provided by an embodiment of the present disclosure. The page control tree contains a target control 201. According to the control relationship on the page control tree, the ancestor control of the target control is found, and the control type to which the ancestor control belongs is determined. When it is determined that the ancestor control belongs to a preset control type, the scene corresponding to the ancestor control is determined as the visibility detection scene of the target control.
[0058] The preset control types may include common control types in the Android system, such as a list control, a button control, and the like.
[0059] In another optional implementation, at least one visibility detection scenario corresponding to the target control may include a page switching scenario and / or a foreground and background switching scenario corresponding to the target control. In order to determine the above-mentioned visibility detection scenario, the disclosed embodiment may determine the page switching scenario and / or the foreground and background switching scenario corresponding to the target control as the visibility detection scenario of the target control.
[0060] In actual applications, based on the native capabilities of the system, page switching scenarios, foreground and background switching scenarios, scenarios related to ancestor controls of the target control on the control page tree, etc. can be detected. The disclosed embodiment detects the above scenarios through the native capabilities of the system and determines them as visibility detection scenarios corresponding to the target control, which can improve the efficiency of control visibility detection.
[0061] In actual applications, business personnel have different needs for visibility detection scenarios of some controls. If the visibility detection scenario is determined based on the native capabilities of the system, it cannot meet the needs of business personnel. Therefore, in order to meet the diverse needs of business personnel for visibility detection scenarios, the embodiments of the present disclosure can support business personnel to customize the visibility detection scenario configuration for the target control.
[0062] Specifically, a visibility detection scenario configured for a target control in a target application and a visibility detection trigger condition configured for the visibility detection scenario are received. Then, the visibility of the target control can be detected by combining the visibility detection scenario detected by the system native capability and the custom configured visibility detection scenario.
[0063] In an optional implementation, business personnel can configure a custom visibility detection scenario for a target control based on demand. For example, control visibility detection is paused during animation display, and control visibility detection is resumed after the animation ends.
[0064] In addition, there may be controls developed by business personnel in the target application that require visibility detection. For such controls, the system can receive customized visibility detection scenarios configured by business personnel to further meet the control visibility detection needs of business personnel.
[0065] S102: Receive visibility detection configuration information for a first visibility detection scenario.
[0066] The visibility detection configuration information includes whether to perform visibility detection on the target control in the first visibility detection scenario.
[0067] In the disclosed embodiment, the first visibility detection scene may be any visibility detection scene in the visibility detection scene corresponding to the target control. Visibility detection configuration information may be configured for each visibility detection scene corresponding to the target control to determine whether to detect the visibility of the target control in the corresponding visibility detection scene.
[0068] The configuration information of the control visibility detection for the first visibility detection scenario can be referred to as the first visibility detection configuration information, wherein the first visibility detection configuration information includes information on whether to perform visibility detection on the target control in the first visibility detection scenario. That is, through the first visibility detection configuration information, it can be determined whether to perform visibility detection on the target control in the first visibility detection scenario.
[0069] S103: Generate a visibility detection trigger for the target control based on the visibility detection configuration information for the first visibility detection scenario.
[0070] The visibility detection trigger is used to trigger visibility detection of the target control when determining the visibility detection trigger condition corresponding to the visibility detection scenario of the target control.
[0071] In the disclosed embodiment, a visibility detection trigger of a target control is generated based on visibility detection configuration information, wherein different visibility detection configuration information may be set for different visibility detection scenarios, and a corresponding visibility detection trigger is generated for the visibility detection configuration information corresponding to the same control. Specifically, one control may correspond to one visibility detection trigger, which is used to determine the visibility detection trigger condition corresponding to the visibility detection scenario of the control.
[0072] In the disclosed embodiment, the visibility detection trigger is deployed in the software package of the target application program including the target control, and is specifically used to call the visibility detector when the visibility detection trigger condition corresponding to the visibility detection scenario of the target control is determined during the running stage of the target application program, and the visibility detector is used to perform visibility detection on the target control. That is, when the target application program deployed with the visibility detection trigger is in the running process, the visibility detection trigger is started, and when any one or more visibility detection trigger conditions corresponding to the visibility detection scenario of the target control are determined, the visibility detector is called to trigger the visibility detection of the target control.
[0073] In the disclosed embodiment, the visibility detector is used to perform visibility detection on the target control when the visibility detection trigger condition corresponding to the visibility detection scenario of the target control occurs. Specifically, for the visibility detection items performed by the visibility detector on the target control, it can specifically support custom configuration of the parameters of the visibility detector to meet the diverse needs of business personnel for visibility detection.
[0074] In an optional embodiment, a parameter value configured for a first visibility detection parameter in a visibility detector is received, wherein the first visibility detection parameter includes a minimum visible ratio of a control width to height and / or a minimum invisible ratio of a control width to height, and the first visibility detection parameter is used by the visibility detector to determine whether a target control is visible by detecting the ratio of the width to height of the target control.
[0075] The minimum visible aspect ratio of a control refers to the minimum aspect ratio of a control that is considered visible. If the actual aspect ratio of the target control is greater than the minimum visible aspect ratio, the target control is visible. If the actual aspect ratio of the target control is less than the minimum visible aspect ratio, the target control is invisible.
[0076] In another optional implementation, a parameter value for a second visibility detection parameter configuration in a visibility detector is received, wherein the second visibility detection parameter includes a minimum visible duration of a control and / or a minimum invisible duration of a control, and the second visibility detection parameter is used by the visibility detector to determine whether a target control is visible by detecting a single display duration of the target control.
[0077] The minimum visible duration of a control refers to the minimum display duration of a target control on a page to be considered visible. That is, when the display duration of a target control is greater than the minimum visible duration, it is considered visible, and when the display duration is less than the minimum visible duration, it is considered invisible.
[0078] In another optional implementation, a cover control configured for a target control is received, wherein the cover control is used by a visibility detector to determine whether the target control is visible by detecting visible areas corresponding to the cover control and the target control respectively.
[0079] In the disclosed embodiment, the covering control is configured by a business person for a target control, and the covering control covers part of the display area of the target control to detect whether the visible area of the target control is visible.
[0080] The visible area of the target control may include a portion that is not blocked by the blocking control.
[0081] In an optional implementation, for ease of operation and understanding, the visible area can be preset as a rectangle, and for the covered part, the corresponding extended part is also cropped along the width and height of the covered control. If there is a remaining visible area, it is determined that the target control is visible.
[0082] like Figure 3 As shown, it is a schematic diagram of a target control display area provided by an embodiment of the present disclosure. The target control 301 is partially blocked in width and height by the blocked control 302, and the width and height of the blocked control 301 are extended, the extended area is cut out, and the remaining display area is used as a new visible area, as shown in the figure (the dotted line drawing part), based on the new visible area, it is determined that the target control is visible.
[0083] In another optional implementation, a parameter value configured for a third visibility detection parameter in the visibility detector may also be received, wherein the third visibility detection parameter includes a visible window size, and the third visibility detection parameter is used by the visibility detector to determine whether the target control is visible by detecting an intersection area between the visible area of the target control and the visible window size.
[0084] In the embodiment of the present disclosure, the visible window may be configured by business personnel for the target control. Specifically, the visible window may include the current display screen, the center of the current display screen, and the like.
[0085] In an optional implementation, after receiving a third visibility detection parameter containing a visible window size in the visibility detector, an intersection is performed with the received visible window size and the visible area of the target control. If the intersection area is not empty, the intersection area is used as the new visible area of the target control, and the target control is visible; if the intersection area is empty, the target control is invisible.
[0086] In actual applications, the visibility detector may be configured with multiple inspection items for detecting the visibility of the target control. In the embodiment of the present disclosure, when multiple inspection items are configured, business personnel can be supported to configure the inspection items to determine whether the target control is visible when a certain number of items are met.
[0087] In an optional implementation manner, the target control may be configured to determine that the target control is visible when all the check items meet the condition that the target control is visible.
[0088] In another optional implementation manner, the target control may be configured to determine that the target control is visible under the condition that some of the inspection items meet the requirement of being visible.
[0089] The disclosed embodiment provides a method for processing control visibility detection, first, determining at least one visibility detection scenario corresponding to a target control in a target application, wherein at least one visibility detection scenario has a visibility detection trigger condition, receiving visibility detection configuration information for a first visibility detection scenario, wherein the visibility detection configuration information includes whether to perform visibility detection on the target control in the first visibility detection scenario, and then, based on the visibility detection configuration information for the first visibility detection scenario, generating a visibility detection trigger for the target control, wherein the visibility detection trigger is used to trigger visibility detection on the target control when the visibility detection trigger condition corresponding to the visibility detection scenario of the target control is determined. After determining the visibility detection scenario of the target control, the disclosed embodiment can also receive further configuration of the visibility detection scenario by the user, and then generate a visibility detection trigger for the target control, which is used to perform visibility detection on the target control once the visibility detection trigger condition is determined during the application running stage. It can be seen that the disclosed embodiment supports the configuration function of the visibility detection scenario of the target control, which meets the needs of business personnel for control visibility detection.
[0090] In actual applications, in visibility detection scenarios, there may be situations where visibility detection is triggered repeatedly. To avoid repeated detection of the visibility of the target control in the same visibility detection scenario, the embodiments of the present disclosure also support customized configuration of which visibility detection scenarios support repeated visibility detection and which visibility detection scenarios prohibit repeated visibility detection.
[0091] Specifically, a parameter value of a fourth visibility detection parameter configuration in the visibility detector is received, wherein the fourth visibility detection parameter includes whether a certain visibility detection scene of the target control needs to re-detect visibility during a back-and-forth switching process.
[0092] On the basis of the above embodiments, in the process of calling the visibility detector to detect the visibility of the target control based on the visibility detection trigger, in order to support the change of the detection result of the visibility detection, the embodiment of the present disclosure also provides a visibility detection manager. Specifically, the visibility detection manager is used to adjust the visibility monitoring result of the target control.
[0093] In an optional implementation, a business person may manually change the visibility detection result of the target control through the visibility detection manager, and re-determine the visibility of the target control based on the changed visibility detection result.
[0094] Based on the above method embodiment, the present disclosure also provides a processing device for control visibility detection, referring to Figure 4 , is a structural diagram of a processing device for control visibility detection provided by an embodiment of the present disclosure, the device comprising:
[0095] The determination module 401 is used to determine at least one visibility detection scenario corresponding to a target control in a target application; wherein the at least one visibility detection scenario has a visibility detection trigger condition;
[0096] A first receiving module 402 is configured to receive visibility detection configuration information for a first visibility detection scenario; wherein the visibility detection configuration information includes whether to perform visibility detection on the target control in the first visibility detection scenario;
[0097] Generation module 403 is used to generate a visibility detection trigger for the target control based on the visibility detection configuration information for the first visibility detection scenario; wherein the visibility detection trigger is used to trigger visibility detection of the target control when the visibility detection trigger condition corresponding to the visibility detection scenario of the target control is determined.
[0098] In an optional implementation, the visibility detection trigger is specifically used to call a visibility detector when determining a visibility detection trigger condition corresponding to the visibility detection scenario of the target control during the running phase of the target application, and the visibility detector is used to perform visibility detection on the target control.
[0099] In an optional implementation, the device further includes:
[0100] A second receiving module is used to receive parameter values configured for a first visibility detection parameter in the visibility detector; wherein the first visibility detection parameter includes a minimum visible ratio of width to height of a control and / or a minimum invisible ratio of width to height of a control, and the first visibility detection parameter is used by the visibility detector to determine whether the target control is visible by detecting the ratio of width to height of the target control.
[0101] In an optional implementation, the device further includes:
[0102] A third receiving module is used to receive a parameter value configured for a second visibility detection parameter in the visibility detector; wherein the second visibility detection parameter includes a minimum visible duration of a control and / or a minimum invisible duration of a control, and the second visibility detection parameter is used by the visibility detector to determine whether the target control is visible by detecting a single display duration of the target control.
[0103] In an optional implementation, the device further includes:
[0104] A fourth receiving module is used to receive a cover control configured for the target control; wherein the cover control is used by the visibility detector to determine whether the target control is visible by detecting visible areas respectively corresponding to the cover control and the target control.
[0105] In an optional implementation, the device further includes:
[0106] A fifth receiving module is used to receive a parameter value configured for a third visibility detection parameter in the visibility detector; wherein the third visibility detection parameter includes a visible window size, and the third visibility detection parameter is used by the visibility detector to determine whether the target control is visible by detecting an intersection area between the visible area of the target control and the visible window size.
[0107] In an optional implementation manner, the determining module includes:
[0108] An acquisition module, used for acquiring a page control tree of a target control in a target application, and determining an ancestor control of the target control from the page control tree;
[0109] The first determination submodule is used to determine the scene corresponding to the ancestor control as the visibility detection scene of the target control when it is determined that the ancestor control belongs to a preset control type.
[0110] In an optional implementation manner, the determining module is specifically configured to:
[0111] The page switching scene and / or the foreground and background switching scene corresponding to the target control is determined as the visibility detection scene of the target control.
[0112] In an optional implementation manner, the determining module is specifically configured to:
[0113] A visibility detection scenario configured for a target control in a target application and a visibility detection trigger condition configured for the visibility detection scenario are received.
[0114] In an optional implementation, the device further includes:
[0115] The second generating module is used to generate a visibility detection manager; wherein the visibility detection manager is used to adjust the visibility detection trigger of the target control and / or the visibility detector.
[0116] In the control visibility detection processing device provided by the embodiment of the present disclosure, first, at least one visibility detection scenario corresponding to the target control in the target application is determined, wherein at least one visibility detection scenario has a visibility detection trigger condition, and visibility detection configuration information for the first visibility detection scenario is received, wherein the visibility detection configuration information includes whether to perform visibility detection on the target control in the first visibility detection scenario, and then, based on the visibility detection configuration information for the first visibility detection scenario, a visibility detection trigger for the target control is generated, wherein the visibility detection trigger is used to trigger visibility detection on the target control when the visibility detection trigger condition corresponding to the visibility detection scenario of the target control is determined. After determining the visibility detection scenario of the target control, the embodiment of the present disclosure can also receive further configuration of the visibility detection scenario by the user, and then generate a visibility detection trigger for the target control, which is used to perform visibility detection on the target control once the visibility detection trigger condition is determined during the application running stage. It can be seen that the embodiment of the present disclosure supports the configuration function of the visibility detection scenario of the target control, which meets the needs of business personnel for control visibility detection.
[0117] In addition to the above-mentioned methods and apparatus, the embodiments of the present disclosure also provide a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device implements the processing method for control visibility detection described in the embodiments of the present disclosure.
[0118] The embodiments of the present disclosure also provide a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the processing method for control visibility detection described in the embodiments of the present disclosure is implemented.
[0119] In addition, the present disclosure also provides a processing device for detecting visibility of a control, see Figure 5 As shown, this may include:
[0120] Processor 501, memory 502, input device 503 and output device 505. The number of processors 501 in the control visibility detection processing device can be one or more. Figure 5 In some embodiments of the present disclosure, the processor 501, the memory 502, the input device 503 and the output device 505 may be connected via a bus or other means, wherein: Figure 5 The example of connecting through bus is taken in the following.
[0121] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing of the control visibility detection processing device by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. The input device 503 may be used to receive input digital or character information, and to generate signal input related to user settings and function control of the control visibility detection processing device.
[0122] Specifically in this embodiment, the processor 501 will load the executable files corresponding to the processes of one or more applications into the memory 502 according to the following instructions, and the processor 501 will run the applications stored in the memory 502, thereby realizing the various functions of the above-mentioned control visibility detection processing device.
[0123] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0124] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be 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 the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for processing control visibility detection, characterized in that: The method comprises: Determine at least one visibility detection scenario corresponding to a target control in a target application; wherein the at least one visibility detection scenario respectively has a visibility detection trigger condition; Receiving visibility detection configuration information for a first visibility detection scenario; wherein the visibility detection configuration information includes whether to perform visibility detection on the target control in the first visibility detection scenario; Based on the visibility detection configuration information for the first visibility detection scenario, a visibility detection trigger for the target control is generated; wherein the visibility detection trigger is used to trigger visibility detection of the target control when the visibility detection trigger condition corresponding to the visibility detection scenario of the target control is determined.
2. The method according to claim 1, characterized in that: The visibility detection trigger is specifically used to call the visibility detector when determining the visibility detection trigger condition corresponding to the visibility detection scenario of the target control during the running phase of the target application, and the visibility detector is used to perform visibility detection on the target control.
3. The method according to claim 2, characterized in that The method further comprises: Receive a parameter value configured for a first visibility detection parameter in the visibility detector; wherein the first visibility detection parameter includes a minimum visible ratio of a control's width to height and / or a minimum invisible ratio of a control's width to height, and the first visibility detection parameter is used by the visibility detector to determine whether the target control is visible by detecting the ratio of the target control's width to height.
4. The method according to claim 2, characterized in that: The method further comprises: Receive a parameter value configured for a second visibility detection parameter in the visibility detector; wherein the second visibility detection parameter includes a minimum visible duration of a control and / or a minimum invisible duration of a control, and the second visibility detection parameter is used by the visibility detector to determine whether the target control is visible by detecting a single display duration of the target control.
5. The method according to claim 2, characterized in that: The method further comprises: Receive a cover control configured for the target control; wherein the cover control is used by the visibility detector to determine whether the target control is visible by detecting visible areas respectively corresponding to the cover control and the target control.
6. The method according to claim 2, characterized in that The method further comprises: Receive a parameter value configured for a third visibility detection parameter in the visibility detector; wherein the third visibility detection parameter includes a visible window size, and the third visibility detection parameter is used by the visibility detector to determine whether the target control is visible by detecting an intersection area between the visible area of the target control and the visible window size.
7. The method according to claim 1, characterized in that The determining at least one visibility detection scenario corresponding to the target control in the target application includes: Obtain a page control tree of a target control in a target application, and determine an ancestor control of the target control from the page control tree; If it is determined that the ancestor control belongs to a preset control type, the scene corresponding to the ancestor control is determined as the visibility detection scene of the target control.
8. The method according to claim 1, characterized in that The determining at least one visibility detection scenario corresponding to the target control in the target application includes: The page switching scene and / or the foreground and background switching scene corresponding to the target control is determined as the visibility detection scene of the target control.
9. The method according to claim 1, characterized in that: The determining at least one visibility detection scenario corresponding to the target control in the target application includes: A visibility detection scenario configured for a target control in a target application and a visibility detection trigger condition configured for the visibility detection scenario are received.
10. The method according to claim 1 or 2, characterized in that: The method further comprises: Generate a visibility detection manager; wherein the visibility detection manager is used to adjust the visibility detection trigger of the target control and / or the visibility detector.
11. A processing device for control visibility detection, characterized in that: The device comprises: A determination module, configured to determine at least one visibility detection scenario corresponding to a target control in a target application; wherein the at least one visibility detection scenario has a visibility detection trigger condition; A first receiving module, configured to receive visibility detection configuration information for a first visibility detection scenario; wherein the visibility detection configuration information includes whether to perform visibility detection on the target control in the first visibility detection scenario; A generation module is used to generate a visibility detection trigger for the target control based on the visibility detection configuration information for the first visibility detection scenario; wherein the visibility detection trigger is used to trigger visibility detection of the target control when the visibility detection trigger condition corresponding to the visibility detection scenario of the target control is determined.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the method according to any one of claims 1 to 10.
13. A processing device for control visibility detection, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 10 is implemented.