CN117369816A - Page partitioning method, device, equipment and medium - Google Patents

Page partitioning method, device, equipment and medium Download PDF

Info

Publication number
CN117369816A
CN117369816A CN202311446742.2A CN202311446742A CN117369816A CN 117369816 A CN117369816 A CN 117369816A CN 202311446742 A CN202311446742 A CN 202311446742A CN 117369816 A CN117369816 A CN 117369816A
Authority
CN
China
Prior art keywords
page
metadata
partition
alternative
block element
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
CN202311446742.2A
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.)
China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Original Assignee
China Southern Power Grid Digital Platform Technology Guangdong 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 China Southern Power Grid Digital Platform Technology Guangdong Co ltd filed Critical China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Priority to CN202311446742.2A priority Critical patent/CN117369816A/en
Publication of CN117369816A publication Critical patent/CN117369816A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/72Code refactoring

Abstract

The invention discloses a page partitioning method, device, equipment and storage medium. The method comprises the following steps: acquiring first page metadata of a first display type; acquiring at least one visual block element from the first page metadata; dividing each visual block element to obtain at least one page partition; forming partition metadata according to visual block elements included in each page partition; and converting the partition metadata to obtain second page metadata of a second display type. The technical scheme of the embodiment of the invention can improve the accuracy and efficiency of page partition.

Description

Page partitioning method, device, equipment and medium
Technical Field
The present invention relates to the field of web page development technologies, and in particular, to a method, an apparatus, a device, and a medium for partitioning a page.
Background
Along with the increasing variety of mobile terminal devices, more and more web pages need to be converted by the mobile terminal in order to meet the demands of users.
At present, the conversion of the mobile terminal of the webpage is mainly realized by modifying codes, and the conversion tool is used for converting the webpage into the mobile terminal.
In the currently mainstream conversion tools in the industry, the defects are that rendered pages are needed, and the processing efficiency of the pages with rich contents is low.
Disclosure of Invention
The invention provides a page partitioning method, device, equipment and medium, which are used for improving the accuracy and efficiency of page partitioning and achieving the purpose of accurately and quickly converting complex pages at a webpage end into pages at a mobile end.
In a first aspect, an embodiment of the present invention provides a method for partitioning a page, where the method includes:
acquiring first page metadata of a first display type;
acquiring at least one visual block element from the first page metadata;
dividing each visual block element to obtain at least one page partition;
forming partition metadata according to visual block elements included in each page partition;
and converting the partition metadata to obtain second page metadata of a second display type.
In a second aspect, an embodiment of the present invention further provides a page partitioning apparatus, where the apparatus includes:
the data acquisition module is used for acquiring first page metadata of a first display type;
the element acquisition module is used for acquiring at least one visual block element from the first page metadata;
The element dividing module is used for dividing each visual block element to obtain at least one page partition;
the metadata forming module is used for forming partition metadata according to visual block elements included in each page partition;
and the data conversion module is used for converting the partition metadata to obtain second page metadata of a second display type.
In a third aspect, an embodiment of the present invention further provides a page partition device, where the page partition device includes:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the page partitioning method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to perform the page partitioning method of any one of the embodiments of the present invention.
According to the technical scheme, the visual block elements belonging to the same partition are classified by dividing the visual block elements, so that different operations can be executed for different partitions, the accuracy of page partition is improved, the visual block elements are formed into partition metadata and the partition metadata are converted, conversion among different pages is facilitated, the efficiency of page partition is improved, meanwhile, page partition can be realized without rendering steps, page partition can be realized in a development state, the complexity of page partition is simplified, and the speed of page partition is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for partitioning a page according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram of a page partition provided in accordance with an embodiment of the present invention;
FIG. 3 is a flow chart of a method for partitioning a page according to a second embodiment of the present invention;
FIG. 4 is a flow chart of a method of partitioning a page provided in accordance with an embodiment of the present invention;
FIG. 5 is a block diagram of a page partitioning apparatus provided in accordance with an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a page partition device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the technical scheme of the embodiment of the invention, the acquisition, storage, application and the like of the related visual block elements and the like all meet the requirements of related laws and regulations, and the common-sequence harmony is not violated.
Example 1
Fig. 1 is a flowchart of a page partitioning method according to a first embodiment of the present invention. The embodiment of the invention can be applied to the case of page partition, and the method can be executed by a page partition device which can be realized in the form of hardware and/or software.
Referring to the page partitioning method shown in fig. 1, the method includes:
s101, acquiring first page metadata of a first display type.
The presentation type may be a type of a client of the page display. The display types include: mobile terminal, web terminal, computer terminal or server terminal, etc., as well as, for example, the display types include but are not limited to: mobile terminal display type or web page display type, etc. The first presentation type may be any of the presentation types. The metadata may be data describing the data. The page metadata may be data describing data of the presentation type presentation page. The page metadata includes: first page metadata and second page metadata. Attributes of page metadata include, but are not limited to: attribute 'Properties', instruction 'Directives', event 'Events', user type 'uiType', model identification number 'ModelId', etc.
The page component may be a page area that implements different page presentation effects. Properties represent attributes of the current page component width and height. Directives means instructions contained by the current page component, such as the 'v-model' instruction, by which user-submitted data is retrieved. Events represent Events contained in the current page component, such as a 'change' event, which indicates that the corresponding logical operation is triggered when the data in the page component changes. uiType represents the current page component type. Modelid represents the current page component unique identification number (Identity document, ID).
Specifically, the first page metadata of the development state corresponding to the first display type may be obtained as the first page metadata of the first display type.
In one example, the first presentation type is a web-side, i.e., web-side presentation type. And acquiring the first page metadata of the development state corresponding to the web end. The first display type is a mobile terminal, namely a mobile terminal display type. And acquiring the first page metadata of the development state corresponding to the mobile terminal.
S102, acquiring at least one visual block element from the first page metadata.
The visual block element may be an element that provides structure and context to the bulk content in a hypertext markup language (Hyper Text Markup Language, HTML) document. Wherein the visual block element comprises a plurality of page elements.
Illustratively, visual block elements may be div (division), row, and p-tags. Specifically, the < div > tag may divide the HTML document into separate and distinct portions. From the first page metadata, the < div > tags are looked up, each being a visual block element. The search means include, but are not limited to: a string search algorithm or a string matching algorithm, etc. In one example, if 4 < div > tags are searched for in the first page metadata by the string search algorithm, 4 visual block elements are obtained from the first page metadata.
S103, dividing each visual block element to obtain at least one page partition.
Wherein a page partition may be a collection of visual block elements of the same type. The same type may be adjacent in location, close in function, or there is a call relationship, etc.
Specifically, the visual block elements are divided according to whether the visual block elements are of the same type or not, the visual block elements of the same type are divided into one page partition, and the visual block elements which are not of the same type are divided into different page partitions. Page partitioning includes, but is not limited to: query page partition, list page partition, form page partition, chart page partition, etc.
In one example, visual block element a is of the same type as visual block element B, visual block element C is not of the same type as visual block element a and visual block element B, visual block element a and visual block element B are divided into one page partition, and visual block element C is divided into one page partition.
After all the page partitions are determined, if the number of the page partitions is only one, element degradation classification is performed, wherein the large-size visual block elements are used as classification objects, classification results are indistinguishable, the large-size visual block elements can be degraded, small-size visual block elements are obtained, and the small-size visual block elements are used as classification objects to divide the plurality of page partitions. Acquiring at least one row according to the first page metadata, and determining the row as a visual block element corresponding to the first page metadata one by one; if the number of the page partitions obtained by the division is still only one, at least one p label is obtained, and the visual block elements corresponding to one are determined.
S104, forming partition metadata according to visual block elements included in each page partition.
Wherein the partition metadata may be data describing page partition data in one page partition.
Specifically, different visual block elements are contained in different page partitions, the visual block elements forming different page partitions are different, and the page partitions are different, so that metadata of the page partitions can be determined according to the visual block elements forming the page partitions.
In one example, the query page partition contains 4 visual block elements, and partition metadata for the query page partition is determined from the content of the 4 visual block elements and the metadata for the visual block elements.
S105, converting the partition metadata to obtain second page metadata of a second display type.
Wherein the second presentation type may be any one of the presentation types. The second presentation type is different from the first presentation type.
The partition metadata is still metadata adapting to the first presentation type, and the partition metadata can be converted to obtain second page metadata adapting to the second presentation type. For example, the partition metadata may be converted according to a correspondence between the first presentation type metadata and the second presentation type metadata, to obtain second page metadata of the second presentation type.
According to the technical scheme, the visual block elements belonging to the same partition are classified by dividing the visual block elements, so that different operations can be executed for different partitions, the accuracy of page partition is improved, the visual block elements are formed into partition metadata and the partition metadata are converted, conversion among different pages is facilitated, the efficiency of page partition is improved, meanwhile, page partition can be realized without rendering steps, page partition can be realized in a development state, the complexity of page partition is simplified, and the speed of page partition is improved.
Optionally, dividing each visual block element to obtain at least one page partition, including: acquiring metadata of at least one preset page partition; comparing the metadata of each visual block element with partition metadata of each preset page partition to obtain visual block elements corresponding to each preset page partition; and dividing visual block elements corresponding to the preset page partitions into the preset page partitions aiming at each preset page partition to obtain at least one page partition.
The metadata of the preset at least one page partition may refer to metadata of the page partition preset by the development user for the second display type. The metadata of the preset page partition may refer to a function of the preset page partition, and according to the function, visual block elements generally included in the page partition and metadata defining the page partition are determined.
Specifically, metadata of the visual block element is compared with metadata of at least one preset page partition, if the functions of the metadata and the metadata are the same or similar, the preset page partition to which the visual block element belongs is obtained, the visual block element which belongs to the same page partition is divided into the page partition, and the page partition corresponding to each visual block element in the first page metadata is obtained.
In one example, a user presets a partition master library, where the partition master library includes operations on partition metadata corresponding to multiple page partitions in first page metadata of a first display type, and converts the partition metadata into partition metadata of a corresponding page partition in second page metadata of a second display type. As shown in fig. 2, page partitioning in a partitioned master library includes, but is not limited to: query page partition, list page partition, form page partition, chart page partition, etc.
The information in the partition master set library is mainly mounted on the area Block RuleConfigs attribute, and the mainly contained partition attribute is provided with an identification number 'ids', a type ', a name', and associated 'relation' noise 'extraction'. Ids represents the set containing page component Ids. The Type represents the partition Type and is determined according to the Type of the effective element corresponding to the included visual block element. Name represents the partition Name (the Name of the active element). The relationship represents the associated attribute. Exclusion represents a collection of noise elements.
The preset page partition comprises the following steps: query page partitions and list page partitions. And comparing the metadata of the visual block element A in the first page metadata with the partition metadata of the query page partition and the list page partition in the preset page partition, wherein the partition metadata of the visual block element A and the list page partition are similar, and dividing the visual block element A into the list page partition to obtain the list page partition.
And compared with metadata of preset page partitions, the method is convenient for dividing the page partitions, and realizes the conversion of the metadata between the page partitions.
Optionally, the first display type is a web-side display type; the second presentation type is a mobile terminal presentation type.
Specifically, the page metadata of the first presentation type may be converted to the second presentation type by placing the page metadata of the first presentation type into a corresponding engine for rendering. And placing the page metadata of the second presentation type into a corresponding engine for rendering, wherein the page metadata of the second presentation type can also be converted into the first presentation type.
By the page partitioning method provided by the invention, the page metadata can be efficiently partitioned, and the rapid page partitioning is realized.
Example two
Fig. 3 is a flowchart of a page partitioning method according to a second embodiment of the present invention. The embodiment of the invention optimizes and improves the page partition operation on the basis of the embodiment.
Further, dividing each visual block element to obtain at least one page partition, and selecting a target block element from each visual block element; obtaining at least one alternative packet; according to the metadata of the effective elements included in the target block element and the metadata of the effective elements included in each alternative group, carrying out association detection on the effective elements included in the target block element and the effective elements included in each alternative group to obtain element association detection results corresponding to each alternative group; when the association relation between the target block element and the candidate group is determined according to the element association detection result corresponding to the candidate group, adding the target block element into the candidate group; when the fact that the target block element and each candidate group have no association relation is determined according to the element association detection result, generating a new candidate group according to the target block element; returning to the step of executing the selection of the target block element until all visual block elements are selected; and determining each alternative packet as a page partition' corresponding to one so as to perfect the operation on the page partition.
In the embodiments of the present invention, the descriptions of other embodiments may be referred to in the portions not described in detail.
Referring to the page partitioning method shown in fig. 3, the method includes:
s301, acquiring first page metadata of a first display type.
S302, at least one visual block element is acquired from the first page metadata.
S303, selecting a target block element from the visual block elements.
The target block element may be a visual block element that needs to be partitioned into pages currently.
Specifically, the target block elements are selected by traversing one by one in the visual block elements, and can be selected randomly or sequentially, and the invention is not limited.
In one example, the first page metadata of the first presentation type includes a visual block element a and a visual block element B. And taking the visual block element A as a target block element, and carrying out page partition division on the target block element.
S304, at least one alternative packet is acquired.
Wherein the alternative groupings may be sets of visual block elements that the page partition includes.
Specifically, if the alternative grouping with the same function as the visual block element exists, continuing to divide the visual block element; if there is no alternative grouping with the same function as the visual block element, generating an alternative grouping with the same function as the visual block element.
In one example, the target block element function is a query function, no function is an alternative grouping to the query function, and an alternative grouping is generated that is a function of the query function.
S305, according to the metadata of the effective elements included in the target block element and the metadata of the effective elements included in each candidate group, performing association detection on the effective elements included in the target block element and the effective elements included in each candidate group, and obtaining element association detection results corresponding to each candidate group.
The effective element can be an element which can be browsed by a user after rendering. The element association detection result may be that there is an association relationship and there is no association relationship.
Specifically, metadata of effective elements included in the target block element and metadata of effective elements included in each alternative group are compared, and element association detection results of different alternative groups are obtained. In the comparison process, only the metadata of the effective elements are compared, and if the visual block element and the target block element do not comprise the effective elements, the comparison is not performed.
In one example, the target block element includes an effective element, the candidate packet 1 includes an effective element, and association detection is performed on the effective element included in the target block element and the effective element included in the candidate packet 1, so that an element association detection result corresponding to the candidate packet 1 is obtained as an association.
S306, when the association relation between the target block element and the candidate group is determined according to the element association detection result corresponding to the candidate group, adding the target block element into the candidate group.
Specifically, when the element association detection result corresponding to the candidate packet is that there is an association relationship, the target block element and the candidate packet have an association relationship, and the target block element is added into the candidate packet. And when the element association detection result corresponding to the alternative grouping is that the association relation does not exist, the target block element and the alternative grouping do not exist, and the target block element is not added into the alternative grouping.
In one example, the element association detection result corresponding to the alternative group 1 is that there is an association relationship, the target block element and the alternative group 1 are in an association relationship, and the target block element is added into the alternative group.
S307, when the fact that the association relation between the target block element and each candidate group does not exist is determined according to the element association detection result, a new candidate group is generated according to the target block element.
Specifically, association detection is performed on the target block element and each existing candidate group, if the target block element and each existing candidate group have no association relationship, generating a candidate group corresponding to the target block element according to the target block element, wherein the candidate partition comprises the target block element.
In one example, there are 1 alternative group 1, the page partition corresponding to the visual block element a in the alternative group 1 is a query page partition, the page partition corresponding to the target block element is a list page partition, the target block element and the alternative group 1 perform association detection, and if the association detection result is that no association relationship exists, a new alternative group 2 is generated.
S308, returning to the step of executing the selection target block element until all the visual block elements are selected.
Specifically, the first page metadata includes at least one visual block element, and the visual block elements are divided into alternative groups one by one until all the visual block elements included in the first page metadata are divided.
In one example, the first page metadata includes a visual block element a and a visual block element B, where the visual block element a is divided into alternative groups, and after the division of the visual block element a is completed, the division of the visual block element B into alternative groups is performed, and after the division of the visual block element B is completed, the step of selecting the target block element is not performed any more.
S309, determining each alternative packet as a page partition corresponding to each other one by one.
Specifically, after the first page metadata comprises visual block elements and the visual block elements are subjected to the correspondence of the alternative groupings, the visual block elements in each alternative grouping have an association relationship, and then each alternative grouping is in one-to-one correspondence with a page partition.
In one example, the first page metadata includes a visual block element a and a visual block element B, the visual block element a corresponding to an alternative packet 1 and the visual block element B corresponding to an alternative packet 2. Alternative group 1 corresponds to the query page partition and alternative group 2 corresponds to the list page partition.
S310, forming partition metadata according to visual block elements included in each page partition.
S311, converting the partition metadata to obtain second page metadata of a second display type.
In the embodiment of the invention, the visual block elements are classified by carrying out the association detection among the visual block elements, and the visual block elements with association relation are divided into one group, so that the page is conveniently partitioned, and the page conversion efficiency is improved.
Optionally, performing association detection on the effective element included in the target block element and the effective element included in each candidate packet according to the metadata of the effective element included in the target block element and the metadata of the effective element included in each candidate packet, to obtain an element association detection result corresponding to each candidate packet, including: detecting whether a calling relationship exists between the effective elements included in the target block element and the effective elements included in each candidate group according to the metadata of the effective elements included in the target block element and the metadata of the effective elements included in each candidate group, and obtaining the effective elements with calling relationships, corresponding to each candidate group, of the target block element; counting the first element number of the effective elements with calling relations corresponding to the target block elements aiming at the candidate groups; acquiring the second element number of the effective elements included in the alternative packet; calculating the ratio between the first element quantity and the second element quantity corresponding to each alternative grouping to obtain the effective ratio corresponding to each alternative grouping; and determining an element association detection result of the target block element corresponding to each candidate packet according to the effective ratio corresponding to each candidate packet.
Specifically, a user presets an effective threshold according to actual application conditions. Acquiring the effective ratio of the number of the effective elements with calling relation between the effective elements included in the target block element and the effective elements included in each candidate packet to the number of the effective elements included in the candidate packet, and comparing each effective ratio with an effective threshold; if the effective ratio is larger than the effective threshold, determining that the element association detection result corresponding to the target block element and the candidate packet is that an association relation exists; if the effective ratio is smaller than or equal to the effective threshold, determining that the association detection result of the target block element and the element corresponding to the alternative packet is that no association relation exists.
In one example, the user presets an effective threshold of 80%. The target block element comprises 6 effective elements with calling relation with the effective elements included in the alternative packet 1, 10 effective elements included in the alternative packet 1, and 60% effective ratio corresponding to the alternative packet 1. The target block element comprises 9 effective elements with calling relation with the effective elements included in the alternative packet 2, 10 effective elements included in the alternative packet 2, and 90% effective ratio corresponding to the alternative packet 2. The association detection result of the target block element and the element corresponding to the alternative packet 1 is that no association relation exists; and the association detection result of the target block element and the element corresponding to the alternative packet 2 is that an association relation exists.
Obtaining the association tightness degree of the target block element and the elements in each alternative group by obtaining the effective ratio between the target block element and the effective elements with calling relations in each alternative group; the method is convenient for dividing the corresponding groups of the visual block elements, and rapidly determines the page partition corresponding to the visual block elements, so that the page conversion efficiency is improved.
Optionally, after adding the target block element to the candidate group, the method further includes: acquiring effective elements which are corresponding to the target block elements aiming at the alternative packets and do not have calling relations; and aiming at the effective element which is corresponding to the alternative packet and does not have a calling relation, the target block element is used as a noise element corresponding to the alternative packet, and the noise element is used for not showing in the second showing type.
Specifically, the effective element, which corresponds to the candidate packet and does not have a calling relationship, of the target block element is determined to be a noise element, and the noise element is not converted in the page conversion process. Noise elements include, but are not limited to: class= 'layout', uitype= 'anchor', etc.
In one example, the target block element is determined as a noise element for the active element a and the active element B corresponding to the candidate packet, where the active element a and the active element B have no call relationship, and the noise element is not converted.
Through screening and dividing noise elements, the data size in the page conversion process is reduced, and the page conversion efficiency is improved.
Optionally, the page partitioning method further includes: when the target block element is determined to comprise a specific element, acquiring adjacent block elements belonging to the same father node as the target block element; when the attribute characteristics of the adjacent block elements include the specific behavior of the specific elements, the adjacent block elements and the target block elements are divided into the same alternative group.
Wherein a node may be a tag that may implement a page function. The node may further include at least one node, the node including the at least one node may be a root node or a parent node, the node including the at least one node being a parent node of the at least one node, the at least one node being a child node of the parent node. The root node has no parent node and only child nodes.
Specifically, the target block element includes specific elements including, but not limited to: input, table, textarea, form, etc., the attribute characteristics of neighboring block elements belonging to the same parent node as the target block element include specific behaviors of specific elements, including but not limited to: save, query, reset, etc., indicating that there is an association relationship between the two, then the adjacent block element and the target block element are divided into the same candidate group.
In one example, as shown in FIG. 4, first page metadata of a first presentation type is obtained; and acquiring at least one visual block element from the first page metadata to obtain a visual block element set. Comparing the visual block elements with a partitioned mother board library, wherein the partitioned mother board library comprises partitioned mother board metadata, and judging whether all the visual block elements are completely matched; if the matching is completed, the detailed information of the page partition is obtained, otherwise, the unmatched visual block elements are traversed. Detecting the association of the target block element comprising the effective element and the effective element in each alternative group, and if no association exists, using the effective element of the target block element which has no calling relation for the alternative group as the noise element corresponding to the alternative group; and if the association relation exists, obtaining the effective element of the calling relation corresponding to each alternative packet by the target block element. Judging whether the visual block elements have association relations with each alternative grouping, if so, adding the target block elements into the alternative groupings, and obtaining page partitions; if no association relation exists between the visual block elements, generating a new alternative group according to the target block elements, and obtaining the page partition. Judging whether the number of the partitions of the page partition is greater than 1, and if so, obtaining a page partition data set; otherwise, performing degradation extraction. And finally, the detailed information of the page partition is obtained, and the efficiency of the page partition is improved.
And through the judgment of the specific elements and the specific behaviors, the visual block elements with the association relationship are further screened, so that the page partition is facilitated.
Example III
Fig. 5 is a schematic structural diagram of a page partitioning device according to a fourth embodiment of the present invention. The embodiment of the invention is applicable to the case of page partition, the device can execute the page partition method, the device can be realized in the form of hardware and/or software, and the device can be configured in page partition equipment.
Referring to the page partitioning apparatus shown in fig. 5, comprising: a data acquisition module 501, an element acquisition module 502, an element partitioning module 503, a metadata formation module 504, and a data conversion module 505, wherein,
a data acquisition module 501, configured to acquire first page metadata of a first presentation type;
an element obtaining module 502, configured to obtain at least one visual block element from the first page metadata;
an element dividing module 503, configured to divide each visual block element to obtain at least one page partition;
a metadata forming module 504, configured to form partition metadata according to visual block elements included in each page partition;
the data conversion module 505 is configured to convert the partition metadata to obtain second page metadata of a second presentation type.
According to the technical scheme, the visual block elements belonging to the same partition are classified by dividing the visual block elements, so that different operations can be executed for different partitions, the accuracy of page partition is improved, the visual block elements are formed into partition metadata and the partition metadata are converted, conversion among different pages is facilitated, the efficiency of page partition is improved, meanwhile, page partition can be realized without rendering steps, page partition can be realized in a development state, the complexity of page partition is simplified, and the speed of page partition is improved.
Optionally, the element dividing module 503 includes:
an element selection unit for selecting a target block element from among the visual block elements;
a packet acquisition unit configured to acquire at least one alternative packet;
the result acquisition unit is used for carrying out association detection on the effective elements included in the target block element and the effective elements included in each candidate group according to the metadata of the effective elements included in the target block element and the metadata of the effective elements included in each candidate group, so as to obtain element association detection results corresponding to each candidate group;
the relation determining unit is used for adding the target block element into the alternative grouping when determining that the target block element has the association relation with the alternative grouping according to the element association detection result corresponding to the alternative grouping;
The result analysis unit is used for generating a new alternative group according to the target block element when determining that the target block element and each alternative group have no association relation according to the element association detection result;
a selection completion unit, configured to return to the step of executing the selection target element until all visual block elements are selected;
and the partition determining unit is used for determining each alternative packet as a page partition corresponding to one by one.
Optionally, the result obtaining unit includes:
the relation judging subunit is used for detecting whether a calling relation exists between the effective elements included in the target block element and the effective elements included in each candidate group according to the metadata of the effective elements included in the target block element and the metadata of the effective elements included in each candidate group, and obtaining the effective elements with calling relation corresponding to each candidate group of the target block element;
the element statistics unit is used for counting the first element number of the effective elements with calling relations corresponding to the target block elements aiming at the candidate groups;
a number acquisition subunit configured to acquire a second element number of the valid elements included in the candidate packet;
the ratio calculating subunit is used for calculating the ratio between the first element quantity and the second element quantity corresponding to each alternative packet to obtain the effective ratio corresponding to each alternative packet;
And the ratio analysis subunit is used for determining an element association detection result of the target block element corresponding to each alternative packet according to the effective ratio corresponding to each alternative packet.
Optionally, the element dividing module 503 further includes:
an effective element obtaining unit, configured to obtain an effective element that does not have a calling relationship and corresponds to the candidate group, where the effective element is used for obtaining the target block element after the target block element is added to the candidate group;
the noise element classifying unit is used for regarding the effective elements which are corresponding to the candidate groups and do not have calling relation as the noise elements corresponding to the candidate groups, and the noise elements are used for not displaying in the second display type.
Optionally, the element dividing module 503 further includes:
the adjacent element analysis unit is used for acquiring adjacent block elements belonging to the same father node with the target block element when the target block element is determined to comprise the specific element;
and the specific grouping unit is used for dividing the adjacent block elements and the target block elements into the same alternative grouping when the attribute characteristics of the adjacent block elements comprise the specific behaviors of the specific elements.
Optionally, the page partitioning device includes:
the metadata acquisition module is used for acquiring metadata of at least one preset page partition;
The element comparison module is used for comparing the metadata of each visual block element with the partition metadata of each preset page partition to obtain the visual block element corresponding to each preset page partition;
the preset partition dividing module is used for dividing visual block elements corresponding to the preset page partitions into the preset page partitions aiming at each preset page partition to obtain at least one page partition.
Optionally, in the page partitioning device, the first display type is a web end display type; the second presentation type is a mobile terminal presentation type.
The page partitioning device provided by the embodiment of the invention can execute the page partitioning method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the page partitioning method.
Example IV
FIG. 6 illustrates a schematic diagram of a page partitioning apparatus 600 that can be used to implement an embodiment of the present invention.
As shown in fig. 6, the page partitioning apparatus 600 includes at least one processor 601, and a memory such as a Read Only Memory (ROM) 602, a Random Access Memory (RAM) 603, etc. communicatively connected to the at least one processor 601, wherein the memory stores a computer program executable by the at least one processor, and the processor 601 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 602 or the computer program loaded from the storage unit 608 into the Random Access Memory (RAM) 603. In the RAM603, various programs and data required for the operation of the page partition device 600 can also be stored. The processor 601, the ROM602, and the RAM603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Multiple components in page partitioning device 600 are connected to I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the page partitioning device 600 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The processor 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 601 performs the various methods and processes described above, such as the page partitioning method.
In some embodiments, the page partitioning method may be implemented as a computer program, which is tangibly embodied on a computer-readable storage medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto page partitioning device 600 via ROM602 and/or communication unit 609. When a computer program is loaded into RAM603 and executed by processor 601, one or more of the steps of the page partitioning method described above may be performed. Alternatively, in other embodiments, processor 601 may be configured to perform the page partitioning method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above can be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program 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 the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage 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. Alternatively, the computer readable storage medium may be a machine readable signal medium. 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 page partitioning device 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 pointing device (e.g., a mouse or a trackball) through which a user can provide input to the page partitioning device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may 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 input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background 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 background, 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), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically 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 can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS (Virtual Private Server ) service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method of partitioning a page, the method comprising:
acquiring first page metadata of a first display type;
acquiring at least one visual block element from the first page metadata;
dividing each visual block element to obtain at least one page partition;
forming partition metadata according to visual block elements included in each page partition;
and converting the partition metadata to obtain second page metadata of a second display type.
2. The method of claim 1, wherein the dividing each visual block element to obtain at least one page partition comprises:
selecting a target block element from the visual block elements;
obtaining at least one alternative packet;
performing association detection on the effective elements included in the target block element and the effective elements included in each alternative group according to the metadata of the effective elements included in the target block element and the metadata of the effective elements included in each alternative group, so as to obtain element association detection results corresponding to each alternative group;
when determining that the association relation exists between the target block element and the alternative packet according to the element association detection result corresponding to the alternative packet, adding the target block element into the alternative packet;
when the fact that the target block element and each alternative grouping have no association relation is determined according to the element association detection result, generating a new alternative grouping according to the target block element;
returning to the step of executing the target element selection until all visual block elements are selected;
and determining each alternative packet as a page partition corresponding to each alternative packet one by one.
3. The method according to claim 2, wherein the performing association detection on the valid element included in the target block element and the valid element included in each candidate group according to the metadata of the valid element included in the target block element and the metadata of the valid element included in each candidate group to obtain the element association detection result corresponding to each candidate group includes:
detecting whether a calling relationship exists between the effective elements included in the target block element and the effective elements included in each alternative group according to the metadata of the effective elements included in the target block element and the metadata of the effective elements included in each alternative group, so as to obtain the effective elements with calling relationships corresponding to each alternative group of the target block element;
counting the first element number of the effective elements with calling relations corresponding to the target block elements aiming at the alternative groups;
acquiring the second element number of the effective elements included in the alternative packet;
calculating the ratio between the first element quantity corresponding to each alternative packet and the second element quantity to obtain the effective ratio corresponding to each alternative packet;
And determining an element association detection result of the target block element corresponding to each alternative packet according to the effective ratio corresponding to each alternative packet.
4. A method according to claim 3, further comprising, after adding the target block element to the alternative packet:
acquiring an effective element which is corresponding to the candidate packet and does not have a calling relationship of the target block element;
and aiming at the effective element which is corresponding to the alternative packet and does not have a calling relation, the target block element is used as a noise element corresponding to the alternative packet, and the noise element is used for not displaying in the second display type.
5. The method as recited in claim 2, further comprising:
when the target block element is determined to comprise a specific element, acquiring adjacent block elements belonging to the same father node as the target block element;
and dividing the adjacent block element and the target block element into the same alternative group when the attribute characteristic of the adjacent block element comprises the specific behavior of the specific element.
6. The method of claim 1, wherein the dividing each visual block element to obtain at least one page partition comprises:
Acquiring metadata of at least one preset page partition;
comparing the metadata of each visual block element with partition metadata of each preset page partition to obtain visual block elements corresponding to each preset page partition;
dividing visual block elements corresponding to the preset page partitions into the preset page partitions aiming at each preset page partition to obtain at least one page partition.
7. The method of claim 1, wherein the first presentation type is a web-side presentation type; the second display type is a mobile terminal display type.
8. A page partitioning apparatus, said apparatus comprising:
the data acquisition module is used for acquiring first page metadata of a first display type;
an element acquisition module, configured to acquire at least one visual block element from the first page metadata;
the element dividing module is used for dividing each visual block element to obtain at least one page partition;
the metadata forming module is used for forming partition metadata according to visual block elements included in each page partition;
and the data conversion module is used for converting the partition metadata to obtain second page metadata of a second display type.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the page partitioning method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the page partitioning method of any one of claims 1-7 when executed.
CN202311446742.2A 2023-11-01 2023-11-01 Page partitioning method, device, equipment and medium Pending CN117369816A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311446742.2A CN117369816A (en) 2023-11-01 2023-11-01 Page partitioning method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311446742.2A CN117369816A (en) 2023-11-01 2023-11-01 Page partitioning method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN117369816A true CN117369816A (en) 2024-01-09

Family

ID=89403936

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311446742.2A Pending CN117369816A (en) 2023-11-01 2023-11-01 Page partitioning method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117369816A (en)

Similar Documents

Publication Publication Date Title
US20210374195A1 (en) Information processing method, electronic device and storage medium
CN111726336B (en) Method and system for extracting identification information of networked intelligent equipment
US20220358178A1 (en) Data query method, electronic device, and storage medium
Yu et al. Web content information extraction based on DOM tree and statistical information
CN113722600A (en) Data query method, device, equipment and product applied to big data
CN112989235A (en) Knowledge base-based internal link construction method, device, equipment and storage medium
CN112579781A (en) Text classification method and device, electronic equipment and medium
CN117093619A (en) Rule engine processing method and device, electronic equipment and storage medium
CN109948015B (en) Meta search list result extraction method and system
CN116451619A (en) Component information processing method, device, medium and equipment
CN114491232B (en) Information query method and device, electronic equipment and storage medium
CN117369816A (en) Page partitioning method, device, equipment and medium
CN115904240A (en) Data processing method and device, electronic equipment and storage medium
CN114995719A (en) List rendering method, device, equipment and storage medium
CN115269519A (en) Log detection method and device and electronic equipment
CN114519153A (en) Webpage history record display method, device, equipment and storage medium
CN112181825A (en) Test case library construction method and device, electronic equipment and medium
US20230086429A1 (en) Method of recognizing address, electronic device and storage medium
CN117742900B (en) Method, device, equipment and storage medium for constructing service call graph
CN117573491A (en) Positioning method, device, equipment and storage medium for performance bottleneck
CN115187153B (en) Data processing method and system applied to business risk tracing
CN117390023A (en) Data aggregation method, data aggregation device, apparatus, and storage medium
CN117313644A (en) DFMEA analysis method, device, equipment and medium for automobile chip
CN117591693A (en) Label data storage method and system
CN117632734A (en) Performance test method of database, electronic equipment and storage medium

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