Method, device, electronic device and storage medium for determining page layout

By calculating the inclusion degree and relationship of the page module based on the page data, and adaptively determining the page layout, the problem of high complexity and difficulty in adapting to the page layout determination in the prior art is solved, and high-quality page layout determination is achieved.

CN113742619BActive Publication Date: 2025-02-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011270299.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-13
Publication Date
2025-02-21
Estimated Expiration
2040-11-13

AI Technical Summary

Technical Problem

The prior art increases the complexity and workload of page UI design when determining page layout, and it is difficult to realize adaptive determination of page layout.

Method used

By determining the position information of the page module based on the page data of the target page, calculating the inclusion degree between the modules, determining the row relationship and column relationship, and then adaptively determining the page layout.

Benefits of technology

It realizes high-quality and high-fidelity page layout determination, reducing the complexity and workload of page UI design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113742619B_ABST
    Figure CN113742619B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, electronic device and storage medium for determining page layout, and relates to the field of computer technology. A specific implementation of the method includes: determining the position information of page modules included in the target page according to the page data of the target page; calculating the degree of inclusion between the page modules according to the position information; determining the row relationship and column relationship between the page modules according to the degree of inclusion and the position information of the page modules; determining the page layout of the target page according to the degree of inclusion and the row relationship and column relationship between the page modules. This implementation can solve the problem that the existing method of determining page layout increases the complexity and workload of page UI design, and it is difficult to achieve the problem of adaptive determination of page layout.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for determining a page layout. Background Art

[0002] With the intelligent development of Internet technology, how to automatically convert UI pages into code at low cost has become an increasingly urgent need. Among them, how to determine the page layout of the UI page with high quality and high fidelity is particularly important. In the existing method of determining the page layout, it is necessary to compulsorily add the page layout when designing the page UI, so that the subsequent determined page layout is high-fidelity and high-quality. However, this method not only increases the complexity and workload of page UI design, but also has many restrictions on the process of determining the page layout, making it difficult to achieve adaptive determination of the page layout. Summary of the invention

[0003] In view of this, an embodiment of the present invention provides a method, device, system and storage medium for determining page layout, which can solve the problem that the existing method of determining page layout increases the complexity and workload of page UI design and it is difficult to achieve adaptive determination of page layout.

[0004] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for determining a page layout is provided.

[0005] A method for determining a page layout according to an embodiment of the present invention includes: determining the position information of page modules included in the target page based on page data of the target page; calculating the degree of inclusion between the page modules based on the position information; determining the row relationship and column relationship between the page modules based on the degree of inclusion and the position information of the page modules; determining the page layout of the target page based on the degree of inclusion and the row relationship and column relationship between the page modules.

[0006] In one embodiment, the degree of inclusion includes complete inclusion and incomplete inclusion;

[0007] The determining, according to the inclusion degree and the position information of the page modules, the row relationship and the column relationship between the page modules comprises:

[0008] For the two page modules whose degree of inclusion is complete inclusion, the included page module is determined as a child module of the corresponding parent module, and the parent module is a page module that includes the included page module;

[0009] According to the position information of the page modules, the row relationship and column relationship between the pending page modules are determined, and the pending page modules are other page modules in the page modules except the submodules.

[0010] In yet another embodiment, the position information includes row coordinates and column coordinates of the preset position;

[0011] The step of determining the row relationship and column relationship between the pending page modules according to the position information of the page modules includes:

[0012] Sorting the pending page modules according to the row coordinates of the preset positions of the pending page modules to obtain a first order;

[0013] According to the column coordinates of the preset positions of the page modules, a second sequence is obtained for the to-be-determined page modules;

[0014] The row relationship between the pending page modules is determined according to the second sequence and the position information of the pending page modules, and the column relationship between the pending page modules is determined according to the first sequence and the position information of the pending page modules.

[0015] In yet another embodiment, determining the row relationship between the pending page modules according to the second sequence and the position information of the pending page modules includes:

[0016] Determine the to-be-determined page module located at the first position in the second sequence as the first module, and determine the to-be-determined page module located at the second position in the second sequence as the second module;

[0017] According to the position information of the first module and the position information of the second module, determine whether the first module and the second module include overlapping areas in the row direction; if so, combine the first module and the second module to obtain a first target module, determine the position information of the first target module according to the position information of the first module and the position information of the second module, update the first target module to a new first module, and update the pending page module located after the second module to a new second module; if not, determine that the first module is a separate row, update the second module to a new first module, and update the pending page module located after the second module before the update to a new second module.

[0018] In yet another embodiment, determining the column relationship between the pending page modules according to the first sequence and the position information of the pending page modules includes:

[0019] Determine the page module located first in the first sequence as the first module, and determine the page module located second in the first sequence as the second module;

[0020] According to the position information of the first module and the position information of the second module, determine whether the first module and the second module include overlapping areas in the column direction; if so, combine the first module and the second module to obtain a second target module, determine the position information of the second target module according to the position information of the first module and the position information of the second module, update the second target module to a new first module, and update the pending page module located after the second module to a new second module; if not, determine that the first module is a separate column, update the second module to a new first module, and update the pending page module located after the second module before the update to a new second module.

[0021] In yet another embodiment, the page module includes an A module and a B module;

[0022] The calculating the inclusion degree between the page modules according to the position information includes:

[0023] Determine the location area corresponding to the A module according to the location information of the A module, and determine the location area corresponding to the B module according to the location information of the B module;

[0024] If the location area corresponding to the A module completely includes the location area corresponding to the B module, or the location area corresponding to the B module completely includes the location area corresponding to the A module, then the degree of inclusion between the A module and the B module is determined to be complete inclusion;

[0025] If the location area corresponding to the A module does not completely include the location area corresponding to the B module, and the location area corresponding to the B module does not completely include the location area corresponding to the A module, then the degree of inclusion between the A module and the B module is determined to be incomplete inclusion.

[0026] To achieve the above objective, according to another aspect of an embodiment of the present invention, a device for determining a page layout is provided.

