Client transmits the method and system of data with page end
Technical field
The present invention relates to the communications field, particularly relate to a kind of method of client and page end transmission data and be
System.
Background technology
Web game has the most constantly developed since releasing in groping, and various new techniques the most constantly incorporate.Especially
It is the realization of client and the data interchange technology of page end, makes network game industry scintillating.This interworking technology is beaten
Broken the exploitation of conventional web game and only carried out, at page end, the fixed pattern played so that web game no matter from technology,
There is the lifting of matter in the fine arts, game quality, overcome the restriction of current browser technology to greatest extent.
Client is embodied on the client data interchange with webpage with the data syn-chronization of page end so that pass through
Carry out intercommunication between user and the user logged in by client that Web page logs in, reached whether at net
Page end or client carries out obtained data of playing, can retain to other end.Current visitor
The technology of family end and web data intercommunication is mainly by the data center of server device, by client or webpage
Data are transmitted to what opposite end realized, concrete, and when client sends data to page end, client first will
Data send this data center, and are sent the data to page end by this data center;Same, work as net
Page end is when client sends data, and page end first sends the data to this data center, then by these data
The heart sends the data to client.
During stating the data syn-chronization of client and page end in realization, inventor finds in prior art
At least there are the following problems: client to be realized is mutual with page end data, it is necessary to will by data center
Data forward and could realize so that client and page end need to use substantial amounts of bandwidth alternately, and
And, when user is more, need the friendship increasing more server to support client and page end data
Mutually so that realize client and compare high with the cost of page end transmission data, and communication burden is heavier.
Summary of the invention
Embodiments of the invention provide the method and system of a kind of client and page end transmission data, reduce
Client and page end transmit cost and the communication burden of data.
For reaching above-mentioned purpose, embodiments of the invention adopt the following technical scheme that
A kind of method that client transmits data with page end, including:
Page end receives data, performs the event that described data are corresponding, and call that client provides with described
The first interface that page end carries out data transmission, sends described data to described client;
Described client, after knowing that described page end calls described first interface, receives described data, and right
Described data process, and perform the event that described data are corresponding.
A kind of client transmits the system of data with page end, including: page end and client;
Described page end, is used for receiving data, performs the event that described data are corresponding, and calls described client
The first interface carried out data transmission with described page end that end provides, sends described data to described client;
Described client, for after knowing that described page end calls described first interface, receives described data,
And described data are processed, perform the event that described data are corresponding.
The client that the embodiment of the present invention provides transmits the method and system of data with page end, with prior art
In forward data could realize data between the two by data center to transmit and compare, it can be at page end
After receiving data, by the first interface general carried out data transmission with described page end provided by client
These data are sent to client so that the data that page end sends to client need not move through data center
Forward and directly transmit so that client reduces with the mutual required bandwidth of page end, and then works as user
Time relatively more, it is not necessary to increase more server to support the mutual of client and page end data, thus
Reduce client and the cost of page end transmission data and communication burden.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to enforcement
In example or description of the prior art, the required accompanying drawing used is briefly described, it should be apparent that, describe below
In accompanying drawing be only some embodiments of the present invention, for those of ordinary skill in the art, do not paying
On the premise of going out creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the method flow diagram that in the embodiment of the present invention 1, a kind of client and page end transmit data;
Fig. 2 is that in the embodiment of the present invention 1, client shows the effect receiving the corresponding event of data with page end simultaneously
Fruit figure;
Fig. 3 is the method flow diagram that in the embodiment of the present invention 1, another kind of client and page end transmit data;
Fig. 4 is the method flow diagram that in the embodiment of the present invention 1, another kind of client and page end transmit data;
Fig. 5 is that in the embodiment of the present invention 1, client stops with page end performing to receive the corresponding event of data simultaneously
Design sketch;
Fig. 6 is the block diagram of system that in the embodiment of the present invention 2, client and page end transmit data.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clearly
Chu, be fully described by, it is clear that described embodiment be only a part of embodiment of the present invention rather than
Whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creation
The every other embodiment obtained under property work premise, broadly falls into the scope of protection of the invention.
Embodiment 1
The embodiment of the present invention provides a kind of method of client and page end transmission data, as it is shown in figure 1, should
Method includes:
101, page end receives data, performs the event that described data are corresponding, and call that client provides with
The first interface that described page end carries out data transmission, sends described data to described client.
Wherein, the first interface carried out data transmission with page end that described client provides can be that physics connects
Mouthful, it is also possible to for software interface, this is not limited by the concrete embodiment of the present invention, as long as it can be real
The interface of the data transmission of existing page end and client, broadly falls into the scope of embodiment of the present invention protection.When it
During for software interface, such as, when described client Web exploitation script be JS (JavaScript,
It is a kind of based on object and event-driven and the client-side scripting language with relative safety.Also it is simultaneously
A kind of be widely used in client Web exploitation script) time, described in call first interface for amendment client
The location attribute of end;When the script of client Web exploitation is other language, it can be tool
Having the attribute of corresponding function, this is not limited by the embodiment of the present invention.
102, described client is after knowing that described page end calls described first interface, receives described data,
And described data are processed, perform the event that described data are corresponding.
Method based on above-mentioned client with page end transmission data, to the experience of user be: page end and visitor
Family end shows the event that reception data are corresponding simultaneously.Such as, as in figure 2 it is shown, when QQ user receives message,
Page end and client all can be simultaneously emitted by prompting message.Wherein, receive good friend's "~evil beautiful " as user
When sending the message come, the icon of "~evil beautiful " in prompting message 1 i.e. my good friend and prompting message 2
The i.e. information alert icon on my good friend left side, an and prompting message 3 i.e. (left side of Fig. 2, client task hurdle
Leftover bits and pieces circle is schemed) in application program, all can be simultaneously emitted by prompting message.Wherein, in my good friend
The prompting message of the icon of "~evil beautiful " and the information alert icon on my good friend left side is disappearing of page end
Breath is reminded, and the prompting message in client task hurdle is the prompting message of client.
After page end is carried out, with client, the event that described data are corresponding, user both can be at page end pair
Described event carries out response operation, it is also possible in client, described event is carried out response and operates, concrete basis
This is not limited by inventive embodiments;No matter but at which end, described event is carried out response and operate, the other end
This response operation will be performed.Concrete,
When client receives the response to reception data correspondence event, the embodiment of the present invention also provides for as follows
The method that client transmits data with page end, as it is shown on figure 3, the method includes:
201, described client is after receiving the response to described event, terminates the execution of described event, and
Call the second interface carried out data transmission with described client that described page end provides, to described page end
Send the response of described event.
It should be noted that when, after the event that data described in client executing are corresponding, this event being shown to
User, after user sees this event, can carry out a response, i.e. have a client to this event this event
The operation of end, client, after receiving the response to described event, can terminate the execution of this event;And
So that page end knows client user's response to this event, also terminate the execution of this event of page end,
Client can call the second interface carried out data transmission with described client that described page end provides, to institute
State page end and send the response of described event.
202, after described page end receives the response of described event, terminate performing described event.
When page end receives the response to reception data correspondence event, the embodiment of the present invention also provides for as follows
The method that client transmits data with page end, as shown in Figure 4, the method includes:
301, described page end is after receiving the response to described event, terminates the execution of described event, and
Sent the response of described event to described client by described first interface.
302, after described client receives the response of described event, terminate performing described event.
Methods based on above-mentioned client and page end transmission data, to the experience of user be: when page end with
After client shows simultaneously and receives event corresponding to data, and though user page end or in client to institute
The event of stating carries out response operation, and the other end also can perform this response operation.Such as, as it is shown in figure 5, work as QQ
User receives after message, page end and client all can be simultaneously emitted by prompting message;User clicks in client
This prompting message 3, the prompting message of client disappears, and the prompting message 1 and 2 of page end also disappears simultaneously,
And all return to receive good friend and do not send the state before message.
The embodiment of the present invention, with prior art forward data could realize between the two by data center
Data transmission is compared, and it can be after page end receives data, by that provide by client with described net
The first interface that page end carries out data transmission sends the data to client so that page end is sent out to client
The data sent need not move through the forwarding of data center and directly transmit so that client is mutual with page end
Required bandwidth reduces, and then when user is more, it is not necessary to increase more server to support visitor
Family end is mutual with page end data, thus reduces client and the cost of page end transmission data and communication
Burden.
Further, in the embodiment of the present invention, when client is to page end transmission data, client can also be led to
The second interface carried out data transmission with described client that crossing page end provides transfers data to page end,
Client is made to need not move through the forwarding of data center to the data that page end sends and directly transmit so that
Client reduces further with the mutual required bandwidth of page end, when user is more, more need not
Increase more server and support the data interaction between client and page end, thus further drop
The cost of low client and page end transmission data and communication burden.
Embodiment 2
The embodiment of the present invention provides the system of a kind of client and page end transmission data, as shown in Figure 6, is somebody's turn to do
System includes: page end 41 and client 42.
Described page end 41, is used for receiving data, performs the event that described data are corresponding, and calls described visitor
The first interface carried out data transmission with described page end 41 that family end 42 provides, to described client 42
Send described data.Wherein, what described client provided is permissible with the first interface that page end carries out data transmission
For physical interface, it is also possible to for software interface, this is not limited by the concrete embodiment of the present invention, as long as
The interface that its data being capable of page end and client are transmitted, broadly falls into the model of embodiment of the present invention protection
Enclose.When it is software interface, such as, the script developed when described client Web is JS
(JavaScript, it is a kind of based on object and event-driven and the client script with relative safety
Language.Also be simultaneously a kind of script being widely used in the exploitation of client Web) time, described in call first
Interface is the location attribute of amendment client;When the script of client Web exploitation is other language
Time, it can be the attribute with corresponding function, and this is not limited by the embodiment of the present invention.
Described client 42, for after knowing that described page end 41 calls described first interface, receives described
Data, and described data are processed, perform the event that described data are corresponding.
Further alternative, after page end is carried out, with client, the event that described data are corresponding, user was both
At page end, described event can be carried out response to operate, it is also possible in client, described event is responded
Operation, this is not limited by the concrete embodiment of the present invention;No matter but described event being rung at any end
Should operate, the other end all can perform this response operation.
When client 42 receives the response to reception data correspondence event, described client 42 is additionally operable to,
After receiving the response to described event, terminate the execution of described event, and call described page end 41 and carry
Second interface carried out data transmission with described client 42 of confession, sends described thing to described page end 41
The response of part;Described page end 41 is additionally operable to, and after receiving the response of described event, terminates performing described thing
Part.
When page end 41 receives the response to reception data correspondence event, described page end 41 is additionally operable to,
After receiving the response to described event, terminate the execution of described event, and by described first interface to
Described client 42 sends the response of described event;Described client 42 is additionally operable to, and receives described event
Response after, terminate perform described event.
It should be noted that the embodiment of the present invention provides client transmit involved by the system of data with page end
And other of client and page end describe, be referred to the associated description in embodiment 1, the present invention is real
Execute example to will not be described in great detail herein.
The embodiment of the present invention, with prior art forward data could realize between the two by data center
Data transmission is compared, and it can be after page end receives data, by that provide by client with described net
The first interface that page end carries out data transmission sends the data to client so that page end is sent out to client
The data sent need not move through the forwarding of data center and directly transmit so that client is mutual with page end
Required bandwidth reduces, and then when user is more, it is not necessary to increase more server to support visitor
Family end is mutual with page end data, thus reduces client and the cost of page end transmission data and communication
Burden.
Further, in the embodiment of the present invention, when client is to page end transmission data, client can also be led to
The second interface carried out data transmission with described client that crossing page end provides transfers data to page end,
Client is made to need not move through the forwarding of data center to the data that page end sends and directly transmit so that
Client reduces further with the mutual required bandwidth of page end, when user is more, more need not
Increase more server and support the data interaction between client and page end, thus further drop
The cost of low client and page end transmission data and communication burden.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive this
Bright can add the mode of required common hardware by software and realize, naturally it is also possible to by hardware, but a lot
In the case of the former is more preferably embodiment.Based on such understanding, technical scheme substantially or
Person says that the part contributing prior art can embody with the form of software product, and this computer is soft
Part product is stored in the storage medium that can read, such as the floppy disk of computer, and hard disk or CD etc., if including
Dry instruction is with so that a computer equipment (can be personal computer, server, or the network equipment
Deng) perform the method described in each embodiment of the present invention.
The above, the only detailed description of the invention of the present invention, but protection scope of the present invention is not limited to
This, any those familiar with the art, in the technical scope that the invention discloses, can readily occur in
Change or replacement, all should contain within protection scope of the present invention.Therefore, protection scope of the present invention should
It is as the criterion with described scope of the claims.