A method, device, medium and program product for outputting a control tree

By generating and analyzing the control tree structure, we can identify and repair the layout problems of the mobile terminal App page, solve the problem of extended page opening time, improve the user experience and operational efficiency, and avoid user churn and revenue loss.

CN114489900BActive Publication Date: 2024-09-13SHANG HAI CHEN LIAN KE JI YOU XIAN GONG SI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210087320.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-25
Publication Date
2024-09-13
Estimated Expiration
2042-01-25

AI Technical Summary

Technical Problem

The complex layout of mobile terminal App pages prolongs the time it takes to open the page, affects user experience, and leads to user churn and revenue loss.

Method used

By generating a control tree structure, analyzing node parameters, identifying layout problems and injecting the control tree structure, the control tree structure is output so that operations or developers can intuitively discover and maintain it.

Benefits of technology

By counting page performance parameters through the control tree structure, you can discover and repair layout problems in a timely manner to avoid user churn and revenue loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114489900B
    Figure CN114489900B
Patent Text Reader

Abstract

The purpose of the present application is to provide a method, device, medium and program product for outputting a control tree, the method comprising: in response to the target page being rendered, generating a control tree structure corresponding to the target page by traversing one or more controls on the target page, wherein the control tree structure includes multiple nodes, each node corresponding to one of the one or more controls; obtaining node parameters corresponding to each node by performing parameter analysis on the control tree structure; if it is determined that the target page has a layout problem based on the node parameters, injecting the node parameters corresponding to at least one node into the corresponding node in the control tree structure, and outputting the control tree structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to a technology for outputting a control tree. Background Art

[0002] In the prior art, the page layout of Apps on mobile terminals (e.g., mobile phones) is becoming more and more complex, and there are more and more elements on the page, which results in a longer and longer time to open the page, which seriously affects the user experience of the App and leads to user churn and revenue loss of the App. Summary of the invention

[0003] One object of the present application is to provide a method, device, medium and program product for outputting a control tree.

[0004] According to one aspect of the present application, a method for outputting a control tree is provided, the method comprising:

[0005] In response to the target page being rendered, generating a control tree structure corresponding to the target page by traversing one or more controls on the target page, wherein the control tree structure includes a plurality of nodes, each node corresponding to one of the one or more controls;

[0006] By performing parameter analysis on the control tree structure, obtaining node parameters corresponding to each node;

[0007] If it is determined according to the node parameters that the target page has a layout problem, a node parameter corresponding to at least one node is injected into a corresponding node in the control tree structure, and the control tree structure is output.

[0008] According to one aspect of the present application, a user device for outputting a control tree is provided, the device comprising:

[0009] A module, configured to generate a control tree structure corresponding to the target page by traversing one or more controls on the target page in response to the target page being rendered, wherein the control tree structure includes a plurality of nodes, each node corresponding to one of the one or more controls;

[0010] A module 12 is used to obtain the node parameters corresponding to each node by performing parameter analysis on the control tree structure;

[0011] A module 3 is used for injecting node parameters corresponding to at least one node into a corresponding node in the control tree structure and outputting the control tree structure if it is determined that the target page has a layout problem according to the node parameters.

[0012] According to one aspect of the present application, a computer device for outputting a control tree is provided, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the operation of any of the methods described above.

[0013] According to one aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that when the computer program is executed by a processor, the operation of any of the methods described above is implemented.

[0014] According to one aspect of the present application, a computer program product is provided, including a computer program, which implements the steps of any of the above methods when executed by a processor.

[0015] Compared with the prior art, the present application generates a control tree structure corresponding to the target page by traversing one or more controls on the target page in response to the target page being rendered, wherein the control tree structure includes multiple nodes, each node corresponding to one of the one or more controls; by performing parameter analysis on the control tree structure, the node parameters corresponding to each node are obtained; if it is determined that the target page has a layout problem according to the node parameters, the node parameters corresponding to at least one node are injected into the corresponding node in the control tree structure, and the control tree structure is output, so that the key performance parameters of the page in the target application are counted by means of the control tree structure, and the key performance parameters are analyzed to determine whether the page has a layout problem. If a page in the target application has a layout problem, the key performance parameters are re-injected into the corresponding node in the control tree structure corresponding to the page, and the control tree structure is output, so that the operator or developer of the target application can intuitively browse the control tree structure corresponding to the page with the layout problem, so that the layout problem of the page can be discovered in time, and the user loss and revenue loss of the target application can be avoided by maintaining or modifying the page. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0017] Figure 1 A flow chart of a method for outputting a control tree according to an embodiment of the present application is shown;

[0018] Figure 2 A user device structure diagram for outputting a control tree according to an embodiment of the present application is shown;

[0019] Figure 3A schematic diagram showing a presentation of a control tree structure according to an embodiment of the present application is shown;

