CN101291273A - Method, system for communication among webpage, and application in music searching - Google Patents

Method, system for communication among webpage, and application in music searching Download PDF

Info

Publication number
CN101291273A
CN101291273A CNA2008101148373A CN200810114837A CN101291273A CN 101291273 A CN101291273 A CN 101291273A CN A2008101148373 A CNA2008101148373 A CN A2008101148373A CN 200810114837 A CN200810114837 A CN 200810114837A CN 101291273 A CN101291273 A CN 101291273A
Authority
CN
China
Prior art keywords
client
request
webpage
answer
operation requests
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
CNA2008101148373A
Other languages
Chinese (zh)
Other versions
CN101291273B (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.)
NET EASE YOUDAO INFORMATION TECHNOLOGY (BEIJING) Co Ltd
Original Assignee
NET EASE YOUDAO INFORMATION TECHNOLOGY (BEIJING) 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 NET EASE YOUDAO INFORMATION TECHNOLOGY (BEIJING) Co Ltd filed Critical NET EASE YOUDAO INFORMATION TECHNOLOGY (BEIJING) Co Ltd
Priority to CN2008101148373A priority Critical patent/CN101291273B/en
Publication of CN101291273A publication Critical patent/CN101291273A/en
Application granted granted Critical
Publication of CN101291273B publication Critical patent/CN101291273B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a system for communication between web pages and application of the method and the system in music search. The invention is to solve the problems of interruption of play of the current page, bandwidth waste and untimely response of the prior means adopted of refreshing the pages or polling a server. The method comprises the following steps that: a web page A of a client sends out an operation request and then waits for reply of the server; when the server receives a trigger request sent out by another web page B of the client, the reply of the operation request of the corresponding web page A is returned to the client; and the client performs corresponding operation on the web page A according to the reply. As for the client, the method does not need polling the server and only needs connection for once, thereby the bandwidth and server resources are greatly saved. Simultaneously, when the server obtains another trigger request, the server can reply to the client, thereby the real-time communication ability is guaranteed to the maximum degree and simultaneously refreshing of the pages is avoided. Moreover, the method and the system are also suitable for communication between two unrelated web pages.

Description

A kind of method of communication among webpage, system and the application in music searching
Technical field
The present invention relates to networking technology area, particularly relate to a kind of method, system and the application in music searching of communication among webpage.
Background technology
Usually, user's internet behavior all is based on client-browser model, and promptly client browser sends request, and the Website server described request that makes an immediate response is made answer.For example, when the user passes through Web (WorldWide Web, the World Wide Web (WWW)) Ban BBS (Bulletin Board System, when BBS (Bulletin Board System)) posting son, the user submits to server to the literal of writing, server returns a new page after receiving, and this page has comprised user's model, just illustrates that user's model has been delivered success.
Based on this communication pattern, a kind of network application is an online tin of song: the user listens song (claiming that this webpage is a music box) on a webpage, then at another webpage, suppose it is the result of page searching of song, clicked the interpolation button, wish new song of adding can immediate response on the music box page.At this moment, relate to two communication issues between webpage.
At above-mentioned application, following two kinds of processing methods are arranged:
A kind of method is, if these two pages have relation, promptly browser allows to communicate by letter between them, and then the music box page need refresh, the song of newly adding could be updated on the music box page.But current music of listening will be interrupted under this mode, can bring bad experience to the user.
Another kind method is, the music box page (being client) can be with Javascript (being a kind of script that is come by the LiveScript development of Netscape) the regular access server of program, and whether check has new song to be added.Visit regularly can be 5s once, 3s once, perhaps ceaselessly visit.But this mode is the waste bandwidth resource very, and real-time is very poor.
In sum, present method usually adopts the mode that refreshes the page or polling server, has the problems such as current page broadcast, waste bandwidth, response be untimely that interrupt.
Summary of the invention
Technical problem to be solved by this invention provides a kind of method, system and application in music searching of communication among webpage, to solve the existing mode that refreshes the page or polling server that adopts, there be current page broadcast, waste bandwidth, the untimely problem of response of interrupting.
For solving the problems of the technologies described above,, the invention discloses following according to specific embodiment provided by the invention
Technical scheme:
A kind of method of communication among webpage comprises:
After a webpage A of client sends operation requests, wait for the service end answer;
After service end is received the trigger request that another webpage B of this client sends, the answer of corresponding webpage A operation requests is returned to this client;
This client is carried out corresponding operating according to described answer to webpage A.
Preferably, described method also comprises: client identification and request mark subsidiary when described webpage A is sent operation requests are preserved.
Preferably, the answer of corresponding webpage A operation requests is returned to this client specifically comprise: the subsidiary client identification of trigger request that webpage B is sent, mate with the client identification of described preservation; When the match is successful, obtain the operation requests of webpage A according to the request mark that is complementary, will return to this client to answer that should operation requests then.
Wherein, after the webpage A of described client is opened, send operation requests automatically.
Wherein, receive the answer of service end when this client after, webpage A continues to service end transmit operation request.
Wherein, when described operation requests is when obtaining the request of song information that the user adds, this client is carried out corresponding operating according to described answer to webpage A and specifically comprised: this client is by the page script program, and the song information that the user is added dynamically updates webpage A.
A kind of system of communication among webpage comprises: client and service end, wherein,
Described client comprises the operation requests unit, and a webpage A who is used for this client sends operation requests to service end; The operation trigger element, another webpage B that is used for this client sends trigger request to service end; Operating unit is used for carrying out corresponding operating according to the answer of service end;
Described service end is used for after receiving the operation requests of client, waits for receiving the trigger request that this client sends; After receiving trigger request, will return to this client to answer that should operation requests.
Preferably, described service end further comprises: memory cell, subsidiary client identification and request mark when being used to preserve client terminal web page A and sending operation requests; Search the unit, be used for the subsidiary client identification of trigger request that client terminal web page B is sent, mate with the client identification of described preservation; When the match is successful, service end obtained the operation requests of client terminal web page A according to the request mark that is complementary, will return to this client to answer that should operation requests then.
Wherein, described memory cell is database or internal memory.
Preferably, described service end is provided with two ports, is respectively applied for to receive operation requests and the trigger request that client sends.
A kind of communication among webpage method that is applied to music searching comprises:
The music page sends the request of obtaining song information that the user adds, and waiting for server is answered then;
Click the interpolation button of music searching results page as the user after, this page sends the request of adding song to described server;
Described server returns to the described music page with the song information that the user added as answer after receiving the request of adding song;
The music page upgrades the page according to described answer.
Preferably, described method also comprises: after server was received the request that the music page sends, client identification and request mark that this request is subsidiary were preserved.
Preferably, server returns to the described music page with the song information that the user added as answer and specifically comprises: server will add the subsidiary client identification of request of song, mate with the client identification of described preservation; When the match is successful, the request according to the request mark that is complementary obtains obtaining song information that the user adds returned to the described music page with the song information that the user added as answer then.
According to specific embodiment provided by the invention, the present invention has following technique effect:
At first, the present invention changes conventional thought, proposes a kind of new communication among webpage pattern, that is: client webpage A sends operation requests (obtaining the request of the song information that the user adds as hope), service end receives request and pretends to handle, and allows client wait for always; After receiving the trigger request that another webpage B of this client sends, service end (adds button), just the answer of corresponding webpage A operation requests is returned to waiting client as clicking.
Like this,, do not need polling server, only need once to connect to get final product, thereby greatly saved bandwidth and server resource for client.Simultaneously,, just can make answer, guarantee the real time communication ability to the full extent, avoid refreshing of the page simultaneously this client when server obtains another trigger request.
Secondly, new communication pattern of the present invention not only can solve the communication issue between related two webpages, also is applicable to two communications between irrelevant webpage.For example, result of page searching is newly opened, with the music box page without any relation, in this case, add button if the user clicks at described result of page searching, the then described music box page can add new song equally automatically, and can not interrupt the music of listening.
Description of drawings
Fig. 1 is the method flow diagram of the embodiment of the invention one described communication among webpage;
Fig. 2 is the method flow diagram of the embodiment of the invention two described communication among webpage;
Fig. 3 is the schematic diagram of the embodiment of the invention two described communication among webpage;
Fig. 4 is the system construction drawing of the described a kind of communication among webpage of the embodiment of the invention.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
At the communication issue between two webpages, the present invention changes conventional thought, proposes a kind of new communication among webpage pattern, referring to the explanation of embodiment one.
Embodiment one:
With reference to Fig. 1, be the method flow diagram of the embodiment of the invention one described communication among webpage.
S101 after a webpage A of client sends operation requests, waits for the service end answer;
S102, service end receives described operation requests and pretends to handle, and allows client wait for always;
S103, another webpage B of this client sends trigger request to service end;
S104 after service end is received the trigger request of this client, returns to waiting client with the answer of corresponding webpage A operation requests;
S105, this client is carried out corresponding operating according to described answer to webpage A.
Above-mentioned flow process has realized the real time communication between webpage A and the webpage B, pattern difference with traditional " client-requested; service end is replied immediately ", after service end is received the operation requests of client among the present invention, do not reply immediately, but the trigger request of wait client, after client was sent trigger request, service end was just really returned answer.
Describe in detail below in conjunction with practical application.
Embodiment two:
With reference to Fig. 2, be the method flow diagram of the embodiment of the invention two described communication among webpage.Be example with online tin of song still, the user logins the website of an online tin of song on certain client, open the song search results page of this website, show list of songs on the page, after the song that the user selects to listen, open a new broadcast page, this is play the page and is called music box.
S201, music box can send one from the trend Website server and show that own hope obtains the request of the song information that the user adds when being opened first.
Described request is aforesaid operation requests, and this request has attached client id and request ID.Wherein, client id is used for client of unique identification, can be registered user's number of the account, also can be an interim ID who generates.
Preferably, can be with the cookie of this client as client id, for example the user logins 1 63 passes, and when clicking other channels of Netease, server end always can know automatically whom the user is, and is also passable even the user reopens browser then.
Described request ID is used for client-requested of unique identification, be that operating system is that each socket (is also referred to as " socket " usually, be used to describe IP address and port) integer providing, be addressable this socket and this request done any operation by this integer.
After S202, Website server receive the request that this client sends, described client id and request ID are preserved (can adopt database to preserve or memory), represent that this request is temporary transient not handle.Then, server continues to wait for that the user adds request.Simultaneously for music box, also always at AR awaiting reply.
S203, when the user result of page searching select new song and click add button after, this result of page searching sends the request of adding song from the trend Website server.The request of described interpolation song is aforesaid trigger request, equally also subsidiary client id of this request and request ID.
After S204, Website server received the request of described interpolation song, the client id that this request is subsidiary and the client id of preservation were mated, and search whether identical client id is arranged.
S205, when the match is successful, just can obtain corresponding request (this request is the request that music box obtains the song information that the user adds) according to the request ID that is complementary (i.e. the request ID of Bao Cuning), and the song that the user added is returned to waiting client as answer.
If coupling is unsuccessful, server just can ask not do any processing to this interpolation, because this illustrates that this music box also do not open (just opened and should send request, client id just can exist).
S206 after the information that this client is newly sung, can upgrade the page dynamically with javascript, and not need to interrupt in progress song.
After music box receives a reply and dynamically updates the page, also can send the request of obtaining song that the user adds automatically, continue AR awaiting reply then, promptly repeat above flow process.Hence one can see that, and the life cycle of whole music box window all can be sent this request, in case after receiving a reply, just handle this answer, sends out request again after handling, and circulate is closed up to music box always.
Above-mentioned flow process can also be with reference to schematic diagram shown in Figure 3.In the time 1, client sends request to service end, waits for then; In the time 2, client is added new song, triggers server; In the time 3, service end is returned the answer result to client.
By Fig. 2 and example shown in Figure 3 as can be known,, do not need polling server, only need once to connect to get final product, thereby greatly saved bandwidth and server resource for client.Simultaneously, when server obtains another interpolation request, just can make answer, guarantee the real time communication ability to the full extent, avoid refreshing of the page simultaneously this client.
New communication among webpage pattern of the present invention not only can solve the communication issue between related two webpages, also is applicable to two communications between irrelevant webpage.Have relation to be meant that browser allows to communicate by letter between them between webpage, and two irrelevant web browsers just do not allow them to visit mutually, this relation between webpage is the consideration for safety factor.Give an example: if the in-company website A of browsing, and the while has been opened another website B, if browser allows these two pages to visit mutually, for example one section javascript code on the webpage B can accessed web page A, and the confidential information of company will be revealed so.So this is limited, require these two independently window can not visit mutually, promptly it doesn't matter for the webpage of the webpage of website A and website B.
But, can not visit sometimes also inconvenient especially mutually.For example the window B of voting results can be ejected in a ballot website, when the user after window A ballot, window B will refresh automatically and shows up-to-date voting results.If can not allow these two windows visit mutually, this thing just can't realize.Therefore, need set up the relation of these two windows, allow them to visit mutually, could realize refreshing automatically of voting results.
Usually, if window A produces (for example the user has order a link at window B and ejected window A) by window B, these two windows are exactly related so, and they can visit mutually.Since A is ejected by B, B just obviously believes A so, so just there is not safety issue.Online tin of above-mentioned song example, music box is produced by result of page searching, and these two pages are related.
But, if it doesn't matter for two pages, promptly can not visit mutually, utilize new communication pattern of the present invention, also can realize the communication between webpage.Because between two webpages that the method for the invention in whole realization flow, does not need to consider to communicate by letter whether relation is arranged.Therefore, though result of page searching newly open, with the music box page without any relation, in this case, add button if the user clicks at described result of page searching, the described music box page can add new song equally automatically, and can not interrupt the music of listening.
At said method, the present invention also provides a kind of system embodiment of communication among webpage.With reference to Fig. 4, be the system construction drawing of described a kind of communication among webpage.Described system mainly comprises client U41 and service end U42.
Described client U41 comprises operation requests unit U411, and a webpage A who is used for this client sends operation requests to service end U42; Operation trigger element U412, another webpage B that is used for this client sends trigger request to service end U42; Operating unit U413 is used for carrying out corresponding operating according to the answer of service end U42.
Described service end U42 is used for after the operation requests of receiving client U41, waits for receiving the trigger request that this client U41 sends; After receiving trigger request, will return to this client U41 to answer that should operation requests.
Preferably, described service end U42 further comprises memory cell U421, subsidiary client identification and request mark when being used to preserve client terminal web page A and sending operation requests; Search unit U422, be used for the subsidiary client identification of trigger request that client terminal web page B is sent, mate with the client identification of described preservation; When the match is successful, service end U42 obtained the operation requests of client terminal web page A according to the request mark that is complementary, will return to this client U41 to answer that should operation requests then.
Preferably, described memory cell U421 can be database, also can be internal memory, and the present invention does not limit at this.
Preferably, service end U42 is provided with two ports and receives operation requests and trigger request respectively for distinguishing operation requests and the trigger request that client U41 sends.
With online tin of song is example, and client terminal web page A is music box, and client terminal web page B is result of page searching.When music box was opened, U411 sent the request of obtaining song information that the user adds automatically by the operation requests unit, and subsidiary simultaneously client id and request ID are sent over together, then AR awaiting reply; Service end U42 is saved in memory cell U421 with described client id and request ID, waits the request of song to be added then; When the user clicked the interpolation button of result of page searching, the operation trigger element U412 of client sent to service end U42 with the request of described interpolation song, subsidiary simultaneously client id; Service end U42 is by searching unit U422, mate adding the subsidiary client id of request and the client id of preservation, when the match is successful, service end U42 returns to this client U41 with the song information that the user added as answer then according to the request that the request ID that is complementary obtains obtaining song information that the user adds; Client U41 receives a reply, and by operating unit U413 the song of newly adding is dynamically updated on the music box, and can not interrupt in progress song.
The part that does not describe in detail in the system shown in Figure 4 can be considered for length referring to the relevant portion of Fig. 1, Fig. 2 and method shown in Figure 3, is not described in detail in this.
More than to the method for a kind of communication among webpage provided by the present invention, system and the application in music searching, be described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, part in specific embodiments and applications all can change.In sum, this description should not be construed as limitation of the present invention.

