CN114327460A - Page layout adjusting method and device, electronic equipment and storage medium - Google Patents

Page layout adjusting method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114327460A
CN114327460A CN202111642978.4A CN202111642978A CN114327460A CN 114327460 A CN114327460 A CN 114327460A CN 202111642978 A CN202111642978 A CN 202111642978A CN 114327460 A CN114327460 A CN 114327460A
Authority
CN
China
Prior art keywords
target
node
page
layout
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111642978.4A
Other languages
Chinese (zh)
Inventor
高学智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111642978.4A priority Critical patent/CN114327460A/en
Publication of CN114327460A publication Critical patent/CN114327460A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The disclosure provides a page layout adjusting method, a page layout adjusting device, electronic equipment, a storage medium and a computer program product, and 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; the limiting dimension used for limiting the position of the page node in the preset layout mode is larger than the preset dimension; at least one target node in a target page is removed through page root layout, a first target dependency relationship of parallel nodes of the target node and a second target dependency relationship of child nodes of the target node are determined, and a new page layout of the target page is formed. By utilizing the 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 the user experience are improved.

Description

Page layout adjusting method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technology, and more particularly, to the field of mobile application technology.
Background
The mobile application App is based on a 'page' and is used as a bearer for various interactive elements (pictures, characters, buttons, popup windows, toasts and the like). Due to the performance limitation of the mobile device, in the process of developing the page, the performance of the mobile device and the optimization of a program need to be considered to optimize the running performance of the App.
Because the drawing efficiency of the mobile device to the page is greatly influenced by the depth level of the page, the page level exists in a tree structure, and all leaf nodes of the tree structure need to be traversed in the process of drawing the page, the traversing and drawing efficiency is exponentially reduced when the depth level is added, page loading is possibly blocked and crashed when the depth level is seriously increased, and the user experience is greatly reduced.
Disclosure of Invention
The disclosure provides a page layout adjustment method, a page layout adjustment device, an electronic device, a storage medium and a computer program product.
According to an aspect of the present disclosure, there is provided a page layout adjustment method, including:
acquiring a page root layout constructed based on a preset layout mode; the limiting dimension used for limiting the position of the page node in the preset layout mode is larger than the preset dimension;
at least one target node in a target page is removed through page root layout, a first target dependency relationship of parallel nodes of the target node and a second target dependency relationship of child nodes of the target node are determined, and a new page layout of the target page is formed.
According to another aspect of the present disclosure, there is provided a page layout adjusting apparatus including:
the layout construction module is used for acquiring a page root layout constructed based on a preset layout mode; the limiting dimension used for limiting the position of the page node in the preset layout mode is larger than the preset dimension;
and the node removing module is used for removing at least one target node in the target page through the page root layout, determining a first target dependency relationship of parallel nodes of the target node and a second target dependency relationship of child nodes of the target node, and forming a new page layout of the target page.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform a method in any of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising computer programs/instructions which, when executed by a processor, implement the method in any of the embodiments of the present disclosure.
According to the technical scheme of the embodiment, the page root layout is constructed by the aid of the preset layout in which the limited dimension of the limited page node position is larger than the preset dimension, the nodes in the target page can be effectively eliminated by the page root layout, and the dependency relationship of the nodes related to the deleted nodes is accurately rewritten, so that the depth level of the existing page can be effectively reduced by the aid of the scheme of the embodiment, page rendering efficiency and user experience are improved, meanwhile, manual level reconstruction of each page is avoided, workload of page level reconstruction is effectively reduced, and technical level requirements on related personnel are lowered.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of a page layout adjustment method according to an embodiment of the present disclosure;
FIG. 2A is one of schematic diagrams of a page layout according to an embodiment of the present disclosure;
FIG. 2B is a second schematic diagram of a page layout according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of a page layout adjustment method according to another embodiment of the present disclosure;
FIG. 4 is a flow chart of a page layout adjustment method according to yet another embodiment of the present disclosure;
FIG. 5 is a block diagram of a page layout adjustment apparatus according to an embodiment of the present disclosure;
fig. 6 is a block diagram of an electronic device for implementing a page layout adjustment method according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The mobile application App is based on a 'page' and is used as a bearer for various interactive elements (pictures, characters, buttons, popup windows, toasts and the like). Due to the performance limitation of the mobile device, in the process of developing the page, the performance of the mobile device and the optimization of a program need to be considered to optimize the running performance of the App. Because the drawing efficiency of the mobile device to the page is greatly influenced by the depth level of the page, the page level exists in a tree structure, and all leaf nodes of the tree structure need to be traversed in the process of drawing the page, the traversing drawing efficiency is exponentially reduced when the depth level is added, and in the serious case, the page may cause stagnation and breakdown, and the user experience is greatly reduced.
If the page is a simple service page, excessive page hierarchies do not exist, and hierarchy control can be well realized through oral engagement and specification limitation.
If the service scene is copied or the existing page is maintained, the phenomenon that a developer does Not delve on the original logic afterwards and only newly increases on the original basis is common, so that the page level which is already complex originally becomes more difficult to maintain, the depth level becomes deeper and deeper along with the change times, the performance of the page becomes worse and worse, the loading is slow if the page is light, the animation is unsponsive, and an Application Not Responding (ANR) dialog box or loading crash occurs if the page is heavy.
In view of the foregoing technical defects, the present disclosure provides a page layout adjustment method, device, electronic device, storage medium, and computer program product, where a preset layout that a limited dimension of a limited page node position is greater than a preset dimension is used to construct a page root layout, a node in a target page can be effectively deleted by using the page root layout, and a dependency relationship of a node related to the deleted node can be accurately rewritten, so that a depth level of an existing page can be effectively reduced by using the scheme of the present disclosure, page rendering efficiency and user experience are improved, meanwhile, manual hierarchy reconstruction of each page is avoided, workload of page hierarchy reconstruction is effectively reduced, and technical level requirements on related personnel are reduced.
The page layout adjusting method provided by the present disclosure is explained below by specific embodiments.
Fig. 1 is a flowchart of a page layout adjustment method in an embodiment of the present disclosure, which may be executed by a device with computing capability and is used to perform page level reconfiguration on a target page. As shown in fig. 1, the page layout adjustment method includes:
s110, acquiring a page root layout constructed based on a preset layout mode; and the limiting dimension used for limiting the position of the page node in the preset layout mode is larger than the preset dimension.
S120, removing at least one target node in the target page through page root layout, and determining a first target dependency relationship of parallel nodes of the target node and a second target dependency relationship of child nodes of the target node to form a new page layout of the target page.
A new dependency relationship between the nodes is formed, i.e. a new page layout is formed.
The preset dimension can be flexibly set according to the requirement of an actual scene, for example, the preset dimension is set to 4, 5, 6, or 7, and the like, which is not limited in this disclosure.
For example, the predetermined layout manner may include a constrained layout. The constraint layout has the characteristic of mutual constraint, namely the definition of the position of the page node in the page can be performed in a mode of mutual constraint between the nodes, so that the position of the page node can be defined on more defined dimensions by utilizing the constraint layout, and the depth level of the page can be effectively reduced by utilizing the page following layout constructed by the constraint layout.
Illustratively, a container Decor displaying a custom layout is provided in a system of a mobile device, a page layout of each page in an APP or referred to as a layout object CusPage is stored in the container, the page root layout is used as a root structure AutoRoot or a root node in the container, and each page layout is used as a child node or a child layout of the page root layout, so that depth level adjustment for detecting the child layout corresponding to each page by using the page root layout can be realized. In addition, before the above embodiment of the present disclosure is executed, a Base page is defined, all pages in the APP are inherited from the Base page, and a method for rewriting the custom layout in the page may be specifically a method for rewriting the custom layout based on the Constraint layout Constraint, that is, AutoRoot inherits from the Constraint. And after the page root layout is constructed, detecting the depth levels of all pages in the APP, and performing page node removal and rearrangement on all the pages.
The parallel node refers to a node having the same node depth as the target node. The first target dependency relationship is used for defining the position of the parallel node of the target node in the target page, and the second target dependency relationship is used for defining the position of the child node of the target node in the target page. The first target dependency relationship and the second target dependency relationship do not relate to target nodes, so that the target nodes can be removed after the first target dependency relationship and the second target dependency relationship are determined.
In some embodiments, the above-mentioned page root layout may be used to detect a depth level of a certain target page, and when the depth level of the target page is greater than a preset level, the page root layout is used to remove at least one target node in the target page, and determine a first target dependency relationship of parallel nodes of the target node and a second target dependency relationship of child nodes of the target node.
By detecting the depth levels of the target pages, whether the depth levels of the target pages are large or not can be determined, and the depth levels of the target pages can be reduced by removing the nodes in the target pages with the large depth levels, so that the loading efficiency of the target pages can be improved; and for the target page loading efficiency with a smaller depth level, the influence of the depth level is smaller, so that the operation of reducing the depth level is not needed, and the efficiency of adjusting the depth level of the whole page of the APP is favorably improved.
When detecting the depth level of the target page by using the page root layout, the page root layout level is required to traverse the page layout or the layout object of the target page, and specifically, the depth level of the target page may be determined by traversing a node tree formed by nodes of the target page.
Before the target node is eliminated, the target node needs to be screened out from each node of the target page, which can be realized by the following method as an example: and screening out a first target node from a node tree formed by each node of the target page by utilizing the page root layout. When the first target node is screened, the node depth of each node is determined based on the node tree, and then the node with the minimum node depth is screened from each node according to the determined number of the nodes; if the node with the minimum depth of the screened nodes is one, the screened node with the limited dimension larger than the preset dimension is used as a first target node; if the screened nodes with the minimum node depth are multiple, one of the screened nodes can be arbitrarily selected as a first target node.
When the target nodes are screened, not only the node depth needs to be considered, but also the node types need to be combined, if the node types are in linear layout or relative layout, the dimensions for position limitation of the nodes of the types are less, the positions of the nodes related to the nodes of the types can be redefined based on the preset layout mode, namely, the dependency relationship of the related nodes is rewritten, and the nodes are deleted, so that the depth level of the target page is reduced, and the loading efficiency of the target page is improved. If the node type is constraint layout, the nodes of the constraint layout are subjected to position limitation by using a layout mode that the limited dimension is larger than the preset dimension, so that the nodes of the type cannot be deleted. In summary, the first target node can be screened according to the following principle: screening out a node with the minimum node depth from all nodes of the target page based on the node tree corresponding to the target page, wherein the node type is a node of a preset node type; and taking the screened node as a first target node.
The nodes with smaller node depth are used as target nodes, and the order and accuracy of the rewriting of the dependency relationship can be ensured. In addition, the target nodes are screened through the preset node types, and the target nodes needing to be subjected to dependency relationship rewriting can be screened accurately.
After the first target node is screened out, the first target node can be deleted by utilizing the page root layout, and 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 are determined based on a preset layout mode.
After the first target node is deleted, the depth level of the current target page can be redetected by utilizing the page root layout, if the current depth level of the target page is still larger than the preset level, second target nodes can be screened from each current node of the target page according to the mode of screening the first target node, the screened second target nodes are removed, and the first target dependency relationship of the parallel nodes of the second target nodes and the second target dependency relationship of the child nodes of the second target nodes are determined. And then, detecting the current depth level of the target page again, repeatedly screening a new target node, deleting the new target node and rewriting the dependency relationship of the nodes related to the new target node when the current depth level of the target page is still larger than the preset level, and repeating the steps until the depth level of the target page is smaller than or equal to the preset level.
Illustratively, the second target node may be screened as follows: screening out a node with the minimum node depth from all nodes of a target page based on a node tree currently corresponding to the target page, wherein the node type is a node of a preset node type; and taking the screened node as a 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. And selecting corresponding nodes from small to large according to the node depth when the target nodes are screened.
According to the method, the depth level of the target page is detected for multiple times by utilizing the page root layout, and when the depth level of the target page is greater than the preset level, the target nodes in the target page are screened and removed, so that the preset level can be realized according to expected requirements, and the depth level of the target page is reduced, so that the loading efficiency of the target page can be ensured to meet the preset loading efficiency.
In addition, the depth level of the target page may not be detected after each target node is removed, and the depth level of the target page may be detected once after the target node and all other nodes (i.e., all parallel nodes of the target node) of the page level where the target node is located are removed. And when the detected depth level is larger than the preset level, continuing to perform operations such as screening and deleting of the target node.
Illustratively, the preset hierarchy may be set based on the service type and complexity level of the APP. The preset levels corresponding to all pages in the APP may be the same. Certainly, the preset levels of different pages in the APP may be different, and for scenes with different preset levels corresponding to different pages, the preset level of the corresponding page needs to be determined based on the service type of the page and the complexity of the page.
In the method, each node is removed, the current depth level of the target page is detected by utilizing the page root layout, and then whether other target nodes need to be continuously screened and deleted is judged. In practical application, the number of target nodes to be deleted may be determined first, and then the corresponding number of target nodes may be screened and deleted. Illustratively, this may be achieved by:
firstly, determining the number of nodes to be removed based on the depth level and the preset level of a target page through page root layout; then, screening the number of target nodes from each node of the target page based on the node tree corresponding to the target page; and finally, removing the target node aiming at each screened target node, and determining a first target dependency relationship of the parallel nodes of the target node and a second target dependency relationship of the child nodes of the target node based on a preset layout mode.
The nodes in the screened-out number (represented by N) of target nodes are N nodes with the minimum node depth in the target page.
The number of the nodes needing to be deleted is determined, then the target nodes with the corresponding number are screened out for elimination and the dependency relationship of the related nodes is rewritten, so that the frequency of detecting the depth level of the target page can be effectively reduced, and the efficiency of adjusting the page layout is improved.
The depth level of the target page is related to the number of nodes in the target page, and the depth level is smaller when the number of the nodes is smaller, so that the depth level of the target page can be reduced by removing the nodes in the target page.
In some embodiments, the dependencies of the nodes associated with the target node may be rewritten by determining a first target dependency of the parallel nodes of the target node and a second target dependency of the children of the target node using:
firstly, a first dependency relationship between a target node and a parallel node of the target node is determined.
And determining a first dependency relationship between the target node and the parallel node thereof by using the page root layout, wherein the first dependency relationship is the dependency relationship before the parallel node of the target node is rewritten.
And secondly, respectively determining a second dependency relationship between the target node and each child node of the target node.
And determining a second dependency relationship between the target node and each child node thereof by using the page root layout, wherein the second dependency relationship is the dependency relationship before the child nodes of the target node are rewritten.
And thirdly, determining a first target dependency relationship of the parallel nodes based on a preset layout mode and the first dependency relationship.
And rewriting the first dependency relationship of the parallel nodes of the target node based on the preset layout mode by utilizing the page root layout to obtain the first target dependency relationship.
And fourthly, aiming at each child node, determining a second target dependency relationship of the child node based on the determined first target dependency relationship, a preset layout mode and a second dependency relationship corresponding to the child node.
And rewriting the dependency relationship of the child nodes of the target node by using the page root layout based on the preset layout mode and the first target dependency relationship to obtain a second target dependency relationship corresponding to the child nodes.
The method for determining the dependency relationship before rewriting of the parallel nodes and the child nodes of the target node and rewriting the dependency relationship on the basis can ensure the accuracy of rewriting of the dependency relationship.
After the node elimination and the dependency relationship rewriting are completed on one target page based on the mode in the embodiment, a new layout file can be generated based on the rewritten dependency relationship, and the original layout file is replaced by the new layout file, so that the purpose of automatically optimizing the depth level of the target page is achieved.
As shown in fig. 2A, the maximum depth level of the node tree of the target page before the target node is removed is 4, the root layout in the container dcor is the page root layout CusRoot, as shown in fig. 2B, in the present disclosure, the page root layout AutoRoot is constructed based on a preset layout mode, the page root layout CusRoot is replaced by the page root layout AutoRoot, and after depth level detection and adjustment, it can be seen that 3 target nodes, that is, Child nodes Child 1, Child 2, and Child 3, are deleted, and the maximum depth level of the node tree of the target page is changed to 3.
Next, the page layout adjusting method of the present disclosure is described by an embodiment, as shown in fig. 3, the page layout adjusting method of the present embodiment includes the following steps:
firstly, starting a task of adjusting the page layout.
And secondly, detecting the depth level of the target page by utilizing the page root layout.
And thirdly, if the depth level of the target page is greater than the preset level, triggering a task of page node rearrangement, and executing the fourth step.
Fourthly, sequentially detecting whether each node type is a node of a preset node type according to the sequence of the depth of the nodes in the node tree corresponding to the target node from small to large, rewriting the dependency relationship of the nodes related to the preset node type for the nodes of the preset node type, and removing the nodes; and the nodes of the non-preset node types are not subjected to dependency relationship rewriting.
And fifthly, if the depth level of the target page is smaller than the preset level, the task of page node rearrangement is not triggered.
As shown in fig. 4, in the fourth step of this embodiment, when rewriting the dependency relationship of the node related to the node of the preset node type, it is necessary to obtain a first dependency relationship between the parallel node of the node and the node, and obtain a second dependency relationship between the child node of the node and the node; then, based on a preset layout mode, converting the first dependency relationship into a first target dependency relationship, and applying the first target dependency relationship to child nodes of the node; converting the second dependency relationship into a second target dependency relationship based on a preset layout mode, the type of the node and the first target dependency relationship; and then, eliminating the node, namely eliminating the dependency relationship of the node, and finishing the task of page node rearrangement corresponding to the node. Then acquiring a parallel node of the node, and if no parallel node exists, finishing the hierarchical rearrangement corresponding to the node; otherwise, the node type detection is carried out on the parallel node of the node, and if the node is the node with the preset node type, the steps are repeated to rewrite the dependency relationship of the node related to the parallel node.
The page layout adjusting method in the embodiment directly acts the constructed page root layout on the existing layout file, namely, the original page root layout is directly replaced, the independent reconstruction cost is not increased, the depth level detection and the reduction replacement are performed on the existing page layout, the page loading efficiency is guaranteed, meanwhile, the automatic conversion can be performed on the existing code logic, the complex page depth level is reduced, the manual page layout adjustment on each page is avoided, the workload of the page layout adjustment or the page layout reconstruction is greatly reduced, the requirement on the consistency of the coding quality and the technical level of developers is low, and the page layout adjusting method can well play a role in large-scale multi-team maintenance projects.
Based on the same inventive concept, the embodiment of the present disclosure further provides a page layout adjusting apparatus corresponding to the page layout adjusting method, and since the principle of the apparatus in the embodiment of the present disclosure for solving the problem is similar to the page layout adjusting method in the embodiment of the present disclosure, the implementation of the apparatus may refer to the implementation of the method, and repeated details are not described again.
FIG. 5 is a block diagram of page layout adjustment in an embodiment in accordance with the present disclosure. As shown in fig. 5, the apparatus includes:
a layout construction module 510, configured to obtain a page root layout constructed based on a preset layout mode; and the limiting dimension used for limiting the position of the page node in the preset layout mode is larger than the preset dimension.
The node removing module 520 is configured to remove at least one target node in the target page through the page root layout, and determine a first target dependency relationship of parallel nodes of the target node and a second target dependency relationship of child nodes of the target node to form a new page layout of the target page.
In some embodiments, node culling module 520 is to:
detecting the depth level of a target page through the page root layout;
and under the condition that the depth level of the target page is greater than the preset level, at least one target node in the target page is removed through page root layout.
In some embodiments, the predetermined layout style includes a constrained layout.
In some embodiments, node culling module 520 is to:
screening out a first target node from each node of a target page through page root layout based on a node tree corresponding to the target page;
removing a first target node, and determining a first target dependency relationship of parallel nodes of the first target node and a second target dependency relationship of child nodes of the first target node based on a preset layout mode;
under the condition that the current depth level of the target page is greater than the preset level, a second target node in the target page is removed, and a first target dependency relationship of a parallel node of the second target node and a second target dependency relationship of a child node of the second target node are determined; and repeating the steps of screening the target nodes and deleting the target nodes until the depth level of the target page is less than or equal to the preset level.
In some embodiments, node culling module 520 is to:
screening out a node with the minimum node depth from all nodes of a target page based on a node tree corresponding to the target page through page root layout, wherein the node type is a node of a preset node type;
and taking the screened node as a first target node.
In some embodiments, the preset node type includes at least one of a linear layout node type and a relative layout node type.
In some embodiments, node culling module 520 is to:
determining the number of nodes needing to be removed based on the depth level and the preset level of the target page through page root layout;
screening a number of target nodes from each node of a target page based on a node tree corresponding to the target page;
and removing the target nodes aiming at each screened target node, and determining a first target dependency relationship of parallel nodes of the target nodes and a second target dependency relationship of child nodes of the target nodes based on a preset layout mode.
In some embodiments, node culling module 520 is to:
determining a first dependency relationship between a target node and a parallel node of the target node;
respectively determining a second dependency relationship between the target node and each child node of the target node;
determining a first target dependency relationship of the parallel nodes based on a preset layout mode and the first dependency relationship;
and for each child node, determining a second target dependency relationship of the child node based on the determined first target dependency relationship, a preset layout mode and a second dependency relationship corresponding to the child node.
In some embodiments, the page layout corresponding to the target page is a sub-layout of a page root layout.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 6 illustrates a schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the device 600 includes a computing unit 610 that may perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)620 or a computer program loaded from a storage unit 680 into a Random Access Memory (RAM) 630. In the RAM630, various programs and data required for the operation of the device 600 can also be stored. The computing unit 610, the ROM620, and the RAM630 are connected to each other by a bus 640. An input/output (I/O) interface 650 is also connected to bus 640.
Various components in device 600 are connected to I/O interface 650, including: an input unit 660 such as a keyboard, a mouse, etc.; an output unit 670 such as various types of displays, speakers, and the like; a storage unit 680, such as a magnetic disk, optical disk, or the like; and a communication unit 690 such as a network card, modem, wireless communication transceiver, etc. The communication unit 690 allows the device 600 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 610 may be a variety of general purpose and/or special purpose processing components having 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 specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 610 performs the respective 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 embodied 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 onto the device 600 via the ROM620 and/or the communication unit 690. When the computer program is loaded into RAM630 and executed by 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).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a 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 may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (21)

