CN101799752A - Method and system for positioning HTML page control variations - Google Patents

Method and system for positioning HTML page control variations Download PDF

Info

Publication number
CN101799752A
CN101799752A CN200910239528A CN200910239528A CN101799752A CN 101799752 A CN101799752 A CN 101799752A CN 200910239528 A CN200910239528 A CN 200910239528A CN 200910239528 A CN200910239528 A CN 200910239528A CN 101799752 A CN101799752 A CN 101799752A
Authority
CN
China
Prior art keywords
control
numbering
data
numbered
controls
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
CN200910239528A
Other languages
Chinese (zh)
Other versions
CN101799752B (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.)
SHENZHEN LAN-YOU TECHNOLOG Co Ltd
Original Assignee
SHENZHEN LAN-YOU TECHNOLOG 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 SHENZHEN LAN-YOU TECHNOLOG Co Ltd filed Critical SHENZHEN LAN-YOU TECHNOLOG Co Ltd
Priority to CN200910239528.3A priority Critical patent/CN101799752B/en
Publication of CN101799752A publication Critical patent/CN101799752A/en
Application granted granted Critical
Publication of CN101799752B publication Critical patent/CN101799752B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a method and a system for positioning HTML page control variations. The method for positioning the HTML page control variations comprises the following steps of: A, decomposing control codes before page operation to obtain a plurality of independent controls without sub-controls and storing the controls to be data 1 after numbering the controls according to each original hierarchical relationship; B, decomposing the control codes after the page operation to obtain a plurality of independent controls without the sub-controls and storing the controls to be data 2 after numbering the controls according to each original hierarchical relationship; and C, comparing the control codes having the same numbers in the data 1 and the data 2 from the outside to the inside of the hierarchy of the numbers so as to obtain the number of varied controls. The numbers of the controls varied before and after the page operation can be accurately judged and the varied HTML controls can be automatically positioned; only the varied HTML controls are positioned and unvaried controls do not need updating; and therefore, the method and the system for positioning the HTML page control variations are favorable for reducing network transmission data traffic and simplifying the no-refresh development and reconstruction process of pages.

Description

