CN101799752B - 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
CN101799752B
CN101799752B CN200910239528.3A CN200910239528A CN101799752B CN 101799752 B CN101799752 B CN 101799752B CN 200910239528 A CN200910239528 A CN 200910239528A CN 101799752 B CN101799752 B CN 101799752B
Authority
CN
China
Prior art keywords
control
controls
data
numbering
numbers
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.)
Active
Application number
CN200910239528.3A
Other languages
Chinese (zh)
Other versions
CN101799752A (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

Landscapes

  • Information Transfer Between Computers (AREA)
  • Document Processing Apparatus (AREA)

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

Method and system for positioning HTML page control change
Technical Field
The invention relates to the technical field of computers, in particular to a method and a system for positioning HTML page control change.
Background
AJAX (asynchronous JavaScript and XML), namely asynchronous JavaScript language and extensible markup language XML, is a webpage development technology for creating interactive webpage application, and the WEB page non-refreshing technology realized based on the AJAX is to obtain an HTML control to be changed from a server program through the AJAX and then update the control through JavaScript on a page.
HTML (HyperText Mark-up Language), i.e., HyperText markup Language or HyperText markup Language, is the most widely used Language on the internet at present and is also the main Language constituting web documents. The key point for realizing the page non-refreshing is to position the control needing to be updated in the HTML page.
There are 2 ways to implement this: one is to manually specify the HTML control needed to be updated in a coding mode; another is to wrap the controls that may need to be updated without updates with DIV elements and then update the wrapped controls. Wherein a DIV element is an element used to provide structure and context for the content of a large block (block-level) in an HTML document, and all the content between the start tag and the end tag of the DIV is used to form the block, wherein the properties of the contained elements are controlled by the properties of the DIV tag or by formatting the block using a style sheet.
The positioning scheme of the HTML system control page change in the prior art has the following defects:
1. the bandwidth is occupied too much. The existing positioning mode only specifies the HTML controls needing to be updated, and whether the controls are changed in the page execution process cannot be predicted. Thus, each execution of a page updates the specified controls, even if the controls have not changed. Therefore, each operation needs to obtain the HTML control codes of the controls from the server side in an AJAX mode, and the controls are updated if the controls are not changed, and are not updated if the controls are not changed.
2. The use is complicated. The original page needs to be changed by using a DIV for packaging, and the layout of the HTML page can be influenced because the DIV is an HTML control. In addition, once the non-refreshing mode needs to be cancelled, the pages are changed, and the DIVs used for wrapping are deleted.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method and a system for positioning HTML page control change, which can automatically position a control that changes during the execution of a page without changing the page.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a positioning method for HTML page control change is constructed, which comprises the following steps:
A. decomposing control codes before page operation to obtain a plurality of independent controls without child controls, numbering according to respective original hierarchical relation, and storing as data 1;
B. decomposing the control codes after the page operation to obtain a plurality of independent controls without child controls, numbering according to respective original hierarchical relations, and storing the controls as data 2;
C. and comparing the control codes with the same number in the data 1 and the data 2 according to the sequence of the numbering levels from outside to inside to obtain the number of the changed control.
In the method for positioning the HTML page control change, only controls with the same number are compared in the step C.
In the step C, comparison is performed from the outermost layer to the inner layer of the hierarchy step by step.
In the step C, when comparing the control codes, if the two control codes are the same, the method enters the next level for comparison, and if the two control codes are different, the method records the numbers corresponding to the different control codes and does not enter the comparison of the next level.
The method for positioning the HTML page control change comprises the following steps that a control code before operation comprises three controls which are respectively marked as a control a, a control b and a control c; the control a comprises a control b and a control c, and the control b comprises the control c; the step A comprises the following steps:
a1, decomposing control codes before page operation to obtain independent controls a, b and c;
a2, numbering a control a, a control b and a control c respectively by using a numbering mode with a hierarchical relationship, wherein the number of the control a is still a, the number of the control b is a-b, and the number of the control c is a-b-c;
a3, removing the child controls contained in the controls with the numbers a, a-b and a-b-c obtained in the step A2, and storing the removed child controls as data 1.
The invention relates to a method for positioning the change of an HTML page control, wherein the step B comprises the following steps:
b1, decomposing the operated control codes to obtain a control a, a control B and a control c;
b2, numbering the control a, the control B and the control c respectively by using a numbering mode with a hierarchical relationship, wherein the number of the control a is still a, the number of the control B is a-B, and the number of the control c is a-B-c;
b3, removing the child controls contained in the controls a and a-B obtained in the step B2, and storing the removed child controls as data 2.
The invention relates to a method for positioning the change of an HTML page control, wherein the step C comprises the following steps:
c1, comparing the controls with the numbers a in the data 1 and the data 2, if the controls with the numbers a are different, recording the numbers of the controls a, and if the controls with the numbers a are the same, executing the step C2;
c2, comparing the controls with numbers a-b in the data 1 and the data 2, if the controls are different, recording the numbers of the controls b, and if the controls are the same, executing the step C3;
c3, comparing the controls with numbers a-b-C in the data 1 and the data 2, if the controls are not the same, recording the numbers of the controls C, and if the controls are the same, quitting the comparison.
The invention also provides a positioning system for the control change in the HTML page, which comprises a control code decomposition module, a numbering and storing module, a comparison module and a change control list generation module; wherein,
the control code decomposition module is used for decomposing control codes before page operation to obtain a plurality of independent controls without sub-controls, and decomposing control codes after page operation to obtain a plurality of independent controls without sub-controls;
the numbering and storing module is used for numbering the independent controls before the page operation before the decomposition according to respective original hierarchical relations and storing the independent controls as data 1, and numbering the independent controls before the page operation after the decomposition according to respective original hierarchical relations and storing the independent controls as data 2;
the comparison module is used for comparing the control codes with the same number in the data 1 and the data 2 according to the sequence of the numbering levels from outside to inside to obtain the changed control numbers;
and the change control list generating module is used for generating a change control number list according to the obtained changed control number.
The invention can accurately judge the number of the changed control before and after the page operation by decomposing, numbering and comparing the HTML page controls before and after the page operation, can automatically position the changed HTML control, only position the changed HTML control, and the unchanged control does not need to be updated, thereby being beneficial to reducing the network transmission data quantity and simplifying the non-refreshing development and reconstruction process of the page.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a flowchart of a method for locating changes to controls of an HTML page according to an embodiment of the present invention;
FIG. 2 is a schematic block diagram of a positioning system for HTML page control changes according to an embodiment of the present invention.
Detailed Description
The following detailed description of preferred embodiments of the invention refers to the accompanying drawings.
Fig. 1 shows a flow chart of a method for positioning HTML page control changes according to a preferred embodiment of the present invention, and in this embodiment, a control, b control, and c control with IDs a, b, and c, respectively, are included in a control code before operation, where the control a includes the control b and the control c, and the control b includes the control c. The page HTML control code hierarchy is as follows:
<div id=”a”>
<div id=”b”>
<div id=”c”>
</div>
</div>
</div>
it should be understood that the above control code is used only for structural illustration in the present embodiment, and is not related to the specific meaning indicated, and the following detailed description describes the positioning method of the above control code change, including the following steps:
step S10, decomposing control codes before page operation to obtain a plurality of independent controls without child controls, numbering according to respective original hierarchical relations, storing as data 1, and totally comprising the following three steps:
first step S11: decomposing the HTML control codes to obtain an independent 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>
in a second step S12, the controls obtained in the first step are all nested, that is, the control a includes controls b and c, and the control b includes a control c, and in order to accurately indicate the hierarchical relationship, the three controls are numbered by using the numbering method with the hierarchical relationship. The results after numbering are as follows:
the a control is numbered as a, and the code is as follows:
<div id=”a”>
<div id=”b”>
<div id=”c”>
</div>
</div>
</div>
b, the control code is numbered as a-b, and the code is as follows:
<div id=”b”>
<div id=”c”>
</div>
</div>
the control number of c is a-b-c, and the code is as follows:
<div id=”c”>
</div>
third, step S13, removing the child controls contained in each control obtained in step S12, and obtaining the following result
A control code numbered a:
<div id=”a”>
</div>
b control code numbered a-b:
<div id=”b”>
</div>
c control code numbered a-b-c:
<div id=”c”>
</div>
the result of the third step S13 is now saved as structural data of the page, named data 1.
After the page is executed, the new HTML control code may change to the following structure:
<div id=”a”>
<div id=”b”>this is test!
<div id=”c”>
</div>
</div>
</div>
step S20, the three steps of analysis in step S101 are repeatedly carried out on the control code operated on the page, and the following controls are obtained:
a control code numbered a:
<div id=”a”>
</div>
b control code numbered a-b:
<div id=”b”>this is test!
</div>
c control code numbered a-b-c:
<div id=”c”>
</div>
and naming the control structure obtained in the step S120 as data 2 and storing the control structure.
And step S30, comparing the control codes with the same number in the data 1 and the data 2 according to the sequence of the numbering levels from outside to inside to obtain the number of the changed control. The logic of the comparison is as follows:
1) the comparison is only performed in controls with the same number;
2) the sequence is a, a-b-c, compared from the outermost layer of the hierarchy;
3) and during comparison, if the two control codes are the same, entering the next level for comparison, and if the two control codes are different, recording the numbers corresponding to the different control codes and not entering the next level for comparison any more.
According to the logic of the above comparison, the process of comparing data 1 with data 2 in step S103 is as follows: firstly, comparing two control codes with the number of a, and if the two control codes with the number of a are completely the same, starting to compare the two control codes with the number of a-b of the next level; and if the two control codes with the serial numbers of a-b are different, the two control codes with the serial numbers of a-b-c of the next level are not compared, and the serial number of the control b is recorded.
In this embodiment, the two control codes with the numbers a-b are different, but if the two control codes with the numbers a-b are the same, the control codes c of the next level need to be compared, and if the control codes c are different, the numbers of the controls c are recorded.
And step S40, finally, recording the changed control number obtained by comparison in step S103, and generating a changed control number list so as to update the control through JavaScript. Therefore, only the changed HTML control can be positioned, and the unchanged control can be automatically ignored, so that the network transmission data volume is reduced, and the non-refreshing development and modification process of the HTML page is simplified.
In the above method, although only the positioning of the control code structure in the three-layer nested relationship is illustrated, the method can be applied to the positioning of the control code in the multi-layer nested relationship according to the sequential principle.
The embodiment of the present invention further provides a positioning system for the control change in the HTML page, which can implement the above positioning method, and the functional block diagram is shown in fig. 2, and the positioning system includes a control code decomposition module 10, a numbering and storing module 20, a comparison module 30, and a change control list generation module 40.
The control code decomposition module 10 is configured to decompose a control code before a page operation to obtain a plurality of independent controls without sub-controls, and decompose a control code after the page operation to obtain a plurality of independent controls without sub-controls. The numbering and storing module 20 is configured to number the plurality of independent controls before the page splitting operation according to the respective original hierarchical relationships and store the number as data 1, and number the plurality of independent controls before the page splitting operation according to the respective original hierarchical relationships and store the number as data 2. The comparison module 30 is configured to compare the control codes with the same number in the data 1 and the data 2 according to the sequence of the numbering hierarchy from outside to inside, so as to obtain the changed control numbers. The change control list generating module 40 is configured to generate a change control number list according to the obtained changed control number.
The specific implementation method of the positioning system according to the embodiment of the present invention refers to the positioning method described above, and is not described herein again.
The invention can accurately judge the number of the changed control before and after the page operation by decomposing, numbering and comparing the HTML page controls before and after the page operation, can automatically position the changed HTML control, only position the changed HTML control, and the unchanged control does not need to be updated, thereby being beneficial to reducing the network transmission data quantity and simplifying the non-refreshing development and reconstruction process of the page.
It will be understood that modifications and variations can be made by persons skilled in the art in light of the above teachings and all such modifications and variations are intended to be included within the scope of the invention as defined in the appended claims.