Claims (13)

1, a kind of method of communication among webpage is characterized in that, comprising:
After a webpage A of client sends operation requests, wait for the service end answer;
After service end is received the trigger request that another webpage B of this client sends, the answer of corresponding webpage A operation requests is returned to this client;
This client is carried out corresponding operating according to described answer to webpage A.
2, method according to claim 1 is characterized in that, also comprises:
Client identification and request mark subsidiary when described webpage A is sent operation requests are preserved.
3, method according to claim 2 is characterized in that, the answer of corresponding webpage A operation requests is returned to this client specifically comprise:
The client identification that the trigger request that webpage B is sent is subsidiary mates with the client identification of described preservation;
When the match is successful, obtain the operation requests of webpage A according to the request mark that is complementary, will return to this client to answer that should operation requests then.
4, method according to claim 1 is characterized in that: after the webpage A of described client is opened, send operation requests automatically.
5, method according to claim 1 is characterized in that: receive the answer of service end when this client after, webpage A continues to service end transmit operation request.
6, method according to claim 1 is characterized in that, when described operation requests is when obtaining the request of song information that the user adds, this client is carried out corresponding operating according to described answer to webpage A and specifically comprised:
This client is by the page script program, and the song information that the user is added dynamically updates webpage A.
7, a kind of system of communication among webpage is characterized in that, comprising: client and service end, wherein,
Described client comprises the operation requests unit, and a webpage A who is used for this client sends operation requests to service end; The operation trigger element, another webpage B that is used for this client sends trigger request to service end; Operating unit is used for carrying out corresponding operating according to the answer of service end;
Described service end is used for after receiving the operation requests of client, waits for receiving the trigger request that this client sends; After receiving trigger request, will return to this client to answer that should operation requests.
8, system according to claim 7 is characterized in that, described service end further comprises:
Memory cell, subsidiary client identification and request mark when being used to preserve client terminal web page A and sending operation requests;
Search the unit, be used for the subsidiary client identification of trigger request that client terminal web page B is sent, mate with the client identification of described preservation;
When the match is successful, service end obtained the operation requests of client terminal web page A according to the request mark that is complementary, will return to this client to answer that should operation requests then.
9, system according to claim 8 is characterized in that: described memory cell is database or internal memory.
10, system according to claim 7 is characterized in that: described service end is provided with two ports, is respectively applied for to receive operation requests and the trigger request that client sends.
11, a kind of communication among webpage method that is applied to music searching is characterized in that, comprising:
The music page sends the request of obtaining song information that the user adds, and waiting for server is answered then;
Click the interpolation button of music searching results page as the user after, this page sends the request of adding song to described server;
Described server returns to the described music page with the song information that the user added as answer after receiving the request of adding song;
The music page upgrades the page according to described answer.
12, method according to claim 11 is characterized in that, also comprises:
After server was received the request that the music page sends, client identification and request mark that this request is subsidiary were preserved.
13, method according to claim 12 is characterized in that, server returns to the described music page with the song information that the user added as answer and specifically comprises:
Server will add the subsidiary client identification of request of song, mate with the client identification of described preservation;
When the match is successful, the request according to the request mark that is complementary obtains obtaining song information that the user adds returned to the described music page with the song information that the user added as answer then.
CN2008101148373A 2008-06-12 2008-06-12 Method, system for communication among webpage, and application in music searching Active CN101291273B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008101148373A CN101291273B (en) 2008-06-12 2008-06-12 Method, system for communication among webpage, and application in music searching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008101148373A CN101291273B (en) 2008-06-12 2008-06-12 Method, system for communication among webpage, and application in music searching

Publications (2)

Publication Number Publication Date
CN101291273A true CN101291273A (en) 2008-10-22
CN101291273B CN101291273B (en) 2011-04-06

Family

ID=40035363

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101148373A Active CN101291273B (en) 2008-06-12 2008-06-12 Method, system for communication among webpage, and application in music searching

Country Status (1)

Country Link
CN (1) CN101291273B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708930A (en) * 2016-11-17 2017-05-24 北京小米移动软件有限公司 Application page refreshing method and application page refreshing device
CN110971669A (en) * 2019-11-11 2020-04-07 北京达佳互联信息技术有限公司 Message notification method, device, server, electronic equipment and readable storage medium
CN113726893A (en) * 2021-08-31 2021-11-30 广州艾美网络科技有限公司 Method and device for updating song library, KTV box, song server and network KTV system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100541494C (en) * 2007-10-12 2009-09-16 唐丽霞 The double window mouth electronic chart service system and the method for band magnifier window on the internet

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708930A (en) * 2016-11-17 2017-05-24 北京小米移动软件有限公司 Application page refreshing method and application page refreshing device
CN110971669A (en) * 2019-11-11 2020-04-07 北京达佳互联信息技术有限公司 Message notification method, device, server, electronic equipment and readable storage medium
CN110971669B (en) * 2019-11-11 2022-03-01 北京达佳互联信息技术有限公司 Message notification method, device, server, electronic equipment and readable storage medium
CN113726893A (en) * 2021-08-31 2021-11-30 广州艾美网络科技有限公司 Method and device for updating song library, KTV box, song server and network KTV system
CN113726893B (en) * 2021-08-31 2024-01-09 广州艾美网络科技有限公司 Method and device for updating music library, KTV box, song server and network KTV system

Also Published As

Publication number Publication date
CN101291273B (en) 2011-04-06

Similar Documents

Publication Publication Date Title
US7013303B2 (en) System and method for multiple data sources to plug into a standardized interface for distributed deep search
US6950821B2 (en) System and method for resolving distributed network search queries to information providers
US7099871B2 (en) System and method for distributed real-time search
US6961723B2 (en) System and method for determining relevancy of query responses in a distributed network search mechanism
US6934702B2 (en) Method and system of routing messages in a distributed search network
US7171415B2 (en) Distributed information discovery through searching selected registered information providers
CN100462977C (en) Capture server, distribution server, method and system for generating webpage capture
CN102932352B (en) The method that communicates and server is carried out with client
CN106651470A (en) Directed advertisement promotion system based on user behavior prediction analysis
CN101355587B (en) Method and apparatus for obtaining URL information as well as method and system for implementing searching engine
CN104125208A (en) Data transmission method and data transmission device
CN102904903B (en) Communication system and communication means
CN102402519A (en) Search method, search result display method, search server and client
CN101188625A (en) A method and system for realizing information content subscription
CN102413151A (en) Network resource sharing method and system
CN108932238A (en) A kind of cross-domain communication method and device
CN105897888A (en) Client connection method and system
CN101291273B (en) Method, system for communication among webpage, and application in music searching
CN206452410U (en) A kind of house ornamentation user buying behavior analysis system
CN102867056A (en) Method and system for searching keyword
CN102647463B (en) The generation method of Web side navigation, wireless router terminal and system
CN110245307A (en) Page cache management method and system, terminal device and storage medium
CN102707967A (en) Method, equipment and system for running third-party application program
CN102918527B (en) Investigation method and system for web application hosting
CN103473376A (en) Data processing method and client ends

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