[0027] A device for determining a page layout according to an embodiment of the present invention includes: a determination unit, used to determine the position information of page modules included in the target page based on the page data of the target page; a calculation unit, used to calculate the degree of inclusion between the page modules based on the position information; the determination unit is also used to determine the row relationship and column relationship between the page modules based on the degree of inclusion and the position information of the page modules; the determination unit is also used to determine the page layout of the target page based on the degree of inclusion and the row relationship and column relationship between the page modules.

[0028] In one embodiment, the degree of inclusion includes complete inclusion and incomplete inclusion; and the determining unit is specifically configured to:

[0029] For the two page modules whose degree of inclusion is complete inclusion, the included page module is determined as a child module of the corresponding parent module, and the parent module is a page module that includes the included page module;

[0030] According to the position information of the page modules, the row relationship and column relationship between the pending page modules are determined, and the pending page modules are other page modules in the page modules except the submodules.

[0031] In yet another embodiment, the position information includes row coordinates and column coordinates of a preset position; and the determining unit is specifically configured to:

[0032] Sorting the pending page modules according to the row coordinates of the preset positions of the pending page modules to obtain a first order;

[0033] According to the column coordinates of the preset positions of the page modules, a second sequence is obtained for the to-be-determined page modules;

[0034] The row relationship between the pending page modules is determined according to the second sequence and the position information of the pending page modules, and the column relationship between the pending page modules is determined according to the first sequence and the position information of the pending page modules.

[0035] In yet another embodiment, the determining unit is specifically configured to:

[0036] Determine the to-be-determined page module located at the first position in the second sequence as the first module, and determine the to-be-determined page module located at the second position in the second sequence as the second module;

[0037] According to the position information of the first module and the position information of the second module, determine whether the first module and the second module include overlapping areas in the row direction; if so, combine the first module and the second module to obtain a first target module, determine the position information of the first target module according to the position information of the first module and the position information of the second module, update the first target module to a new first module, and update the pending page module located after the second module to a new second module; if not, determine that the first module is a separate row, update the second module to a new first module, and update the pending page module located after the second module before the update to a new second module.

[0038] In yet another embodiment, the determining unit is specifically configured to:

[0039] Determine the page module located first in the first sequence as the first module, and determine the page module located second in the first sequence as the second module;

[0040] According to the position information of the first module and the position information of the second module, determine whether the first module and the second module include overlapping areas in the column direction; if so, combine the first module and the second module to obtain a second target module, determine the position information of the second target module according to the position information of the first module and the position information of the second module, update the second target module to a new first module, and update the pending page module located after the second module to a new second module; if not, determine that the first module is a separate column, update the second module to a new first module, and update the pending page module located after the second module before the update to a new second module.

[0041] In yet another embodiment, the page module includes an A module and a B module; the computing unit is specifically configured to:

[0042] Determine the location area corresponding to the A module according to the location information of the A module, and determine the location area corresponding to the B module according to the location information of the B module;

[0043] If the location area corresponding to the A module completely includes the location area corresponding to the B module, or the location area corresponding to the B module completely includes the location area corresponding to the A module, then the degree of inclusion between the A module and the B module is determined to be complete inclusion;

[0044] If the location area corresponding to the A module does not completely include the location area corresponding to the B module, and the location area corresponding to the B module does not completely include the location area corresponding to the A module, then the degree of inclusion between the A module and the B module is determined to be incomplete inclusion.

[0045] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.

[0046] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining the page layout provided by the embodiment of the present invention.

[0047] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer readable medium is provided.

[0048] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, the method for determining a page layout provided by an embodiment of the present invention is implemented.

[0049] An embodiment of the above invention has the following advantages or beneficial effects: In the embodiment of the present invention, for the target page, the degree of inclusion, row relationship and column relationship can be determined in sequence through the position information of each page module, and then the page layout of the target page can be determined. In this way, there is no need to add the page layout when designing the UI page, but the page layout is adaptively determined according to the page data, which not only ensures high-quality and high-fidelity determination of the page layout of the UI page, but also reduces the complexity and workload of the page UI design.

[0050] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0052] Figure 1 is a schematic diagram of a main process of a method for determining a page layout according to an embodiment of the present invention;

[0053] Figure 2 is a schematic diagram of the degree of inclusion between page modules according to an embodiment of the present invention;

[0054] Figure 3 is a schematic diagram of a row relationship between page modules according to an embodiment of the present invention;

[0055] Figure 4 is a schematic diagram of a main process of a method for determining row relationships according to an embodiment of the present invention;

[0056] Figure 5 is a schematic diagram of the column relationship between page modules according to an embodiment of the present invention;

[0057] Figure 6 is a schematic diagram of a main process of a method for determining a column relationship according to an embodiment of the present invention;

[0058] Figure 7 is a schematic diagram of main units of a device for determining a page layout according to an embodiment of the present invention;

[0059] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0060] Fig. 9 It is a schematic diagram of the structure of a computer system suitable for implementing the embodiment of the present invention. DETAILED DESCRIPTION

[0061] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0062] It should be pointed out that the embodiments of the present invention and the features in the embodiments may be combined with each other if there is no conflict.

[0063] The embodiment of the present invention provides a method for determining a page layout, which can be executed by a terminal device, such as Figure 1 As shown, the method includes the following steps.

[0064] S101: Determine location information of page modules included in the target page according to page data of the target page.

[0065] The target page may be a UI (user interface) page. The page data is the page data of the target page, and may specifically be a JSON Schema file of the target page. The page data includes the location information of each page module in the target page.

[0066] Specifically, the location information of the page module may include coordinate information of the page module, for example, the coordinates of two vertices of diagonal points of the page module, and may also include the coordinates of one vertex of the page module and the height and width of the page module.

[0067] S102: Calculate the degree of inclusion between page modules based on the location information.

[0068] The degree of inclusion may include complete inclusion and incomplete inclusion. In this step, the location area corresponding to each page module can be determined based on the location information of the page module, and the degree of inclusion between the page modules can be determined based on the location relationship between these location areas. For example, Figure 2 FIG. 1 is a schematic diagram showing the degree of inclusion between two page modules in an embodiment of the present invention. Figure 2 In the first case, the degree of inclusion of the two page modules is complete, and in the second and third cases, the degree of inclusion of the two page modules is incomplete.

[0069] like Figure 2 As shown in the first case, the location area corresponding to one page module completely includes the location area corresponding to another page module, so the inclusion degree of these two page modules is complete inclusion; Figure 2As shown in the second case, the location areas corresponding to the two page modules partially overlap, and Figure 2 As shown in the third case, the location areas corresponding to the two page modules do not overlap with each other, and the inclusion degree of these two page modules can be determined as incomplete inclusion. Assuming that module A and module B are any two page modules in each page module, this step can be specifically performed as follows: determine the location area corresponding to module A according to the location information of module A, and determine the location area corresponding to module B according to the location information of module B; if the location area corresponding to module A completely includes the location area corresponding to module B, or the location area corresponding to module B completely includes the location area corresponding to module A, then determine that the inclusion degree between module A and module B is complete inclusion; if the location area corresponding to module A does not completely include the location area corresponding to module B, and the location area corresponding to module B does not completely include the location area corresponding to module A, then determine that the inclusion degree between module A and module B is incomplete inclusion.

[0070] Specifically, the position information of the page module in the embodiment of the present invention is described by taking the coordinates (x, y) of the upper left corner vertex of the page module, the height (height) and the width (weidth) of the page module as an example. Assume that the position information of module A is expressed as {"x1":0,"y1":0,"weidth1":200,"height1":50}, and the position information of module B is expressed as {"x2":300,"y2":5,"weidth2":100,"height2":100}. Then, through the above-mentioned position information of module A, it can be determined that the coordinates of the lower right corner vertex of module A are (x1+width1, y1+height1), and through the above-mentioned position information of module B, it can be determined that the coordinates of the lower right corner vertex of module B are (x2+width2, y2+height2). Then, the degree of inclusion between module A and module B is determined by comparing the size of the coordinates of the upper left corner vertex and the lower right corner vertex between module A and module B. The specific process is: if x1≤x2≤x2+width2≤x1+width1, and y1+height1≤y2+height2≤y2≤y1, then it is determined that module A contains module B, that is, the degree of inclusion between module A and module B is complete inclusion, and module B is the included module; if x2≤x1≤x1+width2≤x2+width1, and y2+height2≤y1+height1≤y1≤y2, then it is determined that module B contains module A, that is, the degree of inclusion between module B and module A is complete inclusion, and module A is the included module; if the size of the coordinates of the upper left vertex and the lower right vertex between module A and module B do not meet the above two conditions, then it is determined that module A and module B do not contain each other, that is, the degree of inclusion between module A and module B is incomplete inclusion. Therefore, when the position information of module A is {"x1":0,"y1":0,"weidth1":200,"height1":50} and the position information of module B is {"x2":300,"y2":5,"weidth2":100,"height2":100}, it can be calculated that the degree of inclusion between module A and module B is incomplete inclusion.

[0071] In this step, after determining that the page module with a degree of inclusion is completely included, the included page module can be determined as a child module, the page module that contains the included page module can be determined as a parent module, and the corresponding relationship between the parent module and the child module between the two can be stored. For example, if the degree of inclusion between module A and module B is completely included, and module A contains module B, module B is determined as a child module, and module A is determined as the parent module of module B.

[0072] It should be noted that after determining the degree of inclusion between each page module, it can be stored in the form of JSON Tree. For example, a JSON Tree can be: [{"name":"A","frame":{"x":0,"y":0,"weidth":200,"height":50},"children":[],"style":{} ,"type":"Image"},{"name":"B","frame":{"x":300,"y":5,"weidth":100,"height":100},"children":[{ "name":"b-1","frame":{"x":310,"y":10,"weidth":80,"height":40},"children":[],"style":{},"type ":"Text"}],"style":{},"type":"Div"},null,{"name":"C","frame":{"x":0,"y":60,"weidth":100,"heig ht":50},"children":[],"style":{},"type":"Div"}]. In JSONTree, the content in a {} including name, frame, children, style, and type parameters corresponds to the information of a page module, and the degree of inclusion between page modules corresponding to different {} is incomplete, where name represents the name of the page module, frame represents the location information of the page module, children represents the submodule of the page module named name, style represents the style of the page module, and type represents the type of the page module. Therefore, from the above JSON Tree, it can be seen that the page modules in the JSON Tree include module A, module B, module C, and module b-1, where the degree of inclusion between module A, module B, and module C is incomplete, and module b-1 is a submodule of module B, that is, module B includes module b-1, and the degree of inclusion between module b-1 and module B is incomplete.

[0073] S103: Determine the row relationship and column relationship between the page modules according to the inclusion degree and the position information of the page modules.

[0074] After the inclusion degree between the page modules is determined in step S102, the row relationship and column relationship between the page modules may be determined in combination with the position information of the page modules.

[0075] In the embodiment of the present invention, for a page module with a degree of inclusion of full inclusion, since the positional relationship between the included submodule and the corresponding parent module has been determined, the row relationship and column relationship between the submodule and other page modules can be reflected by the row relationship and column relationship between the corresponding parent module and other page modules. Therefore, in order to simplify the processing process, the row relationship and column relationship of the submodule can no longer be determined in this step, that is, in this step, the submodule determined in step S102 can be temporarily ignored, and the row relationship and column relationship between all modules except the submodule in all page modules can be determined based on the positional relationship. In this step, all modules except the submodule in all page modules are referred to as pending page modules, that is, the row relationship and column relationship between the pending page modules are determined based on the positional information of the page modules, wherein the pending page modules include the parent module determined in step S102 and the page module that does not contain the submodule.

[0076] For the pending page modules, in this step, the row relationship and column relationship between the pending page modules can be determined respectively according to the position information.

[0077] Specifically, with regard to row relationships, in order to reduce the comparison process between pending page modules, the pending page modules can be sorted according to the column coordinates of the preset positions in each pending page module to obtain a second arrangement order. In this way, the pending page modules in the second order are arranged in order from high to low or from low to high according to the row position. Therefore, it is only necessary to compare the row relationships between adjacent pending page modules in sequence according to the second order to determine the row relationships between the pending page modules. In other words, the row relationships between the pending page modules are determined according to the second order and the position information of the pending page modules. The specific execution process may be: determining the pending page module located at the first position in the second sequence as the first module, and determining the pending page module located at the second position in the second sequence as the second module; judging whether the first module and the second module include overlapping areas in the row direction according to the position information of the first module and the position information of the second module; if so, combining the first module and the second module to obtain a first target module, determining the position information of the first target module according to the position information of the first module and the position information of the second module, and updating the first target module to a new first module, and updating the pending page module located after the second module in the second sequence to a new second module; if not, determining that the first module is a separate row, and updating the second module to a new first module, and updating the pending page module located after the second module before the update in the second sequence to a new second module.

[0078] In the above process, the first pending page module in the second order is first selected as the first module, and the second pending page module in the second order is second selected as the second module, and then the row relationship between the first module and the second module is compared. The comparison method is: according to the position information of the first module and the position information of the second module, whether the first module and the second module include overlapping areas in the row direction; if the first module and the second module include overlapping areas in the row direction, at this time, the first module and the second module cannot be divided in the row direction, then the first module and the second module can be combined into a new page module, that is, the first target module, which is the parent module of the first module and the second module in the row direction, and the position information of the first target module can be determined according to the position information of the first module and the second module; if the first module and the second module do not include overlapping areas in the row direction, it means that the first module and the second module do not overlap in the row direction and can be divided into two rows, then the first module is determined to be a single row, and the second module needs to be compared with the subsequent pending page modules. After executing the above comparison process, the row relationship between the first module and the second module is determined, and then subsequent comparisons need to be performed. At this time, if the above comparison process determines the parent module of the first module and the second module in the row direction, that is, the first target module, the first target template is updated to a new first module, and the pending page module located after the second module in the second sequence is updated to a new second module, and then the row relationship between the first target module and the new second module is compared through the above comparison method; if the above comparison process determines that the first module is a single row, the second template is updated to a new first module, and the pending page module located after the second module before the update in the second sequence is updated to a new second module, and then the row relationship between the new first module and the new second module is compared through the above comparison method. In this way, the row relationship between the pending page modules can be determined by cyclically executing the comparison process.

[0079] It should be noted that the preset position in this step can be set according to the specific scene, for example, it can be a vertex of the page module, and the second sequence can be the pending page modules arranged in descending order or from small to large according to the column coordinates of the preset position. In the embodiment of the present invention, the position information such as the coordinates of each point included in the page module can be determined based on the position information of the page module, so that it can be determined whether the first module and the second module include an overlapping area in the row direction, and the position information of the first target module can be determined. In the above comparison process, the overlapping area of ​​the first module and the second module in the row direction does not mean that there must be an overlapping area between the first module and the second module in the row direction, but means that the first module and the second module occupy the same row in the row direction, and can occupy different parts of the same row.

[0080] Specifically, with regard to the column relationship, in order to reduce the comparison process between the pending page modules, the pending page modules can be sorted according to the row coordinates of the preset positions in each pending page module to obtain a first arrangement order. In this way, the pending page modules in the first order are arranged according to the column positions, so it is only necessary to compare the column relationships between adjacent pending page modules in sequence according to the first order to determine the column relationships between the pending page modules. In other words, the column relationships between the pending page modules are determined according to the first order and the position information of the pending page modules. The specific execution process may be: determining the pending page module located at the first position in the first sequence as the first module, and determining the pending page module located at the second position in the first sequence as the second module; judging whether the first module and the second module include overlapping areas in the column direction according to the position information of the first module and the position information of the second module; if so, combining the first module and the second module to obtain a second target module, determining the position information of the second target module according to the position information of the first module and the position information of the second module, and updating the second target module to a new first module, and updating the pending page module located after the second module in the first sequence to a new second module; if not, determining that the first module is a separate column, and updating the second module to a new first module, and updating the pending page module located after the second module before the update in the first sequence to a new second module.

[0081] In the above process, firstly, the pending page module located in the first position in the first sequence is selected as the first module, and the pending page module located in the second position in the first sequence is selected as the second module, and then the column relationship between the first module and the second module is compared. The comparison method is: according to the position information of the first module and the position information of the second module, whether the first module and the second module include overlapping areas in the column direction; if the first module and the second module include overlapping areas in the column direction, at this time, the first module and the second module cannot be divided in the column direction, then the first module and the second module can be combined into a new page module, that is, the second target module, which is the parent module of the first module and the second module in the column direction, and the position information of the second target module can be determined according to the position information of the first module and the second module; if the first module and the second module do not include overlapping areas in the column direction, it means that the first module and the second module do not overlap in the column direction and can be divided into two columns, then the first module is determined to be a single column, and the second module needs to be compared with the subsequent pending page module. After executing the above comparison process, the column relationship between the first module and the second module can be determined, and then the subsequent comparison can be performed. At this time, after executing the above comparison process, if the parent module of the first module and the second module, that is, the second target module, is determined, the first target module is updated to a new first module, and the pending page module located after the second module in the first order is updated to a new second module, and then the above comparison method is used for comparison again; if the first module is determined to be a single column, the second template is updated to a new first module, and the pending page module located after the second module before the update in the first order is updated to a new second module, and then the above comparison method is used for comparison again, so that the column relationship between the pending page modules can be determined by cyclically executing the comparison process.

[0082] It should be noted that the preset position in this step can be set according to the specific scene, for example, it can be a vertex of the page module, and the first order can be that the pending page modules are arranged in order from large to small or from small to large according to the row coordinates of the preset position. In the embodiment of the present invention, the position information such as the coordinates of each point included in the page module can be determined based on the position information of the page module, so that it can be determined whether the first module and the second module include overlapping areas in the column direction, and the position information of the second target module can be determined. In the above comparison process, the overlapping area of ​​the first module and the second module in the column direction does not mean that there must be an overlapping area between the first module and the second module in the column direction, but means that the first module and the second module occupy the same column in the column direction, and can occupy different parts of the same column.

[0083] S104: Determine the page layout of the target page according to the degree of inclusion and the row relationship and column relationship between page modules.

[0084] After determining the inclusion degree, row relationship and column relationship between page modules, the page layout of the target page can be determined. The page layout of the target page can be represented by JSON Tree.

[0085] In an embodiment of the present invention, for a target page, the degree of inclusion, row relationship, and column relationship can be determined in sequence through the position information of each page module, and then the page layout of the target page can be determined. In this way, there is no need to increase the page layout when designing the UI page. Instead, the page layout is adaptively determined based on the page data, which not only ensures high-quality and high-fidelity determination of the page layout of the UI page, but also reduces the complexity and workload of page UI design.

[0086] It should be noted that when comparing the row relationship between the first module and the second module in step S103, the position relationship between the first module and the second module in the row direction may be specifically as follows: Figure 3 As shown. Figure 3 As shown, there are 6 positional relationships between the first module and the second module in the row direction, among which the 1st, 2nd, 4th and 5th positional relationships are that the first module and the second module include overlapping areas in the row direction, and the 3rd and 6th positional relationships are that the first module and the second module do not include overlapping areas in the row direction.

[0087] based on Figure 3 The row position relationship shown, combined with Figure 1 In the embodiment shown in FIG. 1 , the method for determining the row relationship in step S103 is specifically described. Figure 4 As shown, the method includes the following methods.

[0088] S401: Determine the pending page module.

[0089] In this step, the pending page modules are determined according to the degree of inclusion between the page modules. The specific principle is the same as that in step S103 and will not be repeated here.

[0090] S402: Sort the pending page modules according to the column coordinates of the preset positions to obtain a second order.

[0091] Among them, in the embodiment of the present invention, taking the position information including the coordinates, height and width values ​​of the upper left corner vertex of the page module as an example, the preset position can be selected as the upper left corner vertex, so the second order can be obtained by arranging the column coordinates of the upper left corner vertex of the pending page module from large to small or from small to large.

[0092] S403: Determine the to-be-determined page module that is located at the first position in the second sequence as the first module, and determine the to-be-determined page module that is located at the second position in the second sequence as the second module.

[0093] Among them, the first two pending page modules in the second sequence are compared first, so the first pending page module in the second sequence is determined as the first module, and the second pending page module in the second sequence is determined as the second module.

[0094] S404: Determine whether the first module and the second module include an overlapping area in the row direction, if so, execute step S405, if not, execute step S408.

[0095] In the embodiment of the present invention, taking the position information of the first module as {x1, y1, weidth1, height1} and the position information of the second module as {x2, y2, weidth2, height2} as an example, it can be calculated that the corresponding area of ​​the first module in the row direction is the interval from y1 to y1-height1, and the corresponding area of ​​the second module in the row direction is the interval from y2 to y2-height2. Therefore, by comparing whether the interval from y1 to y1-height1 includes an overlapping interval with the interval from y2 to y2-height2, it can be determined whether the first module and the second module include an overlapping area in the row direction. If the interval from y1 to y1-height1 includes an overlapping interval with the interval from y2 to y2-height2, it is determined that the first module and the second module include an overlapping area in the row direction, that is, Figure 3 The first, second, fourth and fifth positional relationships in the above formula; if the interval from y1 to y1-height1 does not include an overlapping interval with the interval from y2 to y2-height2, it is determined that the first module and the second module do not include an overlapping area in the row direction, that is, Figure 3 The 3rd and 6th position relationships.

[0096] S405: Determine the position information of the first target module according to the position information of the first module and the position information of the second module.

[0097] In this step, the first module and the second module are combined to obtain a first target module, and the position information of the first target module is determined.

[0098] Specifically, in the embodiment of the present invention, the position information of the first module is {x1, y1, weidth1, height1}, and the position information of the second module is {x2, y2, weidth2, height2}, then the coordinates of the lower right corner vertex of the first module can be calculated as (x1+weidth1, y1-height1), and the coordinates of the lower right corner vertex of the second module can be calculated as (x2+weidth2, y2-height2). Figure 3 As shown, Figure 3 In the first case, the left page module is the first module, and the right page module is the second module. Figure 3 In the first case shown in FIG. 1 , it can be determined that the vertex coordinates of the first target module are (x1, y1), the height is height1, and the width is x2+weidth2-x1; Figure 3 In the second case shown, it can be determined that the vertex coordinates of the first target module are (x1, y1), the height is y1-y2+height2, and the width is x2+weidth2-x1; Figure 3 In the fourth case shown in FIG. 1 , it can be determined that the vertex coordinates of the first target module are (x2, y1), the height is height1, and the width is x1+weidth1-x2; Figure 3 In the fifth case shown, it can be determined that the vertex coordinates of the first target module are (x2, y1), the height is y1-y2+height2, and the width is x1+weidth1-x2.

[0099] S406: Determine whether there is a pending page module after the second module in the second sequence. If not, end the process; if yes, execute step S407.

[0100] After determining the row position relationship between the first module and the second module, it can be determined whether there are any uncompared pending page modules in the second sequence, that is, whether there are any uncompared pending page modules after the second module in the second sequence. If yes, it means that there are still uncompared pending page modules, and step S407 needs to be executed; if not, it means that there are no uncompared pending page modules, the row relationship has been determined, and the process can be ended.

[0101] S407: The first target module is updated to be a new first module, and the pending page module located one position after the second module in the second sequence is updated to be a new second module.

[0102] The first module and the second module are combined to determine the first target module, and then the first target module is compared with the subsequent pending page modules as a whole, so the first target module is updated to a new first module, and the pending page module located after the second module in the second sequence is updated to a new second module, and then step S404 is executed to determine the row relationship between the updated first module and the updated second module.

[0103] S408: Determine that the first module is a separate row, and determine whether there is a pending page module after the second module in the second sequence. If not, end the process; if yes, execute step S409.

[0104] The first module and the second module do not include overlapping areas in the row direction, that is, the first module is determined to be a separate row, and then it is determined whether there are any uncompared pending page modules in the second sequence, that is, it is determined whether there are any pending page modules after the second module in the second sequence. If yes, it means that there are still uncompared pending page modules, and step S409 needs to be executed; if not, it means that there are no uncompared pending page modules, the row relationship has been determined, and the process can be ended.

[0105] S409: updating the second module to be a new first module, and updating the pending page module located one position after the second module in the second sequence to be a new second module.

[0106] After determining the row relationship between the first module and the second module, the second module can be updated to a new first module, and the pending page module located after the second module in the second sequence can be updated to a new second module, and then step S404 is executed to determine the row relationship between the updated first module and the updated second module.

[0107] In an embodiment of the present invention, by sequentially comparing the row relationships between the pending page modules in the second order, the row relationships between the page modules can be determined, and then the page layout of the target page can be determined. In this way, there is no need to increase the page layout when designing the UI page, but the page layout is adaptively determined based on the page data, which not only ensures high-quality and high-fidelity determination of the page layout of the UI page, but also reduces the complexity and workload of the page UI design.

[0108] It should be noted that when comparing the column relationship between the first module and the second module in step S103, the position relationship between the first module and the second module in the column direction may be specifically as follows: Figure 5 As shown. Figure 5 As shown, there are 6 positional relationships between the first module and the second module in the column direction, among which the 1st, 2nd, 4th and 5th positional relationships are that the first module and the second module include overlapping areas in the column direction, and the 3rd and 6th positional relationships are that the first module and the second module do not include overlapping areas in the column direction.

[0109] based on Figure 5 The column position relationship shown, combined with Figure 1 In the embodiment shown in FIG. 1 , the method for determining the column relationship in step S103 is specifically described. Figure 6 As shown, the method includes the following methods.

[0110] S601: Determine the pending page module.

[0111] In this step, the pending page modules are determined according to the degree of inclusion between the page modules. The specific principle is the same as that in step S103 and will not be repeated here.

[0112] S602: Sort the pending page modules according to the row coordinates of the preset positions to obtain a first order.

[0113] Among them, in the embodiment of the present invention, taking the position information including the coordinates, height and width values ​​of the upper left corner vertex of the page module as an example, the preset position can be selected as the upper left corner vertex, so the first order can be the pending page module arranged from large to small or from small to large according to the column coordinates of the upper left corner vertex.

[0114] S603: Determine the to-be-determined page module that is at the first position in the first sequence as the first module, and determine the to-be-determined page module that is at the second position in the first sequence as the second module.

[0115] Among them, the pending page modules located at the first two positions in the first sequence are first compared, so the pending page module located at the first position in the first sequence is determined as the first module, and the pending page module located at the second position in the first sequence is determined as the second module.

[0116] S604: Determine whether the first module and the second module include an overlapping area in the column direction, if so, execute step S605, if not, execute step S608.

[0117] In the embodiment of the present invention, taking the position information of the first module as {x1, y1, weidth1, height1} and the position information of the second module as {x2, y2, weidth2, height2} as an example, it can be calculated that the corresponding area of ​​the first module in the column direction is the interval from x1 to x1+weidth1, and the corresponding area of ​​the second module in the column direction is the interval from x2 to x2+weidth2. Therefore, by comparing whether the interval from x1 to x1+weidth1 includes an overlapping interval with the interval from x2 to x2+weidth2, it can be determined whether the first module and the second module include an overlapping area in the column direction. If the interval from x1 to x1+weidth1 includes an overlapping interval with the interval from x2 to x2+weidth2, it is determined that the first module and the second module include an overlapping area in the column direction, that is, Figure 5 The first, second, fourth and fifth positional relationships in the formula; if the interval from x1 to x1+weidth1 and the interval from x2 to x2+weidth2 do not include an overlapping interval, it is determined that the first module and the second module do not include an overlapping area in the column direction, that is, Figure 5 The 3rd and 6th position relationships.

[0118] S605: Determine the position information of the second target module according to the position information of the first module and the position information of the second module.

[0119] In this step, the first module and the second module are combined to obtain a second target module, and the position information of the second target module is determined.

[0120] Specifically, in the embodiment of the present invention, the position information of the first module is {x1, y1, weidth1, height1}, and the position information of the second module is {x2, y2, weidth2, height2}, then the coordinates of the lower right corner vertex of the first module can be calculated as (x1+weidth1, y1-height1), and the coordinates of the lower right corner vertex of the second module can be calculated as (x2+weidth2, y2-height2). Figure 5 As shown, Figure 5 In the first case, the upper page module is the first module, and the lower page module is the second module. Figure 5 In the first case shown, it can be determined that the vertex coordinates of the second target module are (x1, y1), the height is y1-y2+height2, and the width is weidth1; Figure 5 In the second case shown, it can be determined that the vertex coordinates of the second target module are (x1, y1), the height is y1-y2+height2, and the width is x2+weidth2-x1; Figure 5 In the fourth case shown, it can be determined that the vertex coordinates of the second target module are (x2, y1), the height is y1-y2+height2, and the width is x1+weidth1-x2; Figure 5 In the fifth case shown, it can be determined that the vertex coordinates of the first target module are (x2, y1), the height is y1-y2+height2, and the width is x1+weidth1-x2.

[0121] S606: Determine whether there is a pending page module after the second module in the first sequence. If not, end the process; if so, execute step S607.

[0122] After determining the column position relationship between the first module and the second module, it can be determined whether there are any uncompared pending page modules in the first sequence, that is, whether there are any uncompared pending page modules after the second module in the first sequence. If yes, it means that there are still uncompared pending page modules, and step S607 needs to be executed; if not, it means that there are no uncompared pending page modules, the column relationship has been determined, and the process can be ended.

[0123] S607: The first target module is updated to be a new first module, and the pending page module located one position after the second module in the first sequence is updated to be a new second module.

[0124] The first module and the second module are combined to determine the second target module, and then the second target module is compared with the subsequent pending page module as a whole, so the second target module is updated to a new first module, and the pending page module located after the second module in the first sequence is updated to a new second module, and then step S604 is executed to determine the column relationship between the updated first module and the updated second module.

[0125] S608: Determine that the first module is a separate column, and determine whether there are any pending page modules after the second module in the first sequence. If yes, end the process; if yes, execute step S609.

[0126] The first module and the second module do not include overlapping areas in the column direction, that is, the first module is determined to be a separate column, and then it is determined whether there are any uncompared pending page modules in the first sequence, that is, it is determined whether there are any pending page modules after the second module in the first sequence. If yes, it means that there are still uncompared pending page modules, and step S609 needs to be executed; if not, it means that there are no uncompared pending page modules, the column relationship has been determined, and the process can be ended.

[0127] S609: Update the first module to a new first module, and update the pending page module located one position after the second module in the first sequence to a new second module.

[0128] After determining the column relationship between the first module and the second module, the second module can be updated to a new first module, and the pending page module located after the second module in the first sequence can be updated to a new second module, and then step S604 is executed to determine the column relationship between the updated first module and the updated second module.

[0129] In an embodiment of the present invention, by comparing the column relationships between the pending page modules in the first order in sequence, the column relationships between the page modules can be determined, and then the page layout of the target page can be determined. In this way, there is no need to increase the page layout when designing the UI page, but the page layout is adaptively determined according to the page data, which not only ensures high-quality and high-fidelity determination of the page layout of the UI page, but also reduces the complexity and workload of the page UI design.

[0130] In order to solve the problems existing in the prior art, the embodiment of the present invention provides a device 700 for determining a page layout, such as Figure 7 As shown, the device 700 includes:

[0131] The determination unit 701 is used to determine the location information of the page modules included in the target page according to the page data of the target page;

[0132] A calculation unit 702, configured to calculate the degree of inclusion between the page modules according to the location information;

[0133] The determining unit 701 is further configured to determine the row relationship and column relationship between the page modules according to the inclusion degree and the position information of the page modules;

[0134] The determining unit 701 is further configured to determine a page layout of the target page according to the degree of inclusion and the row relationship and column relationship between the page modules.

[0135] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 1 The method of the illustrated embodiment is the same and will not be described again here.

[0136] In one implementation of the embodiment of the present invention, the degree of inclusion includes complete inclusion and incomplete inclusion;

[0137] The determining unit 701 is specifically configured to:

[0138] For the two page modules whose degree of inclusion is complete inclusion, the included page module is determined as a child module of the corresponding parent module, and the parent module is a page module that includes the included page module;

[0139] According to the position information of the page modules, the row relationship and column relationship between the pending page modules are determined, and the pending page modules are other page modules in the page modules except the submodules.

[0140] In another implementation of the embodiment of the present invention, the position information includes row coordinates and column coordinates of a preset position; the determining unit 701 is specifically configured to:

[0141] Sorting the pending page modules according to the row coordinates of the preset positions of the pending page modules to obtain a first order;

[0142] According to the column coordinates of the preset positions of the page modules, a second sequence is obtained for the to-be-determined page modules;

[0143] The row relationship between the pending page modules is determined according to the second sequence and the position information of the pending page modules, and the column relationship between the pending page modules is determined according to the first sequence and the position information of the pending page modules.

[0144] In another implementation of the embodiment of the present invention, the determining unit 701 is specifically configured to:

[0145] Determine the to-be-determined page module located at the first position in the second sequence as the first module, and determine the to-be-determined page module located at the second position in the second sequence as the second module;

[0146] According to the position information of the first module and the position information of the second module, determine whether the first module and the second module include overlapping areas in the row direction; if so, combine the first module and the second module to obtain a first target module, determine the position information of the first target module according to the position information of the first module and the position information of the second module, update the first target module to a new first module, and update the pending page module located after the second module to a new second module; if not, determine that the first module is a separate row, update the second module to a new first module, and update the pending page module located after the second module before the update to a new second module.

[0147] In another implementation of the embodiment of the present invention, the determining unit 701 is specifically configured to:

[0148] Determine the page module located first in the first sequence as the first module, and determine the page module located second in the first sequence as the second module;

[0149] According to the position information of the first module and the position information of the second module, determine whether the first module and the second module include overlapping areas in the column direction; if so, combine the first module and the second module to obtain a second target module, determine the position information of the second target module according to the position information of the first module and the position information of the second module, update the second target module to a new first module, and update the pending page module located after the second module to a new second module; if not, determine that the first module is a separate column, update the second module to a new first module, and update the pending page module located after the second module before the update to a new second module.

[0150] In another implementation of the embodiment of the present invention, the page module includes module A and module B; the calculation unit 702 is specifically used to:

[0151] Determine the location area corresponding to the A module according to the location information of the A module, and determine the location area corresponding to the B module according to the location information of the B module;

[0152] If the location area corresponding to the A module completely includes the location area corresponding to the B module, or the location area corresponding to the B module completely includes the location area corresponding to the A module, then the degree of inclusion between the A module and the B module is determined to be complete inclusion;

[0153] If the location area corresponding to the A module does not completely include the location area corresponding to the B module, and the location area corresponding to the B module does not completely include the location area corresponding to the A module, then the degree of inclusion between the A module and the B module is determined to be incomplete inclusion.

[0154] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 1 , Figure 4 or Figure 6 The method of the illustrated embodiment is the same and will not be repeated here.

[0155] In an embodiment of the present invention, for a target page, the degree of inclusion, row relationship, and column relationship can be determined in sequence through the position information of each page module, and then the page layout of the target page can be determined. In this way, there is no need to increase the page layout when designing the UI page. Instead, the page layout is adaptively determined based on the page data, which not only ensures high-quality and high-fidelity determination of the page layout of the UI page, but also reduces the complexity and workload of page UI design.

[0156] According to an embodiment of the present invention, the present invention also provides an electronic device and a readable storage medium.

[0157] The electronic device of the present invention comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the method for determining the page layout provided in an embodiment of the present invention.

[0158] Figure 8 An exemplary system architecture 800 is shown to which the method or apparatus for determining a page layout according to an embodiment of the present invention can be applied.

[0159] like Figure 8 As shown, system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. Network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and server 805. Network 804 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0160] The user can use the terminal devices 801, 802, 803 to interact with the server 805 through the network 804 to receive or send messages, etc. Various client applications can be installed on the terminal devices 801, 802, 803.

[0161] The terminal devices 801 , 802 , and 803 may be smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0162] The server 805 may be a server that provides various services. The server may analyze and process the received data such as the product information query request, and feed back the processing result (such as product information - just an example) to the terminal device.

[0163] It should be noted that the method for determining the page layout provided in the embodiment of the present invention is generally executed by the terminal devices 801 , 802 , 803 , and accordingly, the apparatus for determining the page layout is generally arranged in the terminal devices 801 , 802 , 803 .

[0164] It should be understood that Figure 8 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0165] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 suitable for implementing an embodiment of the present invention. Fig. 9 The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0166] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0167] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.

[0168] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present invention are executed.

[0169] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0170] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a unit, a program segment, or a part of a code, and the above-mentioned unit, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0171] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be arranged in a processor, for example, it may be described as: a processor includes a determination unit and a calculation unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the determination unit may also be described as a "unit that determines the function of the unit".

[0172] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device executes the method for determining the page layout provided by the present invention.

[0173] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for determining a page layout, characterized in that: include: Determine, according to the page data of the target page, the position information of the page module included in the target page, wherein the position information includes the row coordinates and the column coordinates of the preset position; According to the position information, the degree of inclusion between the page modules is calculated, the degree of inclusion includes complete inclusion and incomplete inclusion, and for two page modules whose degree of inclusion is complete inclusion, the included page module is determined as a child module of the corresponding parent module, and the parent module is a page module that includes the included page module; Determining the row relationship and column relationship between the page modules according to the inclusion degree and the position information of the page modules; Determining a page layout of the target page according to the degree of inclusion and the row relationship and column relationship between the page modules; The determining, according to the inclusion degree and the position information of the page modules, the column relationship and the row relationship between the page modules comprises: According to the row coordinates of the preset positions in each pending page module, the pending page modules are sorted to obtain a first order, and the column relationships between adjacent pending page modules are sequentially compared according to the first order to determine the column relationships between the pending page modules, wherein all modules except the submodules in all page modules are called pending page modules; The pending page modules are sorted according to the column coordinates of the preset positions in each pending page module to obtain a second order, and the row relationships between adjacent pending page modules are compared in sequence according to the second order to determine the row relationships between the pending page modules.

2. The method according to claim 1, characterized in that The step of sequentially comparing the row relationships between adjacent pending page modules in the second order to determine the row relationships between the pending page modules includes: Determine the to-be-determined page module located at the first position in the second sequence as the first module, and determine the to-be-determined page module located at the second position in the second sequence as the second module; According to the position information of the first module and the position information of the second module, determine whether the first module and the second module include overlapping areas in the row direction; if so, combine the first module and the second module to obtain a first target module, determine the position information of the first target module according to the position information of the first module and the position information of the second module, update the first target module to a new first module, and update the pending page module located after the second module to a new second module; if not, determine that the first module is a separate row, update the second module to a new first module, and update the pending page module located after the second module before the update to a new second module.

3. The method according to claim 1, characterized in that: The step of sequentially comparing the column relationships between adjacent pending page modules in the first order to determine the column relationships between the pending page modules includes: Determine the page module located first in the first sequence as the first module, and determine the page module located second in the first sequence as the second module; According to the position information of the first module and the position information of the second module, determine whether the first module and the second module include overlapping areas in the column direction; if so, combine the first module and the second module to obtain a second target module, determine the position information of the second target module according to the position information of the first module and the position information of the second module, update the second target module to a new first module, and update the pending page module located after the second module to a new second module; if not, determine that the first module is a separate column, update the second module to a new first module, and update the pending page module located after the second module before the update to a new second module.

4. The method according to claim 1, characterized in that: The page module includes module A and module B; The calculating the inclusion degree between the page modules according to the position information includes: Determine the location area corresponding to the A module according to the location information of the A module, and determine the location area corresponding to the B module according to the location information of the B module; If the location area corresponding to the A module completely includes the location area corresponding to the B module, or the location area corresponding to the B module completely includes the location area corresponding to the A module, then the degree of inclusion between the A module and the B module is determined to be complete inclusion; If the location area corresponding to the A module does not completely include the location area corresponding to the B module, and the location area corresponding to the B module does not completely include the location area corresponding to the A module, then the degree of inclusion between the A module and the B module is determined to be incomplete inclusion.

5. A device for determining a page layout, characterized in that: include: A determination unit, configured to determine position information of a page module included in the target page according to page data of the target page, wherein the position information includes row coordinates and column coordinates of a preset position; a calculation unit, configured to calculate the degree of inclusion between the page modules according to the position information, wherein the degree of inclusion includes complete inclusion and incomplete inclusion, and for two page modules whose degree of inclusion is complete inclusion, determine the included page module as a child module of the corresponding parent module, wherein the parent module is a page module that includes the included page module; The determining unit is further used to determine the row relationship and column relationship between the page modules according to the inclusion degree and the position information of the page modules; The determining unit is further configured to determine a page layout of the target page according to the degree of inclusion and the row relationship and column relationship between the page modules; The determining unit is further configured to: According to the row coordinates of the preset positions in each pending page module, the pending page modules are sorted to obtain a first order, and the column relationships between adjacent pending page modules are sequentially compared according to the first order to determine the column relationships between the pending page modules, wherein all modules except the submodules in all page modules are called pending page modules; The pending page modules are sorted according to the column coordinates of the preset positions in each pending page module to obtain a second order, and the row relationships between adjacent pending page modules are compared in sequence according to the second order to determine the row relationships between the pending page modules.

6. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

7. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Method and device for generating hypertext markup language (HTML) procedure code

    CN103744674A