Page layout adjustment method and device, electronic equipment and storage medium

By constructing a root layout for the page, removing target nodes, and rewriting dependencies, the problem of excessively deep page hierarchy in mobile applications is solved, improving page rendering efficiency and user experience, and reducing the workload of page hierarchy reconstruction.

CN114327460BActive Publication Date: 2026-02-10BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111642978.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2026-02-10
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

Excessive page depth in mobile applications can reduce rendering efficiency, potentially causing loading delays and crashes, thus impacting user experience.

Method used

By constructing a root layout for the page, removing target nodes and rewriting the dependencies of related nodes, the page depth is reduced, and a new page layout is constructed using a layout method with a limited dimension greater than the preset dimension.

Benefits of technology

It effectively reduces the depth of page layers, improves page rendering efficiency and user experience, lowers the technical requirements for developers, and reduces the workload of page layer reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114327460B_ABST
    Figure CN114327460B_ABST
Patent Text Reader

Abstract

The present disclosure provides a page layout adjustment method and device, electronic equipment, storage medium and computer program product, relates to the technical field of computers, in particular to the technical field of mobile terminal application programs. The method comprises the following steps: acquiring a page root layout constructed based on a preset layout mode; wherein the limiting dimension for limiting the position of a page node in the preset layout mode is greater than the preset dimension; by means of the page root layout, at least one target node in a target page is removed, a first target dependency relationship of a parallel node of the target node and a second target dependency relationship of a child node of the target node are determined, so as to form a new page layout of the target page. By using the above-mentioned page root layout, the nodes in the target page can be effectively deleted, and the dependency relationship of the nodes related to the deleted nodes can be accurately rewritten, so that the depth level of the existing page is effectively reduced, and the page rendering efficiency and user experience are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more particularly to the field of mobile application technology. Background Technology

[0002] Mobile applications (Apps) are based on "pages," which serve as the carriers of various interactive elements (images, text, buttons, pop-ups, etc.). Due to the performance limitations of mobile devices, the development of "pages" needs to consider the performance of the mobile device and the optimization of the application to ensure the best possible performance for the App.

[0003] Since the page rendering efficiency of mobile devices is greatly affected by the page depth hierarchy, and the page hierarchy exists in a tree structure, the rendering process needs to traverse all the leaf nodes of the tree structure. Therefore, with each additional level of depth, the traversal rendering efficiency decreases exponentially. In severe cases, it may cause page loading to lag or crash, greatly reducing the user experience. Summary of the Invention

[0004] This disclosure provides a page layout adjustment method, apparatus, electronic device, storage medium, and computer program product.

[0005] According to one aspect of this disclosure, a method for adjusting page layout is provided, comprising:

[0006] Obtain the root layout of the page based on a preset layout method; wherein, the limiting dimension used to restrict the position of page nodes in the preset layout method is greater than the preset dimension;

[0007] By using the page root layout, at least one target node in the target page is removed, and the first target dependency relationship of the target node's parallel nodes and the second target dependency relationship of the target node's child nodes are determined to form a new page layout for the target page.

[0008] According to another aspect of this disclosure, a page layout adjustment device is provided, comprising:

[0009] The layout building module is used to obtain the page root layout based on a preset layout method; wherein, the limiting dimension used to restrict the position of page nodes in the preset layout method is greater than the preset dimension.

[0010] The node removal module is used to remove at least one target node from the target page through the page root layout, and to determine the first target dependency relationship of the target node's parallel nodes and the second target dependency relationship of the target node's child nodes, so as to form a new page layout for the target page.

[0011] According to another aspect of this disclosure, an electronic device is provided, comprising:

[0012] At least one processor; and

[0013] A memory that is communicatively connected to at least one processor; wherein,

[0014] The memory stores instructions that can be executed by at least one processor to enable the at least one processor to perform the methods in any embodiment of this disclosure.

[0015] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform the methods of any embodiment of this disclosure.

[0016] According to another aspect of this disclosure, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the methods in any embodiment of this disclosure.

[0017] The technical solution of this disclosure uses a preset layout with a defined dimension for limiting the position of page nodes that is greater than a preset dimension to construct the root layout of the page. This root layout can effectively remove nodes from the target page and accurately rewrite the dependency relationships of nodes related to the deleted nodes. Therefore, the solution of this disclosure can effectively reduce the depth of existing pages, improve page rendering efficiency and user experience, and avoid manually reconstructing the hierarchy of each page, effectively reducing the workload of page hierarchy reconstruction and lowering the technical requirements for relevant personnel.

[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0019] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0020] Figure 1 This is a flowchart of a page layout adjustment method according to an embodiment of the present disclosure;

[0021] Figure 2A This is one of the schematic diagrams of a page layout according to an embodiment of the present disclosure;

[0022] Figure 2B This is a second schematic diagram of the page layout according to an embodiment of the present disclosure;

[0023] Figure 3 This is a flowchart of a page layout adjustment method according to another embodiment of the present disclosure;

[0024] Figure 4 This is a flowchart of a page layout adjustment method according to another embodiment of the present disclosure;

[0025] Figure 5 This is a block diagram of a page layout adjustment device according to an embodiment of the present disclosure;

[0026] Figure 6 This is a block diagram of an electronic device used to implement the page layout adjustment method of the embodiments of this disclosure. Detailed Implementation

[0027] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0028] Mobile applications (Apps) are based on "pages," which serve as the carriers of various interactive elements (images, text, buttons, pop-ups, etc.). Due to the performance limitations of mobile devices, the development of "pages" requires consideration of both mobile device performance and program optimization to ensure optimal App performance. Since the page rendering efficiency on mobile devices is greatly affected by the page's depth hierarchy, and page hierarchies exist in a tree structure, rendering a page requires traversing all leaf nodes of the tree. Therefore, with each additional level of depth, the traversal and rendering efficiency decreases exponentially, potentially leading to lag, crashes, and a significantly degraded user experience.

[0029] For pages with simple business functions, there won't be too many page layers. Layer control can be well achieved through verbal agreements and standardized restrictions.

[0030] In business scenarios involving duplication or maintaining existing pages, a common phenomenon is that developers are hesitant to alter the original logic and can only add new elements on top of it. This makes the already complex page hierarchy even more difficult to maintain, with the depth of the hierarchy increasing with each modification, leading to increasingly poor page performance. This can range from slow loading and stuttering animations to more serious issues like Application Not Responding (ANR) dialog boxes or crashes.

[0031] To address the aforementioned technical deficiencies, this disclosure provides a page layout adjustment method, apparatus, electronic device, storage medium, and computer program product. This disclosure utilizes a preset layout where the defined dimension of the page node positions is greater than a preset dimension to construct a page root layout. This page root layout effectively deletes nodes from the target page and accurately rewrites the dependencies between nodes related to the deleted nodes. Therefore, the solution using this disclosure effectively reduces the depth of existing page layers, improves page rendering efficiency and user experience, and avoids manually reconstructing the layers of each page separately, effectively reducing the workload of page layer reconstruction and lowering the technical skill requirements for relevant personnel.

[0032] The page layout adjustment method provided in this disclosure will be described below through specific embodiments.

[0033] Figure 1 This is a flowchart of a page layout adjustment method according to an embodiment of this disclosure. The method of this embodiment can be executed by a device with computing power and is used to reconstruct the page hierarchy of a target page. Figure 1 As shown, the methods for adjusting the page layout include:

[0034] S110. Obtain the page root layout constructed based on the preset layout method; wherein, the limiting dimension used to limit the position of page nodes in the preset layout method is greater than the preset dimension.

[0035] S120. By using the page root layout, remove at least one target node from the target page, and determine the first target dependency relationship of the target node's parallel nodes and the second target dependency relationship of the target node's child nodes to form a new page layout for the target page.

[0036] This creates new dependencies between nodes, resulting in a new page layout.

[0037] The aforementioned preset dimensions can be flexibly set according to the needs of the actual scenario. For example, the preset dimensions can be set to 4, 5, 6 or 7, etc. This disclosure does not limit this.

[0038] For example, the preset layout method may include constraint layout. Constraint layout has the characteristic of mutual constraint, that is, the position of page nodes in the page can be restricted by mutual constraints between nodes. Therefore, using constraint layout can restrict the position of page nodes in more dimensions, thereby the page and layout constructed using constraint layout can effectively reduce the depth of the page hierarchy.

[0039] For example, the mobile device system provides a container called Decor to display custom layouts. This container stores the page layouts, or layout objects (CusPages), of each page in the app. The aforementioned root layout serves as the root structure AutoRoot or root node in this container, and each page layout serves as a child node or child layout of the root layout. This enables the depth-level adjustment of the corresponding child layouts of each page using the root layout. Furthermore, before executing the above embodiments of this disclosure, a base page, or Base page, is defined. All pages in the app inherit from this page. The method for custom layouts is overridden on this page, specifically based on Constraint layout, where AutoRoot inherits from Constraint. After the root layout is constructed, it is used to detect the depth-level of each page in the app, as well as to remove and rearrange page nodes.

[0040] The aforementioned parallel nodes refer to nodes with the same node depth as the target node. The first target dependency is used to limit the position of the target node's parallel nodes within the target page, and the second target dependency is used to limit the position of the target node's child nodes within the target page. Neither the first nor the second target dependency involves the target node; therefore, after determining the first and second target dependencies, the target node can be removed.

[0041] In some embodiments, the depth level of a target page can be detected using the above-described page root layout. If the depth level of the target page is greater than a preset level, at least one target node in the target page can be removed using the page root layout. The first target dependency relationship of the target node's parallel nodes and the second target dependency relationship of the target node's child nodes can also be determined.

[0042] By detecting the depth level of a target page, it can be determined whether the depth level of the target page is relatively large. Removing nodes from target pages with large depth levels can reduce the depth level of such target pages, thereby improving the loading efficiency of such target pages. On the other hand, the loading efficiency of target pages with small depth levels is less affected by the depth level, so there is no need to reduce the depth level. This helps to improve the efficiency of adjusting the overall page depth level of the app.

[0043] When using the root layout to detect the depth level of a target page, the root layout level needs to traverse the target page's page layout or layout object. Specifically, this can be done by traversing the node tree formed by each node of the target page to determine the depth level of the target page.

[0044] Before removing target nodes, it is necessary to filter out target nodes from all nodes on the target page. For example, this can be achieved as follows: Using the aforementioned root layout, filter out the first target node from the node tree formed by the nodes on the target page. When filtering the first target node, first determine the node depth of each node based on the aforementioned node tree, and then, based on the determined number of nodes, filter out the node with the smallest node depth. If there is only one node with the smallest node depth, then that node, whose defined dimension is greater than the preset dimension, will be selected as the first target node. If there are multiple nodes with the smallest node depth, any one of the selected nodes can be arbitrarily chosen as the first target node.

[0045] When selecting target nodes, it's crucial to consider not only node depth but also node type. If the node type is linear or relative, these nodes have fewer dimensions for positional constraints. Therefore, the positions of related nodes can be redefined based on the preset layout, essentially rewriting dependencies and deleting the node. This reduces the target page's depth and improves loading efficiency. However, if the node type is constrained, it cannot be deleted because its position is already constrained by a layout with a constraint dimension greater than the preset dimension. In summary, the following principle applies when selecting the first target node: Based on the node tree corresponding to the target page, select the node with the lowest depth and a preset node type from all nodes on the target page; this selected node becomes the first target node.

[0046] Using nodes with shallower node depths as target nodes ensures the orderliness and accuracy of dependency rewriting. Furthermore, filtering target nodes by preset node types accurately identifies the nodes requiring dependency rewriting.

[0047] After identifying the first target node, the first target node can be deleted using the aforementioned page root layout. Based on the preset layout, the first target dependency of the parallel nodes of the first target node and the second target dependency of the child nodes of the first target node can be determined.

[0048] After deleting the first target node, the root layout described above can be used to re-detect the depth level of the current target page. If the current depth level of the target page is still greater than the preset level, a second target node can be selected from the current nodes of the target page in the same way as the first target node. The selected second target node is then removed, and the first target dependency relationship of the parallel nodes of the second target node and the second target dependency relationship of the child nodes of the second target node are determined. Then, the current depth level of the target page needs to be detected again. If the current depth level of the target page is still greater than the preset level, the process of selecting new target nodes, deleting new target nodes, and rewriting the dependencies of nodes related to the new target nodes is repeated until the depth level of the target page is less than or equal to the preset level.

[0049] For example, the second target node can be selected as follows: Based on the node tree corresponding to the current target page, select the node with the smallest node depth and a preset node type from all nodes on the target page; use this selected node as the second target node. The node depth of the first target node is less than or equal to the node depth of the second target node. When selecting target nodes, select the corresponding nodes according to their node depth from smallest to largest.