Localization method and system that a kind of html page control changes
Technical field
The present invention relates to field of computer technology, relate in particular to localization method and system that a kind of html page control changes.
Background technology
AJAX (Asynchronous JavaScript and XML), be asynchronous JavaScript script and expandable mark language XML, it is a kind of webpage development technology that interaction network page is used of creating, it then is need to obtain the HTML control changed by AJAX from serve end program that the WEB page of realizing based on AJAX does not have refresh technique, by JavaScript this control is upgraded on the page then.
HTML (HyperText Mark-up Language), promptly HTML (Hypertext Markup Language) or HTML are the language that is most widely used on the present network, also are the main language that constitutes web document.Realize that the page does not have and refresh the control that focuses on needing in the html page to upgrade and position.
The mode that realizes has 2 kinds at present: a kind of is manually to specify the HTML control that needs renewal by the mode of coding; Another kind of then be possible need not have the control that refreshes renewal to use the DIV element to wrap up, the control to parcel upgrades then.Wherein the DIV element is to be used for providing for the content of bulk in the html document (block-level) element of structure and background, the start-tag of DIV and all the elements between the end-tag all are used for constituting this piece, wherein the characteristic of institute's containing element is controlled by the attribute of DIV label, or by using this piece of fstyleformat.scrolltrackization to control.
There is following shortcoming in the targeting scheme that the HTML of the prior art system control page changes:
1, bandwidth occupancy is too much.Existing locator meams has only been specified needs the HTML control that upgrades, and can't predict these controls and in the process that the page is carried out whether variation taken place.Therefore, the execution of each page all can be upgraded the control of these appointments, even any variation does not take place these controls.This has just caused each operation all can need to obtain the HTML control code of these controls by the AJAX mode from service end, does not accomplish that control changes then to upgrade, and does not change and does not then upgrade.
2, use complexity.The mode of using DIV to wrap up need be changed original page, and because DIV itself is exactly a HTML control, this just may exert an influence to the html page layout.In addition, refresh mode, again the page is changed, delete these DIV in order to parcel in case the page need cancel not have.
Summary of the invention
The technical problem to be solved in the present invention is, at the above-mentioned defective of prior art, provides a kind of localization method and system of html page control variation, and it can not change the page, automatically the control that changes in the positioning webpage implementation.
The technical solution adopted for the present invention to solve the technical problems is:
Construct the localization method that a kind of html page control changes, it may further comprise the steps:
A, decompose the control code before the page operation, obtain not having a plurality of independent control of child control, after being numbered according to separately former hierarchical relationship, be stored as data 1;
B, decompose the control code after the page operation, obtain not having a plurality of independently controls of child control, after being numbered according to separately former hierarchical relationship, be stored as data 2;
C, by numbering level order from outside to inside, the identical control code of numbering in comparing data 1 and the data 2 obtains changing the control numbering.
The localization method that html page control of the present invention changes, wherein, among the described step C, a control that relatively has identical numbering.
The localization method that html page control of the present invention changes, wherein, among the described step C, the outermost layer from level progressively compares to internal layer.
The localization method that html page control of the present invention changes, wherein, among the described step C, when comparing the control code, if two sections control codes are identical, then enter into next level and compare, if two sections control code differences, then write down the different pairing numbering of control code of this section, and no longer enter into the comparison of next level.
The localization method that html page control of the present invention changes wherein, comprises three controls in described preoperative control code, note is made a control, b control, c control respectively; Wherein comprised b control, c control in a control, and the b control has comprised the c control; Described steps A may further comprise the steps:
Control code before A1, the decomposition page operation obtains independently a control, b control, c control;
The numbering that A2, use have hierarchical relationship is numbered a control, b control, c control respectively, and wherein a control numbering still is a, and the b control is numbered a-b, and the c control is numbered a-b-c;
A3, the numbering that obtains in the steps A 2 is respectively after the child control that is comprised in the control of a, a-b, a-b-c removes, saves as data 1.
The localization method that html page control of the present invention changes, wherein, described step B may further comprise the steps:
Control code behind B1, the operation splitting obtains a control, b control, c control;
The numbering that B2, use have hierarchical relationship is numbered a control, b control, c control respectively, and wherein a control numbering still is a, and the b control is numbered a-b, and the c control is numbered a-b-c;
B3, the child control that is comprised among the control a that obtains among the step B2 and the a-b removed after, save as data 2.
The localization method that html page control of the present invention changes, wherein, described step C may further comprise the steps:
If the control that is numbered a in C1, comparing data 1 and the data 2 inequality, then writes down the numbering of a control, if identical, and execution in step C2 then;
Be numbered the control of a-b in C2, comparing data 1 and the data 2, if inequality, then write down the numbering of b control, if identical, execution in step C3 then;
Be numbered the control of a-b-c in C3, comparing data 1 and the data 2,, then write down the numbering of c control,, then withdraw from comparison if identical as if inequality.
The present invention also provides the positioning system that control changes in a kind of html page, wherein, comprises control code decomposing module, numbering and memory module, comparison module and variation list of controls generation module; Wherein,
Described control code decomposing module is used to decompose the preceding control code of page operation, obtains not having a plurality of independent control of child control, and decomposes the control code after the page operation, obtains not having a plurality of independently controls of child control;
Described numbering and memory module, be used for a plurality of independent control before the page operation before decomposing, after being numbered according to separately former hierarchical relationship, be stored as data 1, and to a plurality of independent control before the page operation after decomposing, after being numbered according to separately former hierarchical relationship, be stored as data 2;
Described comparison module is used for by numbering level order from outside to inside, the identical control code of numbering in comparing data 1 and the data 2, the control that obtains changing numbering;
Described variation list of controls generation module is used for the control numbering according to the variation that obtains, and generates to change the control numbered list.
The present invention is by decomposing the html page control before and after the page operation, number and compare, can accurately judge the numbering of the control that is changed before and after the page operation, can locate the HTML control that change takes place automatically, only the HTML control of change takes place in the location, unconverted control need not to upgrade, help reducing the transmitted data on network amount, simplify the brushless newly developed and transformation process of the page.
Description of drawings
The invention will be further described below in conjunction with drawings and Examples, in the accompanying drawing:
Fig. 1 is the localization method process flow diagram that the html page control of the embodiment of the invention changes;
Fig. 2 is the positioning system theory diagram that the html page control of the embodiment of the invention changes.
Embodiment
Below in conjunction with diagram, the preferred embodiments of the present invention are described in detail.
The localization method process flow diagram that the html page control of preferred embodiment of the present invention changes as shown in Figure 1, in the present embodiment to comprise in the preoperative control code that ID is respectively a control of a, b, c, b control, c control and is specifically described, wherein comprised b control, c control in a control, and the b control has comprised the c control.Page HTML control code layer aggregated(particle) structure is as follows:
<div?id=”a”>
<div?id=”b”>
<div?id=”c”>
</div>
</div>
</div>
Should be appreciated that above-mentioned control code only is used for structural signal in the present embodiment, and the concrete implication represented with it is irrelevant, describes the localization method to above control code change below in detail, may further comprise the steps:
Step S10, decompose the control code before the page operation, obtain not having a plurality of independent control of child control, after being numbered according to separately former hierarchical relationship, be stored as data 1, comprise following three steps altogether:
First step S11: decompose above HTML control code, obtain independently control, wherein:
A control code:
<div?id=”a”>
<div?id=”b”>
<div?id=”c”>
</div>
</div>
</div>
B control code:
<div?id=”b”>
<div?id=”c”>
</div>
</div>
C control code:
<div?id=”c”>
</div>
The second step S12, the control that obtains by the first step, can see that these controls all are nested against one another, that is to say and comprised b, c control in a control, the b control has then comprised the c control, in order accurately to indicate its hierarchical relationship, we use the numbering with hierarchical relationship respectively these three controls to be numbered.The result is as follows in the numbering back:
The a control is numbered a, and code is as follows:
<div?id=”a”>
<div?id=”b”>
<div?id=”c”>
</div>
</div>
</div>
B control Code Number is a-b, and code is as follows:
<div?id=”b”>
<div?id=”c”>
</div>
</div>
The control of c is numbered a-b-c, and code is as follows:
<div?id=”c”>
</div>
The 3rd the step S13, the child control that is comprised in each control that obtains among the step S12 is removed, so obtain following result
Be numbered a control code of a:
<div?id=”a”>
</div>
Be numbered the b control code of a-b:
<div?id=”b”>
</div>
Be numbered the c control code of a-b-c:
<div?id=”c”>
</div>
The result that present the 3rd step S13 obtains preserves called after data 1 as the structured data of the page.
After executing the page, new HTML control code may become following structure:
<div?id=”a”>
<div?id=”b”>this?is?test!
<div?id=”c”>
</div>
</div>
</div>
Step S20, the control code after the above page operation repeated three among step S101 step analyze, obtain following control:
Be numbered a control code of a:
<div?id=”a”>
</div>
Be numbered the b control code of a-b:
<div?id=”b”>this?is?test!
</div>
Be numbered the c control code of a-b-c:
<div?id=”c”>
</div>
With the control structure called after data 2 that obtain among the step S120, and preserve.
Step S30, by numbering level order from outside to inside, the identical control code of numbering in comparing data 1 and the data 2 obtains changing the control numbering.Logic relatively is as follows:
1) relatively only in having the control of identical numbering, carries out;
2) outermost layer from level begins comparison, and order is a, a-b, a-b-c;
3) relatively the time, enter into next level if two sections control codes are identical and compare, if two sections control code differences then write down the different pairing numbering of control code of this section and no longer enter into the comparison of next level.
Logic according to above comparison, as follows with data 2 process relatively among the step S103: two sections control codes that relatively are numbered earlier a to data 1, if it is identical to be numbered two sections control codes of a, then begin two sections control codes that are numbered a-b of next level are compared; If be numbered two sections control code differences of a-b, then no longer two sections control codes that are numbered a-b-c of next level are compared the numbering of record b control.
What provide in the present embodiment is two sections situations that the control code is different that are numbered a-b, if but two sections control codes that are numbered a-b are identical, then need again the c control code of next level is compared, if c control code difference then writes down the numbering of c control.
Step S40, again the control number record that changes that relatively obtains among the step S103 is got off at last, generate and change the control numbered list, so that this control is upgraded by JavaScript.Like this, just can only locate the HTML control that change takes place, unconverted control can be ignored automatically, helps reducing the transmitted data on network amount, simplifies the brushless newly developed and transformation process of html page.
In the above method, though only exemplified the location of the control code structure of three layers of nest relation, principle successively is applied to location to the control code of multilayer nest relation with this method.
The embodiment of the invention also provides the positioning system that control changes in a kind of html page that can realize above localization method, theory diagram as shown in Figure 2, it comprises control code decomposing module 10, numbering and memory module 20, comparison module 30 and changes list of controls generation module 40.
Wherein, control code decomposing module 10 is used to decompose the preceding control code of page operation, obtains not having a plurality of independent control of child control, and decomposes the control code after the page operation, obtains not having a plurality of independently controls of child control.Numbering and memory module 20 are used for a plurality of independent control before the page operation before decomposing, after being numbered according to separately former hierarchical relationship, be stored as data 1, and to a plurality of independent control before the page operation after decomposing, after being numbered according to separately former hierarchical relationship, be stored as data 2.Comparison module 30 is used for by numbering level order from outside to inside, the identical control code of numbering in comparing data 1 and the data 2, the control that obtains changing numbering.Change list of controls generation module 40 and be used for numbering, generate variation control numbered list according to the control of the variation that obtains.
The specific implementation method of the positioning system of the embodiment of the invention does not repeat them here with reference to previously described localization method.
The present invention is by decomposing the html page control before and after the page operation, number and compare, can accurately judge the numbering of the control that is changed before and after the page operation, can locate the HTML control that change takes place automatically, only the HTML control of change takes place in the location, unconverted control need not to upgrade, help reducing the transmitted data on network amount, simplify the brushless newly developed and transformation process of the page.
Should be understood that, for those of ordinary skills, can be improved according to the above description or conversion, and all these improvement and conversion all should belong to the protection domain of claims of the present invention.

Claims (8)

1. the localization method that the html page control changes is characterized in that, may further comprise the steps:
A, decompose the control code before the page operation, obtain not having a plurality of independent control of child control, after being numbered according to separately former hierarchical relationship, be stored as data 1;
B, decompose the control code after the page operation, obtain not having a plurality of independently controls of child control, after being numbered according to separately former hierarchical relationship, be stored as data 2;
C, by numbering level order from outside to inside, the identical control code of numbering in comparing data 1 and the data 2 obtains changing the control numbering.
2. the localization method that html page control according to claim 1 changes is characterized in that, among the described step C, and a control that relatively has identical numbering.
3. the localization method that html page control according to claim 1 changes is characterized in that among the described step C, the outermost layer from level progressively compares to internal layer.
4. the localization method that html page control according to claim 1 changes, it is characterized in that, among the described step C, when comparing the control code, if two sections control codes are identical, then enter into next level and compare, if two sections control code differences, then write down the different pairing numbering of control code of this section, and no longer enter into the comparison of next level.
5. the localization method that changes according to each described html page control in the claim 1 to 4 is characterized in that, comprises three controls in described preoperative control code, and note is made a control, b control, c control respectively; Wherein comprised b control, c control in a control, and the b control has comprised the c control; Described steps A may further comprise the steps:
Control code before A1, the decomposition page operation obtains independently a control, b control, c control;
The numbering that A2, use have hierarchical relationship is numbered a control, b control, c control respectively, and wherein a control numbering still is a, and the b control is numbered a-b, and the c control is numbered a-b-c;
A3, the numbering that obtains in the steps A 2 is respectively after the child control that is comprised in the control of a, a-b, a-b-c removes, saves as data 1.
6. the localization method that html page control according to claim 5 changes is characterized in that described step B may further comprise the steps:
Control code behind B1, the operation splitting obtains a control, b control, c control;
The numbering that B2, use have hierarchical relationship is numbered a control, b control, c control respectively, and wherein a control numbering still is a, and the b control is numbered a-b, and the c control is numbered a-b-c;
B3, the child control that is comprised among the control a that obtains among the step B2 and the a-b removed after, save as data 2.
7. the localization method that html page control according to claim 6 changes is characterized in that described step C may further comprise the steps:
If the control that is numbered a in C1, comparing data 1 and the data 2 inequality, then writes down the numbering of a control, if identical, and execution in step C2 then;
Be numbered the control of a-b in C2, comparing data 1 and the data 2, if inequality, then write down the numbering of b control, if identical, execution in step C3 then;
Be numbered the control of a-b-c in C3, comparing data 1 and the data 2,, then write down the numbering of c control,, then withdraw from comparison if identical as if inequality.
8. the positioning system that control changes in the html page is characterized in that, comprises control code decomposing module, numbering and memory module, comparison module and variation list of controls generation module; Wherein,
Described control code decomposing module is used to decompose the preceding control code of page operation, obtains not having a plurality of independent control of child control, and decomposes the control code after the page operation, obtains not having a plurality of independently controls of child control;
Described numbering and memory module, be used for a plurality of independent control before the page operation before decomposing, after being numbered according to separately former hierarchical relationship, be stored as data 1, and to a plurality of independent control before the page operation after decomposing, after being numbered according to separately former hierarchical relationship, be stored as data 2;
Described comparison module is used for by numbering level order from outside to inside, the identical control code of numbering in comparing data 1 and the data 2, the control that obtains changing numbering;
Described variation list of controls generation module is used for the control numbering according to the variation that obtains, and generates to change the control numbered list.
CN200910239528.3A 2009-12-31 2009-12-31 Method and system for positioning HTML page control variations Active CN101799752B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910239528.3A CN101799752B (en) 2009-12-31 2009-12-31 Method and system for positioning HTML page control variations

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910239528.3A CN101799752B (en) 2009-12-31 2009-12-31 Method and system for positioning HTML page control variations

Publications (2)

Publication Number Publication Date
CN101799752A true CN101799752A (en) 2010-08-11
CN101799752B CN101799752B (en) 2015-03-04

Family

ID=42595441

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910239528.3A Active CN101799752B (en) 2009-12-31 2009-12-31 Method and system for positioning HTML page control variations

Country Status (1)

Country Link
CN (1) CN101799752B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103188543A (en) * 2013-03-19 2013-07-03 东莞宇龙通信科技有限公司 Remote control method and device
CN106293690A (en) * 2015-06-29 2017-01-04 阿里巴巴集团控股有限公司 A kind of method and device of formation component object
CN108536467A (en) * 2018-04-08 2018-09-14 中国联合网络通信集团有限公司 Location processing method, device, terminal device and the storage medium of code
CN109766526A (en) * 2018-12-12 2019-05-17 东软集团股份有限公司 List store method, device, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1176518A2 (en) * 2000-07-24 2002-01-30 ViaGOLD Direct Network Ltd. Method and system in a computer network for searching and linking web sites
CN101296219A (en) * 2007-04-26 2008-10-29 上海市静安区教育学院附属学校 Text information detecting algorithm and personalized network information issuance monitoring method based on the same
CN101599118A (en) * 2009-06-26 2009-12-09 华中师范大学 Html web page is distorted and is detected and localization method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1176518A2 (en) * 2000-07-24 2002-01-30 ViaGOLD Direct Network Ltd. Method and system in a computer network for searching and linking web sites
CN101296219A (en) * 2007-04-26 2008-10-29 上海市静安区教育学院附属学校 Text information detecting algorithm and personalized network information issuance monitoring method based on the same
CN101599118A (en) * 2009-06-26 2009-12-09 华中师范大学 Html web page is distorted and is detected and localization method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103188543A (en) * 2013-03-19 2013-07-03 东莞宇龙通信科技有限公司 Remote control method and device
CN106293690A (en) * 2015-06-29 2017-01-04 阿里巴巴集团控股有限公司 A kind of method and device of formation component object
CN106293690B (en) * 2015-06-29 2020-02-28 阿里巴巴集团控股有限公司 Method and device for generating component object
CN108536467A (en) * 2018-04-08 2018-09-14 中国联合网络通信集团有限公司 Location processing method, device, terminal device and the storage medium of code
CN109766526A (en) * 2018-12-12 2019-05-17 东软集团股份有限公司 List store method, device, storage medium and electronic equipment
CN109766526B (en) * 2018-12-12 2023-07-25 东软集团股份有限公司 Form preservation method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN101799752B (en) 2015-03-04