1. A page layout adjustment method includes:
acquiring a page root layout constructed based on a preset layout mode; the preset layout mode is used for limiting the position of a page node;
and removing at least one target node in a target page through the page root layout, and determining a first target dependency relationship of parallel nodes of the target node and a second target dependency relationship of child nodes of the target node to form a new page layout of the target page.
2. The method of claim 1, wherein said culling at least one target node in a target page by the page root layout comprises:
detecting a depth level of a target page through the page root layout;
and under the condition that the depth level of the target page is greater than a preset level, at least one target node in the target page is removed through the page root layout.
3. The method of claim 1, wherein the preset layout style comprises a constrained layout.
4. The method of any one of claims 1 to 3, wherein said culling at least one target node in a target page through the page root layout, and determining a first target dependency of parallel nodes of the target node and a second target dependency of children nodes of the target node, comprises:
screening out a first target node from each node of the target page based on the node tree corresponding to the target page through the page root layout;
removing the first target node, and determining a first target dependency relationship of parallel nodes of the first target node and a second target dependency relationship of child nodes of the first target node based on the preset layout mode;
under the condition that the current depth level of the target page is greater than the preset level, a second target node in the target page is removed, and a first target dependency relationship of a parallel node of the second target node and a second target dependency relationship of a child node of the second target node are determined; and repeating the steps of screening the target nodes and deleting the target nodes until the depth level of the target page is less than or equal to the preset level.
5. The method of claim 4, wherein the screening out a first target node from each node of the target page based on the node tree corresponding to the target page through the page root layout comprises:
screening out a node with the minimum node depth from all nodes of the target page based on the node tree corresponding to the target page through the page root layout, wherein the node type is a node of a preset node type;
and taking the screened node as the first target node.
6. The method of claim 5, wherein the preset node type comprises at least one of a linear layout node type and a relative layout node type.
7. The method of any one of claims 1 to 3, wherein said culling at least one target node in a target page through the page root layout, and determining a first target dependency of parallel nodes of the target node and a second target dependency of children nodes of the target node, comprises:
determining the number of nodes needing to be removed based on the depth level of the target page and the preset level through the page root layout;
screening the number of target nodes from each node of the target page based on the node tree corresponding to the target page;
and removing the target nodes aiming at each screened target node, and determining a first target dependency relationship of parallel nodes of the target nodes and a second target dependency relationship of child nodes of the target nodes based on the preset layout mode.
8. The method of any of claims 1 to 7, wherein the determining a first target dependency of parallel nodes of the target node and a second target dependency of children nodes of the target node comprises:
determining a first dependency relationship between the target node and a parallel node of the target node;
respectively determining a second dependency relationship between the target node and each child node of the target node;
determining a first target dependency relationship of the parallel nodes based on the preset layout mode and the first dependency relationship;
and for each child node, determining a second target dependency relationship of the child node based on the determined first target dependency relationship, the preset layout mode and a second dependency relationship corresponding to the child node.
9. The method of claim 1, wherein the page layout corresponding to the target page is a sub-layout of the page root layout.
10. A page layout adjusting apparatus comprising:
the layout construction module is used for acquiring a page root layout constructed based on a preset layout mode; wherein, the limiting dimension used for limiting the position of the page node in the preset layout mode is larger than the preset dimension;
and the node removing module is used for removing at least one target node in a target page through the page root layout, and determining a first target dependency relationship of parallel nodes of the target node and a second target dependency relationship of child nodes of the target node to form a new page layout of the target page.
11. The apparatus of claim 10, wherein the node culling module is to:
detecting a depth level of a target page through the page root layout;
and under the condition that the depth level of the target page is greater than a preset level, at least one target node in the target page is removed through the page root layout.
12. The apparatus of claim 10, wherein the preset layout style comprises a constrained layout.
13. The apparatus of any of claims 10 to 12, wherein the node culling module is to:
screening out a first target node from each node of the target page based on the node tree corresponding to the target page through the page root layout;
removing the first target node, and determining a first target dependency relationship of parallel nodes of the first target node and a second target dependency relationship of child nodes of the first target node based on the preset layout mode;
under the condition that the current depth level of the target page is greater than the preset level, a second target node in the target page is removed, and a first target dependency relationship of a parallel node of the second target node and a second target dependency relationship of a child node of the second target node are determined; and repeating the steps of screening the target nodes and deleting the target nodes until the depth level of the target page is less than or equal to the preset level.
14. The apparatus of claim 13, wherein the node culling module is to:
screening out a node with the minimum node depth from all nodes of the target page based on the node tree corresponding to the target page through the page root layout, wherein the node type is a node of a preset node type;
and taking the screened node as the first target node.
15. The apparatus of claim 14, wherein the preset node type comprises at least one of a linear layout node type and a relative layout node type.
16. The apparatus of any of claims 10 to 12, wherein the node culling module is to:
determining the number of nodes needing to be removed based on the depth level of the target page and the preset level through the page root layout;
screening the number of target nodes from each node of the target page based on the node tree corresponding to the target page;
and removing the target nodes aiming at each screened target node, and determining a first target dependency relationship of parallel nodes of the target nodes and a second target dependency relationship of child nodes of the target nodes based on the preset layout mode.
17. The apparatus of any of claims 10 to 16, wherein the node culling module is to:
determining a first dependency relationship between the target node and a parallel node of the target node;
respectively determining a second dependency relationship between the target node and each child node of the target node;
determining a first target dependency relationship of the parallel nodes based on the preset layout mode and the first dependency relationship;
and for each child node, determining a second target dependency relationship of the child node based on the determined first target dependency relationship, the preset layout mode and a second dependency relationship corresponding to the child node.
18. The apparatus of claim 10, wherein the page layout corresponding to the target page is a sub-layout of the page root layout.
19. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
20. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-9.
21. A computer program product comprising a computer program/instructions which, when executed by a processor, implement the method of any one of claims 1-9.
CN202111642978.4A 2021-12-29 2021-12-29 Page layout adjusting method and device, electronic equipment and storage medium Pending CN114327460A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111642978.4A CN114327460A (en) 2021-12-29 2021-12-29 Page layout adjusting method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111642978.4A CN114327460A (en) 2021-12-29 2021-12-29 Page layout adjusting method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114327460A true CN114327460A (en) 2022-04-12

Family

ID=81016022

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111642978.4A Pending CN114327460A (en) 2021-12-29 2021-12-29 Page layout adjusting method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114327460A (en)

Similar Documents

Publication Publication Date Title
US12034820B2 (en) Fusing and degradation method and apparatus for micro-service, device, and medium
US10656934B2 (en) Efficient software testing
CN115237436A (en) Application deployment method and device, electronic equipment and readable storage medium
CN113392346A (en) Path processing method and device for resource file, electronic equipment and storage medium
CN114691148A (en) Model reasoning acceleration method and device, electronic equipment and storage medium
CN113656533A (en) Tree control processing method and device and electronic equipment
CN113849581A (en) Alarm information processing method, device, equipment and storage medium
WO2021114676A1 (en) Method, apparatus, and device for updating hard disk prediction model, and medium
CN115186738B (en) Model training method, device and storage medium
CN114327460A (en) Page layout adjusting method and device, electronic equipment and storage medium
CN114697398B (en) Data processing method, device, electronic equipment, storage medium and product
CN114168119B (en) Code file editing method, device, electronic equipment and storage medium
CN115794742A (en) File path data processing method, device, equipment and storage medium
CN112149040B (en) Page skeleton screen generation method and device, electronic equipment and storage medium
CN115328736A (en) Probe deployment method, device, equipment and storage medium
CN114816184A (en) Display method, device, equipment and storage medium of operation control
CN114399513A (en) Method and device for training image segmentation model and image segmentation
CN112799642A (en) Method, apparatus, device and storage medium for processing data
US20230004774A1 (en) Method and apparatus for generating node representation, electronic device and readable storage medium
CN115408195A (en) Batch task management method, equipment and storage medium for heterogeneous platform
CN114417071A (en) Node state determination method, device, equipment and storage medium
CN114706791A (en) Test case processing method and device, electronic equipment and readable storage medium
CN115686479A (en) File creation method and related device
CN115761093A (en) Rendering method, rendering device, electronic equipment and storage medium
CN114491280A (en) Recommendation and model training methods, apparatuses, devices, media and program products

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination