CN103914555A - Webpage re-layout method and webpage re-layout device - Google Patents

Webpage re-layout method and webpage re-layout device Download PDF

Info

Publication number
CN103914555A
CN103914555A CN201410148919.5A CN201410148919A CN103914555A CN 103914555 A CN103914555 A CN 103914555A CN 201410148919 A CN201410148919 A CN 201410148919A CN 103914555 A CN103914555 A CN 103914555A
Authority
CN
China
Prior art keywords
piecemeal
horizontal
layout
ordinate
rule
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.)
Granted
Application number
CN201410148919.5A
Other languages
Chinese (zh)
Other versions
CN103914555B (en
Inventor
孙帆
曹一挥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201410148919.5A priority Critical patent/CN103914555B/en
Publication of CN103914555A publication Critical patent/CN103914555A/en
Application granted granted Critical
Publication of CN103914555B publication Critical patent/CN103914555B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a webpage re-layout method and a webpage re-layout device and aims to improve display effects and promote use experience. The webpage re-layout method includes: constructing a page partitioning tree; acquiring importance degree of each partition in the page partitioning tree; reordering the partitions according to a sequence from high importance degree to low importance degree to obtain a webpage after re-layout. Using the webpage re-layout method can improve display effects and promote use experience.

Description

Webpage is the method and apparatus of layout again
Technical field
The present invention relates to webpage transcoding technology field, relate in particular to a kind of webpage method and apparatus of layout again.
Background technology
Along with the popularity rate of mobile device is more and more higher, people are more and more higher by the demand of browsing page by mobile equipment, and still, the webpage major part in internet is designed based on desktop display device, the inconvenience while causing by browsing page by mobile equipment.In order to facilitate user's browsing page in mobile device, need to carry out again layout to be applicable to the demonstration of mobile device to webpage.
In correlation technique, be generally, by the former page being carried out to the modes such as compressed page size, adjustment word size, text folding row, webpage is carried out to layout again.But this mode may cause page core content to be submerged, make user cannot obtain be concerned about content, reduce page bandwagon effect.
Summary of the invention
The present invention is intended to solve at least to a certain extent one of technical matters in correlation technique.
For this reason, one object of the present invention is to propose a kind of webpage method of layout again, and the method is displayed page core content preferentially, improves page bandwagon effect.
Another object of the present invention is to propose a kind of webpage device of layout again.
For achieving the above object, the webpage method of layout again that first aspect present invention embodiment proposes, comprising: build Segment tree; Obtain the importance degree of each piecemeal in described Segment tree; To described each piecemeal rearrangement, obtain again the webpage after layout according to importance degree order from high to low.
The webpage method of layout again that first aspect present invention embodiment proposes, resequences to piecemeal by the importance degree according to piecemeal, can preferentially represent important piecemeal, makes user priority obtain the content of care, improves user and experiences.And, same semantic chunk can be divided in a piecemeal and show by horizontal merging, content level is more reasonable.
For achieving the above object, the webpage device of layout again that second aspect present invention embodiment proposes, comprising: build module, for building Segment tree; Acquisition module, for obtaining the importance degree of the each piecemeal of described Segment tree; Reordering module, for according to importance degree order from high to low, described each piecemeal being resequenced, obtains again the webpage after layout.
The webpage device of layout again that second aspect present invention embodiment proposes, resequences to piecemeal by the importance degree according to piecemeal, can preferentially represent important piecemeal, makes user priority obtain the content of care, improves user and experiences.And, same semantic chunk can be divided in a piecemeal and show by horizontal merging, content level is more reasonable.
For achieving the above object, the mobile device that third aspect present invention embodiment proposes, comprising: housing, processor, storer, circuit board and power circuit, wherein, circuit board is placed in the interior volume that housing surrounds, and processor and storer are arranged on circuit board; Power circuit, is used to each circuit or the device power supply of mobile device; Storer is for stores executable programs code; Processor moves the program corresponding with executable program code by the executable program code of storing in read memory, for carrying out following steps: build Segment tree; Obtain the importance degree of each piecemeal in described Segment tree; To described each piecemeal rearrangement, obtain again the webpage after layout according to importance degree order from high to low.
The mobile device that third aspect present invention embodiment proposes, resequences to piecemeal by the importance degree according to piecemeal, can preferentially represent important piecemeal, makes user priority obtain the content of care, improves user and experiences.And, same semantic chunk can be divided in a piecemeal and show by horizontal merging, content level is more reasonable.
The aspect that the present invention is additional and advantage in the following description part provide, and part will become obviously from the following description, or recognize by practice of the present invention.
Accompanying drawing explanation
The present invention above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments obviously and easily and understand, wherein:
Fig. 1 is the webpage schematic flow sheet of the method for layout again proposing in one embodiment of the invention;
Fig. 2 is the schematic flow sheet that builds Segment tree in the embodiment of the present invention;
Fig. 3 is the schematic flow sheet of in the embodiment of the present invention, preliminary layout piecemeal being processed;
Fig. 4 is the structural representation of in the embodiment of the present invention, preliminary layout piecemeal being processed;
Fig. 5 is the schematic diagram of the Segment tree of setting up in the embodiment of the present invention;
Fig. 6 is the importance sorting schematic diagram of each piecemeal in the embodiment of the present invention;
Fig. 7 is the piecemeal schematic diagram after resetting in the embodiment of the present invention;
Fig. 8 is the webpage structural representation of the device of layout again that another embodiment of the present invention proposes;
Fig. 9 is the structural representation that builds module in the embodiment of the present invention.
Embodiment
Describe embodiments of the invention below in detail, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has the element of identical or similar functions from start to finish.Be exemplary below by the embodiment being described with reference to the drawings, only for explaining the present invention, and can not be interpreted as limitation of the present invention.On the contrary, embodiments of the invention comprise all changes, modification and the equivalent within the scope of spirit and the intension that falls into additional claims.
Fig. 1 is the webpage schematic flow sheet of the method for layout again proposing in one embodiment of the invention, and the method comprises:
S11: build Segment tree.
Segment tree can be from large BOB(beginning of block) corresponding to full page, the piecemeal of each iteration divided and/or merged obtain.
Referring to Fig. 2, building Segment tree can comprise:
S21: the root node of showing node from full page starts, travels through each child node successively, obtains preliminary layout piecemeal;
Wherein, root node can be DOM(document) tree in body node, body is HTML (Hypertext Markup Language) (Hyper Text Mark-up Language, HTML) be a kind of label of HTML (Hypertext Markup Language), it is the root node of showing node in full page, all the elements that body comprises document, such as text, hyperlink, form, image and list etc.
Corresponding the node with spatial layout feature piecemeal can be defined as to a preliminary layout piecemeal; Discrete corresponding piecemeal of node without spatial layout feature is defined as to a preliminary layout piecemeal; And, the corresponding piecemeal of node continuously without spatial layout feature is merged into a preliminary layout piecemeal.
Wherein, the node with spatial layout feature is for example node corresponding to div label, the node that tr label is corresponding etc.The node without spatial layout feature is for example node corresponding to puretext label, the node that p label is corresponding etc.
S22: to described preliminary layout piecemeal, process according to following order, obtain piecemeal after treatment: laterally merge, laterally divide, longitudinally divide, until the granularity of each piecemeal after treatment is in default threshold value;
Preferentially preliminary layout piecemeal is laterally merged, more laterally divide, longitudinally divide again afterwards.
Laterally merge and refer to the adjacent and highly approximately uniform piecemeal of merging, because page layout generally has horizontal semantic dependency, can avoid relevant horizontal semanteme piecemeal to split through horizontal merging, facilitate user to understand piecemeal content.
Laterally division refers to the page is divided from top to bottom.
Longitudinally divide and refer to for the piecemeal after each horizontal division, dividing from left to right in this piecemeal.
Wherein, referring to Fig. 3, the flow process that preliminary layout piecemeal is processed can comprise:
S31: judge whether to have two piecemeals that can laterally merge, if so, carry out S32, otherwise carry out S33.
In the time meeting following condition for first and second, can merge processing to first and second, described first and described second be horizontal two adjacent layout piecemeals in described preliminary layout piecemeal:
Abs (ys1-ys2) <=thy, and abs (ye1-ye2) <=thy, and, abs (xe1-xs2) <=thx,
Wherein, ys1 represents the origin coordinates of first ordinate, ys2 represents the origin coordinates of second ordinate, ye1 represents the end coordinate of first ordinate, ye2 represents the end coordinate of second ordinate, and xe1 represents the end coordinate of first horizontal ordinate, and xs2 represents the origin coordinates of second horizontal ordinate, thy and thx are respectively default threshold value, and abs represents to ask absolute value.
S32: merge this two piecemeals.
Referring to Fig. 4, the piecemeal after merging dots.
S33: the page is laterally divided.
Laterally division specifically can comprise:
Increase successively the ordinate of horizontal partition line, described horizontal partition line is moved from top to bottom successively, described horizontal partition line is a line across the page;
In described horizontal partition line successively moving process, in the time that described horizontal partition line does not pass any, adopting described horizontal partition line is the first half and the latter half by page division, and described is the layout piecemeal after horizontal merging;
In described the latter half, again increase successively the ordinate of described horizontal partition line, and in the time that described horizontal partition line does not pass any, again adopt described horizontal partition line to divide, until described horizontal partition line arrives page lowermost end, the piecemeal after laterally being divided.
As shown in Figure 4, after horizontal division, the piecemeal dot-and-dash line after the horizontal division obtaining represents.
S34: the piecemeal after corresponding each horizontal division, longitudinally divide.
Longitudinally division can comprise:
In the piecemeal obtaining, increase successively the horizontal ordinate of longitudinal cut-off rule after each horizontal division, described longitudinal cut-off rule is moved from left to right successively, described longitudinal cut-off rule is a line of the vertical piecemeal across obtaining after laterally dividing;
In described longitudinal cut-off rule successively moving process, in the time that described longitudinal cut-off rule does not pass any, adopt described longitudinal cut-off rule that the piecemeal obtaining after described horizontal division is divided into left-half and right half part, described is the piecemeal through horizontal merging and after laterally dividing;
At right half part, again increase successively the horizontal ordinate of described longitudinal cut-off rule, and in the time that described longitudinal cut-off rule does not pass any, again adopt described longitudinal cut-off rule to divide, until described longitudinal cut-off rule arrives page low order end, the piecemeal after laterally being divided.
As shown in Figure 4, after longitudinal division, after the longitudinal division obtaining, piecemeal dotted line represents.
After above-mentioned processing, judge that the granularity of the piecemeal after dividing is whether in default threshold value, wherein, piecemeal after division refers to the piecemeal through horizontal division and after longitudinally dividing, if do not existed, repeat above-mentioned flow process, in each piecemeal, travel through child node and laterally merge and laterally divide and longitudinally divide and process.
In the present embodiment, laterally merge by preferential, because semanteme generally has horizontal correlativity, can avoid relevant semanteme piecemeal to split, be conducive to user and understand.
S23: according to the nest relation of the piecemeal after described division, obtain Segment tree.
Wherein, as shown in Figure 5, tree is followed successively by Segment from top to bottom: the piecemeal obtaining after laterally dividing, the piecemeal obtaining after longitudinally dividing, the piecemeal after laterally merging.
S12: the importance degree that obtains each piecemeal in described Segment tree.
Specifically can comprise:
For the piecemeal obtaining after horizontal division, the importance degree that piecemeal topmost and is bottom set is minimum, to the each piecemeal in centre topmost and bottom, in accordance with the order from top to bottom, importance degree is set and successively decreases successively.
For example, because b1, b2 are topmost, b13-b16 is bottom, and therefore, the importance degree of b1 and b2 and b13-b16 is set to minimum, and in addition, the importance degree that piecemeal bottom can be set is lower than the importance degree of piecemeal topmost.
For b3-b8 and these two horizontal piecemeals of b9-b12, the importance degree of piecemeal that b3-b8 can be set is higher than the importance degree of b9-b12.
For the piecemeal obtaining after longitudinal division, adopt following formula to determine the importance degree of each piecemeal:
w1*width-w2*distance,
Wherein, width represents the width of piecemeal, and distance represents that the horizontal ordinate at piecemeal center is apart from the distance of page axis, and w1 and w2 represent predefined coefficient.
For example, for the piecemeal after this horizontal division of b3-b8, because b3, b8 are at two ends, therefore importance degree is lower than the importance degree of this piecemeal of b4-b7.And can from left to right arrange successively and successively decrease for b3 and these two piecemeals of b8.
According to importance degree order from high to low, each piecemeal is sorted to 60 schematic diagram from top to bottom referring to Fig. 6.
S13: to described each piecemeal rearrangement, obtain again the webpage after layout according to importance degree order from high to low.
For example, the each piecemeal 70 after rearrangement as shown in Figure 7.
Wherein, the granularity that each piecemeal is shown can be determined according to the granularity of default applicable mobile terminal.
The present embodiment is resequenced to piecemeal according to the importance degree of piecemeal, can preferentially represent important piecemeal, makes user priority obtain the content of care, improves user and experiences.And, same semantic chunk can be divided in a piecemeal and show by horizontal merging, content level is more reasonable.
Fig. 8 is the webpage structural representation of the device of layout again that another embodiment of the present invention proposes, and this device 80 comprises structure module 81, acquisition module 82 and reordering module 83.
Build module 81 for building Segment tree;
Segment tree can be from large BOB(beginning of block) corresponding to full page, the piecemeal of each iteration divided and/or merged obtain.
Referring to Fig. 9, described structure module 81 can specifically comprise first module 811, second unit 812 and the 3rd unit 813;
First module 811, for showing from full page the root node of node, travels through each child node successively, obtains preliminary layout piecemeal;
Wherein, root node can be DOM(document) tree in body node, body is HTML (Hypertext Markup Language) (Hyper Text Mark-up Language, HTML) be a kind of label of HTML (Hypertext Markup Language), it is the root node of showing node in full page, all the elements that body comprises document, such as text, hyperlink, form, image and list etc.
Corresponding the node with spatial layout feature piecemeal can be defined as to a preliminary layout piecemeal; And, the corresponding piecemeal of node continuously without spatial layout feature is merged into a preliminary layout piecemeal.
Wherein, the node with spatial layout feature is for example node corresponding to div label, the node that tr label is corresponding etc.The node without spatial layout feature is for example node corresponding to puretext label, the node that p label is corresponding etc.
In an embodiment, described first module specifically for:
Corresponding the node with spatial layout feature piecemeal is defined as to a preliminary layout piecemeal;
Discrete corresponding piecemeal of node without spatial layout feature is defined as to a preliminary layout piecemeal; And,
The corresponding piecemeal of node continuously without spatial layout feature is merged into a preliminary layout piecemeal.
Second unit 812, for to described preliminary layout piecemeal, is processed according to following order, obtains piecemeal after treatment, until the granularity of each piecemeal after treatment is in default threshold value:
Laterally merge, laterally divide, longitudinally divide;
Preferentially preliminary layout piecemeal is laterally merged, more laterally divide, longitudinally divide again afterwards.
Laterally merge and refer to the adjacent and highly approximately uniform piecemeal of merging, because page layout generally has horizontal semantic dependency, can avoid relevant horizontal semanteme piecemeal to split through horizontal merging, facilitate user to understand piecemeal content.
Laterally division refers to the page is divided from top to bottom.
Longitudinally divide and refer to for the piecemeal after each horizontal division, dividing from left to right in this piecemeal.
In an embodiment, the described horizontal merging that second unit carries out, comprising:
In the time meeting following condition for first and second, described first and described second are merged to processings, described first is horizontal two adjacent layout piecemeals in described preliminary layout piecemeal with described second:
Abs (ys1-ys2) <=thy, and abs (ye1-ye2) <=thy, and, abs (xe1-xs2) <=thx,
Wherein, ys1 represents the origin coordinates of first ordinate, ys2 represents the origin coordinates of second ordinate, ye1 represents the end coordinate of first ordinate, ye2 represents the end coordinate of second ordinate, and xe1 represents the end coordinate of first horizontal ordinate, and xs2 represents the origin coordinates of second horizontal ordinate, thy and thx are respectively default threshold value, and abs represents to ask absolute value.
In an embodiment, the described horizontal division that described second unit carries out, comprising:
Increase successively the ordinate of horizontal partition line, described horizontal partition line is moved from top to bottom successively, described horizontal partition line is a line across the page;
In described horizontal partition line successively moving process, in the time that described horizontal partition line does not pass any, adopting described horizontal partition line is the first half and the latter half by page division, and described is the layout piecemeal after horizontal merging;
In described the latter half, again increase successively the ordinate of described horizontal partition line, and in the time that described horizontal partition line does not pass any, again adopt described horizontal partition line to divide, until described horizontal partition line arrives page lowermost end, the piecemeal after laterally being divided.
In an embodiment, described longitudinal division that described second unit carries out, comprising:
In the piecemeal obtaining, increase successively the horizontal ordinate of longitudinal cut-off rule after each horizontal division, described longitudinal cut-off rule is moved from left to right successively, described longitudinal cut-off rule is a line of the vertical piecemeal across obtaining after laterally dividing;
In described longitudinal cut-off rule successively moving process, in the time that described longitudinal cut-off rule does not pass any, adopt described longitudinal cut-off rule that the piecemeal obtaining after described horizontal division is divided into left-half and right half part, described is the piecemeal through horizontal merging and after laterally dividing;
At right half part, again increase successively the horizontal ordinate of described longitudinal cut-off rule, and in the time that described longitudinal cut-off rule does not pass any, again adopt described longitudinal cut-off rule to divide, until described longitudinal cut-off rule arrives page low order end, the piecemeal after laterally being divided.
The 3rd unit 813, for according to the nest relation of the piecemeal after described division, obtains Segment tree.
In an embodiment, the described Segment tree that described Unit the 3rd obtains is made up of following piece from top to bottom:
The piecemeal obtaining after laterally dividing;
The piecemeal obtaining after longitudinally dividing;
The piecemeal obtaining after laterally merging.
Acquisition module 82 is for obtaining the importance degree of the each piecemeal of described Segment tree;
In an embodiment, described acquisition module specifically for:
For the piecemeal obtaining after horizontal division, the importance degree that piecemeal topmost and is bottom set is minimum, to the each piecemeal in centre topmost and bottom, in accordance with the order from top to bottom, importance degree is set and successively decreases successively.
For example, because b1, b2 are topmost, b13-b16 is bottom, and therefore, the importance degree of b1 and b2 and b13-b16 is set to minimum, and in addition, the importance degree that piecemeal bottom can be set is lower than the importance degree of piecemeal topmost.
For b3-b8 and these two horizontal piecemeals of b9-b12, the importance degree of piecemeal that b3-b8 can be set is higher than the importance degree of b9-b12.
In an embodiment, described acquisition module specifically for:
For the piecemeal obtaining after longitudinal division, adopt following formula to determine the importance degree of each piecemeal:
w1*width-w2*distance,
Wherein, width represents the width of piecemeal, and distance represents that the horizontal ordinate at piecemeal center is apart from the distance of page axis, and w1 and w2 represent predefined coefficient.
For example, for the piecemeal after this horizontal division of b3-b8, because b3, b8 are at two ends, therefore importance degree is lower than the importance degree of this piecemeal of b4-b7.And can from left to right arrange successively and successively decrease for b3 and these two piecemeals of b8.
According to importance degree order from high to low, the schematic diagram that each piecemeal is sorted is from top to bottom referring to Fig. 6.
Reordering module 83, for according to importance degree order from high to low, described each piecemeal being resequenced, obtains again the webpage after layout.
Wherein, the granularity that each piecemeal is shown can be determined according to the granularity of default applicable mobile terminal.
For example, the each piecemeal after rearrangement as shown in Figure 6.
The device of the present embodiment is corresponding with said method embodiment, and idiographic flow and parameter can be referring to the descriptions in said method embodiment.
The present embodiment is resequenced to piecemeal according to the importance degree of piecemeal, can preferentially represent important piecemeal, makes user priority obtain the content of care, improves user and experiences.And, same semantic chunk can be divided in a piecemeal and show by horizontal merging, content level is more reasonable.
The embodiment of the present invention also provides a kind of mobile device, and this mobile device comprises housing, processor, storer, circuit board and power circuit, and wherein, circuit board is placed in the interior volume that housing surrounds, and processor and storer are arranged on circuit board; Power circuit, is used to each circuit or the device power supply of mobile device; Storer is for stores executable programs code; Processor moves the program corresponding with executable program code by the executable program code of storing in read memory, for carrying out following steps:
S11 ': build Segment tree.
Segment tree can be from large BOB(beginning of block) corresponding to full page, the piecemeal of each iteration divided and/or merged obtain.
Building Segment tree can comprise:
S21 ': the root node of showing node from full page starts, travels through each child node successively, obtains preliminary layout piecemeal;
Wherein, root node can be DOM(document) tree in body node, body is HTML (Hypertext Markup Language) (Hyper Text Mark-up Language, HTML) be a kind of label of HTML (Hypertext Markup Language), it is the root node of showing node in full page, all the elements that body comprises document, such as text, hyperlink, form, image and list etc.
Corresponding the node with spatial layout feature piecemeal can be defined as to a preliminary layout piecemeal; Discrete corresponding piecemeal of node without spatial layout feature is defined as to a preliminary layout piecemeal; And, the corresponding piecemeal of node continuously without spatial layout feature is merged into a preliminary layout piecemeal.
Wherein, the node with spatial layout feature is for example node corresponding to div label, the node that tr label is corresponding etc.The node without spatial layout feature is for example node corresponding to puretext label, the node that p label is corresponding etc.
S22 ': to described preliminary layout piecemeal, process according to following order, obtain piecemeal after treatment: laterally merge, laterally divide, longitudinally divide, until the granularity of each piecemeal after treatment is in default threshold value;
Preferentially preliminary layout piecemeal is laterally merged, more laterally divide, longitudinally divide again afterwards.
Laterally merge and refer to the adjacent and highly approximately uniform piecemeal of merging, because page layout generally has horizontal semantic dependency, can avoid relevant horizontal semanteme piecemeal to split through horizontal merging, facilitate user to understand piecemeal content.
Laterally division refers to the page is divided from top to bottom.
Longitudinally divide and refer to for the piecemeal after each horizontal division, dividing from left to right in this piecemeal.
Wherein, the flow process of preliminary layout piecemeal being processed can comprise:
S31 ': judge whether to have two piecemeals that can laterally merge, if so, carry out S32 ', otherwise carry out S33 '.
In the time meeting following condition for first and second, can merge processing to first and second, described first and described second be horizontal two adjacent layout piecemeals in described preliminary layout piecemeal:
Abs (ys1-ys2) <=thy, and abs (ye1-ye2) <=thy, and, abs (xe1-xs2) <=thx,
Wherein, ys1 represents the origin coordinates of first ordinate, ys2 represents the origin coordinates of second ordinate, ye1 represents the end coordinate of first ordinate, ye2 represents the end coordinate of second ordinate, and xe1 represents the end coordinate of first horizontal ordinate, and xs2 represents the origin coordinates of second horizontal ordinate, thy and thx are respectively default threshold value, and abs represents to ask absolute value.
S32 ': merge this two piecemeals.
Referring to Fig. 4, the piecemeal after merging dots.
S33 ': the page is laterally divided.
Laterally division specifically can comprise:
Increase successively the ordinate of horizontal partition line, described horizontal partition line is moved from top to bottom successively, described horizontal partition line is a line across the page;
In described horizontal partition line successively moving process, in the time that described horizontal partition line does not pass any, adopting described horizontal partition line is the first half and the latter half by page division, and described is the layout piecemeal after horizontal merging;
In described the latter half, again increase successively the ordinate of described horizontal partition line, and in the time that described horizontal partition line does not pass any, again adopt described horizontal partition line to divide, until described horizontal partition line arrives page lowermost end, the piecemeal after laterally being divided.
As shown in Figure 4, after horizontal division, the piecemeal dot-and-dash line after the horizontal division obtaining represents.
S34 ': the piecemeal after corresponding each horizontal division, longitudinally divide.
Longitudinally division can comprise:
In the piecemeal obtaining, increase successively the horizontal ordinate of longitudinal cut-off rule after each horizontal division, described longitudinal cut-off rule is moved from left to right successively, described longitudinal cut-off rule is a line of the vertical piecemeal across obtaining after laterally dividing;
In described longitudinal cut-off rule successively moving process, in the time that described longitudinal cut-off rule does not pass any, adopt described longitudinal cut-off rule that the piecemeal obtaining after described horizontal division is divided into left-half and right half part, described is the piecemeal through horizontal merging and after laterally dividing;
At right half part, again increase successively the horizontal ordinate of described longitudinal cut-off rule, and in the time that described longitudinal cut-off rule does not pass any, again adopt described longitudinal cut-off rule to divide, until described longitudinal cut-off rule arrives page low order end, the piecemeal after laterally being divided.
As shown in Figure 4, after longitudinal division, after the longitudinal division obtaining, piecemeal dotted line represents.
After above-mentioned processing, judge that the granularity of the piecemeal after dividing is whether in default threshold value, wherein, piecemeal after division refers to the piecemeal through horizontal division and after longitudinally dividing, if do not existed, repeat above-mentioned flow process, in each piecemeal, travel through child node and laterally merge and laterally divide and longitudinally divide and process.
In the present embodiment, laterally merge by preferential, because semanteme generally has horizontal correlativity, can avoid relevant semanteme piecemeal to split, be conducive to user and understand.
S23 ': according to the nest relation of the piecemeal after described division, obtain Segment tree.
Wherein, as shown in Figure 5, tree is followed successively by Segment from top to bottom: the piecemeal obtaining after laterally dividing, the piecemeal obtaining after longitudinally dividing, the piecemeal after laterally merging.
S12 ': the importance degree that obtains each piecemeal in described Segment tree.
Specifically can comprise:
For the piecemeal obtaining after horizontal division, the importance degree that piecemeal topmost and is bottom set is minimum, to the each piecemeal in centre topmost and bottom, in accordance with the order from top to bottom, importance degree is set and successively decreases successively.
For example, because b1, b2 are topmost, b13-b16 is bottom, and therefore, the importance degree of b1 and b2 and b13-b16 is set to minimum, and in addition, the importance degree that piecemeal bottom can be set is lower than the importance degree of piecemeal topmost.
For b3-b8 and these two horizontal piecemeals of b9-b12, the importance degree of piecemeal that b3-b8 can be set is higher than the importance degree of b9-b12.
For the piecemeal obtaining after longitudinal division, adopt following formula to determine the importance degree of each piecemeal:
w1*width-w2*distance,
Wherein, width represents the width of piecemeal, and distance represents that the horizontal ordinate at piecemeal center is apart from the distance of page axis, and w1 and w2 represent predefined coefficient.
For example, for the piecemeal after this horizontal division of b3-b8, because b3, b8 are at two ends, therefore importance degree is lower than the importance degree of this piecemeal of b4-b7.And can from left to right arrange successively and successively decrease for b3 and these two piecemeals of b8.
According to importance degree order from high to low, the schematic diagram that each piecemeal is sorted is from top to bottom referring to Fig. 6.
S13 ': to described each piecemeal rearrangement, obtain again the webpage after layout according to importance degree order from high to low.
For example, the each piecemeal after rearrangement as shown in Figure 7.
Wherein, the granularity that each piecemeal is shown can be determined according to the granularity of default applicable mobile terminal.
The present embodiment is resequenced to piecemeal according to the importance degree of piecemeal, can preferentially represent important piecemeal, makes user priority obtain the content of care, improves user and experiences.And, same semantic chunk can be divided in a piecemeal and show by horizontal merging, content level is more reasonable.
It should be noted that, in description of the invention, term " first ", " second " etc. are only for describing object, and can not be interpreted as indication or hint relative importance.In addition,, in description of the invention, except as otherwise noted, the implication of " multiple " is two or more.
Any process of otherwise describing in process flow diagram or at this or method are described and can be understood to, represent to comprise that one or more is for realizing module, fragment or the part of code of executable instruction of step of specific logical function or process, and the scope of the preferred embodiment of the present invention comprises other realization, wherein can be not according to order shown or that discuss, comprise according to related function by the mode of basic while or by contrary order, carry out function, this should be understood by embodiments of the invention person of ordinary skill in the field.
Should be appreciated that each several part of the present invention can realize with hardware, software, firmware or their combination.In the above-described embodiment, multiple steps or method can realize with being stored in software or the firmware carried out in storer and by suitable instruction execution system.For example, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: there is the discrete logic for data-signal being realized to the logic gates of logic function, there is the special IC of suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is can carry out the hardware that instruction is relevant by program to complete, described program can be stored in a kind of computer-readable recording medium, this program, in the time carrying out, comprises step of embodiment of the method one or a combination set of.
In addition, the each functional unit in each embodiment of the present invention can be integrated in a processing module, can be also that the independent physics of unit exists, and also can be integrated in a module two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, and also can adopt the form of software function module to realize.If described integrated module realizes and during as production marketing independently or use, also can be stored in a computer read/write memory medium using the form of software function module.
The above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.
In the description of this instructions, the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means to be contained at least one embodiment of the present invention or example in conjunction with specific features, structure, material or the feature of this embodiment or example description.In this manual, the schematic statement of above-mentioned term is not necessarily referred to identical embodiment or example.And specific features, structure, material or the feature of description can be with suitable mode combination in any one or more embodiment or example.
In description of the invention, it will be appreciated that, term " " center ", " longitudinally ", " laterally ", " length ", " width ", " thickness ", " on ", D score, " front ", " afterwards ", " left side ", " right side ", " vertically ", " level ", " top ", " end " " interior ", " outward ", " clockwise ", " counterclockwise ", " axially ", " radially ", orientation or the position relationship of indications such as " circumferentially " are based on orientation shown in the drawings or position relationship, only the present invention for convenience of description and simplified characterization, rather than device or the element of indication or hint indication must have specific orientation, with specific orientation structure and operation, therefore can not be interpreted as limitation of the present invention.
In the present invention, unless otherwise clearly defined and limited, the terms such as term " installation ", " being connected ", " connection ", " fixing " should be interpreted broadly, and for example, can be to be fixedly connected with, and can be also to removably connect, or integral; Can be mechanical connection, can be also electrical connection; Can be to be directly connected, also can indirectly be connected by intermediary, can be the connection of two element internals or the interaction relationship of two elements.For the ordinary skill in the art, can understand as the case may be above-mentioned term concrete meaning in the present invention.
In the present invention, unless otherwise clearly defined and limited, First Characteristic Second Characteristic " on " or D score can be that the first and second features directly contact, or the first and second features are by intermediary indirect contact.And, First Characteristic Second Characteristic " on ", " top " and " above " but First Characteristic directly over Second Characteristic or oblique upper, or only represent that First Characteristic level height is higher than Second Characteristic.First Characteristic Second Characteristic " under ", " below " and " below " can be First Characteristic under Second Characteristic or tiltedly, or only represent that First Characteristic level height is less than Second Characteristic.
Although illustrated and described embodiments of the invention above, be understandable that, above-described embodiment is exemplary, can not be interpreted as limitation of the present invention, and those of ordinary skill in the art can change above-described embodiment within the scope of the invention, modification, replacement and modification.

Claims (18)

1. a webpage method for layout again, is characterized in that, comprising:
Structure Segment tree;
Obtain the importance degree of each piecemeal in described Segment tree;
To described each piecemeal rearrangement, obtain again the webpage after layout according to importance degree order from high to low.
2. method according to claim 1, is characterized in that, described structure Segment tree, comprising:
The root node of showing node from full page starts, and travels through successively each child node, obtains preliminary layout piecemeal;
To described preliminary layout piecemeal, process according to following order, obtain piecemeal after treatment, until the granularity of each piecemeal after treatment is in default threshold value:
Laterally merge, laterally divide, longitudinally divide;
According to the nest relation of the piecemeal after described division, obtain Segment tree.
3. method according to claim 2, is characterized in that, describedly travels through successively each child node, obtains preliminary layout piecemeal, comprising:
Corresponding the node with spatial layout feature piecemeal is defined as to a preliminary layout piecemeal;
Discrete corresponding piecemeal of node without spatial layout feature is defined as to a preliminary layout piecemeal; And,
The corresponding piecemeal of node continuously without spatial layout feature is merged into a preliminary layout piecemeal.
4. method according to claim 2, is characterized in that, described horizontal merging, comprising:
In the time meeting following condition for first and second, described first and described second are merged to processings, described first is horizontal two adjacent layout piecemeals in described preliminary layout piecemeal with described second:
Abs (ys1-ys2) <=thy, and abs (ye1-ye2) <=thy, and, abs (xe1-xs2) <=thx,
Wherein, ys1 represents the origin coordinates of first ordinate, ys2 represents the origin coordinates of second ordinate, ye1 represents the end coordinate of first ordinate, ye2 represents the end coordinate of second ordinate, and xe1 represents the end coordinate of first horizontal ordinate, and xs2 represents the origin coordinates of second horizontal ordinate, thy and thx are respectively default threshold value, and abs represents to ask absolute value.
5. method according to claim 2, is characterized in that, described horizontal division, comprising:
Increase successively the ordinate of horizontal partition line, described horizontal partition line is moved from top to bottom successively, described horizontal partition line is a line across the page;
In described horizontal partition line successively moving process, in the time that described horizontal partition line does not pass any, adopting described horizontal partition line is the first half and the latter half by page division, and described is the layout piecemeal after horizontal merging;
In described the latter half, again increase successively the ordinate of described horizontal partition line, and in the time that described horizontal partition line does not pass any, again adopt described horizontal partition line to divide, until described horizontal partition line arrives page lowermost end, the piecemeal after laterally being divided.
6. method according to claim 2, is characterized in that, described longitudinal division, comprising:
In the piecemeal obtaining, increase successively the horizontal ordinate of longitudinal cut-off rule after each horizontal division, described longitudinal cut-off rule is moved from left to right successively, described longitudinal cut-off rule is a line of the vertical piecemeal across obtaining after laterally dividing;
In described longitudinal cut-off rule successively moving process, in the time that described longitudinal cut-off rule does not pass any, adopt described longitudinal cut-off rule that the piecemeal obtaining after described horizontal division is divided into left-half and right half part, described is the piecemeal through horizontal merging and after laterally dividing;
At right half part, again increase successively the horizontal ordinate of described longitudinal cut-off rule, and in the time that described longitudinal cut-off rule does not pass any, again adopt described longitudinal cut-off rule to divide, until described longitudinal cut-off rule arrives page low order end, the piecemeal after laterally being divided.
7. method according to claim 2, described Segment tree is made up of following piece from top to bottom:
The piecemeal obtaining after laterally dividing;
The piecemeal obtaining after longitudinally dividing;
The piecemeal obtaining after laterally merging.
8. method according to claim 7, is characterized in that, described in obtain the importance degree of each piecemeal in described Segment tree, comprising:
For the piecemeal obtaining after horizontal division, the importance degree that piecemeal topmost and is bottom set is minimum, to the each piecemeal in centre topmost and bottom, in accordance with the order from top to bottom, importance degree is set and successively decreases successively.
9. method according to claim 7, is characterized in that, described in obtain the importance degree of each piecemeal in described Segment tree, comprising:
For the piecemeal obtaining after longitudinal division, adopt following formula to determine the importance degree of each piecemeal:
w1*width-w2*distance,
Wherein, width represents the width of piecemeal, and distance represents that the horizontal ordinate at piecemeal center is apart from the distance of page axis, and w1 and w2 represent predefined coefficient.
10. a webpage device for layout again, is characterized in that, comprising:
Build module, for building Segment tree;
Acquisition module, for obtaining the importance degree of the each piecemeal of described Segment tree;
Reordering module, for according to importance degree order from high to low, described each piecemeal being resequenced, obtains again the webpage after layout.
11. devices according to claim 10, is characterized in that, described structure module comprises:
First module, for showing from full page the root node of node, travels through each child node successively, obtains preliminary layout piecemeal;
Second unit, for to described preliminary layout piecemeal, processes according to following order, obtains piecemeal after treatment, until the granularity of each piecemeal after treatment is in default threshold value:
Laterally merge, laterally divide, longitudinally divide;
Unit the 3rd, for according to the nest relation of the piecemeal after described division, obtains Segment tree.
12. devices according to claim 11, is characterized in that, described first module specifically for:
Corresponding the node with spatial layout feature piecemeal is defined as to a preliminary layout piecemeal;
Discrete corresponding piecemeal of node without spatial layout feature is defined as to a preliminary layout piecemeal; And,
The corresponding piecemeal of node continuously without spatial layout feature is merged into a preliminary layout piecemeal.
13. devices according to claim 11, is characterized in that, the described horizontal merging that described second unit carries out, comprising:
In the time meeting following condition for first and second, described first and described second are merged to processings, described first is horizontal two adjacent layout piecemeals in described preliminary layout piecemeal with described second:
Abs (ys1-ys2) <=thy, and abs (ye1-ye2) <=thy, and, abs (xe1-xs2) <=thx,
Wherein, ys1 represents the origin coordinates of first ordinate, ys2 represents the origin coordinates of second ordinate, ye1 represents the end coordinate of first ordinate, ye2 represents the end coordinate of second ordinate, and xe1 represents the end coordinate of first horizontal ordinate, and xs2 represents the origin coordinates of second horizontal ordinate, thy and thx are respectively default threshold value, and abs represents to ask absolute value.
14. devices according to claim 11, is characterized in that, the described horizontal division that described second unit carries out, comprising:
Increase successively the ordinate of horizontal partition line, described horizontal partition line is moved from top to bottom successively, described horizontal partition line is a line across the page;
In described horizontal partition line successively moving process, in the time that described horizontal partition line does not pass any, adopting described horizontal partition line is the first half and the latter half by page division, and described is the layout piecemeal after horizontal merging;
In described the latter half, again increase successively the ordinate of described horizontal partition line, and in the time that described horizontal partition line does not pass any, again adopt described horizontal partition line to divide, until described horizontal partition line arrives page lowermost end, the piecemeal after laterally being divided.
15. devices according to claim 11, is characterized in that, described longitudinal division that described second unit carries out, comprising:
In the piecemeal obtaining, increase successively the horizontal ordinate of longitudinal cut-off rule after each horizontal division, described longitudinal cut-off rule is moved from left to right successively, described longitudinal cut-off rule is a line of the vertical piecemeal across obtaining after laterally dividing;
In described longitudinal cut-off rule successively moving process, in the time that described longitudinal cut-off rule does not pass any, adopt described longitudinal cut-off rule that the piecemeal obtaining after described horizontal division is divided into left-half and right half part, described is the piecemeal through horizontal merging and after laterally dividing;
At right half part, again increase successively the horizontal ordinate of described longitudinal cut-off rule, and in the time that described longitudinal cut-off rule does not pass any, again adopt described longitudinal cut-off rule to divide, until described longitudinal cut-off rule arrives page low order end, the piecemeal after laterally being divided.
16. devices according to claim 11, is characterized in that, the described Segment tree that described Unit the 3rd obtains is made up of following piece from top to bottom:
The piecemeal obtaining after laterally dividing;
The piecemeal obtaining after longitudinally dividing;
The piecemeal obtaining after laterally merging.
17. devices according to claim 16, is characterized in that, described acquisition module specifically for:
For the piecemeal obtaining after horizontal division, the importance degree that piecemeal topmost and is bottom set is minimum, to the each piecemeal in centre topmost and bottom, in accordance with the order from top to bottom, importance degree is set and successively decreases successively.
18. devices according to claim 16, is characterized in that, described acquisition module specifically for:
For the piecemeal obtaining after longitudinal division, adopt following formula to determine the importance degree of each piecemeal:
w1*width-w2*distance,
Wherein, width represents the width of piecemeal, and distance represents that the horizontal ordinate at piecemeal center is apart from the distance of page axis, and w1 and w2 represent predefined coefficient.
CN201410148919.5A 2014-04-14 2014-04-14 The method and apparatus that webpage is laid out again Active CN103914555B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410148919.5A CN103914555B (en) 2014-04-14 2014-04-14 The method and apparatus that webpage is laid out again

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410148919.5A CN103914555B (en) 2014-04-14 2014-04-14 The method and apparatus that webpage is laid out again

Publications (2)

Publication Number Publication Date
CN103914555A true CN103914555A (en) 2014-07-09
CN103914555B CN103914555B (en) 2017-10-27

Family

ID=51040235

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410148919.5A Active CN103914555B (en) 2014-04-14 2014-04-14 The method and apparatus that webpage is laid out again

Country Status (1)

Country Link
CN (1) CN103914555B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104238885A (en) * 2014-09-11 2014-12-24 吴涛军 Automatic layout and content displaying method and device suitable for multi-equipment content displaying
CN104346172A (en) * 2014-10-31 2015-02-11 亚信科技(南京)有限公司 Irregular DIV dynamic layout method
CN106469036A (en) * 2015-08-14 2017-03-01 腾讯科技(深圳)有限公司 Method for information display and client
CN108052662A (en) * 2017-12-29 2018-05-18 上海器魂智能科技有限公司 Web-based assembly layout method, apparatus, equipment and storage medium
CN110457030A (en) * 2019-10-08 2019-11-15 成都四方伟业软件股份有限公司 A kind of mobile adaptation rearrangement method and device of component layout
CN111611035A (en) * 2020-04-29 2020-09-01 浙江大华技术股份有限公司 User-defined window segmentation layout method and device, computer equipment and storage medium
CN114448969A (en) * 2021-12-27 2022-05-06 天翼云科技有限公司 Data uploading and storing method and device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040255244A1 (en) * 2003-04-07 2004-12-16 Aaron Filner Single column layout for content pages
CN101770452A (en) * 2009-12-31 2010-07-07 杭州昊达网络有限公司 Method for automatic typesetting of content blocks
CN103124968A (en) * 2010-09-01 2013-05-29 阿克塞尔斯普林格数字电视指导有限责任公司 Content transformation for lean-back entertainment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040255244A1 (en) * 2003-04-07 2004-12-16 Aaron Filner Single column layout for content pages
CN101770452A (en) * 2009-12-31 2010-07-07 杭州昊达网络有限公司 Method for automatic typesetting of content blocks
CN103124968A (en) * 2010-09-01 2013-05-29 阿克塞尔斯普林格数字电视指导有限责任公司 Content transformation for lean-back entertainment

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104238885A (en) * 2014-09-11 2014-12-24 吴涛军 Automatic layout and content displaying method and device suitable for multi-equipment content displaying
CN104238885B (en) * 2014-09-11 2019-09-10 吴涛军 The method and device that a kind of autoplacement shown suitable for more equipment contents and content are shown
CN104346172A (en) * 2014-10-31 2015-02-11 亚信科技(南京)有限公司 Irregular DIV dynamic layout method
CN104346172B (en) * 2014-10-31 2017-08-01 湖南亚信软件有限公司 A kind of irregular DIV Dynamic Distributions method
CN106469036A (en) * 2015-08-14 2017-03-01 腾讯科技(深圳)有限公司 Method for information display and client
CN108052662A (en) * 2017-12-29 2018-05-18 上海器魂智能科技有限公司 Web-based assembly layout method, apparatus, equipment and storage medium
CN108052662B (en) * 2017-12-29 2021-11-09 上海器魂智能科技有限公司 Webpage-based component layout method, device, equipment and storage medium
CN110457030A (en) * 2019-10-08 2019-11-15 成都四方伟业软件股份有限公司 A kind of mobile adaptation rearrangement method and device of component layout
CN111611035A (en) * 2020-04-29 2020-09-01 浙江大华技术股份有限公司 User-defined window segmentation layout method and device, computer equipment and storage medium
CN111611035B (en) * 2020-04-29 2022-05-31 浙江大华技术股份有限公司 User-defined window segmentation layout method and device, computer equipment and storage medium
CN114448969A (en) * 2021-12-27 2022-05-06 天翼云科技有限公司 Data uploading and storing method and device, computer equipment and storage medium
CN114448969B (en) * 2021-12-27 2023-06-23 天翼云科技有限公司 Data uploading and storing method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN103914555B (en) 2017-10-27

Similar Documents

Publication Publication Date Title
CN103914555A (en) Webpage re-layout method and webpage re-layout device
CN111639289A (en) Webpage loading method and device
CN104317968A (en) Page self-adaptive adjusting method and system
CN102629204B (en) Web page source code generation method and device
CN103064920A (en) Method and device for scaling page fonts in mobile terminal
CN105677654B (en) Advertisement filtering method and device
CN110390038A (en) Segment method, apparatus, equipment and storage medium based on dom tree
CN104820589A (en) Method and device for dynamically adapting webpage
CN107943466B (en) Database access statement generation method, device and equipment
CN104133865A (en) Advertisement filtering method and device
US20140201232A1 (en) Scoping searches within websites
WO2015035319A1 (en) Method and apparatus of controlling page element
CN106168959B (en) Webpage layout method and device
CN105577719B (en) A kind of data compression method and device
CN105335410A (en) Synthesis rendering acceleration based webpage updating method and apparatus
US20180067996A1 (en) Automated graph layout using metadata
CN105320662B (en) Webpage generating method and device
CN105205077A (en) Page layout method, device and system
CN103020179A (en) Method, device and equipment for extracting webpage contents
CN105224465B (en) Webpage adjustment method and device
CN112835576A (en) Page packaging method
CN106951429B (en) Method, browser and equipment for enhancing webpage comment display
CN105739962A (en) Table cell editor control expansion method and system based on HTML (Hypertext Markup Language)
CN106339381B (en) Information processing method and device
CN104077221A (en) Style test method and device for front-end page

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant