View overdrawing detection method and device, readable medium and electronic equipment
By monitoring the visibility changes of the control view, using the search and collision detection technology of the root view and subview, the over-drawing of the control view is automatically detected, solving the problems of insufficient information and low efficiency in the existing technology, and achieving efficient and accurate over-plot analysis.
Patent Information
- Application Number
- CN202411515400.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-28
AI Technical Summary
The prior art detects and analyzes the over-drawing problem of control views, insufficient information volume, resulting in low efficiency in subsequent analysis and optimization and time-consuming.
By listening to the visibility changes of the control view on the page, obtain the root view and search for the subview to form a control collection. Then, using collision detection technology, the intersection control view is combined to determine whether the number of combined views has reached the over-number threshold, thereby determining whether there is over-drawing.
It realizes automatic detection and analysis of the problem of overdrawing control views, clarifying the composition of the overdrawing area, improving the comprehensiveness and accuracy of detection, reducing time-consuming and improving efficiency.
Smart Images

Figure CN119440949A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and more specifically, to a view over-drawing detection method, a view over-drawing detection device, a computer-readable medium, and an electronic device. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims, and no description herein is admitted to be prior art by inclusion in this section.
[0003] The control view is a visual display element contained in the page of the APP (Application), and each page can usually include multiple control views. During the page display process, the control view needs to be drawn so that it presents a display effect that meets the definition. When there is an overlapping relationship between control views, only the top layer of the jointly covered area is visible, but the lower layer will still be drawn in the same frame, resulting in the problem of overdrawing (OverDraw). Overdrawing will occupy additional hardware resources and even cause the APP to run stuck, affecting the page loading efficiency and presentation effect.
[0004] Currently, you can enable the function of debugging GPU over-drawing to display the areas with over-drawing in the page. However, simply displaying the areas with over-drawing provides insufficient information. Subsequent analysis and optimization require more in-depth and detailed troubleshooting, which is time-consuming and inefficient. Summary of the invention
[0005] In this context, embodiments of the present disclosure are intended to provide a view over-drawing detection method, a view over-drawing detection device, a computer-readable medium, and an electronic device.
[0006] According to a first aspect of an embodiment of the present disclosure, a method for detecting over-drawing of views is provided, which may include: when a visibility change of a control view is detected on a page, obtaining a root view in the page; searching for sub-views of corresponding branches in the page based on the root view, and adding the root view and the sub-views as original control views to a control set; in the control set, taking the original control view in an unused state as a reference control, performing collision detection with each other original control view in an unused state, and performing collision detection with each intersection control view that does not contain the reference control, and setting the reference control to a used state after the collision detection process is completed; wherein the reference control is combined with other original control views or intersection control views that generate intersections during the collision detection process to form a newly added intersection control view in the control set; when all the original control views in the control set are in a used state, determining that the intersection control view whose number of combined views is greater than or equal to an excessive number threshold is over-drawn.
[0007] Optionally, when a visibility change of a control view is monitored on the page, the root view in the page is obtained, including: when a visibility change of the control view is monitored on the page, waiting for a preset loading time; when no visibility change of the control view occurs on the page within the preset loading time, obtaining the root view in the page.
[0008] Optionally, in the control set, the original control view in an unused state is used as a benchmark control, and collision detection is performed with each other original control view in an unused state, and collision detection is performed with each intersection control view that does not contain the benchmark control, and before the benchmark control is set to a used state after the collision detection process is completed, the method also includes: filtering the original control views in the control set based on a pruning condition; the pruning condition is set based on the area covered by the drawing content of the original control view.
[0009] Optionally, the pruning condition includes at least one of the following:
[0010] Filter the original control views without drawing content;
[0011] The original control views having drawing contents and whose area covered by the drawing contents is smaller than or equal to the first preset area size are filtered.
[0012] Optionally, the pruning condition includes:
[0013] Filtering the original control views having drawing content, where the area covered by the drawing content is greater than or equal to the second preset area size;
[0014] Furthermore, before determining that the intersection control view whose number of combined views is greater than or equal to an excessive number threshold is over-drawn, it also includes: when the original control views in the control set are all in a used state, the original control view having drawing content and an area covered by the drawing content greater than or equal to a second preset area size is combined with each of the original control views or the intersection control views in the control set to form a newly added intersection control view in the control set.
[0015] Optionally, after determining that the intersection control view whose number of combined views is greater than or equal to an excessive number threshold is over-drawn, it also includes: when it is determined that the over-drawn intersection control view has an ignore mark, filtering based on the ignore mark; the ignore mark indicates that the over-drawing of the intersection control view shall not be processed.
[0016] Optionally, after determining that the intersection control view whose number of combined views is greater than or equal to an excessive number threshold is over-drawn, it also includes: in the intersection control view determined to be over-drawn, respectively obtaining the original view snapshot of each original control view; combining the intersection view snapshot corresponding to the intersection control view based on the original view snapshot; and writing the intersection view snapshot into a circular buffer pool.
[0017] Optionally, after writing the intersection view snapshot into the circular buffer pool, the method further includes: in response to a visualization request for the intersection view snapshot in the circular buffer pool, performing a visual hierarchical display based on the hierarchical relationship between the original view snapshots in the intersection view snapshot.
[0018] Optionally, the visual hierarchical display based on the hierarchical relationship between the original view snapshots in the intersection view snapshot further includes: in response to a selection operation on the original view snapshot in the intersection view snapshot, displaying code information of the original view snapshot.
[0019] Optionally, the visual hierarchical display is based on the hierarchical relationship between the original view snapshots in the intersection view snapshot, and further includes: in response to an ignore operation on the intersection view snapshot, setting an ignore mark for the intersection control view corresponding to the intersection view snapshot; the ignore operation is used to indicate that over-drawing of the intersection control view corresponding to the intersection view snapshot shall not be processed.
[0020] Optionally, the method is applied to a client, and after setting an ignore mark for the intersection control view corresponding to the intersection view snapshot, the method further includes: synchronizing the intersection control view with the ignore mark to a server; the server is used to store the intersection control view with the ignore mark provided by at least one client, and provide the intersection control view with the ignore mark to any client when any client determines that the intersection control view is overdrawn.
[0021] Optionally, after determining that the intersection control view whose number of combined views is greater than or equal to an excessive number threshold is over-drawn, it also includes: among the intersection control views determined to be over-drawn, analyzing at least one of the intersection control views, and providing corresponding modification suggestions based on the analysis; the modification suggestions include at least one of removing the background, reducing the hierarchy, and customizing the drawing area.
[0022] According to a second aspect of an embodiment of the present disclosure, a view over-drawing detection device is provided, which may include: a control view acquisition module, which is used to acquire a root view in the page when monitoring a visibility change of a control view on the page; the control view acquisition module is also used to search for a sub-view of a corresponding branch in the page based on the root view, and add the root view and the sub-view as original control views to a control set; a view collision detection module, which is used to perform collision detection with each other original control view in the unused state in the control set, and with each intersection control view that does not contain the reference control, using the original control view in the unused state as a reference control, and perform collision detection with each intersection control view that does not contain the reference control, and set the reference control to a used state after the collision detection process is completed; wherein the reference control is combined with other original control views or intersection control views that have an intersection in the collision detection process to form a newly added intersection control view in the control set; an over-drawing extraction module, which is used to determine that the intersection control view whose number of combined views is greater than or equal to an excessive number threshold is over-drawn when all the original control views in the control set are in the used state.
[0023] Optionally, the control view acquisition module is specifically used to wait for a preset loading time when monitoring a visibility change of the control view on the page; when no visibility change of the control view on the page occurs within the preset loading time, obtain the root view in the page.
[0024] Optionally, the control view acquisition module is further used to filter the original control views in the control set based on a pruning condition; the pruning condition is set based on an area covered by the drawing content of the original control view.
[0025] Optionally, the pruning condition includes at least one of the following:
[0026] Filter the original control views without drawing content;
[0027] The original control views having drawing contents and whose area covered by the drawing contents is smaller than or equal to the first preset area size are filtered.
[0028] Optionally, the pruning condition includes:
[0029] Filtering the original control views having drawing content, where the area covered by the drawing content is greater than or equal to the second preset area size;
[0030] Furthermore, the view collision detection module is also used to combine the original control view with drawing content and the area covered by the drawing content greater than or equal to the second preset area size with each of the original control views or the intersection control views in the control set, when all the original control views in the control set are in use, so as to form a newly added intersection control view in the control set.
[0031] Optionally, the over-drawing extraction module is further used to filter based on the ignore mark when it is determined that the over-drawn intersection control view has an ignore mark; the ignore mark indicates that the over-drawing of the intersection control view is not to be processed.
[0032] Optionally, the device also includes a view snapshot cache module, which is used to obtain the original view snapshot of each original control view in the intersection control view determined to be overdrawn; combine the intersection view snapshot corresponding to the intersection control view based on the original view snapshot; and write the intersection view snapshot into a circular buffer pool.
[0033] Optionally, the device further comprises a view snapshot display module, configured to respond to a visualization request for the intersection view snapshot in the circular buffer pool and perform a visual hierarchical display based on a hierarchical relationship between the original view snapshots in the intersection view snapshot.
[0034] Optionally, the view snapshot display module is further configured to display code information of the original view snapshot in response to a selection operation on the original view snapshot in the intersection view snapshot.
[0035] Optionally, the view snapshot display module is used to set an ignore mark for the intersection control view corresponding to the intersection view snapshot in response to an ignore operation on the intersection view snapshot; the ignore operation is used to indicate that over-drawing of the intersection control view corresponding to the intersection view snapshot shall not be processed.
[0036] Optionally, the device is applied to a client, and the device also includes: an ignore mark synchronization module, used to synchronize the intersection control view with the ignore mark to a server; the server is used to store the intersection control view with the ignore mark provided by at least one client, and when any client determines that the intersection control view is over-drawn, provide the intersection control view with the ignore mark to any client.
[0037] Optionally, the over-drawing analysis module is used to analyze at least one of the intersection control views determined to be over-drawn, and provide corresponding modification suggestions based on the analysis; the modification suggestions include at least one of removing the background, reducing the hierarchy, and customizing the drawing area.
[0038] According to a third aspect of an embodiment of the present disclosure, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any one of the above-mentioned view overdrawing detection methods is implemented.
[0039] According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned view overdrawing detection methods by executing the executable instructions.
[0040] According to the view over-drawing detection method of the embodiment of the present disclosure, when a visibility change of a control view is monitored on the page, the root view in the page is obtained, and then the sub-views of the corresponding branch are searched in the page based on the root view, and a control set is obtained with the root view and the sub-views as the original spatial views; in the control set, an original control view in an unused state is used as a benchmark control, and collision detection is performed with each other original control view in an unused state, and with each intersection control view that does not contain the benchmark control, and the benchmark control is set to the used state after the collision detection process is completed; wherein, the benchmark control is combined with other original control views or intersection control views that generate intersections during the collision detection process to form a newly added intersection control view in the control set; when all original control views in the control set are in the used state, it is determined that the intersection control view whose number of combined views is greater than or equal to the excessive number threshold is over-drawn. This solution automatically monitors the visibility changes of control views on the page, triggers a search for page control views based on root views and subviews, and then performs collision detection on control views and their combinations to check for possible over-drawing problems. It can clearly identify the composition of control views in the over-drawing area, effectively improving the comprehensiveness and accuracy of over-drawing troubleshooting, with short time consumption and high efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:
[0042] Figure 1 One of the flow charts of the steps of the view overdrawing detection method according to an embodiment of the present disclosure is shown.
[0043] Figure 2 A schematic diagram of the view tree structure in a page of an embodiment of the present disclosure is shown.
[0044] Figure 3 A schematic diagram of the collision detection principle of an embodiment of the present disclosure is shown.
[0045] Figure 4 The second flowchart of the view overdrawing detection method according to the embodiment of the present disclosure is shown.
[0046] Figure 5 The third step flow chart of the view overdrawing detection method according to the embodiment of the present disclosure is shown.
[0047] Figure 6 A schematic diagram of a circular buffer pool according to an embodiment of the present disclosure is shown.
[0048] Figure 7 A schematic diagram of an intersection view snapshot display interface according to an embodiment of the present disclosure is shown.
[0049] Figure 8 A schematic flow chart of the ignore mark management steps of an embodiment of the present disclosure is shown.
[0050] Fig. 9 A schematic diagram of a view over-drawing detection device according to an embodiment of the present disclosure is shown.
[0051] Fig.10 A schematic diagram of a computer readable medium illustrating an embodiment of the present disclosure is shown.
[0052] Fig.11 A schematic diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0053] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0054] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0055] According to an embodiment of the present disclosure, a view over-drawing detection method, a view over-drawing detection device, a computer-readable medium and an electronic device are provided.
[0056] In this document, any number of elements in the drawings is used for illustration rather than limitation, and any naming is used only for distinction and does not have any limiting meaning.
[0057] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.
[0058] Any page of an APP is usually composed of multiple control views, and its structure is in a tree shape. From the root node, child nodes and child nodes of child nodes are branched out layer by layer. The node is the control view. When any two or more control views overlap, the overlapping areas will have overdrawing problems. At this time, the overlapping areas are only visible to the topmost layer, but the covered areas will also be drawn in the same frame, resulting in additional resource usage.
[0059] To address the above issues, currently the native system is often used to enable the function of debugging GPU over-drawing to display the areas with over-drawing in the page. However, this method can only prompt the top-level visible content in the overlapping areas. Usually, further manual analysis of the control views involved in the over-drawing is required to support the subsequent optimization of the control views, which is time-consuming and inefficient.
[0060] In the implementation manner of the present disclosure, by automatically monitoring the visibility changes of control views on the page, triggering a page control view search based on the root view and subviews, and then performing collision detection on the control views and their combinations to check for possible over-drawing problems, the control view composition of the over-drawing area can be clarified, effectively improving the comprehensiveness and accuracy of over-drawing troubleshooting, saving time and increasing efficiency.
[0061] After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention are described in detail below.
[0062] Exemplary application scenarios
[0063] It should be noted that the following application scenarios are only shown to facilitate understanding of the spirit and principle of the present invention, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0064] The view over-drawing detection method of the disclosed embodiment can be applied to a variety of application scenarios involving page development and view optimization as well as optimization of hardware resource utilization in page display.
[0065] In one application scenario, it may involve APP page development. During page development and device adaptation, over-drawing detection is performed on the control view.
[0066] In another application scenario, view optimization may be involved during the actual display of the APP page, and the embodiments of the present disclosure do not impose specific limitations on this.
[0067] Exemplary Methods
[0068] In combination with the above application scenarios, Figure 1 A view overdrawing detection method according to an exemplary embodiment of the present disclosure is described.
[0069] like Figure 1 One of the step flow charts of the view overdrawing detection method according to the exemplary embodiment of the present disclosure may include the following steps 101 to 104:
[0070] Step 101: When monitoring a visibility change of a control view on a page, obtain the root view in the page.
[0071] In the disclosed embodiment, the visibility changes of the control view can be monitored for each page that needs to be detected for over-drawing. Visibility is the display mechanism of the control view, including control transparency, display and hiding status, and can also be size, shape or size. It can be seen that the visibility change of the control view will further cause the coverage relationship of the control view to change. Therefore, by monitoring the visibility changes, it can be further determined whether to perform subsequent collision detection and over-drawing troubleshooting based on the change in the coverage relationship of the control view. The above monitoring can be achieved by registering a corresponding listener for each page. Through the monitoring callback, a prompt will be triggered when the visibility change of the control view on the page occurs.
[0072] Furthermore, the page is a tree structure, and the view tree is constructed by nested control views. The root view is the control view corresponding to the root node in the tree structure. Starting from the root node, all child nodes and child nodes of child nodes can be determined. When it is determined that the visibility of the control view on the page has changed, its root view can be obtained based on the tree structure on the page.
[0073] Step 102: Search the page for the sub-view of the corresponding branch based on the root view, and add the root view and the sub-view as original control views to the control collection.
[0074] In the embodiment of the present disclosure, based on obtaining the root view, the subviews of the corresponding branches can be searched from the root view to the end along the tree structure in the page to obtain all the subviews in the page. On this basis, the root view and the subviews can be used as the original control views of the page to create a control set containing the original control views. Subsequent overdrawing detection is performed on the control set.
[0075] like Figure 2 A schematic diagram of a view tree structure in a page of an exemplary embodiment of the present disclosure is shown, and the page includes pages 201 that overlap each other. Page 201 includes control views A, B, C, D, E, F, and G. The mutual nesting relationship of each control view in page 201 can be represented as a view tree 202. In the view tree 202, there are 4 layers from the control view A of the root node to the control view G of the last child node.
[0076] On this basis, when the visibility change of the control view is monitored in page 201, the root view A can be obtained, and the subviews of the corresponding branch can be searched in the page based on the root view A to obtain subviews B, C, D, E, F and G. The root view A and subviews B, C, D, E, F and G are added to the control collection as the original control views of the page 201 for subsequent overdrawing detection.
[0077] Step 103: In the control set, an original control view in an unused state is used as a reference control, and collision detection is performed with each other original control view in an unused state, and with each intersection control view that does not contain the reference control, and the reference control is set to a used state after the collision detection process is completed; wherein the reference control is combined with other original control views or intersection control views that generate intersections during the collision detection process to form a newly added intersection control view in the control set.
[0078] In the disclosed embodiment, the overlapping relationship between control views can be determined by collision detection, and then overdrawing detection can be implemented based on the overlapping relationship. In the control set, collision detection can be performed on each original control view one by one. The original control view that has not completed the collision detection is in an unused state, and the original control view that has completed the collision detection is set from the unused state to the used state. Before the first original control view in the control set completes the collision detection, each original control view is in an unused state; after the last original control view completes the collision detection, each original control view is in a used state.
[0079] Furthermore, the original control view in an unused state can be used as a reference control in the collision detection process. The reference control performs collision detection with each other original control view in an unused state, and performs collision detection with each intersection control view that does not contain the reference control, and combines the reference control with other original control views or intersection control views that intersect during the collision detection process to form a newly added intersection control view in the control collection. In the control collection, there is no intersection control view before the first original control view completes the collision detection.
[0080] For example, the control set includes original control views a, b, c, d, and e, all of which are unused. First, the original control view a is used as the base control, and collision detection is performed with the original control views b, c, d, and e respectively, where the base control intersects with the original control views b, d, and e respectively.
[0081] Among them, taking the original control views a and b as examples, the collision detection principle in the embodiment of the present disclosure is as follows: Figure 3 Schematic. With the page corner as coordinate (0,0), the coordinate information of control view a in the page can be obtained, the upper left endpoint coordinate (50,70) and the lower right endpoint coordinate (100,140); and the coordinate information of control view b, the upper left endpoint coordinate (80,80) and the lower right endpoint coordinate (90,125). The shadow area 301 is the intersection area of the original control views a and b. At this time, the coordinate information of the shadow area 301 can be obtained by the following algorithm.
[0082] MaxLeft=Max(ALeft,BLeft)
[0083] MaxTop=Max(ATop,BTop)
[0084] MinRight=Min(ARight,BRight)
[0085] MinBottom=Min(ABottom,BBottom)
[0086] And, the coordinates of the upper left endpoint and the lower right endpoint of the shadow area 301 surrounded by (MaxLeft, MaxTop) and (MinRight, MinBottom) are (80,80) and (100,125).
[0087] The same can be applied to other original control views. According to the collision detection results, new intersection control views ab, ad, and ae are added to the control collection, and the baseline control at this time, that is, the original control view a, is set to the used state.
[0088] Then, the original control view b is used as the base control, and collision detection is performed with the original control views c, d, and e, as well as with the intersection control views ad and ae. Since the intersection control view ab already contains the base control for this round of collision detection, no collision detection is performed. Among them, the base control intersects with the original control view c and the intersection control view ae, respectively, so the intersection control views bc and bae are added to the control collection, and the base control at this time, that is, the original control view b, is set to the used state.
[0089] The subsequent collision detection process of the original control views c, d and e can be deduced in this way until the original control views a, b, c, d and e are all in the used state.
[0090] Step 104: When all original control views in the control set are in a used state, it is determined that the intersection control views whose number of combined views is greater than or equal to an excessive number threshold are overdrawn.
[0091] In the embodiment of the present disclosure, after completing the collision detection of all original control views, the control collection includes all the original control views in use and the newly added intersection control view. On this basis, the intersection control views in the control collection are checked for over-drawing. The number of combined views refers to the number of single original control views contained in the intersection control view. Since the intersection control view is composed of different original control views with common areas after collision detection, there is a problem of overlapping intersection areas, and the number of combined views corresponds to the number of drawing times. The excessive number threshold can be dynamically set according to actual conditions such as business characteristics, hardware conditions and network quality. For example, a higher excessive number threshold can be set when the hardware configuration and network quality are high without affecting normal business; or, the excessive number threshold can also be a statically set custom value, such as 2, 3, 4, etc., which is not specifically limited in the embodiment of the present disclosure.
[0092] On this basis, in the intersection control view, when the number of combined views is greater than or equal to the excessive number threshold, it can be considered that there is an over-drawing problem, thereby completing the over-drawing detection on the page.
[0093] like Figure 4 The second step flow chart of the view overdrawing detection method according to the exemplary embodiment of the present disclosure may include the following steps 401 to 407:
[0094] Step 401: When monitoring a visibility change of a control view on a page, wait for a preset loading time.
[0095] In the disclosed embodiments, the visibility change of the control view may also occur during the page loading process, or when the page is in the animation playback state. Therefore, when the visibility change of the control view is monitored on the page, you can first wait for the preset loading time to determine whether the monitoring of the visibility change is called back multiple times within a certain period of time. The preset loading time can be set according to the loading speed of the page. The loading speed of the page may be affected by factors such as hardware conditions, network quality, and the number of page elements, or it can be a custom value. For example, the preset loading time can be set to 1 second, 1.5 seconds, 2 seconds, etc., and the disclosed embodiments do not impose specific restrictions on this.
[0096] Step 402: When the visibility of the control view does not change on the page within the preset loading time, obtain the root view in the page.
[0097] In the disclosed embodiment, when no new visibility change of the control view occurs on the page while waiting for the preset loading time, it can be considered that the visibility change of the control view that triggered the waiting for the preset loading time occurred when the page has been loaded or the animation has been played; conversely, if a new visibility change of the control view occurs on the page within the preset loading time, it is considered that the visibility change of the control view that triggered the waiting for the preset loading time occurred when the page has not been loaded or the animation has not been played, and you can wait for the change in the page to end.
[0098] Furthermore, after monitoring the visibility change of the control view on the page and no new visibility change of the control view occurs on the page within the preset loading time, the root view acquisition of the subsequent steps is further triggered, thereby saving hardware resources and avoiding wasting resources by searching for redundant root views and subviews of the control view in the page.
[0099] For example, after monitoring the visibility change of the control view on the page and waiting for a preset loading time without a new visibility change of the control view on the page, you can obtain the root view of the page through the API (Application Programming Interface): getWindow().getDecorView().
[0100] Step 403: Search the page for the sub-view of the corresponding branch based on the root view, and add the root view and the sub-view as original control views to the control collection.
[0101] In the embodiment of the present disclosure, step 403 may correspond to the relevant description of the aforementioned step 102, and will not be described again here to avoid repetition.
[0102] Step 404: Filter the original control views in the control set based on a pruning condition; the pruning condition is set based on the area covered by the drawing content of the original control view.
[0103] In the disclosed embodiment, the control set created in step 403 includes all the original control views in the page. It takes a long time and is inefficient to perform collision detection on all the original control views. Therefore, the original control views in the control set can be filtered by setting pruning conditions. The pruning conditions can be set based on the area covered by the drawing content of the original control view. Since the area covered by the drawing content of the original control view is related to whether there is an intersection with other original control views, the probability of each original control view intersecting with other original control views can be evaluated based on the setting of pruning conditions. For example, when the area covered by the drawing content of the original control view is large, the probability of intersecting with other original control views is large, otherwise it is small; or, according to the layout of the original control views in the page, it may be that when the area covered by the drawing content of the original control view is located in the center of the page, the probability of intersecting with other original control views is large, otherwise it is small, and so on. Therefore, by filtering the original control views in the control set based on the pruning conditions, some original control views that need to be subjected to subsequent collision detection can be selected according to actual needs, shortening the time consumption and improving efficiency.
[0104] In an optional embodiment of the present disclosure, the pruning condition may include filtering original control views without drawing content.
[0105] In the embodiment of the present disclosure, when the original control view has no drawing content, it does not have an area covered by the drawing content, and thus does not intersect with other original control views with drawing content, and is not an object of over-drawing analysis. It can be filtered by setting corresponding pruning conditions to avoid excessive collision detection.
[0106] In an optional embodiment of the present disclosure, the pruning condition may include filtering original control views having drawing content and an area covered by the drawing content that is smaller than or equal to a first preset area size.
[0107] In the disclosed embodiment, the first preset area size can be set according to the actual page size and the statistical index of the size of the area covered by the drawn content of the original control view. The statistical index can be the mean, median, standard deviation, etc. On this basis, the original control view may have drawn content, but the area covered by the drawn content is less than or equal to the first preset area size, so the probability of intersection with other original control views is low, or even if an intersection occurs, the impact on page loading is low due to the small common area, which is within the acceptable range set by technical personnel in this field according to actual needs. For example, the original control view is a backgroundless control view, and the area covered by its drawn content is less than the first preset area size, so it falls within the filtering range of the pruning condition.
[0108] The above pruning condition example is set from the perspective that the original control view will not intersect with other original control views, or even if the intersection occurs, the impact caused is within an acceptable range. Based on this idea, those skilled in the art can also set other pruning conditions to streamline the control set, or can also streamline the control set from other perspectives, and the embodiments of the present disclosure do not specifically limit this.
[0109] Step 405: In the control set, an original control view in an unused state is used as a reference control, and collision detection is performed with each other original control view in an unused state, and with each intersection control view that does not contain the reference control, and the reference control is set to a used state after the collision detection process is completed; wherein the reference control is combined with other original control views or intersection control views that generate intersections during the collision detection process to form a newly added intersection control view in the control set.
[0110] In the embodiment of the present disclosure, step 405 may correspond to the relevant description of the aforementioned step 103, and will not be described again here to avoid repetition.
[0111] Step 406: When all original control views in the control set are in a used state, it is determined that the intersection control views whose number of combined views is greater than or equal to an excessive number threshold are overdrawn.
[0112] In the embodiment of the present disclosure, step 406 may correspond to the relevant description of the aforementioned step 104, and will not be described again here to avoid repetition.
[0113] In an optional embodiment of the present disclosure, the pruning condition in step 404 may further include filtering original control views having drawing content, and the area covered by the drawing content is greater than or equal to the second preset area size.
[0114] On this basis, the following step 407 may also be included before step 406:
[0115] Step 407: When all original control views in the control set are in the used state, the original control view with drawing content and the area covered by the drawing content is greater than or equal to the second preset area size is combined with each original control view or intersection control view in the control set to form a newly added intersection control view in the control set.
[0116] In the disclosed embodiment, the second preset area size can be set according to the actual page size and the statistical index of the size of the area covered by the drawing content of the original control view. The statistical index can be the mean, median, standard deviation, etc. On this basis, the original control view has drawing content, and the area covered by the drawing content is greater than or equal to the second preset area size, so the probability of intersection with other original control views is high, which has a greater impact on page loading and is not within the acceptable range set by technical personnel in this field according to actual needs. For example, the original control view belongs to a full-screen control view or an extra-large control view, and the area covered by its drawing content is greater than the first preset area size, so it belongs to the filtering range of the pruning condition. At this time, the filtered part of the original control view is combined with each original control view or intersection control view in the control set before step 406 to form a newly added intersection control view in the control set.
[0117] The above-mentioned pruning condition example is set from the perspective that the original control view will inevitably intersect with other original control views, and the impact of the intersection is not within an acceptable range. In step 404, the original control view of this part is filtered out, and collision detection is performed only on the remaining part of the original control view. Since the part of the original control views filtered out under the pruning condition will inevitably intersect, the filtered part of the original control views can be added to each original control view or intersection control view in the control set after step 405 before step 406 for combination. In this process, the part of the original control view that will inevitably intersect with each other original control view in an unused state during collision detection is pre-filtered, which saves computing resources, and the part of the original control view is directly added to the original control view drawing or intersection control view in the control set before step 406 to avoid omission.
[0118] like Figure 5 The third step flow chart of the view overdrawing detection method according to the exemplary embodiment of the present disclosure may include the following steps 501 to 513:
[0119] Step 501: When monitoring a visibility change of a control view on a page, obtain the root view in the page.
[0120] Step 502: Search the page for the sub-view of the corresponding branch based on the root view, and add the root view and the sub-view as original control views to the control collection.
[0121] Step 503: In the control set, an original control view in an unused state is used as a reference control, and collision detection is performed with each other original control view in an unused state, and with each intersection control view that does not contain the reference control, and after the collision detection process is completed, the reference control is set to a used state; wherein the reference control is combined with other original control views or intersection control views that generate intersections during the collision detection process to form a newly added intersection control view in the control set.
[0122] Step 504: When all original control views in the control set are in a used state, it is determined that the intersection control views whose number of combined views is greater than or equal to an excessive number threshold are overdrawn.
[0123] In the embodiment of the present disclosure, steps 501 to 504 may correspond to the aforementioned Figure 1 Steps 101 to 104 shown, or the aforementioned Figure 4 To avoid repetition, the related descriptions of step 401 to step 408 are not repeated here.
[0124] Step 505: In the intersection control view determined to be overdrawn, obtain the original view snapshot of each original control view respectively.
[0125] In the disclosed embodiment, the over-drawn intersection control view is composed of different original control views. When the drawn content needs to be displayed on the page after rendering, each original control view has a corresponding original view snapshot (Bitmap). The original view snapshot is a data structure for representing an image, which stores the pixel information of the image, and the pixel is organized in a specific format and bit depth to form a snapshot.
[0126] Step 506: Combine the intersection view snapshot corresponding to the intersection control view based on the original view snapshot.
[0127] On the basis of obtaining the original view snapshot, the original view snapshot can be combined into the intersection view snapshot corresponding to the intersection control view according to the nested structure of the original control view in the intersection control view. The nested structure of the original control view in the intersection control view can be the level, position, etc. of the original control view. The intersection view snapshot can provide the content that the intersection control view needs to display on the page, and provide relevant information on the overdrawing problem in a more intuitive and convenient way.
[0128] Step 507: Write the intersection view snapshot into the circular buffer pool.
[0129] In the disclosed embodiment, the intersection view snapshot can be cached to save the intersection control views determined by overdrawing detection within a period of time, so as to facilitate the backtracking of overdrawing problem information. At this time, a circular buffer pool can be used for caching, and the circular buffer pool has a predefined size. Assuming that the size of the circular buffer pool is m, and the visibility change monitoring interval of the control view in the page is n seconds, the circular buffer pool can write the intersection view snapshots with problems after overdrawing detection within the last m*n seconds; in addition, after the buffer of the circular buffer pool is full, the newly written intersection view snapshot will automatically overwrite the historical written content, thereby effectively saving memory consumption.
[0130] like Figure 6 A schematic diagram of a circular buffer pool of an exemplary embodiment of the present disclosure is shown. The size of the circular buffer pool can be set to 60. Assuming that the visibility change monitoring interval of the control view in the page is 1 second, the circular buffer pool can write the intersection view snapshot with problems after overdrawing detection within the last 60 seconds.
[0131] exist Figure 6 In the example, the circular buffer pool can be divided into six buffers, 1, 2, 3, 4, 5, and 6. When writing the intersection view snapshot, the writing starts from the starting position of number 1 in the order of numbers, and returns to the starting position of number 1 along the order of 1, 2, 3, 4, 5, and 6 on the circular buffer pool, indicating that it is full. At this time, the newly written intersection view snapshot can overwrite the starting position of number 1 and the subsequent historical written content.
[0132] In an optional method embodiment of the present disclosure, step 507 further includes the following step 508:
[0133] Step 508 : In response to a visualization request for the intersection view snapshot in the circular buffer pool, a visualization hierarchical display is performed based on the hierarchical relationship between the original view snapshots in the intersection view snapshot.
[0134] In the disclosed embodiment, in the intersection view snapshot written into the circular buffer pool, the corresponding visualization request can be received, and any intersection view snapshot can be visualized hierarchically. In the visualization hierarchical display, the original view snapshots are arranged based on the hierarchical relationship defined by the intersection view snapshot, so that the covering relationship between the original control views can be displayed intuitively and clearly. On this basis, operations such as selection, rotation, scaling, and movement of one or more original view snapshots in the intersection view snapshot can also be received to adjust the intersection view snapshot.
[0135] like Figure 7A schematic diagram of the intersection view snapshot display interface of an exemplary embodiment of the present disclosure is shown. Among them, the intersection view snapshot selection bar 701 provides a list of intersection view snapshots written in the circular buffer pool that have overdrawing problems. After the intersection view snapshot selection bar 701 receives a visualization request for the intersection view snapshot a, the intersection view snapshot a can be visualized hierarchically in the visualization display area 702. At this time, a combination of rotation and translation display effects can be used to achieve a three-dimensional hierarchical display.
[0136] In an optional method embodiment of the present disclosure, step 508 further includes the following step 509:
[0137] Step 509 : In response to the selection operation on the original view snapshot in the intersection view snapshot, display code information of the original view snapshot.
[0138] In the embodiment of the present disclosure, when a selection operation of an intersection view snapshot or an original view snapshot is received, code information thereof may be further provided, which may include the ID name of the original control view corresponding to the original view snapshot, the name of the layout in which it is located, etc. The code information facilitates the rapid location and optimization of overdrawing at the code level, effectively improving the analysis efficiency.
[0139] like Figure 7 As shown, the level selection keys of the intersection view snapshot a are also provided in the level selection bar 703, including the first level, the second level and the third level. When the selection operation of the second level is received, the original view snapshot of the second level is highlighted in the visual display area 702, and the code information such as the original control view ID name (id:view1) and the layout name (ayout:xxx.xml) corresponding to the original view snapshot of the second level is displayed in the code area 704 of the bottom bar.
[0140] In an optional method embodiment of the present disclosure, step 509 further includes the following step 510:
[0141] Step 510: In response to an ignore operation on the intersection view snapshot, an ignore mark is set for the intersection control view corresponding to the intersection view snapshot; the ignore operation is used to indicate that overdrawing of the intersection control view corresponding to the intersection view snapshot is not processed.
[0142] In the embodiment of the present disclosure, there may be a situation where over-drawing does not need to be analyzed, processed or optimized based on business needs, and an ignore operation on the intersection view snapshot may be received, and an ignore mark may be set for the intersection control view corresponding to the intersection view snapshot in response to the ignore operation. The ignore mark is used to indicate that over-drawing of the intersection control view corresponding to the intersection view snapshot is not to be processed. When over-drawing detection is performed subsequently, the analysis of the number of intersection control view combinations may be ignored when the intersection control view exists in the control set, or the subsequent analysis and processing flow may be ignored when it is determined that the number of view combinations has an over-drawing problem.
[0143] like Figure 7 As shown, a mark filter button 705 is also included. After receiving a selection operation of the mark filter button 705, an ignore mark can be set for the intersection control view corresponding to the intersection view snapshot being displayed in the visualization display area 702. In subsequent rounds of over-drawing detection, the intersection control view with the ignore mark in the control set can be directly ignored in the judgment of over-drawing, or the subsequent analysis and processing flow can be ignored when it is determined that over-drawing exists.
[0144] In an optional method embodiment of the present disclosure, the method may be applied to a client, and after step 510, the method further includes the following step 511:
[0145] Step 511, synchronize the intersection control view with the ignore mark to the server; the server is used to store the intersection control view with the ignore mark provided by at least one client, and provide the intersection control view with the ignore mark to any client when any client determines that the intersection control view is overdrawn.
[0146] In the embodiment of the present disclosure, when the method is applied to the client, there is a client-server architecture. In the case of setting an ignore mark for the intersection control view, the client can synchronize the intersection control view with the ignore mark to the server. The server can receive data synchronized by one or more clients, and can provide data synchronized by other clients to the client, or provide data synchronized by the client to other clients. Thus, the intersection control view with the ignore mark can be shared among multiple clients. In actual applications, the client can synchronize the data of all intersection control views with the ignore mark from the server at different times such as startup, page display, before excessive collision detection, and after excessive collision detection. It can store all intersection control views with the ignore mark locally, and it can also determine whether the ignore mark is set according to the intersection control view in the control collection after excessive collision detection. The embodiment of the present disclosure does not impose specific restrictions on this.
[0147] In an optional embodiment of the present disclosure, the server may also provide an ignore mark management function so as to manage, maintain and update the data synchronized by multiple clients on the server, such as adding, deleting or modifying the ignore mark of the intersection control view.
[0148] like Figure 8 The schematic flow diagram of the ignore mark management step of the exemplary embodiment of the present disclosure is shown, wherein the client and the server are included, the server can provide the ignore mark management function, and the ignore mark management step can include the following steps 801 to 805.
[0149] Step 801: The client obtains the intersection control view with the ignore flag 1 set from the server.
[0150] Step 802: The client filters the intersection control views in the control set based on the ignore mark 1.
[0151] Step 803: The client displays the remaining intersection control views that have over-drawing problems.
[0152] Step 804: The client sets an ignore flag 2 for the intersection control view in response to the ignore operation.
[0153] Step 805: The client synchronizes the intersection control view with the ignore flag 2 set to the server.
[0154] The above-mentioned markings of ignoring marks 1 and 2 are only used to distinguish scenes.
[0155] In an optional method embodiment of the present disclosure, the aforementioned step 504 further includes the following step 512:
[0156] Step 512: When it is determined that an over-drawn intersection control view has an ignore tag, filtering is performed based on the ignore tag; the ignore tag indicates that the over-drawing of the intersection control view is not processed.
[0157] In the embodiment of the present disclosure, based on determining that the intersection control view has an overdrawing problem, it is possible to further analyze whether the intersection control view is set with an ignore mark. The ignore mark can correspond to the relevant description of the aforementioned steps 510 to 511, and will not be repeated here to avoid repetition. In the case where the intersection control view is set with an ignore mark, the subsequent analysis and processing flow can be ignored.
[0158] For example, the intersection control views with over-drawing problems include "A+B+D", "A+B+G", "A+E+F", "A+F+G", "A+E+G", and "A+E+F+G". Among them, "A+E+F" and "A+F+G" are set with ignore marks, so they are filtered to obtain the intersection control views "A+B+D", "A+B+G", "A+E+G", and "A+E+F+G" for subsequent analysis and processing procedures.
[0159] In an optional method embodiment of the present disclosure, the aforementioned step 504 further includes the following step 513:
[0160] Step 513: Among the intersection control views determined to be overdrawn, analyze at least one intersection control view and provide corresponding modification suggestions based on the analysis; the modification suggestions include at least one of removing the background, reducing the level, and customizing the drawing area.
[0161] In the embodiment of the present disclosure, for the intersection control view that is determined to have an over-drawing problem, an automatic analysis can be performed on the over-drawing problem, and corresponding modification suggestions can be provided in combination with the background settings, hierarchical relationships, etc. of the original view control. The modification suggestions can be as follows:
[0162] Remove the background: For example, if the ImageView component sets both imageDrawable and background, its background will often be completely covered by imageDrawable. In this case, the background is unnecessary and it is recommended to remove it.
[0163] Reduce the hierarchy: For example, when the intersection view controls of complex layout hierarchies are implemented using traditional layout methods, it will lead to serious layout nesting and too deep a hierarchy. In this case, it is recommended to use RelativeLayout, ConstraintLayout, etc. to flatten the layout hierarchy, and it is recommended to use include, merge, and Viewstub tags to reduce the hierarchy and optimize the layout.
[0164] Customized drawing area: For example, it is recommended to use the onDraw method to customize the view. When drawing pictures, you can use methods such as clipRect of Canvas to control only the area that needs to be drawn.
[0165] In an optional embodiment of the present disclosure, when the intersection view snapshot is displayed in a visual hierarchical manner, modification suggestions for the corresponding intersection control view may be displayed accordingly.
[0166] like Figure 7As shown, the intersection control view corresponding to the intersection view snapshot being displayed in the visualization display area 702 is analyzed to obtain modification suggestions, which are then displayed in the suggestion area 706 at the bottom bar.
[0167] According to the view over-drawing detection method of the embodiment of the present disclosure, when a visibility change of a control view is monitored on the page, the root view in the page is obtained, and then the sub-views of the corresponding branch are searched in the page based on the root view, and a control set is obtained with the root view and the sub-views as the original spatial views; in the control set, an original control view in an unused state is used as a benchmark control, and collision detection is performed with each other original control view in an unused state, and with each intersection control view that does not contain the benchmark control, and the benchmark control is set to the used state after the collision detection process is completed; wherein, the benchmark control is combined with other original control views or intersection control views that generate intersections during the collision detection process to form a newly added intersection control view in the control set; when all original control views in the control set are in the used state, it is determined that the intersection control view whose number of combined views is greater than or equal to the excessive number threshold is over-drawn. This solution automatically monitors the visibility changes of control views on the page, triggers a search for page control views based on root views and subviews, and then performs collision detection on control views and their combinations to check for possible over-drawing problems. It can clearly identify the composition of control views in the over-drawing area, effectively improving the comprehensiveness and accuracy of over-drawing troubleshooting, with short time consumption and high efficiency.
[0168] Exemplary Devices
[0169] After introducing the view overdrawing detection method according to the exemplary embodiment of the present disclosure, next, referring to Fig. 9 A view over-drawing detection device according to an exemplary embodiment of the present disclosure is described.
[0170] It should be noted that other specific details of the various functional modules of the view over-drawing detection device of the embodiment of the present disclosure have been described in detail in the embodiment of the above-mentioned view over-drawing detection method, and will not be repeated here.
[0171] Fig. 9A view over-drawing detection device 900 according to an exemplary embodiment of the present disclosure is shown. The device 900 may include: a control view acquisition module 901, which is used to acquire a root view in a page when a visibility change of a control view is detected on the page; the control view acquisition module 901 is also used to search for sub-views of corresponding branches in the page based on the root view, and add the root view and the sub-views as original control views to a control set; a view collision detection module 902, which is used to perform collision detection with each other original control view in an unused state in the control set, and with each intersection control view that does not contain the reference control, using an original control view in an unused state as a reference control, and setting the reference control to a used state after the collision detection process is completed; wherein the reference control is combined with other original control views or intersection control views that generate intersections during the collision detection process to form a newly added intersection control view in the control set; an over-drawing extraction module 903, which is used to determine that an intersection control view whose number of combined views is greater than or equal to an excessive number threshold is over-drawn when all original control views in the control set are in a used state.
[0172] In an optional embodiment of the present disclosure, the control view acquisition module 901 is specifically used to wait for a preset loading time when monitoring a visibility change of the control view on the page; when no visibility change of the control view occurs on the page within the preset loading time, obtain the root view in the page.
[0173] In an optional embodiment of the present disclosure, the control view acquisition module 901 is further used to filter the original control views in the control set based on a pruning condition; the pruning condition is set based on the area covered by the drawing content of the original control view.
[0174] In an optional embodiment of the present disclosure, the pruning condition includes at least one of the following:
[0175] Filter the original control view without drawing content;
[0176] Filter the original control views that have drawn content and the area covered by the drawn content is less than or equal to the first preset area size.
[0177] In an optional embodiment of the present disclosure, the pruning conditions include:
[0178] Filtering original control views that have drawn content and whose area covered by the drawn content is greater than or equal to the size of the second preset area;
[0179] In addition, the view collision detection module 902 is also used to combine the original control view with drawing content and the area covered by the drawing content greater than or equal to the second preset area size with each original control view or intersection control view in the control set when all original control views in the control set are in use, so as to form a newly added intersection control view in the control set.
[0180] In an optional embodiment of the present disclosure, the over-drawing extraction module 903 is further used to filter based on the ignore mark when it is determined that the over-drawn intersection control view has an ignore mark; the ignore mark indicates that the over-drawing of the intersection control view is not processed.
[0181] In an optional embodiment of the present disclosure, the device also includes a view snapshot cache module, which is used to obtain the original view snapshot of each original control view in the intersection control view determined to be overdrawn; combine the intersection view snapshot corresponding to the intersection control view based on the original view snapshot; and write the intersection view snapshot into a circular buffer pool.
[0182] In an optional embodiment of the present disclosure, the device also includes a view snapshot display module, which is used to respond to a visualization request for an intersection view snapshot in the circular buffer pool and perform a visual hierarchical display based on the hierarchical relationship between the original view snapshots in the intersection view snapshot.
[0183] In an optional embodiment of the present disclosure, the view snapshot display module is further configured to display code information of the original view snapshot in response to a selection operation on the original view snapshot in the intersection view snapshot.
[0184] In an optional embodiment of the present disclosure, a view snapshot display module is used to set an ignore mark for the intersection control view corresponding to the intersection view snapshot in response to an ignore operation on the intersection view snapshot; the ignore operation is used to indicate that over-drawing of the intersection control view corresponding to the intersection view snapshot shall not be processed.
[0185] In an optional embodiment of the present disclosure, the device is applied to a client, and the device also includes: an ignore mark synchronization module, which is used to synchronize the intersection control view with the ignore mark to the server; the server is used to store the intersection control view with the ignore mark provided by at least one client, and when any client determines that the intersection control view is over-drawn, provide the intersection control view with the ignore mark to any client.
[0186] In an optional embodiment of the present disclosure, an over-drawing analysis module is used to analyze at least one intersection control view among the intersection control views determined to be over-drawn, and provide corresponding modification suggestions based on the analysis; the modification suggestions include at least one of removing the background, reducing the hierarchy, and customizing the drawing area.
[0187] According to the view over-drawing detection device of the embodiment of the present disclosure, when a visibility change of a control view is monitored on a page, the root view in the page is obtained, and then the sub-views of the corresponding branch are searched in the page based on the root view, and a control set is obtained with the root view and the sub-views as the original spatial views; in the control set, an original control view in an unused state is used as a baseline control, and collision detection is performed with each other original control view in an unused state, and collision detection is performed with each intersection control view that does not contain the baseline control, and the baseline control is set to the used state after the collision detection process is completed; wherein, the baseline control is combined with other original control views or intersection control views that generate intersections during the collision detection process to form a newly added intersection control view in the control set; when all original control views in the control set are in the used state, it is determined that the intersection control view whose number of combined views is greater than or equal to the excessive number threshold is over-drawn. This solution automatically monitors the visibility changes of control views on the page, triggers a search for page control views based on root views and subviews, and then performs collision detection on control views and their combinations to check for possible over-drawing problems. It can clearly identify the composition of control views in the over-drawing area, effectively improving the comprehensiveness and accuracy of over-drawing troubleshooting, with short time consumption and high efficiency.
[0188] It should be noted that although several modules or units of the view overdrawing detection device are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0189] Exemplary computer readable media
[0190] The following is a description of a computer-readable medium according to an exemplary embodiment of the present disclosure.
[0191] In this exemplary embodiment, reference Fig.10 As shown, a program product 1000 for implementing the above method according to an exemplary embodiment of the present disclosure is described, such as a portable compact disk read-only memory (CD-ROM) and including program code, and can be run on a device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a computer-readable medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus, or a device.
[0192] The program product 1000 may use any combination of one or more readable media. The readable medium may be a readable signal medium or a computer readable medium. The computer readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer readable media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0193] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than computer readable media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0194] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RE, etc., or any suitable combination of the foregoing.
[0195] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user computing device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (FAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0196] Exemplary Electronic Devices
[0197] refer to Fig.11 An electronic device according to an exemplary embodiment of the present disclosure is described.
[0198] Fig.11 The electronic device 1100 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0199] like Fig.11 As shown, the electronic device 1100 is in the form of a general computing device. The components of the electronic device 1100 may include, but are not limited to: at least one processing unit 1110, at least one storage unit 1120, a bus 1130 connecting different system components (including the storage unit 1120 and the processing unit 1110), and a display unit 1140.
[0200] The storage unit stores program codes, which can be executed by the processing unit 1110, so that the processing unit 1110 executes the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 1110 can execute the following steps: Figure 1 The method steps shown, etc.
[0201] The storage unit 1120 may include a volatile storage unit, such as a random access storage unit (RAM) 1121 and / or a cache storage unit 1122 , and may further include a read-only storage unit (ROM) 1123 .
[0202] The storage unit 1120 may also include a program / utility 1124 having a set (at least one) of program modules 1125, such program modules 1125 including but not limited to: an operating system, one or more server applications, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0203] The bus 1130 may include a data bus, an address bus, and a control bus.
[0204] The electronic device 1100 may also communicate with one or more external devices 1200 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), and such communication may be performed through an input / output (I / O) interface 1150. The electronic device 1100 also includes a display unit 1140, which is connected to the input / output (I / O) interface 1150 for display. In addition, the electronic device 1100 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 1160. As shown, the network adapter 1160 communicates with other modules of the electronic device 1100 through a bus 1130. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0205] It should be noted that, although several modules or submodules of the device are mentioned in the above detailed description, such division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.
[0206] In addition, although the operations of the disclosed method are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0207] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.
Claims
1. A view overdrawing detection method, characterized in that: The method comprises: When monitoring the visibility change of the control view on the page, obtain the root view in the page; Searching for a subview of a corresponding branch in the page based on the root view, and adding the root view and the subview as original control views to a control collection; In the control set, the original control view in an unused state is used as a reference control, and collision detection is performed with each other original control view in an unused state, and collision detection is performed with each intersection control view that does not contain the reference control, and the reference control is set to a used state after the collision detection process is completed; wherein the reference control is combined with other original control views or intersection control views that generate intersections during the collision detection process to form a newly added intersection control view in the control set; When all the original control views in the control set are in a used state, it is determined that the intersection control views whose number of combined views is greater than or equal to an excessive number threshold are overdrawn.
2. The method according to claim 1, characterized in that When monitoring a visibility change of a control view on a page, obtaining a root view in the page includes: When monitoring the visibility change of the control view on the page, wait for the preset loading time; When the visibility of the control view on the page does not change within the preset loading time, the root view in the page is obtained.
3. The method according to claim 1, characterized in that In the control set, the original control view in an unused state is used as a reference control, and collision detection is performed with each other original control view in an unused state, and collision detection is performed with each intersection control view that does not contain the reference control, and before the reference control is set to a used state after the collision detection process is completed, the method further includes: The original control views in the control set are filtered based on a pruning condition; the pruning condition is set based on an area covered by the drawing content of the original control view.
4. The method according to claim 3, characterized in that The pruning condition includes at least one of the following: Filter the original control views without drawing content; The original control views having drawing contents and whose area covered by the drawing contents is smaller than or equal to the first preset area size are filtered.
5. The method according to claim 3, characterized in that: The pruning conditions include: Filtering the original control views having drawing content, where the area covered by the drawing content is greater than or equal to the second preset area size; And, before determining that the intersection control view whose number of combined views is greater than or equal to the excessive number threshold is overdrawn, the method further includes: When all the original control views in the control set are in used state, the original control view with drawing content and an area covered by the drawing content greater than or equal to the second preset area size will be combined with each of the original control views or the intersection control views in the control set to form a newly added intersection control view in the control set.
6. The method according to claim 1, characterized in that After determining that the intersection control view whose number of combined views is greater than or equal to the excessive number threshold is overdrawn, the method further includes: When it is determined that the overdrawn intersection control view has an ignore mark, filtering is performed based on the ignore mark; the ignore mark indicates that the overdrawing of the intersection control view is not to be processed.
7. The method according to claim 1, characterized in that After determining that the intersection control view whose number of combined views is greater than or equal to the excessive number threshold is overdrawn, the method further includes: In the intersection control view determined to be overdrawn, respectively obtaining an original view snapshot of each original control view; Combining the intersection view snapshot corresponding to the intersection control view based on the original view snapshot; The intersection view snapshot is written into a circular buffer pool.
8. A view over-drawing detection device, characterized in that: The device comprises: A control view acquisition module, used to acquire the root view in the page when monitoring the visibility change of the control view on the page; The control view acquisition module is further used to search for a sub-view of a corresponding branch in the page based on the root view, and add the root view and the sub-view as original control views to the control set; A view collision detection module, used to take the original control view in an unused state as a reference control in the control set, perform collision detection with each other original control view in an unused state, and perform collision detection with each intersection control view that does not contain the reference control, and set the reference control to a used state after the collision detection process is completed; wherein the reference control is combined with other original control views or intersection control views that intersect during the collision detection process to form a newly added intersection control view in the control set; The over-drawing extraction module is used to determine that the intersection control views whose number of combined views is greater than or equal to an excessive number threshold are over-drawn when all the original control views in the control set are in a used state.
9. A computer-readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the view overdrawing detection method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the view overdrawing detection method according to any one of claims 1 to 7 by executing the executable instructions.
Citation Information
Patent Citations
Overdraw evaluation method and system
CN108389151A
Method and system for recognizing transition drawing
CN113568840A
Interface display defect detection method, display method, device and equipment
CN117707912A
User interface techniques for simulating three-dimensional depth
US9367203B1
Cited By
Method and system for improving loading rate
CN120407036A