[0050] The above-mentioned method of using the root layout to perform multiple checks on the depth level of the target page, and filtering and removing target nodes in the target page when the depth level of the target page is greater than the preset level, can reduce the depth level of the target page according to the expected requirements, i.e., the preset level, thereby ensuring that the loading efficiency of the target page can meet the preset loading efficiency.

[0051] Alternatively, instead of checking the target page's depth level after removing each target node, you can check the target page's depth level once after removing the target node and all other nodes in the same page hierarchy (i.e., all parallel nodes of the target node). If the detected depth level is greater than a preset level, then continue with the filtering and deletion of target nodes.

[0052] For example, the aforementioned preset hierarchy can be set based on the business type and complexity of the app. All pages within the app can have the same preset hierarchy. Of course, different pages within the app can also have different preset hierarchies. For scenarios where different pages have different preset hierarchies, the preset hierarchy for each page needs to be determined based on the business type and complexity of the page.

[0053] The above method requires detecting the current depth level of the target page using the page root layout to remove each node, and then determining whether to continue filtering and deleting other target nodes. In practical applications, the number of target nodes to be deleted can be determined first, and then the corresponding number of target nodes can be filtered and deleted. For example, this can be implemented as follows:

[0054] First, based on the root layout of the page and the depth and preset levels of the target page, determine the number of nodes to be removed. Then, based on the node tree corresponding to the target page, select the above number of target nodes from each node of the target page. Finally, for each selected target node, remove the target node and, based on the preset layout, determine the first target dependency relationship of the target node's parallel nodes and the second target dependency relationship of the target node's child nodes.

[0055] The nodes selected from the above number (denoted by N) of target nodes are the N nodes with the smallest node depth in the target page.

[0056] The above method first determines the number of nodes to be deleted, then filters out the corresponding number of target nodes for removal and rewrites the related node dependencies. This can effectively reduce the number of times the target page's depth hierarchy is checked and improve the efficiency of page layout adjustment.

[0057] The depth level of the target page is related to the number of nodes in the target page. The fewer the nodes, the smaller the depth level. Therefore, the depth level of the target page can be reduced by removing nodes from the target page.

[0058] In some embodiments, the dependencies of nodes related to the target node can be rewritten using the following steps: determining the first target dependency of the target node's parallel nodes and the second target dependency of the target node's child nodes.

[0059] First, determine the primary dependency relationship between the target node and its parallel nodes.

[0060] By using the page root layout, determine the first dependency relationship between the target node and its parallel nodes. This first dependency relationship is the dependency relationship between the target node and its parallel nodes before the rewriting.

[0061] Second, determine the secondary dependencies between the target node and each of its child nodes.

[0062] By using the page root layout, we can determine the second dependency relationship between the target node and its various child nodes. This second dependency relationship is the dependency relationship between the target node's child nodes before they are rewritten.

[0063] Third, based on the preset layout and the first dependency relationship, determine the first target dependency relationship of the parallel nodes.

[0064] Using the page root layout, the first dependency relationship of the parallel nodes of the target node is rewritten based on the above-mentioned preset layout method to obtain the above-mentioned first target dependency relationship.

[0065] Fourth, for each child node, based on the determined first target dependency, the preset layout method, and the second dependency corresponding to the child node, determine the second target dependency of the child node.

[0066] Using the page root layout, based on the above-mentioned preset layout method and the first target dependency relationship, the dependency relationship of the child nodes of the target node is rewritten to obtain the second target dependency relationship of the corresponding child nodes.

[0067] The above method of first determining the dependencies of the target node's parallel nodes and child nodes before rewriting, and then rewriting the dependencies based on these dependencies, can ensure the accuracy of dependency rewriting.

[0068] After removing nodes and rewriting dependencies for a target page using the methods described in the above embodiments, a new layout file can be generated based on the rewritten dependencies. This new layout file replaces the original layout file, thereby automatically optimizing the depth hierarchy of the target page.

[0069] like Figure 2A As shown, the maximum depth level of the node tree of the target page before removing the target node is 4, and the root layout in the container Décor is the page root layout CusRoot, as shown. Figure 2B As shown, the page root layout AutoRoot in this disclosure is constructed based on a preset layout method. After replacing the page root layout CusRoot with the page root layout AutoRoot and performing depth level detection and adjustment, it can be seen that three target nodes are deleted, namely child nodes Child 1, Child 2 and Child 3, and the maximum depth level of the node tree of the target page becomes 3.

[0070] The page layout adjustment method of this disclosure will be further illustrated by an embodiment below, such as... Figure 3 As shown, the page layout adjustment method in this embodiment includes the following steps:

[0071] The first step is to initiate the page layout adjustment task.

[0072] The second step is to use the root layout of the page to detect the depth level of the target page.

[0073] Third, if the depth level of the target page is greater than the preset level, the task of page node rearrangement is triggered, and the fourth step is executed.

[0074] Step 4: According to the node depth in the node tree corresponding to the target node in ascending order, check whether each node type is a preset node type. For nodes of the preset node type, rewrite the dependency relationship of its related nodes and remove the node; for nodes of non-preset node type, do not rewrite the dependency relationship.

[0075] Step 5: If the depth level of the target page is less than the preset level, the task of reordering page nodes will not be triggered.

[0076] like Figure 4 As shown, in the fourth step of this embodiment, when rewriting the dependency relationships of nodes related to a node of a preset node type, it is necessary to obtain the first dependency relationship between the node's parallel nodes and the node itself, and the second dependency relationship between the node's child nodes and the node. Then, based on a preset layout method, the first dependency relationship is converted into a first target dependency relationship, and this first target dependency relationship is applied to the node's child nodes. Based on the preset layout method, the node type, and the first target dependency relationship, the second dependency relationship is converted into a second target dependency relationship. Then, the node is removed, i.e., its dependency relationship is removed, completing the task of rearranging the page nodes corresponding to the node. Next, the node's parallel nodes are obtained. If there are no parallel nodes, the hierarchical rearrangement corresponding to the node ends; otherwise, the node type of the node's parallel nodes is checked. If it is a node of a preset node type, the above steps are repeated to rewrite the dependency relationships of nodes related to that parallel node.

[0077] The page layout adjustment method in the above embodiments directly applies the constructed page root layout to the existing layout file, that is, it directly replaces the original page root layout without increasing the cost of separate reconstruction. Furthermore, it performs deep-level detection and reduction replacement on the existing page layout, ensuring page loading efficiency while automatically transforming existing code logic, reducing complex page depth levels, avoiding manual page layout adjustments for each page, greatly reducing the workload of page layout adjustment or reconstruction, and having lower requirements for the consistency of coding skills and technical level of developers. It can play a good role in large-scale multi-team maintenance projects.

[0078] Based on the same inventive concept, this disclosure also provides a page layout adjustment device corresponding to the page layout adjustment method. Since the principle of the device in this disclosure for solving the problem is similar to the page layout adjustment method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0079] Figure 5 This is a block diagram illustrating page layout adjustments according to one embodiment of this disclosure. For example... Figure 5 As shown, the device includes:

[0080] The layout construction module 510 is used to obtain the page root layout constructed based on a preset layout method; wherein, the limiting dimension used to limit the position of page nodes in the preset layout method is greater than the preset dimension.

[0081] The node removal module 520 is used to remove at least one target node from the target page through the page root layout, and to determine the first target dependency relationship of the target node's parallel nodes and the second target dependency relationship of the target node's child nodes, so as to form a new page layout for the target page.

[0082] In some embodiments, the node removal module 520 is used for:

[0083] Detect the depth level of the target page by checking the root layout;

[0084] If the depth level of the target page is greater than the preset level, at least one target node in the target page is removed by using the page root layout.

[0085] In some embodiments, the preset layout method includes a constraint layout.

[0086] In some embodiments, the node removal module 520 is used for:

[0087] By using the root layout of the page, the first target node is selected from the nodes of the target page based on the node tree corresponding to the target page.

[0088] Remove the first target node, and based on the preset layout, determine the first target dependency relationship of the parallel nodes of the first target node, and the second target dependency relationship of the child nodes of the first target node;

[0089] If the current depth level of the target page is greater than the preset level, remove the second target node from the target page, and determine the first target dependency relationship of the parallel nodes of the second target node, and the second target dependency relationship of the child nodes of the second target node; repeat the steps of filtering and deleting target nodes until the depth level of the target page is less than or equal to the preset level.

[0090] In some embodiments, the node removal module 520 is used for:

[0091] Based on the root layout of the page and the node tree corresponding to the target page, a node with the smallest node depth and a preset node type is selected from all the nodes of the target page.

[0092] The selected node is used as the first target node.

[0093] In some embodiments, the preset node type includes at least one of linear layout node type and relative layout node type.

[0094] In some embodiments, the node removal module 520 is used for:

[0095] By using the root layout of the page, the number of nodes that need to be removed is determined based on the depth level and preset level of the target page.

[0096] Based on the node tree corresponding to the target page, select a certain number of target nodes from each node of the target page;

[0097] For each selected target node, the target node is removed, and based on the preset layout, the first target dependency relationship of the target node's parallel nodes and the second target dependency relationship of the target node's child nodes are determined.

[0098] In some embodiments, the node removal module 520 is used for:

[0099] Determine the first dependency between the target node and its parallel nodes;

[0100] Determine the second dependencies between the target node and each of its child nodes;

[0101] Based on the preset layout and the first dependency relationship, determine the first target dependency relationship of the parallel nodes;

[0102] For each child node, based on the determined first target dependency, the preset layout method, and the second dependency corresponding to the child node, the second target dependency of the child node is determined.

[0103] In some embodiments, the page layout corresponding to the target page is a sub-layout of the page root layout.

[0104] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0105] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0106] Figure 6A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0107] like Figure 6 As shown, device 600 includes a computing unit 610, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 620 or a computer program loaded from storage unit 680 into random access memory (RAM) 630. RAM 630 may also store various programs and data required for the operation of device 600. The computing unit 610, ROM 620, and RAM 630 are interconnected via bus 640. Input / output (I / O) interface 650 is also connected to bus 640.

[0108] Multiple components in device 600 are connected to I / O interface 650, including: input unit 660, such as keyboard, mouse, etc.; output unit 670, such as various types of monitors, speakers, etc.; storage unit 680, such as disk, optical disk, etc.; and communication unit 690, such as network card, modem, wireless transceiver, etc. Communication unit 690 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0109] The computing unit 610 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 610 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 610 performs the various methods and processes described above, such as the page layout adjustment method. For example, in some embodiments, the page layout adjustment method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 680. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 620 and / or communication unit 690. When the computer program is loaded into RAM 630 and executed by the computing unit 610, one or more steps of the page layout adjustment method described above may be performed. Alternatively, in other embodiments, the computing unit 610 may be configured to perform the page layout adjustment method by any other suitable means (e.g., by means of firmware).

[0110] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0111] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0112] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0113] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0114] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0115] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0116] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0117] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for adjusting page layout, comprising: Obtain a root layout of the page constructed based on a preset layout method; wherein, in the preset layout method, the limiting dimension used to limit the position of the page nodes is greater than the preset dimension; the root layout of the page serves as the root node in a container, and the container also stores the page layouts of each page in the application APP, and each page layout serves as a child node of the root layout of the page. By using the root layout of the page, at least one target node in the target page is removed, and the first target dependency relationship of the parallel nodes of the target node and the second target dependency relationship of the child nodes of the target node are determined to form a new page layout for the target page. The step of removing at least one target node from the target page through the page root layout includes: detecting the depth level of the target page through the page root layout; and removing at least one target node from the target page through the page root layout if the depth level of the target page is greater than a preset level.

2. The method according to claim 1, wherein, The preset layout methods include constraint layout.

3. The method according to claim 1 or 2, wherein, The step of removing at least one target node from the target page through the page root layout, and determining the first target dependency relationship of the target node's parallel nodes and the second target dependency relationship of the target node's child nodes, includes: Based on the root layout of the page and the node tree corresponding to the target page, the first target node is selected from each node of the target page. Remove the first target node, and based on the preset layout, determine the first target dependency relationship of the parallel nodes of the first target node, and the second target dependency relationship of the child nodes of the first target node; If the current depth level of the target page is greater than the preset level, remove the second target node from the target page, and determine the first target dependency relationship of the parallel nodes of the second target node and the second target dependency relationship of the child nodes of the second target node; repeat the steps of filtering target nodes and deleting target nodes until the depth level of the target page is less than or equal to the preset level.

4. The method according to claim 3, wherein, The step of selecting the first target node from the nodes of the target page based on the node tree corresponding to the target page through the page root layout includes: Based on the root layout of the page and the node tree corresponding to the target page, a node with the smallest node depth and a preset node type is selected from all the nodes of the target page. The selected node is used as the first target node.