[0020] Figure 4 An exemplary system is shown that can be used to implement the various embodiments described in this application.

[0021] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION

[0022] The present application is described in further detail below in conjunction with the accompanying drawings.

[0023] In a typical configuration of the present application, the terminal, the device of the service network and the trusted party all include one or more processors (eg, a central processing unit (CPU)), an input / output interface, a network interface and a memory.

[0024] Memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash memory. Memory is an example of a computer-readable medium.

[0025] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, Phase-Change Memory (PCM), Programmable Random Access Memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of random access memory (RAM), Read-Only Memory (ROM), Electrically-Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, magnetic cassettes, tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0026] The devices referred to in this application include but are not limited to terminals, network devices, or devices formed by integrating terminals and network devices through a network. The terminal includes but is not limited to any mobile electronic product that can interact with a user (for example, interact with a user through a touchpad), such as a smart phone, a tablet computer, etc. The mobile electronic product can use any operating system, such as an Android operating system, an iOS operating system, etc. Among them, the network device includes an electronic device that can automatically perform numerical calculations and information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a programmable logic device (PLD), a field programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc. The network device includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud composed of multiple servers; here, the cloud is composed of a large number of computers or network servers based on cloud computing (Cloud Computing), wherein cloud computing is a type of distributed computing, a virtual supercomputer composed of a group of loosely coupled computer sets. The network includes but is not limited to the Internet, wide area network, metropolitan area network, local area network, VPN network, wireless self-organizing network (Ad Hoc network), etc. Preferably, the device may also be a program running on the terminal, network device, or a device formed by integrating the terminal and network device, network device, touch terminal, or network device and touch terminal through a network.

[0027] Of course, those skilled in the art should understand that the above-mentioned devices are only examples, and other existing or future devices that are applicable to the present application should also be included in the scope of protection of the present application and are included here by reference.

[0028] In the description of the present application, “plurality” means two or more, unless otherwise clearly and specifically defined.

[0029] Figure 1A flow chart of a method for outputting a control tree according to an embodiment of the present application is shown, and the method includes step S11, step S12 and step S13. In step S11, in response to the target page being rendered, the user device generates a control tree structure corresponding to the target page by traversing one or more controls on the target page, wherein the control tree structure includes multiple nodes, and each node corresponds to one of the one or more controls; in step S12, the user device obtains the node parameters corresponding to each node by performing parameter analysis on the control tree structure; in step S13, if it is determined that the target page has a layout problem according to the node parameters, the user device injects the node parameters corresponding to at least one node into the corresponding node in the control tree structure, and outputs the control tree structure.

[0030] In step S11, in response to the target page being rendered, the user device generates a control tree structure corresponding to the target page by traversing one or more controls on the target page, wherein the control tree structure includes multiple nodes, and each node corresponds to one of the one or more controls. In some embodiments, when the target page is started, the target page is rendered on the user device, so that the user can see the complete target page on the user device. In some embodiments, by traversing all controls on the target page (including currently visible controls and currently invisible controls), the traversal results are saved in a tree structure to generate a control tree structure corresponding to the target page, the control tree structure includes multiple nodes, each node corresponds to a control on the target page, and each control in the target page corresponds to a node in the control tree structure. There is a one-to-one correspondence between nodes and controls, that is, different nodes correspond to different controls, and different controls correspond to different nodes. In some embodiments, a window object (e.g., window) is first obtained from the target page, and then various controls on the target page can be obtained from the window object, thereby traversing all controls on the target page. For example, the window object can be obtained from the target page through the WindowManager (window management) service. For example, the first control in the window object is first obtained (e.g., rootview), and then it is determined whether this control has a corresponding sub-control. If so, continue to obtain the first sub-control of at least one sub-control corresponding to this control, and then continue to determine whether this sub-control has a corresponding sub-control. If so, continue to obtain the first sub-control of at least one sub-control corresponding to this sub-control, and so on, until all controls on the target page are traversed.

[0031] In step S12, the user device obtains the node parameters corresponding to each node by performing parameter analysis on the control tree structure. In some embodiments, the node parameters corresponding to each node are obtained by performing parameter analysis on the control tree structure, wherein the node parameters include but are not limited to the depth, degree, height, total number of nodes, etc. corresponding to each node.

[0032] In step S13, if it is determined that the target page has a layout problem according to the node parameters, the user device injects the node parameters corresponding to at least one node into the corresponding node in the control tree structure, and outputs the control tree structure. In some embodiments, the node parameters will affect the rendering speed of the target page by the user device and the time required to render the target page. In some embodiments, it can be determined whether the target page has a layout problem according to the node parameters corresponding to at least one node among the multiple nodes. If it is determined that the target page has a layout problem according to the node parameters corresponding to at least one node, the node parameters corresponding to the at least one node are re-injected into the corresponding node in the control tree structure, or the node parameters corresponding to the multiple nodes are re-injected into the corresponding node in the control tree structure, for example, if the depth corresponding to at least one node is greater than or equal to a predetermined depth threshold, or if the degree corresponding to at least one node is equal to 1, or if the height corresponding to at least one node is greater than or equal to a predetermined height threshold, or if the total number of nodes corresponding to at least one node is greater than or equal to a predetermined number threshold, it can be determined that the target page has a layout problem. In some embodiments, the control tree structure can be directly output, or the control tree structure can be converted into a file of a predetermined format first, and the file is output. The present application uses a control tree structure to count the key performance parameters of a page in a target application, and determines whether the page has a layout problem by analyzing the key performance parameters. If a page in the target application has a layout problem, the key performance parameters are re-injected into the corresponding node in the control tree structure corresponding to the page, and the control tree structure is output, so that the operator or developer of the target application can intuitively browse the control tree structure corresponding to the page with the layout problem, so as to timely discover the layout problem of the page, and avoid user loss and revenue loss of the target application by maintaining or modifying the page.

[0033] In some embodiments, the generating of the control tree structure corresponding to the target page includes: for the first control currently traversed, generating a first node corresponding to the first control, adding the first node to the control tree structure corresponding to the target page; determining whether the first control has at least one corresponding first sub-control; if so, continuing to traverse the first first sub-control in the at least one first sub-control. In some embodiments, for the first control on the target page currently traversed, generating a first node corresponding to the first control, adding the first node to the control tree structure corresponding to the target page, and then continuing to determine whether the first control has a corresponding first sub-control; if so, continuing to traverse the first first sub-control in the at least one first sub-control corresponding to the first control, generating a node corresponding to the first sub-control, and adding the node to the control tree structure, and so on.

[0034] In some embodiments, the determining whether the first control has at least one corresponding first sub-control includes: determining whether the first control is a container type control; if not, determining whether the first control does not have a corresponding first sub-control; otherwise, determining whether the first control has at least one corresponding first sub-control. In some embodiments, only container type controls (e.g., viewGroup) can have corresponding sub-controls, and other types of controls cannot have corresponding sub-controls. In some embodiments, first determine whether the first control is a container type control. If not, it can be directly determined that the first control does not have a corresponding first sub-control. If so, it is only then necessary to determine whether the first control has a corresponding first sub-control.

[0035] In some embodiments, the method further includes: if the first control does not have a corresponding first child control, the user device determines whether the parent control of the first control has at least one second child control that has not been traversed; if so, continue to traverse the first second child control in the at least one second child control. In some embodiments, if a certain control is a child control of another control, the other control is the parent control of the control. In some embodiments, if the first control does not have a corresponding first child control, it is necessary to determine whether the parent control of the first control has at least one second child control that has not been traversed. For example, the parent control of the first control has multiple second child controls View1, View2, View3, and View4, wherein View1 has been traversed before, and View2, View3, and View4 have not been traversed yet, then it can be determined that the first control has at least one second child control that has not been traversed. In some embodiments, if the first control has at least one second child control that has not been traversed, continue to traverse the first second child control in the at least one second child control. Continuing with the above example, since View2, View3, and View4 have not been traversed yet, continue to traverse the first second child control in View2, View3, and View4, that is, View2. In some embodiments, if the parent control of the first control does not have at least one second child control that has not been traversed, it is necessary to determine whether the second parent control of the parent control has at least one third child control that has not been traversed. If so, continue to traverse the first third child control in the at least one third child control. Otherwise, it is necessary to determine whether the third parent control of the second parent control has at least one fourth child control that has not been traversed, and so on. In some embodiments, if the first control has at least one second child control that has not been traversed, continue to traverse the first second child control in the at least one second child control. After traversing the first second child control, if the first second child control has a corresponding third child control, continue to traverse the first third child control in the at least one third child control corresponding to the first second child control, and so on. If the first second child control does not have a corresponding third child control, it is necessary to determine whether the parent control of the first control has one or more second child controls that are arranged behind the first control. If so, continue to traverse the first second child control in the one or more second child controls, and so on. Otherwise, it is necessary to determine whether the parent control of the parent control has at least one third child control that has not been traversed, and so on.

[0036] In some embodiments, for the first control currently traversed, generating a first node corresponding to the first control, and adding the first node to the control tree structure corresponding to the target page, includes: for the first control currently traversed, determining whether the first control has a corresponding parent control; if not, initializing the control tree structure corresponding to the target page, generating a first node corresponding to the first control, and adding the first node as the root node of the control tree structure to the control tree structure; otherwise, locating the second node corresponding to the parent control in the control tree structure, generating a first node corresponding to the first control, and adding the first node as the next child node of the second node to the control tree structure. In some embodiments, for the first control on the target page currently traversed, determine whether the first control has a corresponding parent control. If not, initialize the control tree structure corresponding to the target page, generate a first node corresponding to the first control, and add the first node as the root node of the control tree structure to the control tree structure. If so, locate the second node corresponding to the parent control in the control tree structure, generate a first node corresponding to the first control, and add the first node as the next child node of the second node to the control tree structure. For example, if the second node corresponding to the parent control in the control tree structure currently does not have a corresponding child node, directly add the first node as the first child node of the second node to the control tree structure. If the second node corresponding to the parent control in the control tree structure currently has at least one corresponding child node, add the first node as the next child node after the at least one child node to the control tree structure.

[0037] In some embodiments, the node parameters include the depth corresponding to each node. In some embodiments, the depth corresponding to the node can be determined based on the length of the unique path from the root node of the control tree structure to each node, and the unique path length can be directly used as the depth corresponding to the node, or the unique path length + 1 can also be used as the depth corresponding to the node. For example, the child nodes corresponding to the root node include node A, and the child nodes corresponding to node A include node B. Then the unique path from the root node to node B is "root node->node A->node B", and the length of the path is 2. Then the path length can be directly used as the depth corresponding to node B, or the path length + 1 can also be used as the depth corresponding to node B.

[0038] In some embodiments, the method further includes: if the depth corresponding to at least one node is greater than or equal to a predetermined depth threshold, the user device determines that there is a layout problem with the target page. In some embodiments, if the depth corresponding to a node is deeper, it means that the node corresponds to more nested levels, which will increase the time required for the user device to render the target page, indicating that the node has performance problems. In some embodiments, if there is a node in the control tree structure whose corresponding depth is greater than or equal to a predetermined depth threshold, it can be determined that there is a layout problem with the target page. In some embodiments, if there are more than a predetermined number of at least one node in the control tree structure whose corresponding depth is greater than or equal to a predetermined depth threshold, it can be determined that there is a layout problem with the target page.

[0039] In some embodiments, the node parameters also include the degree corresponding to each node. In some embodiments, the degree corresponding to each node refers to the number of child nodes of the node. For example, if a node has 3 child nodes, the degree corresponding to the node is 0. In some embodiments, if a node does not have child nodes, that is, if the node is a leaf node, the degree corresponding to the node is 0.

[0040] In some embodiments, the method further includes: if the degree corresponding to at least one node is equal to 1, the user device determines that there is a layout problem with the target page. In some embodiments, if the degree corresponding to a node is equal to 1, that is, the node has only one child node, it means that the node has a performance problem. In some embodiments, if there is a node in the control tree structure whose degree is equal to 1, it can be determined that there is a layout problem with the target page. In some embodiments, if there is more than a predetermined number of nodes in the control tree structure whose degree is equal to 1, it can be determined that there is a layout problem with the target page.

[0041] In some embodiments, for each node, if the node is the root node of the control tree structure, the node parameter corresponding to the root node also includes the height of the control tree structure. In some embodiments, the height of the control tree structure refers to the longest path length from the root node of the control tree structure to a leaf node, and the longest path length can be directly used as the height of the control tree structure, or the longest path length + 1 can be used as the height of the control tree structure. In some embodiments, for the root node in the control tree structure, the node parameter corresponding to the root node also includes the height of the control tree structure.

[0042] In some embodiments, the method further includes: if the height corresponding to the root node is greater than or equal to a predetermined height threshold, the user device determines that there is a layout problem with the target page. In some embodiments, if the height of the control tree structure is higher, it means that the control tree structure corresponds to more maximum nested levels, which will increase the time required for the user device to render the target page, indicating that the root node, i.e., the control tree structure, has a performance problem.

[0043] In some embodiments, the node parameter corresponding to the root node also includes the total number of nodes of the control tree structure. In some embodiments, the total number of nodes of the control tree structure refers to the number of all nodes (including root nodes, leaf nodes, and non-leaf nodes) in the control tree structure. In some embodiments, for the root node in the control tree structure, the node parameter corresponding to the root node also includes the total number of nodes of the control tree structure.

[0044] In some embodiments, the method further includes: if the total number of nodes corresponding to the root node is greater than or equal to a predetermined number threshold, the user device determines that there is a layout problem with the target page. In some embodiments, if the total number of nodes in the control tree structure is greater, the time required for the user device to render the target page will increase, indicating that the root node, i.e., the control tree structure, has a performance problem.

[0045] In some embodiments, if the total number of nodes corresponding to the root node is greater than or equal to a predetermined number threshold, determining that the target page has a layout problem includes: if the sum of the product of the total number of nodes corresponding to the root node and the first predetermined coefficient and the product of the height corresponding to the root node and the second predetermined coefficient is greater than or equal to a predetermined value, determining that the target page has a layout problem. In some embodiments, the more the total number of nodes corresponding to the root node, the more time it takes for the user device to render the target page, the more likely the target page has a layout problem, and the higher the height corresponding to the root node, the more time it takes for the user device to render the target page, the more likely the target page has a layout problem. In some embodiments, if mTotal*c1+mHeight*c2>=pv, it can be determined that the target page has a layout problem, where mTotal is the total number of nodes corresponding to the root node, mHeight is the height corresponding to the root node, c1 is the first predetermined coefficient, c2 is the second predetermined coefficient, and pv is a predetermined value.

[0046] In some embodiments, the method further includes: the user device determines whether each of the nodes has a performance problem based on the node parameters; if one or more of the multiple nodes have a performance problem, it is determined that the target page has a layout problem. In some embodiments, based on the node parameters corresponding to each node, it can be determined whether the node has a performance problem in one of the above-mentioned multiple ways, or it can be determined whether the node has a performance problem in any combination of at least one of the above-mentioned multiple ways. In some embodiments, as long as there is a performance problem at one node in the control tree structure, it can be determined that the target page has a layout problem, or a predetermined number of one or more nodes in the control tree structure need to have performance problems before it can be determined that the target page has a layout problem.

[0047] In some embodiments, injecting the node parameters corresponding to at least one node into the corresponding node in the control tree structure includes: injecting the node parameters corresponding to the one or more nodes with performance problems into the corresponding nodes in the control tree structure. In some embodiments, the node parameters corresponding to all nodes are injected into the corresponding nodes in the control tree structure. In some embodiments, only the node parameters corresponding to the one or more nodes with performance problems are injected into the corresponding nodes in the control tree structure.

[0048] In some embodiments, outputting the control tree structure includes: converting the control tree structure into a target file in a key-value pair format, and outputting the target file. In some embodiments, the control tree result is converted into a target file in a key-value pair (e.g., json, JavaScript Object Notation) format, and the target file is output, so that operators or developers can intuitively browse the control tree structure corresponding to the target page with layout problems.

[0049] Figure 2 A user device structure diagram for outputting a control tree according to an embodiment of the present application is shown, and the device includes a first module 11, a second module 12, and a third module 13. The first module 11 is used to generate a control tree structure corresponding to the target page by traversing one or more controls on the target page in response to the target page being rendered, wherein the control tree structure includes multiple nodes, and each node corresponds to one of the one or more controls; the first module 12 is used to obtain the node parameters corresponding to each node by performing parameter analysis on the control tree structure; the first module 13 is used to inject the node parameters corresponding to at least one node into the corresponding node in the control tree structure if it is determined that the target page has a layout problem according to the node parameters, and output the control tree structure.

[0050] A module 11 is used for generating a control tree structure corresponding to the target page in response to the target page being rendered by traversing one or more controls on the target page, wherein the control tree structure includes multiple nodes, and each node corresponds to one of the one or more controls. In some embodiments, when the target page is started, the target page is rendered on the user device, so that the user can see the complete target page on the user device. In some embodiments, by traversing all controls on the target page (including currently visible controls and currently invisible controls), the traversal results are saved in a tree structure to generate a control tree structure corresponding to the target page, the control tree structure includes multiple nodes, each node corresponds to a control on the target page, and each control in the target page corresponds to a node in the control tree structure. There is a one-to-one correspondence between nodes and controls, that is, different nodes correspond to different controls, and different controls correspond to different nodes. In some embodiments, a window object (e.g., window) is first obtained from the target page, and then various controls on the target page can be obtained from the window object, thereby traversing all controls on the target page. For example, the window object can be obtained from the target page through the WindowManager (window management) service. For example, the first control in the window object is first obtained (e.g., rootview), and then it is determined whether this control has a corresponding sub-control. If so, continue to obtain the first sub-control of at least one sub-control corresponding to this control, and then continue to determine whether this sub-control has a corresponding sub-control. If so, continue to obtain the first sub-control of at least one sub-control corresponding to this sub-control, and so on, until all controls on the target page are traversed.

[0051] Module 12 is used to obtain the node parameters corresponding to each node by performing parameter analysis on the control tree structure. In some embodiments, the node parameters corresponding to each node are obtained by performing parameter analysis on the control tree structure, wherein the node parameters include but are not limited to the depth, degree, height, total number of nodes, etc. corresponding to each node.

[0052] A module 13 is used to inject the node parameters corresponding to at least one node into the corresponding node in the control tree structure if it is determined that the target page has a layout problem according to the node parameters, and output the control tree structure. In some embodiments, the node parameters will affect the rendering speed of the target page by the user device and the time required to render the target page. In some embodiments, it can be determined whether the target page has a layout problem according to the node parameters corresponding to at least one node among the multiple nodes. If the target page is determined to have a layout problem according to the node parameters corresponding to at least one node, the node parameters corresponding to the at least one node are re-injected into the corresponding node in the control tree structure, or the node parameters corresponding to the multiple nodes are re-injected into the corresponding node in the control tree structure, for example, if the depth corresponding to at least one node is greater than or equal to a predetermined depth threshold, or if the degree corresponding to at least one node is equal to 1, or if the height corresponding to at least one node is greater than or equal to a predetermined height threshold, or if the total number of nodes corresponding to at least one node is greater than or equal to a predetermined number threshold, it can be determined that the target page has a layout problem. In some embodiments, the control tree structure can be directly output, or the control tree structure can be converted into a file of a predetermined format first, and the file is output. The present application uses a control tree structure to count the key performance parameters of a page in a target application, and determines whether the page has a layout problem by analyzing the key performance parameters. If a page in the target application has a layout problem, the key performance parameters are re-injected into the corresponding node in the control tree structure corresponding to the page, and the control tree structure is output, so that the operator or developer of the target application can intuitively browse the control tree structure corresponding to the page with the layout problem, so as to timely discover the layout problem of the page, and avoid user loss and revenue loss of the target application by maintaining or modifying the page.

[0053] In some embodiments, generating the control tree structure corresponding to the target page includes: for the first control currently traversed, generating a first node corresponding to the first control, adding the first node to the control tree structure corresponding to the target page; determining whether the first control has at least one corresponding first sub-control; if so, continuing to traverse the first first sub-control in the at least one first sub-control. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0054] In some embodiments, the determining whether the first control has at least one corresponding first sub-control includes: determining whether the first control is a container type control; if not, determining whether the first control has no corresponding first sub-control; otherwise, determining whether the first control has at least one corresponding first sub-control. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0055] In some embodiments, the device is further configured to: if the first control does not have a corresponding first child control, determine whether the parent control of the first control has at least one second child control that has not been traversed; if so, continue to traverse the first second child control in the at least one second child control. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0056] In some embodiments, for the first control currently traversed, generating a first node corresponding to the first control, and adding the first node to the control tree structure corresponding to the target page, includes: for the first control currently traversed, determining whether the first control has a corresponding parent control; if not, initializing the control tree structure corresponding to the target page, generating a first node corresponding to the first control, and adding the first node as the root node of the control tree structure to the control tree structure; otherwise, locating the second node corresponding to the parent control in the control tree structure, generating a first node corresponding to the first control, and adding the first node as the next child node of the second node to the control tree structure. Here, the related operations are the same as Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0057] In some embodiments, the node parameters include the depth corresponding to each node. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0058] In some embodiments, the device is further configured to: if the depth corresponding to at least one node is greater than or equal to a predetermined depth threshold, determine that the target page has a layout problem. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0059] In some embodiments, the node parameters also include the degree corresponding to each node. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0060] In some embodiments, the device is further configured to: if the degree corresponding to at least one node is equal to 1, determine that the target page has a layout problem. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0061] In some embodiments, for each node, if the node is the root node of the control tree structure, the node parameter corresponding to the root node also includes the height of the control tree structure. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0062] In some embodiments, the device is further configured to: if the height corresponding to the root node is greater than or equal to a predetermined height threshold, determine that the target page has a layout problem. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0063] In some embodiments, the node parameter corresponding to the root node also includes the total number of nodes in the control tree structure. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0064] In some embodiments, the device is further configured to: if the total number of nodes corresponding to the root node is greater than or equal to a predetermined number threshold, determine that the target page has a layout problem. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0065] In some embodiments, if the total number of nodes corresponding to the root node is greater than or equal to a predetermined number threshold, determining that the target page has a layout problem includes: if the sum of the product of the total number of nodes corresponding to the root node and a first predetermined coefficient and the product of the height corresponding to the root node and a second predetermined coefficient is greater than or equal to a predetermined value, determining that the target page has a layout problem. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0066] In some embodiments, the device is further configured to: determine whether each node has a performance problem according to the node parameters; if one or more of the multiple nodes have a performance problem, determine that the target page has a layout problem. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0067] In some embodiments, injecting the node parameters corresponding to at least one node into the corresponding node in the control tree structure includes: injecting the node parameters corresponding to the one or more nodes with performance problems into the corresponding node in the control tree structure. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0068] In some embodiments, the outputting of the control tree structure includes: converting the control tree structure into a target file in a key-value pair format, and outputting the target file. Figure 1 The embodiments shown are the same or similar, so they are not described again and are incorporated herein by reference.

[0069] Figure 3 A schematic diagram showing the presentation of a control tree structure according to an embodiment of the present application is shown.

[0070] like Figure 3 As shown in the figure, the root node of the control tree structure is rootview. Rootview has two child nodes, namely childview1 and childview2. Childview1 has two child nodes, namely childview3 and childview4. Childview2 has one child node, namely childview5. By performing parameter analysis on the control tree structure, the node parameters corresponding to each node are injected into the corresponding node in the control tree structure. The node parameters corresponding to rootview include the total number of nodes viewsCount(5), depth depth(1), degree or number of child nodes childCount(2). The node parameters corresponding to childview1 include depth depth(2), degree or number of child nodes c hildCount(2), the node parameters corresponding to childview2 include depth depth(2), degree or number of child nodes childCount(1), the node parameters corresponding to childview3 include depth depth(3), degree or number of child nodes childCount(0), the node parameters corresponding to childview4 include depth depth(3), degree or number of child nodes childCount(0), and the node parameters corresponding to childview5 include depth depth(3), degree or number of child nodes childCount(0). Since the degree or number of child nodes childCount corresponding to childview2 is 1, there is a performance problem with childview2, so it can be determined that there is a layout problem with the target page.

[0071] In addition to the methods and devices described in the above embodiments, the present application also provides a computer-readable storage medium, which stores computer code. When the computer code is executed, the method described in any of the preceding items is executed.

[0072] The present application also provides a computer program product. When the computer program product is executed by a computer device, the method described in any of the preceding items is executed.

[0073] The present application also provides a computer device, the computer device comprising:

[0074] one or more processors;

[0075] a memory for storing one or more computer programs;

[0076] When the one or more computer programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any of the preceding items.

[0077] Figure 4 An exemplary system that can be used to implement various embodiments described in this application is shown;

[0078] like Figure 4 In some embodiments shown, the system 300 can be used as any of the devices in the various described embodiments. In some embodiments, the system 300 may include one or more computer-readable media (e.g., system memory or NVM / storage device 320) with instructions and one or more processors (e.g., (one or more) processors 305) coupled to the one or more computer-readable media and configured to execute instructions to implement modules to perform the actions described in this application.

[0079] For one embodiment, system control module 310 may include any suitable interface controller to provide any suitable interface to at least one of processor(s) 305 and / or any suitable device or component in communication with system control module 310 .

[0080] The system control module 310 may include a memory controller module 330 to provide an interface to the system memory 315. The memory controller module 330 may be a hardware module, a software module, and / or a firmware module.

[0081] The system memory 315 may be used, for example, to load and store data and / or instructions for the system 300. For one embodiment, the system memory 315 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the system memory 315 may include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).

[0082] For one embodiment, system control module 310 may include one or more input / output (I / O) controllers to provide interfaces to NVM / storage device 320 and communication interface(s) 325 .

[0083] For example, NVM / storage device 320 may be used to store data and / or instructions. NVM / storage device 320 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).

[0084] NVM / storage device 320 may include storage resources that are physically part of the device on which system 300 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 320 may be accessed over a network via communication interface(s) 325.

[0085] Communication interface(s) 325 may provide an interface for system 300 to communicate over one or more networks and / or with any other suitable devices. System 300 may wirelessly communicate with one or more components of a wireless network in accordance with any of one or more wireless network standards and / or protocols.

[0086] For one embodiment, at least one of the processor(s) 305 may be packaged together with the logic of one or more controllers of the system control module 310 (e.g., the memory controller module 330). For one embodiment, at least one of the processor(s) 305 may be packaged together with the logic of one or more controllers of the system control module 310 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 305 may be integrated on the same die with the logic of one or more controllers of the system control module 310. For one embodiment, at least one of the processor(s) 305 may be integrated on the same die with the logic of one or more controllers of the system control module 310 to form a system on chip (SoC).

[0087] In various embodiments, the system 300 may be, but is not limited to: a server, a workstation, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the system 300 may have more or fewer components and / or a different architecture. For example, in some embodiments, the system 300 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application specific integrated circuit (ASIC), and a speaker.

[0088] It should be noted that the present application can be implemented in software and / or a combination of software and hardware, for example, can be implemented using an application specific integrated circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented using hardware, for example, as a circuit that cooperates with a processor to perform each step or function.

[0089] In addition, a part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes but is not limited to source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0090] Communication media include media by which communication signals containing, for example, computer readable instructions, data structures, program modules, or other data are transmitted from one system to another. Communication media may include guided transmission media such as cables and wires (e.g., fiber optic, coaxial, etc.) and wireless (unguided transmission) media that can propagate energy waves, such as acoustic, electromagnetic, RF, microwave, and infrared. Computer readable instructions, data structures, program modules, or other data may be embodied as a modulated data signal in, for example, a wireless medium such as a carrier wave or similar mechanism such as embodied as part of spread spectrum technology. The term "modulated data signal" refers to a signal whose one or more characteristics are changed or set in such a manner as to encode information in the signal. Modulation may be analog, digital, or a hybrid modulation technique.

[0091] By way of example and not limitation, computer-readable storage media may include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. For example, computer-readable storage media include, but are not limited to, volatile memory, such as random access memory (RAM, DRAM, SRAM); and non-volatile memory, such as flash memory, various read-only memories (ROM, PROM, EPROM, EEPROM), magnetic and ferromagnetic / ferroelectric memories (MRAM, FeRAM); and magnetic and optical storage devices (hard disks, magnetic tapes, CDs, DVDs); or other media now known or later developed that can store computer-readable information / data for use by a computer system.

[0092] Here, according to an embodiment of the present application, a device is included, which includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein, when the computer program instructions are executed by the processor, the device is triggered to run the methods and / or technical solutions based on the aforementioned multiple embodiments of the present application.

[0093] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

Claims

1. A method for outputting a control tree, in, The method includes: In response to the target page being rendered, generating a control tree structure corresponding to the target page by traversing one or more controls on the target page, wherein the control tree structure includes a plurality of nodes, each node corresponding to one of the one or more controls; By performing parameter analysis on the control tree structure, obtaining node parameters corresponding to each node; If it is determined according to the node parameters that the target page has a layout problem, injecting a node parameter corresponding to at least one node into a corresponding node in the control tree structure, and outputting the control tree structure, The node parameters include at least one of the depth corresponding to each node, the degree corresponding to each node, the height of the control tree structure, and the total number of nodes of the control tree structure; The method further comprises at least one of the following: If the depth corresponding to at least one node is greater than or equal to a predetermined depth threshold, it is determined that the target page has a layout problem; If the degree corresponding to at least one node is equal to 1, it is determined that the target page has a layout problem; If the height corresponding to the root node is greater than or equal to a predetermined height threshold, it is determined that there is a layout problem with the target page; If the total number of nodes corresponding to the root node is greater than or equal to a predetermined number threshold, it is determined that the target page has a layout problem.

2. The method according to claim 1, in, The generating of the control tree structure corresponding to the target page includes: For the first control currently traversed, generate a first node corresponding to the first control, and add the first node to the control tree structure corresponding to the target page; Determine whether the first control has at least one corresponding first sub-control; if so, continue to traverse the first first sub-control in the at least one first sub-control.

3. The method according to claim 2, in, The determining whether the first control has at least one corresponding first sub-control includes: Determine whether the first control is a container type control; if not, determine whether the first control has no corresponding first sub-control; otherwise, determine whether the first control has at least one corresponding first sub-control.

4. The method according to claim 2 or 3, in, The method further comprises: If the first control does not have a corresponding first child control, determine whether the parent control of the first control has at least one second child control that has not been traversed; if so, continue to traverse the first second child control in the at least one second child control.

5. The method according to claim 2, in, The step of generating a first node corresponding to the first control currently traversed, and adding the first node to the control tree structure corresponding to the target page includes: For the first control currently traversed, determining whether the first control has a corresponding parent control; If not, initialize the control tree structure corresponding to the target page, generate a first node corresponding to the first control, and add the first node to the control tree structure as the root node of the control tree structure; Otherwise, locate the second node corresponding to the parent control in the control tree structure, generate a first node corresponding to the first control, and add the first node as the next child node of the second node to the control tree structure.

6. The method according to claim 1 in, If the total number of nodes corresponding to the root node is greater than or equal to a predetermined number threshold, determining that the target page has a layout problem includes: If the sum of the product of the total number of nodes corresponding to the root node and the first predetermined coefficient and the product of the height corresponding to the root node and the second predetermined coefficient is greater than or equal to a predetermined value, it is determined that the target page has a layout problem.

7. The method according to claim 1, in, The method further comprises: Determining whether each node has a performance problem according to the node parameters; If one or more nodes among the multiple nodes have performance problems, it is determined that the target page has a layout problem.

8. The method according to claim 7, in, The step of injecting a node parameter corresponding to at least one node into a corresponding node in the control tree structure includes: Inject node parameters corresponding to the one or more nodes with performance issues into corresponding nodes in the control tree structure.

9. The method according to claim 1, in, The outputting the control tree structure includes: The control tree structure is converted into a target file in a key-value pair format, and the target file is output.

10. A computer device for outputting a control tree, comprising a memory, a processor, and a computer program stored in the memory, It is characterized in that The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 9.

11. A computer-readable storage medium having a computer program / instructions stored thereon, It is characterized in that When the computer program / instructions are executed by a processor, the steps of the method as claimed in any one of claims 1 to 9 are implemented.

12. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.