Claims (8)

1. A positioning method for HTML page control change is characterized by comprising the following steps:
A. decomposing control codes before page operation to obtain a plurality of independent controls without child controls, numbering according to respective original hierarchical relation, and storing as data 1;
B. decomposing the control codes after the page operation to obtain a plurality of independent controls without child controls, numbering according to respective original hierarchical relations, and storing the controls as data 2;
C. and comparing the control codes with the same number in the data 1 and the data 2 according to the sequence of the numbering levels from outside to inside to obtain the number of the changed control.
2. A method for locating HTML page control changes as claimed in claim 1, wherein in step C, only controls with the same number are compared.
3. The method of claim 1, wherein in step C, the comparison is performed from the outermost layer of the hierarchy to the inner layer step by step.
4. The method according to claim 1, wherein in step C, when comparing the control codes, if the two control codes are the same, the next level is entered for comparison, and if the two control codes are different, the numbers corresponding to the different control codes are recorded, and the comparison of the next level is not entered.
5. The method for positioning the HTML page control change according to any one of claims 1-4, wherein the control code before operation comprises three controls, which are respectively marked as a control, b control and c control; the control a comprises a control b and a control c, and the control b comprises the control c; the step A comprises the following steps:
a1, decomposing control codes before page operation to obtain independent controls a, b and c;
a2, numbering a control a, a control b and a control c respectively by using a numbering mode with a hierarchical relationship, wherein the number of the control a is still a, the number of the control b is a-b, and the number of the control c is a-b-c;
a3, removing the child controls contained in the controls with the numbers a, a-b and a-b-c obtained in the step A2, and storing the removed child controls as data 1.
6. The method of claim 5, wherein said step B comprises the steps of:
b1, decomposing the operated control codes to obtain a control a, a control B and a control c;
b2, numbering the control a, the control B and the control c respectively by using a numbering mode with a hierarchical relationship, wherein the number of the control a is still a, the number of the control B is a-B, and the number of the control c is a-B-c;
and B3, removing the child controls contained in the controls a, a-B and a-B-c obtained in the step B2, and storing the removed child controls as data 2.
7. The method of claim 6, wherein said step C comprises the steps of:
c1, comparing the controls with the numbers a in the data 1 and the data 2, if the controls with the numbers a are different, recording the numbers of the controls a, and if the controls with the numbers a are the same, executing the step C2;
c2, comparing the controls with numbers a-b in the data 1 and the data 2, if the controls are different, recording the numbers of the controls b, and if the controls are the same, executing the step C3;
c3, comparing the controls with numbers a-b-C in the data 1 and the data 2, if the controls are not the same, recording the numbers of the controls C, and if the controls are the same, quitting the comparison.
8. A positioning system for control change in an HTML page is characterized by comprising a control code decomposition module, a numbering and storing module, a comparison module and a change control list generation module; wherein,
the control code decomposition module is used for decomposing control codes before page operation to obtain a plurality of independent controls without sub-controls, and decomposing control codes after page operation to obtain a plurality of independent controls without sub-controls;
the numbering and storing module is used for numbering the independent controls before the decomposed page operation according to respective original hierarchical relations and storing the independent controls as data 1, and numbering the independent controls after the decomposed page operation according to respective original hierarchical relations and storing the independent controls as data 2;
the comparison module is used for comparing the control codes with the same number in the data 1 and the data 2 according to the sequence of the numbering levels from outside to inside to obtain the changed control numbers;
and the change control list generating module is used for generating a change control number list according to the obtained changed control number.
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 CN101799752A (en) 2010-08-11
CN101799752B true 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)

Families Citing this family (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
CN106293690B (en) * 2015-06-29 2020-02-28 阿里巴巴集团控股有限公司 Method and device for generating component object
CN108536467B (en) * 2018-04-08 2021-11-02 中国联合网络通信集团有限公司 Code positioning processing method and device, terminal equipment and storage medium
CN109766526B (en) * 2018-12-12 2023-07-25 东软集团股份有限公司 Form preservation method and 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

Also Published As

Publication number Publication date
CN101799752A (en) 2010-08-11

Similar Documents

Publication Publication Date Title
US8799353B2 (en) Scope-based extensibility for control surfaces
CN108572819A (en) Method for updating pages, device, terminal and computer readable storage medium
CN105824787B (en) A kind of control method and system of html template dynamic configuration
CN104020997B (en) Extensible graphical rule application system
CN110083790A (en) Page editing method, page output method, device, computer equipment and medium
US20120110437A1 (en) Style and layout caching of web content
US20090019064A1 (en) Document processing device and document processing method
Ying et al. Refactoring legacy AJAX applications to improve the efficiency of the data exchange component
WO2014052661A2 (en) Security remediation
US20120102390A1 (en) Method and apparatus for generating widget
CN101799752B (en) Method and system for positioning HTML page control variations
CN111124379B (en) Page generation method and device, electronic equipment and storage medium
US20090077462A1 (en) Document processing device and document processing method
CN108446136B (en) Element code extraction method and system
US20100162095A1 (en) Data processing apparatus and data processing method
CN108595697A (en) Webpage integrated approach, apparatus and system
Koch et al. Patterns for the Model-based Development of RIAs
US20080010587A1 (en) Document Processing Device and Document Processing Method
US20080005662A1 (en) Server Device and Name Space Issuing Method
US7802181B2 (en) Document processing device and document processing method
US20080256437A1 (en) Document Processing Apparatus and Document Processing Method
Dohrn et al. Design and implementation of wiki content transformations and refactorings
CN110058849A (en) Generation method, device, computer equipment and the storage medium of flow chart
US20130239085A1 (en) Automated detection and implementation of state and object modifications
WO2008099793A1 (en) Encoding/decoding apparatus, method and computer program

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