5. The method according to claim 4, wherein, The preset node type includes at least one of linear layout node type and relative layout node type.

6. The method according to claim 1 or 2, wherein, The step of removing at least one target node from the target page through the page root layout, and determining the first target dependency relationship of the target node's parallel nodes and the second target dependency relationship of the target node's child nodes, includes: Based on the root layout of the page, the number of nodes to be removed is determined according to the depth level of the target page and the preset level. Based on the node tree corresponding to the target page, the specified number of target nodes are selected from each node of the target page; For each selected target node, the target node is removed, and based on the preset layout, the first target dependency relationship of the target node's parallel nodes and the second target dependency relationship of the target node's child nodes are determined.

7. The method according to any one of claims 1 to 6, wherein, Determining the first target dependency relationship of the target node's parallel nodes and the second target dependency relationship of the target node's child nodes includes: Determine the first dependency relationship between the target node and its parallel nodes; Determine the second dependency relationship between the target node and each of its child nodes; Based on the preset layout method and the first dependency relationship, the first target dependency relationship of the parallel node is determined; For each child node, based on the determined first target dependency, the preset layout method, and the second dependency corresponding to the child node, the second target dependency of the child node is determined.

8. The method according to claim 1, wherein, The page layout corresponding to the target page is a sub-layout of the root layout of the page.

9. A page layout adjustment device, comprising: A layout construction module is used to obtain a page root layout constructed based on a preset layout method; wherein, in the preset layout method, the limiting dimension used to limit the position of page nodes is greater than the preset dimension; the page root layout is the root node in a container, and the container also stores the page layouts of each page in the application APP, and each page layout is a child node of the page root layout. The node removal module is used to remove at least one target node from the target page through the page root layout, and to determine the first target dependency relationship of the parallel nodes of the target node and the second target dependency relationship of the child nodes of the target node, so as to form a new page layout of the target page. The node removal module is further configured to: detect the depth level of the target page through the page root layout; and, if the depth level of the target page is greater than a preset level, remove at least one target node from the target page through the page root layout.

10. The apparatus according to claim 9, wherein, The preset layout methods include constraint layout.

11. The apparatus according to claim 9 or 10, wherein, The node removal module is used for: Based on the root layout of the page and the node tree corresponding to the target page, the first target node is selected from each node of the target page. Remove the first target node, and based on the preset layout, determine the first target dependency relationship of the parallel nodes of the first target node, and the second target dependency relationship of the child nodes of the first target node; If the current depth level of the target page is greater than the preset level, remove the second target node from the target page, and determine the first target dependency relationship of the parallel nodes of the second target node, and the second target dependency relationship of the child nodes of the second target node. Repeat the steps of filtering and deleting target nodes until the depth level of the target page is less than or equal to the preset level.

12. The apparatus according to claim 11, wherein, The node removal module is used for: Based on the root layout of the page and the node tree corresponding to the target page, a node with the smallest node depth and a preset node type is selected from all the nodes of the target page. The selected node is used as the first target node.

13. The apparatus according to claim 12, wherein, The preset node type includes at least one of linear layout node type and relative layout node type.

14. The apparatus according to claim 9 or 10, wherein, The node removal module is used for: Based on the root layout of the page, the number of nodes to be removed is determined according to the depth level of the target page and the preset level. Based on the node tree corresponding to the target page, the specified number of target nodes are selected from each node of the target page; For each selected target node, the target node is removed, and based on the preset layout, the first target dependency relationship of the target node's parallel nodes and the second target dependency relationship of the target node's child nodes are determined.

15. The apparatus according to any one of claims 9 to 14, wherein, The node removal module is used for: Determine the first dependency relationship between the target node and its parallel nodes; Determine the second dependency relationship between the target node and each of its child nodes; Based on the preset layout method and the first dependency relationship, the first target dependency relationship of the parallel node is determined; For each child node, based on the determined first target dependency, the preset layout method, and the second dependency corresponding to the child node, the second target dependency of the child node is determined.

16. The apparatus according to claim 9, wherein, The page layout corresponding to the target page is a sub-layout of the root layout of the page.

17. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.

18. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-8.

19. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the method of any one of claims 1-8.