CN103207895A - Method and system for achieving page irrelevant synchronizing function - Google Patents

Method and system for achieving page irrelevant synchronizing function Download PDF

Info

Publication number
CN103207895A
CN103207895A CN2013100823095A CN201310082309A CN103207895A CN 103207895 A CN103207895 A CN 103207895A CN 2013100823095 A CN2013100823095 A CN 2013100823095A CN 201310082309 A CN201310082309 A CN 201310082309A CN 103207895 A CN103207895 A CN 103207895A
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.)
Granted
Application number
CN2013100823095A
Other languages
Chinese (zh)
Other versions
CN103207895B (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 Jingdong Century Trading Co Ltd
Original Assignee
Beijing Jingdong Century Trading 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 Jingdong Century Trading Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201310082309.5A priority Critical patent/CN103207895B/en
Publication of CN103207895A publication Critical patent/CN103207895A/en
Application granted granted Critical
Publication of CN103207895B publication Critical patent/CN103207895B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method and a system for achieving a page irrelevant synchronizing function. The method includes that a main control end sets up an iframe to cite a first page on the main control end; the main control end initializes the first page; a controlled end initializes a second page on the controlled end; the connection of the controlled end and a server is established; the main control end packages operations on the first page into messages and sends the messages to the server; the server sends the received messages to the controlled end through the established connection; and the controlled end receives the messages and performs corresponding logic according to the received messages so as to synchronize the second page and the first page.

Description

The method and system that is used for the irrelevant synchronizing function of the realization page
Technical field
The present invention relates to synchronizing function and realize, more specifically, relate to a kind of for the method and system of realizing the synchronizing function that the page is irrelevant.
Background technology
What the variation of making rapid progress along with network application and diversity were used emerges in large numbers, the user is to the requirement variation day by day of application function, for example unique user leads many people to browse same application, (system divides is main control end and controlled end specific to browsing the same page, the page of main control end and controlled end will keep changing synchronously, comprising that the variation of rolling, the page change).The general mode that adopts of prior art is the page data transmission.Yet this mode needs very person's full page of transmits page local data, and this is bandwidth consumed extremely not only, and the user can obviously feel the flicker of the page.For the user who guarantees controlled end close friend experiences, carry out initialization to new data in addition, make the controlled end subscriber also can operation pages, this can have a strong impact on processing speed.
Therefore, need a kind of method and system of can the page irrespectively realizing synchronizing function.For example, user A and B are simultaneously in browsing pages C(A master control, and B is controlled), the B end is in the variation that does not refresh the page and just can keep high level of synchronization with the page of A end with few communication data.
Summary of the invention
According to an aspect of the present invention, provide a kind of for the method that realizes the synchronizing function that the page is irrelevant, described method comprises: main control end establishment iframe quotes first page on the described main control end; Described main control end is carried out initialization to described first page; Controlled end carries out initialization to second page on the described controlled end; Described controlled end and server connect; Described main control end is packaged into the operation on first page message and described message is sent to described server; The connection that described server passes through to set up sends to described controlled end with the message that receives; And described controlled termination is received described message also according to the message execution respective logic that receives, so that described second page and described first page are synchronous.
Preferably, described main control end is carried out initialization to described first page and further comprised: the node in described first page is numbered by structure, and described numbering has comprised the structural information that makes progress of node; And described node is carried out event detection register with monitoring.
Preferably, if event type is hyperlink, then carry out the hyperlink logical process in order to make it redirect in current window.
Preferably, described controlled end carries out initialization to second page on it and further comprises: the node in described second page is numbered by structure, and described numbering has comprised the structural information that makes progress of node; And described node is carried out event detection register with monitoring.
Preferably, if event type is hyperlink, then carries out the hyperlink logical process in order to make it and open the redirect link at new tab label.
Preferably, described with described message send to described server further comprise via agency described message is sent to described server.
Preferably, described with the message that receives send to described controlled end further comprise via agency the message that receives is sent to described controlled end.
According to a further aspect in the invention, provide a kind of for the system that realizes the synchronizing function that the page is irrelevant, described system comprises: server; Main control end, described main control end are configured to create iframe and quote first page on the described main control end, described first page is carried out initialization, and the operation on first page is packaged into message and described message is sent to described server; Controlled end, described controlled end is configured to second page on the described controlled end is carried out initialization, connect with described server, the connection of passing through to set up receives described message from described server, and carry out respective logic according to the message that receives, so that described second page and described first page are synchronous.
Preferably, described main control end further is configured to: the node in described first page is numbered by structure, and described numbering has comprised the structural information that makes progress of node; And described node is carried out event detection register with monitoring.
Preferably, described main control end further is configured to: if event type is hyperlink, then carry out the hyperlink logical process in order to make it redirect in current window.
Preferably, described controlled end further is configured to: the node in described second page is numbered by structure, and described numbering has comprised the structural information that makes progress of node; And described node is carried out event detection register with monitoring.
Preferably, described controlled end further is configured to: if event type is hyperlink, then carries out the hyperlink logical process in order to make it and open the redirect link at new tab label.
Preferably, described main control end further is configured to via the agency described message be sent to described server.
Preferably, described controlled end comprises that further the connection of passing through to set up via the agency receives described message from described server.
Technical scheme of the present invention is in principal and subordinate's scene, by fast to the DOM node in the page be numbered, the registration of event monitoring and audiomonitor, can capture the page active of main control end, and real-time be transferred to controlled end, the action of controlled end imitation main control end makes the principal and subordinate reach the synchronism of height.
Description of drawings
Accompanying drawing illustrates embodiments of the invention, and is used from explanation principle of the present invention with instructions one.In the accompanying drawings:
Fig. 1 schematically illustrates the view of the system that is used for the irrelevant synchronizing function of the realization page according to an embodiment of the invention.
Fig. 2 schematically illustrates the sequential chart of the processing that is used for the irrelevant synchronizing function of the realization page according to an embodiment of the invention.
Fig. 3 schematically illustrates the process flow diagram of the method that is used for the irrelevant synchronizing function of the realization page according to an embodiment of the invention.
Embodiment
Explain technical scheme according to an embodiment of the invention below with reference to accompanying drawings in detail.
As using in this application, term " framework " is actually a kind of special webpage.Framework can be divided into browser window a plurality of zones as required, and each frame area is an independently module.It is clear that the use framework has the structure of web page of making in webpage, is easy to safeguard and upgrade.
Term " iframe label " is called unsteady frame tagging again, and the iframe label can be created an embedded framework in webpage, calls the content of another web document by specifying the src attribute.That is, it can be used for a html document is embedded among the html and show.The html file that the iframe label is quoted is not and the other separate demonstration of html file, but directly is embedded in the html file, is fused into as a whole mutually with this html file.Any content that can put into common web can be put into embedded frame.Same content can also be repeatedly in a page, shown, and content needn't be repeated to write.Iframe is element important in the page layout, and it is a subframe in the webpage, is set memberships between two webpages, that is to say that the iframe page is subpage frame, and the webpage of nested iframe is parent page.
By embedding the iframe element in the page, and its src properties point is wanted synchronous page address according to technical scheme of the present invention, parent page is as controller, subpage frame carried out the monitoring of operating on initialization and the subpage frame.Listen to operation back encapsulation messages on the parent page and broadcast, realize the synchronous of principal and subordinate's end.
Fig. 1 schematically illustrates the view of the system 100 that is used for the irrelevant synchronizing function of the realization page according to an embodiment of the invention.
As shown in Figure 1, system 100 comprises main control end 101, server 103 and controlled end 105.Main control end 101 is responsible for encapsulation messages and message is sent to server 103, and controlled end 105 is kept synchronously with main control end 101 after receiving message and handling.Server 103 is used for administration web page assembly and respond the request of web browser in order to provide service to main control end 101 and controlled end 105.Controlled end 105 carries out corresponding operating according to the action of main control end 101.Main control end 101 can comprise page controller 107, and page controller 107 is used for the page on the main control end 101 is managed and controls, and for example, the DOM node that page controller 107 can travel through the page is numbered.Main control end 101 may further include total page agency 109, and page general agency 109 is used for being forwarded to server 103 from the message of page controller 107.Similarly, controlled end 105 also can comprise page controller 111 and page general agency 113.Page controller 111 is used for the page on the controlled end 105 is managed and controls, and page general agency 113 is used for message is forwarded to controlled end 105 from server 103.
At first, main control end 101 and controlled end 105 need initialization.The initialization of main control end 101 for example comprises the iframe that creates, node is numbered and Node Events detects and monitor (comprising the processing to hyperlink) etc.The initialization of controlled end 105 comprises node is numbered processing with hyperlink.Wherein, numbering can adopt the mode based on structure to be numbered, thereby effectively reduces the risk of numbering dislocation.
Then, main control end 101 sends message to server 103 after the action on the iframe that listens on the main control end 101, controlled end 105 is resolved this message after pulling this message then, and carry out corresponding actions according to the iframe of message content on controlled end 105, for example roll or trigger the mouse event of certain node, synchronous to be the controlled end iframe page and the main control end iframe page.
Fig. 2 schematically illustrates the sequential chart of the processing that is used for the irrelevant synchronizing function of the realization page according to an embodiment of the invention.
As shown in Figure 2, according to technical scheme of the present invention, synchronously irrelevant with the page in order to make, the page controller 107 of main control end 101 is created iframe and is come reference page, so that the irrelevant demonstration of the page will the synchronous page.
At S1, DOM node in the page controller 107 traversal iframe pages, be numbered by structure, in order to effectively reduce the risk of numbering dislocation, for example number 3_7_0_6, this numbering meaning is presented as: this node is the 3rd layer node (index since 0, i.e. root node), this node is the 6th child node (index is since 0) of its father node, represents except the back of the numbering of level sign from this numbering centre for father node.As understood by a person skilled in the art, more than Bian Hao setting is exemplary, and the setting of numbering is not limited in this kind form.
At S2, page controller 107 carries out event detection and monitors registration node after the DOM node recurrence numbering in for iframe.Page controller 107 detects it and has registered the audiomonitor of which type, increases the audiomonitor of the type simultaneously.If event type is hyperlink, then the hyperlink logical process need be carried out in order to make it redirect in current window at S3.
At S4, page controller 107 encapsulates detected message in monitoring readjustment and this message is sent to server 103.Detected message can comprise for example numbering and the event type of node.For example, if registered slip event on the page A, then page controller 107 is handed to total page agency 109 to the height that rolls to send to server 103 as message content when window slides.
Similarly, at S ' 1, the page controller 111 of controlled end 105 is adopted in the same way the DOM node in its page is numbered, simultaneously the logical process of being correlated with in 2 pairs of hyperlink of S '.And controlled end 105 connects with server 103.For example, described connection can be long the connection, that is, each data transmit can not close this connection, only connects in communication to occur when wrong or close during connection reconstruction.Again for example, server end can arrange a time-out time, and overtime back notice client is closed original connection and rebulid connection.
At S6, after controlled end 105 pulls synchronization message from server 103, and to this synchronization message parsing.For example, determine the type of message, the message of for example rolling, event message and redirect message etc.Alternatively, at S7, in controlled end 105, page general agency 113 receives synchronization message from server 103, and after resolving it is distributed to the page controller 111 of controlled end 105.
At S8,111 pairs of synchronization messages that receive of page controller are handled.For example, if the message that receives is rolling message, then change the scrollTop value of window among the iframe; If the message that receives is event message, then find corresponding element to carry out the triggering of respective type event according to numbering; And if the message that receives is the redirect message of hyperlink, then jump to corresponding page address.Be appreciated that and the invention is not restricted to cited event and action.In computing environment, variety of event and action that existence can take place at webpage can detect these events and action according to technical scheme of the present invention.
Fig. 3 schematically illustrates the process flow diagram of the method 300 that is used for the irrelevant synchronizing function of the realization page according to an embodiment of the invention.
As shown in Figure 3, in step 301, the page controller 107 of main control end 101 is created iframe and is quoted its page.Then, in step 303,107 pairs of pages of page controller carry out initialization.In step 305, the page controller 111 of controlled end 105 carries out initialization to its page.As understood by a person skilled in the art, the execution of step 303 and step 305 is not limited thereto the order of place row, and they can take place simultaneously or successively according to different therewith orders.
Alternatively, the initialization step 303 of described main control end 101 further comprises substep 303-1 to 303-3.At substep 303-1, the node in 107 pairs of pages of the page controller of main control end 101 is numbered by structure, and described numbering has comprised the structural information that makes progress of node.At substep 303-2,107 pairs of nodes of page controller carry out event detection and monitor registration.Further alternatively, if event type is hyperlink, then the hyperlink logical process need be carried out in order to make it redirect in current window at substep 303-3.
Similarly, the initialization step 305 of described controlled end 105 further comprises substep 305-1 to 305-2.At substep 305-1, the node in 111 pairs of pages of the page controller of controlled end 105 is numbered by structure.Alternatively, event type is hyperlink, and then at substep 305-2, page controller 111 need carry out the hyperlink logical process and open the redirect link in order to make it at new tab label.
Next, in step 307, controlled end 105 connects with server 103, in order to receive the synchronization message that is used for controlled end in real time.In step 309, the page controller 107 of main control end 101 is packaged into the operation on first page message and this message is sent to server 103.In step 311, the connection that server 103 passes through to set up sends to controlled end 105 with the message that receives.In step 313, the page controller 111 of controlled end 105 receives this message and it is resolved and handles, for example, page controller 111 is carried out respective logic according to type of message, so that controlled end page face and the main control end page are synchronous, for example, the mouse event on rolling or the triggering node.Then, method 300 finishes.
Alternatively, can adopt the mode of regularly transmitting the innerHTML content to realize, for example, can take to transmit innerHTML or adopt the mode of browser plug-in screenshotss to realize.The granularity of innerHTML can be whole BODY or individual node, but the defective of this mode is: bandwidth consumption is big; In order to guarantee the dirigibility of controlled end, need transmit an event table that has recorded the event on the node simultaneously node is monitored registration again; If individual node, the very difficult innerHTML content of transmission that guarantees can cover the node that dynamically increases or delete outside this node, reaches fully synchronously.
According to technical scheme of the present invention, in principal and subordinate's scene, framework adopts the form of iframe, and the flexible configuration content of pages has guaranteed the independence of the page.For the iframe page that embeds in the homepage, use the method for the realization of the irrelevant synchronizing function of a kind of page that the page is focused on, the page is reached synchronously, comprise and rolling and Event triggered, and the customized configuration by specific webpage, reach principal and subordinate's page fully synchronously.
Above-described embodiment only is the preferred embodiments of the present invention, is not limited to the present invention.It will be apparent for a person skilled in the art that under the situation that does not break away from the spirit and scope of the present invention, can carry out various modifications and change to embodiments of the invention.Therefore, the invention is intended to contain modification or the modification that falls into as within the scope of the present invention that claim limits all.

Claims (14)

1. method that be used for to realize the synchronizing function that the page is irrelevant, described method comprises:
Main control end establishment iframe quotes first page on the described main control end;
Described main control end is carried out initialization to described first page;
Controlled end carries out initialization to second page on the described controlled end;
Described controlled end and server connect;
Described main control end is packaged into the operation on described first page message and described message is sent to described server;
The connection that described server passes through to set up sends to described controlled end with the message that receives; And described controlled termination is received described message also according to the message execution respective logic that receives, so that described second page and described first page are synchronous.
2. method according to claim 1, wherein, described main control end is carried out initialization to described first page and is further comprised:
Node in described first page is numbered by structure, and described numbering has comprised the structural information that makes progress of node; And described node is carried out event detection register with monitoring.
3. method according to claim 2 further comprises:
If event type is hyperlink, then carry out the hyperlink logical process in order to make it redirect in current window.
4. method according to claim 1, wherein, described controlled end carries out initialization to second page on it and further comprises:
Node in described second page is numbered by structure, and described numbering has comprised the structural information that makes progress of node; And described node is carried out event detection register with monitoring.
5. method according to claim 4 further comprises:
If event type is hyperlink, then carries out the hyperlink logical process in order to make it and open the redirect link at new tab label.
6. method according to claim 1 wherein, describedly sends to described server with described message and further comprises via the agency described message is sent to described server.
7. method according to claim 1 wherein, describedly sends to described controlled end with the message that receives and further comprises via the agency message that receives is sent to described controlled end.
8. system that be used for to realize the synchronizing function that the page is irrelevant, described system comprises:
Server;
Main control end, described main control end are configured to create iframe and quote first page on the described main control end, described first page is carried out initialization, and the operation on described first page is packaged into message and described message is sent to described server;
Controlled end, described controlled end is configured to second page on the described controlled end is carried out initialization, connect with described server, the connection of passing through to set up receives described message from described server, and carry out respective logic according to the message that receives, so that described second page and described first page are synchronous.
9. system according to claim 8, wherein, described main control end further is configured to:
Node in described first page is numbered by structure, and described numbering has comprised the structural information that makes progress of node; And described node is carried out event detection register with monitoring.
10. system according to claim 9, wherein, described main control end further is configured to:
If event type is hyperlink, then carry out the hyperlink logical process in order to make it redirect in current window.
11. system according to claim 8, wherein, described controlled end further is configured to:
Node in described second page is numbered by structure, and described numbering has comprised the structural information that makes progress of node; And described node is carried out event detection register with monitoring.
12. system according to claim 11, wherein, described controlled end further is configured to:
If event type is hyperlink, then carries out the hyperlink logical process in order to make it and open the redirect link at new tab label.
13. system according to claim 8, wherein, described main control end further is configured to via the agency described message be sent to described server.
14. system according to claim 8, wherein, described controlled end comprises that further the connection of passing through to set up via the agency receives described message from described server.
CN201310082309.5A 2013-03-14 2013-03-14 For realizing the method and system of the unrelated synchronizing function of the page Active CN103207895B (en)

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 true CN103207895A (en) 2013-07-17
CN103207895B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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

Cited By (3)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
CN103207895B (en) 2016-12-28

Similar Documents

Publication Publication Date Title
CN104378304B (en) The control method of gray scale publication, apparatus and system
US9774697B2 (en) Method, apparatus, and system for pushing notification
CN106464746A (en) Computer system to support failover in event stream processing system
CN101179435B (en) Method of active push network management event and network management system
CN104426925B (en) Web page resources acquisition methods and device
CN103544303B (en) A kind of method of data synchronization, system and equipment
CN104301161B (en) Computational methods, computing device and the communication system of quality of service index
WO2014166265A1 (en) Method, terminal, cache server and system for updating webpage data
CN102510405A (en) Screen sharing method and system
CN107911466A (en) A kind of association method under multi-layer framework
CN103034722A (en) Network video comment gathering device and network video comment gathering method
CN106411629A (en) Method used for monitoring state of CDN node and equipment thereof
CN103207895A (en) Method and system for achieving page irrelevant synchronizing function
CN111669438A (en) Live broadcast message transmission method and device, electronic equipment and medium
CN107766509A (en) A kind of method and apparatus of webpage static backup
CN105893508A (en) Method, device and system for determining access sequence of native page and H5 page
CN104834698A (en) Information pushing method and device
CN101227265B (en) Method for data synchronization among client ends in equipment monitoring system
CN106549967A (en) A kind of IEC104 stipulations analysis system and methods based on event-driven mechanism
CN102915251A (en) Method and device for processing message by multi-page browser
CN104661089A (en) Terminal desktop display method, terminal desktop display device and terminal
US20150302190A1 (en) Method for dynamically adjusting program login interface, and internet terminal
CN106302028A (en) Flux monitoring method and device
CN109446460A (en) A kind of HTML5 Online Video Redirectional system and its implementation
US10684875B2 (en) Synchronization of a virtual machine across mobile devices

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