CN103207895B - For realizing the method and system of the unrelated synchronizing function of the page - Google Patents
For realizing the method and system of the unrelated synchronizing function of the page Download PDFInfo
- Publication number
- CN103207895B CN103207895B CN201310082309.5A CN201310082309A CN103207895B CN 103207895 B CN103207895 B CN 103207895B CN 201310082309 A CN201310082309 A CN 201310082309A CN 103207895 B CN103207895 B CN 103207895B
- Authority
- CN
- China
- Prior art keywords
- page
- message
- main control
- node
- controlled end
- 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
Links
Landscapes
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention provides a kind of method and system for realizing the unrelated synchronizing function of the page.Described method includes: main control end creates iframe to quote the first page in described main control end;Described first page is initialized by described main control end;Second page on described controlled end is initialized by controlled end;Described controlled end is set up with server and is connected;Operation in described first page is packaged into message and sends the message to described server by described main control end;Described server passes through set up connection and the message received is sent to described controlled end;And described controlled end receives described message and performs respective logic, so that described second page is Tong Bu with described first page according to the message received.
Description
Technical field
The present invention relates to synchronizing function realize, more particularly, to a kind of for realizing the unrelated synchronizing function of the page
Method and system.
Background technology
Emerging in large numbers of the change maked rapid progress along with network application and multiformity application, user is to the requirement of application function day by day
Variation, such as unique user lead many people browse same application, specific to browse the same page (system be divided into main control end and
The page of controlled end, main control end and controlled end to keep change to synchronize, including rolling change, page change).Prior art is general
The mode used is page data transmission.But which needs to transmit page local data notably full page, this not only pole
It consumes bandwidth, and user can be clearly felt that the flicker of the page.In addition friendly in order to ensure controlled end Consumer's Experience,
New data is initialized, make controlled end user can also operation pages, this can have a strong impact on processing speed.
The method and system of synchronizing function can be independently realized by the page accordingly, it would be desirable to a kind of.Such as, user A and B is simultaneously
In browsing pages C(A master control, B is controlled), B end is in not refresh page and just can be with the page of A end with few communication data
Face keeps the change of high level of synchronization.
Summary of the invention
According to an aspect of the present invention, it is provided that a kind of method for realizing the unrelated synchronizing function of the page, described side
Method includes: main control end creates iframe to quote the first page in described main control end;Described main control end is to described first page
Initialize;Second page on described controlled end is initialized by controlled end;Described controlled end is set up even with server
Connect;Operation in first page is packaged into message and sends the message to described server by described main control end;Described clothes
Business device passes through set up connection and the message received is sent to described controlled end;And described controlled end receives described message
And perform respective logic according to the message received, so that described second page is Tong Bu with described first page.
Preferably, described main control end carries out initialization to described first page and farther includes: in described first page
Node be numbered by structure, described numbering contains the structural information upwards of node;And described node is carried out thing
Part detection and monitoring registration.
Preferably, if event type is hyperlink, then hyperlink logical process is carried out to be allowed in current window
Redirect.
Preferably, described controlled end second page on which carries out initialization and farther includes: to described second page
In node be numbered by structure, described numbering contains the structural information upwards of node;And described node is carried out
Event detection and monitoring registration.
Preferably, if event type is hyperlink, then carry out hyperlink logical process to be allowed at new tab label
Open and redirect link.
Preferably, send the message to described server described in farther include described message to be sent via agency
To described server.
Preferably, described the message received is sent to described controlled end farther includes will to receive via agency
Message is sent to described controlled end.
According to a further aspect in the invention, it is provided that a kind of system for realizing the unrelated synchronizing function of the page, described
System includes: server;Main control end, described main control end is configured to create iframe to quote the page 1 in described main control end
Face, initializes described first page, and the operation in first page is packaged into message and described message is sent
To described server;Controlled end, described controlled end is configured to initialize the second page on described controlled end, with institute
State server and set up connection, pass through set up connection and receive described message from described server, and according to disappearing of receiving
Breath performs respective logic, so that described second page is Tong Bu with described first page.
Preferably, described main control end is further configured to: be numbered the node in described first page by structure,
Described numbering contains the structural information upwards of node;And described node is carried out event detection and monitors registration.
Preferably, described main control end is further configured to: if event type is hyperlink, then carry out hyperlink logic
Process to be allowed to redirect in current window.
Preferably, described controlled end is further configured to: be numbered the node in described second page by structure,
Described numbering contains the structural information upwards of node;And described node is carried out event detection and monitors registration.
Preferably, described controlled end is further configured to: if event type is hyperlink, then carry out hyperlink logic
Process so that being allowed to open at new tab label redirects link.
Preferably, described main control end is further configured to send the message to described server via agency.
Preferably, described controlled end farther includes to pass through set up connection via agency and receives institute from described server
State message.
Technical scheme is in principal and subordinate's scene, by being quickly numbered the DOM node in the page, event
Monitoring and audiomonitor registration, it is possible to capture the page active of main control end, and real-time it is transferred to controlled end, controlled end imitates
The action of main control end, makes principal and subordinate reach the synchronicity of height.
Accompanying drawing explanation
Accompanying drawing illustrates embodiments of the invention, and for explaining the principle of the present invention together with description.In the accompanying drawings:
Fig. 1 schematically illustrates according to an embodiment of the invention for realizing the system of the unrelated synchronizing function of the page
View.
Fig. 2 schematically illustrates according to an embodiment of the invention for realizing the process of the unrelated synchronizing function of the page
Sequential chart.
Fig. 3 schematically illustrates according to an embodiment of the invention for the method realizing the unrelated synchronizing function of the page
Flow chart.
Detailed description of the invention
Explain in detail technical scheme according to an embodiment of the invention below with reference to accompanying drawings.
As used in this application, term " framework " is actually a kind of special webpage.Framework can be as required
Browser window is divided into multiple region, and each frame area is an independent module.Framework tool is used in webpage
Have so that structure of web page is clear, it is easy to safeguard and update.
Term " iframe label " is also called floating frame tagging, and iframe label can create an inline boxes in webpage
Frame, by specifying src attribute to call the content of another web document.That is, it can be used to embed a html document
A html shows.Html file cited in iframe label is not and the other separate display of html file,
And be directly embedded in a html file, mutually merging with this html file becomes an entirety.Any can put into
The content of common web can be put in embedded frame.Repeatedly can also show same content in a page, without
Repeat to write content.Iframe is element important in page layout, and it is the subframe in a webpage, is father and son between two webpages
Relation, say, that the iframe page is subpage frame, and the webpage of nested iframe is parent page.
According to technical scheme by embedding iframe element in the page, and the sensing of its src attribute is wanted
The page address synchronized, subpage frame, as controller, is initialized and the monitoring of operation on subpage frame by parent page.Parent page
On listen to operate post package message broadcast, it is achieved the synchronization of principal and subordinate's end.
Fig. 1 schematically illustrates according to an embodiment of the invention for realizing the system of the unrelated synchronizing function of the page
The view of 100.
As it is shown in figure 1, system 100 includes main control end 101, server 103 and controlled end 105.Main control end 101 is responsible for encapsulation
Message also sends a message to server 103, and make controlled end 105 receive message and process after with main control end 101
Keep synchronizing.Server 103 is used for administration web page assembly and the request of responding web browser to main control end 101 and controlled
End 105 offer service.Controlled end 105 carries out corresponding operating according to the action of main control end 101.Main control end 101 can include the page
Controller 107, page controller 107 is for being managed the page in main control end 101 and controlling, such as, page controller
107 DOM node that can travel through the page are numbered.Main control end 101 may further include total page agency 109, and the page is total
Agency 109 is for being forwarded to server 103 by the message from page controller 107.Similarly, controlled end 105 can also wrap
Include page controller 111 and page general agency 113.Page controller 111 for the page on controlled end 105 is managed and
Control, and page general agency 113 is for being forwarded to controlled end 105 by message from server 103.
First, main control end 101 and controlled end 105 need to initialize.The initialization of main control end 101 includes such as creating
Iframe, node is numbered and Node Events detection and monitor (including the process to hyperlink) etc..At the beginning of controlled end 105
Beginningization includes being numbered node and the process of hyperlink.Wherein, numbering can be numbered in the way of using based on structure,
Thus effectively reduce the risk of numbering dislocation.
Then, server is sent messages to after the main control end 101 action on the iframe listened in main control end 101
103, after then controlled end 105 pulls this message, this message is resolved, and according to message content on controlled end 105
Perform corresponding actions on iframe, such as, roll or trigger the mouse event of certain node, in order to be the controlled end iframe page
With main control end iframe page synchronization.
Fig. 2 schematically illustrates according to an embodiment of the invention for realizing the process of the unrelated synchronizing function of the page
Sequential chart.
As in figure 2 it is shown, according to technical scheme, in order to make synchronization unrelated with the page, the page control of main control end 101
Device 107 processed creates iframe to quote the page, in order to the page that the unrelated display of the page is to be synchronized.
At S1, page controller 107 travels through the DOM node in the iframe page, is numbered by structure, in order to effectively subtract
The risk of few numbering dislocation, such as numbering 3_7_0_6, this numbering meaning is presented as: this node be third layer node (index from
0 starts, i.e. root node), this node is the 6th child node (index is from the beginning of 0) of its father node, saves for father in the middle of this numbering
Point is except representing after the numbering of level sign.As understood by a person skilled in the art, the setting of above numbering is exemplary,
And the setting numbered is not limited to that kind of a form.
At S2, page controller 107 carries out event detection to node after DOM node recurrence numbering in for iframe
Register with monitoring.Page controller 107 detects its audiomonitor that have registered which type, increases the audiomonitor of the type simultaneously.
If event type is hyperlink, then need to carry out hyperlink logical process at S3 to be allowed to redirect in current window.
At S4, the message detected is packaged and sends this message in monitoring readjustment by page controller 107
Server 103.Detected message can include numbering and the event type of such as node.Such as, if registered on page A
Slip event, then page controller 107 hands to total page agency rolling height as message content when window sliding
109 to be sent to server 103.
Similarly, at S ' 1, the page controller 111 of controlled end 105 is adopted and is saved the DOM in its page in the same way
Point is numbered, the logical process being simultaneously correlated with in 2 pairs of hyperlink of S '.And, controlled end 105 is set up with server 103
Connect.Such as, described connection can be long connection, i.e. every secondary data transmission is not turn off this connection, connects and only occurs in communication
Close during mistake or during connection reconstruction.The most such as, server end can arrange a time-out time, notifies client after time-out
Close original connection and re-establish connection.
At S6, controlled end 105 is after server 103 pulls synchronization message, and resolves this synchronization message.Such as, determine
The type of message, such as, roll message, event message and redirect message etc..Alternatively, at S7, in controlled end 105, the page is total
Agency 113 receives synchronization message from server 103, and is distributed to the page controller of controlled end 105 after parsing
111。
At S8, the synchronization message received is processed by page controller 111.Such as, if the message received is
Roll message, then change the scrollTop value of window in iframe;If the message received is event message, then according to volume
The element number finding correspondence carries out the triggering of respective type event;And if the message received is that redirecting of hyperlink disappears
Breath, then jump to corresponding page address.It is appreciated that and the invention is not restricted to cited event and action.In computing environment
In, there are the various events and action that can occur on webpage, these events can be detected according to technical scheme
And action.
Fig. 3 schematically illustrates according to an embodiment of the invention for the method realizing the unrelated synchronizing function of the page
The flow chart of 300.
As it is shown on figure 3, in step 301, the page controller 107 of main control end 101 creates iframe to quote its page.So
After, in step 303, the page is initialized by page controller 107.In step 305, the page controller 111 of controlled end 105
Its page is initialized.As understood by a person skilled in the art, the execution of step 303 and step 305 is not limited to this place
The order of row, they can occur according to order unlike this simultaneously or successively.
Alternatively, the initialization step 303 of described main control end 101 farther includes sub-step 303-1 to 303-3.At son
Step 303-1, the node in the page is numbered by the page controller 107 of main control end 101 by structure, and described numbering contains
The structural information upwards of node.In sub-step 303-2, page controller 107 carries out event detection and monitors registration node.
Still optionally further, if event type is hyperlink, then need to carry out hyperlink logical process to make in sub-step 303-3
Redirect in current window.
Similarly, the initialization step 305 of described controlled end 105 farther includes sub-step 305-1 to 305-2.At son
Step 305-1, the node in the page is numbered by the page controller 111 of controlled end 105 by structure.Alternatively, event class
Type is hyperlink, then in sub-step 305-2, page controller 111 needs to carry out hyperlink logical process to be allowed to new
Tab label is opened and is redirected link.
It follows that in step 307, controlled end 105 is set up with server 103 and is connected, in order to real-time reception is used for controlled end
Synchronization message.In step 309, the operation in first page is packaged into message and incites somebody to action by the page controller 107 of main control end 101
This message is sent to server 103.In step 311, server 103 passes through set up connection and the message received is sent to
Controlled end 105.In step 313, the page controller 111 of controlled end 105 receives this message and resolves it and process, example
As, page controller 111 performs respective logic according to type of message, so that the controlled end page and main control end page synchronization, example
As, roll or trigger the mouse event on node.Then, method 300 terminates.
Alternatively, can realize in the way of using timing transmission innerHTML content, for example, it is possible to take transmission
The mode of innerHTML or employing browser plug-in screenshotss realizes.The granularity of innerHTML can be whole BODY or list
Individual node, but the defect of which is: and bandwidth consumption is big;In order to ensure the motility of controlled end, need to transmit one simultaneously
Node is monitored registration by event table again that have recorded the event on node;If individual node, it is difficult to ensure that transmission
InnerHTML content can cover the node dynamically increasing outside this node or deleting, reach Complete Synchronization.
According to technical scheme, in principal and subordinate's scene, framework uses the form of iframe, in the flexible configuration page
Hold, it is ensured that the independence of the page.For embedding the iframe page in homepage, use the synchronizing function that a kind of page is unrelated
The method of realization the page is focused on, the page can be made to reach to synchronize, including rolling and event triggers, and by spy
Determine the particular configuration of the page, reach the Complete Synchronization of principal and subordinate's page.
Above-described embodiment is only the preferred embodiments of the present invention, is not limited to the present invention.To those skilled in the art
It is readily apparent that without departing from the spirit and scope of the present invention, can embodiments of the invention be carried out various
Modifications and changes.Therefore, the invention is intended to contain fall within the scope of the present invention as defined by the appended claims all this
The amendment of sample or modification.
Claims (12)
1., for the method realizing the unrelated synchronizing function of the page, described method includes:
Main control end creates iframe and quotes the first page in described main control end;
Described first page is initialized by described main control end;
Second page on described controlled end is initialized by controlled end;
Described controlled end is set up with server and is connected;
Operation in described first page is packaged into message and sends the message to described server by described main control end;
Described server passes through set up connection and the message received is sent to described controlled end;And described controlled termination
Receive described message and perform respective logic, so that described second page is Tong Bu with described first page according to the message received;
Described main control end carries out initialization to described first page and farther includes:
Being numbered the node in described first page by structure, described numbering contains the structural information upwards of node;
And described node is carried out event detection and monitors registration.
Method the most according to claim 1, farther includes:
If event type is hyperlink, then carry out hyperlink logical process to be allowed to redirect in current window.
Method the most according to claim 1, wherein, described controlled end second page on which carries out initializing further
Including:
Being numbered the node in described second page by structure, described numbering contains the structural information upwards of node;
And described node is carried out event detection and monitors registration.
Method the most according to claim 3, farther includes:
If event type is hyperlink, then carry out hyperlink logical process to be allowed to open skip chain at new tab label
Connect.
Method the most according to claim 1, wherein, described in send the message to described server farther include through
Described server is sent the message to by agency.
Method the most according to claim 1, wherein, described be sent to described controlled end by the message received and wrap further
Include, via agency, the message received is sent to described controlled end.
7., for realizing a system for the unrelated synchronizing function of the page, described system includes:
Server;
Main control end, described main control end is configured to create iframe to quote the first page in described main control end, to described the
One page initializes, and the operation in described first page is packaged into message and sends the message to described clothes
Business device;
Controlled end, described controlled end is configured to initialize the second page on described controlled end, with described server
Set up and connect, pass through set up connection and receive described message from described server, and perform phase according to the message received
Answer logic, so that described second page is Tong Bu with described first page;
Wherein, described main control end is further configured to:
Being numbered the node in described first page by structure, described numbering contains the structural information upwards of node;
And described node is carried out event detection and monitors registration.
System the most according to claim 7, wherein, described main control end is further configured to:
If event type is hyperlink, then carry out hyperlink logical process to be allowed to redirect in current window.
System the most according to claim 7, wherein, described controlled end is further configured to:
Being numbered the node in described second page by structure, described numbering contains the structural information upwards of node;
And described node is carried out event detection and monitors registration.
System the most according to claim 9, wherein, described controlled end is further configured to:
If event type is hyperlink, then carry out hyperlink logical process to be allowed to open skip chain at new tab label
Connect.
11. systems according to claim 7, wherein, described main control end is further configured to disappear described via agency
Breath is sent to described server.
12. systems according to claim 7, wherein, described controlled end farther includes to pass through to be set up via agency
Connect and receive described message from described server.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310082309.5A CN103207895B (en) | 2013-03-14 | 2013-03-14 | For realizing the method and system of the unrelated synchronizing function of the page |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310082309.5A CN103207895B (en) | 2013-03-14 | 2013-03-14 | For realizing the method and system of the unrelated synchronizing function of the page |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103207895A CN103207895A (en) | 2013-07-17 |
CN103207895B true CN103207895B (en) | 2016-12-28 |
Family
ID=48755117
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310082309.5A Active CN103207895B (en) | 2013-03-14 | 2013-03-14 | For realizing the method and system of the unrelated synchronizing function of the page |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103207895B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105930392A (en) * | 2016-04-15 | 2016-09-07 | 北京思特奇信息技术股份有限公司 | Cross-domain IFRAME height adaption method based on message transmission and system thereof |
CN107480148A (en) * | 2016-06-07 | 2017-12-15 | 广州市动景计算机科技有限公司 | The method and device and user terminal that control webpage redirects |
CN109032452A (en) * | 2018-08-14 | 2018-12-18 | 北京大米科技有限公司 | Page operation contents synchronization system and method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101000544A (en) * | 2007-01-16 | 2007-07-18 | 华为技术有限公司 | Event distributing method and device based on Web page |
CN101699393A (en) * | 2009-10-09 | 2010-04-28 | 中国电子科技集团公司第二十八研究所 | Intelligent software interface dynamic generation method facing network |
CN101977209A (en) * | 2010-10-11 | 2011-02-16 | 苏州阔地网络科技有限公司 | Method for realizing page-turning synchronization on web page |
CN102314467A (en) * | 2010-12-29 | 2012-01-11 | 苏州阔地网络科技有限公司 | Method for realizing synchronous browsing of web pages |
-
2013
- 2013-03-14 CN CN201310082309.5A patent/CN103207895B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101000544A (en) * | 2007-01-16 | 2007-07-18 | 华为技术有限公司 | Event distributing method and device based on Web page |
CN101699393A (en) * | 2009-10-09 | 2010-04-28 | 中国电子科技集团公司第二十八研究所 | Intelligent software interface dynamic generation method facing network |
CN101977209A (en) * | 2010-10-11 | 2011-02-16 | 苏州阔地网络科技有限公司 | Method for realizing page-turning synchronization on web page |
CN102314467A (en) * | 2010-12-29 | 2012-01-11 | 苏州阔地网络科技有限公司 | Method for realizing synchronous browsing of web pages |
Also Published As
Publication number | Publication date |
---|---|
CN103207895A (en) | 2013-07-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9967295B2 (en) | Automated discovery and launch of an application on a network enabled device | |
US10872127B2 (en) | Method and system of providing for cross-device operations between user devices | |
US20140310392A1 (en) | Method and apparatus for processing composite web transactions | |
JP5857443B2 (en) | Content sharing system | |
US20140195649A1 (en) | Automatic detection of a similar application stored on a networked media device through a multicast capability of an operating system accessed through an application of a mobile device | |
US20170041655A1 (en) | Exposure of public internet protocol addresses in an advertising exchange server to improve relevancy of advertisements | |
CN104426925B (en) | Web page resources acquisition methods and device | |
CN103970760B (en) | A kind of web-page requests processing method and processing device | |
CN103207895B (en) | For realizing the method and system of the unrelated synchronizing function of the page | |
US9323730B2 (en) | Platform and method for real-time synchronized co-browsing of web pages | |
CN103699635B (en) | Information processing method and device | |
CN108416011A (en) | A kind of page processing method, device, terminal and computer readable storage medium | |
US8966359B2 (en) | Web application content mapping | |
CN107357489A (en) | A kind of synchronous method for browsing information, terminal and server | |
CN105379195A (en) | Information sharing method and device | |
CN110247948A (en) | Supplemental content is provided about embedded media | |
CN106230978A (en) | Distributed caching synchronous method, Apparatus and system | |
CN102325225A (en) | Method and device for playing video of mobile phone website | |
CN102915251B (en) | Method and device for processing message by multi-page browser | |
CN109446460B (en) | HTML5 online video redirection system and implementation method thereof | |
US20150302190A1 (en) | Method for dynamically adjusting program login interface, and internet terminal | |
CN102314468A (en) | Synchronous browse method | |
CN102314467A (en) | Method for realizing synchronous browsing of web pages | |
JP2016038684A (en) | Page synchronization method synchronously displaying same page among terminal, synchronization server and program | |
Sciorati | Pandemic Trust: China-Italy Relations during COVID-19 |
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 |