Similar Documents

Publication Publication Date Title
US20100250649A1 (en) Scope-Based Extensibility for Control Surfaces
CN109445835A (en) Method, terminal device and the computer readable storage medium of building project frame
US20080262833A1 (en) Document Processing Device and Document Processing Method
CN104020984B (en) A kind of method and device for generating static page
CN108572819A (en) Method for updating pages, device, terminal and computer readable storage medium
CN103620586B (en) Link source code to run element
US20080005659A1 (en) Data Processing Device, Document Processing Device, and Document Processing Method
CN103440151A (en) Method and apparatus for dynamically loading Web page
CN101799752A (en) Method and system for positioning HTML page control variations
CN101782912A (en) Method and system for information prompt
CN103631719A (en) Web automated testing method and device
US20070258100A1 (en) Document Processing Device and Document Processing Method
US20090077462A1 (en) Document processing device and document processing method
CN1983257A (en) Method and system for demonstrating data by tree-mode structure
CN105743736A (en) Automated testing method and system
CN102299966B (en) Method and device for loading data in large volume at WEB client
CN102073662B (en) Method and system for analyzing and creating XML (Extensible Markup Language) data
CN103473034A (en) Method and device for dynamically publishing Web service
US20080208790A1 (en) Document Processing Device, and Document Processing Method
US20080250311A1 (en) Document Processing Device, and Document Processing Method
CN103678341A (en) Database interaction system and method
CN110058849A (en) Generation method, device, computer equipment and the storage medium of flow chart
CN102541534B (en) Webpage window generating method of mobile device
CN103020033A (en) Electronic spreadsheet system supporting off-line use, construction method and electronic spreadsheet
CN101587470B (en) Document compiling method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant