CN100428255C - Method and device for implementing on-line real-time game in terminal - Google Patents

Method and device for implementing on-line real-time game in terminal Download PDF

Info

Publication number
CN100428255C
CN100428255C CNB2006100986270A CN200610098627A CN100428255C CN 100428255 C CN100428255 C CN 100428255C CN B2006100986270 A CNB2006100986270 A CN B2006100986270A CN 200610098627 A CN200610098627 A CN 200610098627A CN 100428255 C CN100428255 C CN 100428255C
Authority
CN
China
Prior art keywords
recreation
order
calling terminal
terminal
called 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
Application number
CNB2006100986270A
Other languages
Chinese (zh)
Other versions
CN1877592A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2006100986270A priority Critical patent/CN100428255C/en
Publication of CN1877592A publication Critical patent/CN1877592A/en
Application granted granted Critical
Publication of CN100428255C publication Critical patent/CN100428255C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention provides a method and a device for playing a real-time on-line game on a terminal, which belongs to the field of data transmission. The present invention overcomes the defect existing in the prior art that the delay time of the data transmission is long. The present invention enables an on-line game to synchronously run on different terminals by a transmission mechanism, a state synchronizing mechanism and an end-to-end game business process which are of high compression, high redundancy and high reliability. The present invention can keep high coincidence, and consequently, the present invention can improve the entertainment experience of game participation terminal users. The present invention can be used as a separate omnibus algorithm module of the terminal and can supply high reliability transmission to an increment game, and a person who designs a game does not need to know the content so as to reduce the development workload of a game developer; thus, the development of software is convenient.

Description

On terminal, realize the method and apparatus of online real-time game
Technical field
The present invention relates to field of data transmission, relate in particular to a kind of method and apparatus of on terminal, realizing online real-time game.
Background technology
Simply can't satisfy the growing amusement demand of consumer based on the recreation of local runtime, the consumer more wishes and can realize interactive game by network connection and server or with other terminal.
The prior art that can realize interactive game at present has three kinds.First kind is that each terminal that participates in recreation is landed game server, carry out the parameter matching of corresponding terminal by each terminal or game server, after coupling is finished, the game server recreation that brings into operation, and the sight of game running is issued to each terminal that participates in recreation, each terminal is by sending the game operation order obtains interactive game to server experience.The shortcoming of this technology is the participation that needs game server, has increased the operating cost of recreation, and the sight of game running need be issued to each terminal that participates in recreation, can produce very big data traffic, and is very big to network bandwidth consumption.Second kind of prior art and first kind of technology type seemingly, unique difference is recreation after participation terminal lands game server, creates recreation by game terminal, invites another particular terminal fellowship recreation then.Though it provides the function of directed other participation terminals of invitation, it has the operating cost height equally, and data traffic is big, the shortcoming that network bandwidth consumption is big.The third prior art is that recreation establishment terminal is finished the recreation establishment in this locality, invites another terminal to participate in recreation.This moment, the role that terminal has been served as server was created in recreation, except running game, also the sight of recreation was distributed to other recreation participation terminal.The shortcoming of this technology is that the response delay of recreation establishment terminal operation is little, and the response delay of recreation participation terminal operation is big, and the possibility that exists operational order to lose, unfairness concerning the recreation both sides like this; Equally also need bigger service bandwidth.
Summary of the invention
In order to overcome the big shortcoming of data transmission delay in the prior art, the object of the present invention is to provide a kind of method and apparatus of on terminal, realizing online real-time game, game on line can be moved on different terminals simultaneously, and the unanimity that keeps height, thereby the recreation experience of raising recreation participation terminal.
The method that realizes online real-time game on terminal provided by the invention specifically may further comprise the steps:
Steps A: calling terminal invites called end to participate in online real-time game;
Step B: the redundant mutually transmission recreation of described both sides order comprises current operational order and historical operation order in the described recreation order;
Step C: either party recovers described current operational order in the recreation order of follow-up reception when not receiving the current game order;
Step D: either party proposes to stop recreation, then game over.
Steps A 1: calling terminal is initiated the request of the online real-time game of startup to called end, comprises the recreation initial parameter that described calling terminal is provided with in the described request;
Steps A 2: after described called end receives described request, move described recreation and send acknowledge message, after described calling terminal receives described acknowledge message, move described recreation to described calling terminal.
Described steps A 2 is specially:
After described called end receives described request, revise the initial parameter of the recreation in the described request according to the media processing capacity of oneself, move described recreation then, and transmission comprises the affirmation message of amended recreation initial parameter to described calling terminal, after described calling terminal receives described acknowledge message, revise the initial parameter unanimity that corresponding initial parameter makes both sides, move described recreation then.
Described both sides send mutually recreation order all order by predefined data layout encapsulation recreation, described predefined data layout contains state synchronized sign indicating number and sequence of data packet number.
Send mutually in the process of recreation order described both sides, described calling terminal is carried out after receiving the recreation order that called end sends immediately, preserve this order and send back to described called end to show affirmation at described calling terminal simultaneously, described called end receives carries out this order after calling terminal is beamed back the order of accepting one's fate really again.
Send mutually in the process of recreation order described both sides, described called end is carried out after receiving the recreation order that calling terminal sends immediately, preserve this order and send back to described calling terminal to show affirmation at described called end simultaneously, described calling terminal receives carries out this order after called end is beamed back the order of accepting one's fate really again.
Sending the recreation order among the described step B specifically may further comprise the steps:
Step B1: a plurality of recreation orders are mapped as binary code successively by fixing rule;
Step B2: a plurality of binary codes after the described mapping are connected into a binary code stream by fixing order;
Step B3: send after converting described binary code stream to byte sequence.
Described step C also comprises the step of state synchronized:
The packet of described calling terminal has received encapsulation that described called end sends recreation order and synchrodata, the state synchronized sign indicating number in the last packet that the state synchronized sign indicating number in the described packet and described calling terminal are received compares,
If the two is identical, then do not initiate the state synchronized request;
If the two numerical value that differs is then analyzed recreation order and synchrodata in the described packet within the scope of setting, carry out state synchronized;
If not above-mentioned two kinds of situations, then abandon described packet.
Described step C also comprises the step of state synchronized:
Described calling terminal judges whether that according to the time interval that sends between the packet for twice the described calling terminal of needs initiates the state synchronized request, if then described calling terminal is initiated the request of state synchronized to called end, after described called end receives described request, carry out state synchronized; The sequence of data packet that will rigidly connect in sequence of data packet number and the last legal data packet that receives in the packet of receiving if not described calling terminal then number compares, if the relation of the two meets the condition of setting, then described calling terminal is not initiated the request of state synchronized, otherwise described calling terminal abandons and rigidly connects the packet of receiving.
The present invention also provides a kind of device of realizing online real-time game on terminal, and described device comprises:
Invite module, be used for calling terminal and invite called end to participate in online real-time game;
Sending module is used for the redundant mutually transmission recreation of described both sides order, comprises current operational order and historical operation order in the described recreation order;
Recover module, be used for either party when not receiving the current game order, in the recreation order of follow-up reception, recover described current operational order;
Stop module, be used for either party and propose to stop recreation, then game over.
Described invitation module specifically comprises:
Request unit is used for calling terminal and initiates the request of the online real-time game of startup to called end, comprises the recreation initial parameter that described calling terminal is provided with in the described request;
The operation unit after being used for described called end and receiving described request, moves described recreation and sends acknowledge message to described calling terminal, after described calling terminal receives described acknowledge message, moves described recreation.
Described operation unit specifically comprises:
The first operation subelement, after being used for described called end and receiving described request, initial parameter according to the recreation in the media processing capacity modification described request of oneself move described recreation then, and transmission comprises the affirmation message of amended recreation initial parameter to described calling terminal;
The second operation subelement after being used for described calling terminal and receiving described acknowledge message, is revised the initial parameter unanimity that corresponding initial parameter makes both sides, moves described recreation then.
Described device also comprises:
Package module is used for described both sides and sends mutually before the recreation order all by predefined data layout encapsulation recreation order, and described predefined data layout contains state synchronized sign indicating number and sequence of data packet number.
Described device also comprises:
First carries out and the affirmation module, be used for sending mutually the process of recreation order described both sides, described calling terminal is carried out after receiving the recreation order that called end sends immediately, preserve this order and send back to described called end to show affirmation at described calling terminal simultaneously, described called end receives carries out this order after calling terminal is beamed back the order of accepting one's fate really again.
Described device also comprises:
Second carries out and the affirmation module, be used for sending mutually the process of recreation order described both sides, described called end is carried out after receiving the recreation order that calling terminal sends immediately, preserve this order and send back to described calling terminal to show affirmation at described called end simultaneously, described calling terminal receives carries out this order after called end is beamed back the order of accepting one's fate really again.
Described sending module specifically comprises:
Map unit is used for a plurality of recreation orders are mapped as binary code successively by fixing rule;
Linkage unit is used for a plurality of binary codes after the described mapping are connected into a binary code stream by fixing order;
Transmitting element sends after being used for converting described binary code stream to byte sequence.
Described sending module also comprises:
First lock unit, the packet that is used for recreation order that received encapsulation that described called end sends of described calling terminal and synchrodata, state synchronized sign indicating number in the last packet that state synchronized sign indicating number in the described packet and described calling terminal are received compares, if the two is identical, then do not initiate the state synchronized request; If the two numerical value that differs is then analyzed recreation order and synchrodata in the described packet within the scope of setting, carry out state synchronized; If not above-mentioned two kinds of situations, then abandon described packet.
Described sending module also comprises:
Second lock unit, be used for described calling terminal and judge whether that according to the time interval that sends between the packet for twice the described calling terminal of needs initiates the state synchronized request, if then described calling terminal is initiated the request of state synchronized to called end, after described called end receives described request, carry out state synchronized; The sequence of data packet that will rigidly connect in sequence of data packet number and the last legal data packet that receives in the packet of receiving if not described calling terminal then number compares, if the relation of the two meets the condition of setting, then described calling terminal is not initiated the request of state synchronized, otherwise described calling terminal abandons and rigidly connects the packet of receiving.
The invention has the beneficial effects as follows and pass through high compression, the reliability transmission of highly redundant mechanism and state synchronized mechanism, and game service flow process end to end can be moved game on line simultaneously on different terminals, and the unanimity that keeps height is for game on line provides better business experience.The present invention can be used as independently omnibus algorithm module of one at terminal, and for the increment recreation provides high reliability transport, and design games person need not to understand the content of this respect, has reduced game developer's development amount, has made things convenient for the exploitation of Games Software.
Description of drawings
Fig. 1 realizes the process flow diagram of the method for online real-time game on terminal for the present invention;
Fig. 2 realizes the process flow diagram of embodiment of the method for online real-time game on terminal for the present invention;
Fig. 3 is the present invention's synoptic diagram that both sides communicate with one another of realizing playing in the method for online real-time game on terminal;
Fig. 4 is the synoptic diagram of calling terminal among the present invention with compression method transmit operation order;
Fig. 5 sends the synoptic diagram of called end operational order to be confirmed for calling terminal compression among the present invention;
Fig. 6 realizes the device synoptic diagram of online real-time game on terminal for the present invention.
Embodiment
Further specify the present invention below in conjunction with drawings and Examples, but not as a limitation of the invention.
Referring to Fig. 1, the present invention realizes that on terminal the method for online real-time game may further comprise the steps:
Step 1: calling terminal invites called end to participate in online real-time game; Called end can be that proximal terminal can be a distance terminal also, when called end is proximal terminal, coexists in the LAN (Local Area Network) as both sides, then need not can carry out Near Field Communication by telecommunications network, thereby realizes the free interaction of recreation;
Step 2: the redundant mutually transmission recreation of calling terminal and called end order comprises current operational order and historical operation order in the recreation order; The historical operation order is meant the operational order that produced before current operational order, can be an operational order, also can be a plurality of operational orders, and its number can specifically be specified when initial parameter is set;
Step 3: either party recovers described current operational order in the recreation order of follow-up reception when not receiving the current game order; Because the operational order before having comprised in the follow-up recreation order that receives, and current operational order took place before the successor operation order, so extract current operational order in can be from follow-up operational order;
Step 4: either party proposes to stop recreation, then game over.
With a specific embodiment said method is described below, referring to Fig. 2, this method specifically may further comprise the steps:
Step 11: calling terminal connects according to user's wish and called end;
Step 12: calling terminal obtains relevant initial parameter from Games Software, and initial parameter can comprise: game developer, game name, game download address, game state data, order effective bit, data transmission frequency, the continuous the number of transmissions of data, end data is confirmed number of times and state synchronized size of data etc. continuously;
The recreation initial parameter both can be provided by the Games Software developer, also can pre-set by terminal software inside, can also adjust (being that the user is provided with by the menu on the interface) according to user's wish;
This example has also increased some new application requirements on the basis of above-mentioned initial parameter, as game format, specifically is exemplified below:
M=data 46666 udp x-huawei-game; // increased format description " x-huawei-game ", show that these medium are a kind of game formats
A=gamedevelope:huawei; The developer of // this recreation
A=gamename:tankwar; The name of // recreation
a=downloadaddress: http://www.huawei.com/cn/game/exe/view.do?f=402&ctype=0
The download address of // recreation
A=gamedate: " 2 "; The status data of // recreation is defined voluntarily by the game developer, and in this example, recreation is closed since second and played
A=validbit:5; The bit number of valid data is used for data compression in the // data
A=framerate:10; // per second sends the number of times of packet
A=sendtimes:12; The redundant transmission number of times that // data send
A=recvacktimes:12; // number of times that end data is confirmed
A=syncpayloadsize:20; The maximum data packet size of // state synchronized data
Calling terminal initiate to start the request of online real-time game to called end, comprises above-mentioned recreation initial parameter in the request, referring to Fig. 3, calling terminal in the SIP signaling on the INVITE method with SDP in, above-mentioned relevant initial parameter has been described;
Step 13: after called end receives the request that calling terminal sends, check the recreation initial parameter in the request,, then link first downloading game software, the recreation of reruning according to the game download address in the parameter if find that terminal inner does not have corresponding game software; Support this Games Software if find terminal, then move this recreation, and send acknowledge message to calling terminal;
Called end also can be revised earlier the recreation initial parameter according to the media processing capacity of oneself, and send out acknowledge message again and give calling terminal, as: under the relatively poor situation of called end recreation surge capability, redundant transmission number of times and data validation number of times all can be revised as 10 times:
a=sendtimes:10;
a=recvacktimes:10;
Comprised amended initial parameter in the affirmation message that this moment, called end sent;
Step 14: after calling terminal receives the affirmation message that called end sends, analyze the SDP that called end carries on 200OK, if the parameter of confirming to support the amended recreation initial parameter of called end then revising local terminal makes both sides' parameter unanimity, and returns the ACK acknowledge message and give called end; Carry out in the process of initial parameter negotiation above-mentioned both sides, also the method that can adopt XML to be described is held consultation, and its effect is the same;
Calling terminal moves this recreation then, and according to predefined data layout encapsulation recreation order;
Described predefined data layout is as shown in the table:
Figure C20061009862700131
Format description in the table is as follows:
Type of data packet: length is 4 bits, 16 kinds of data types of definable altogether, and this example has only defined 10 types, and is specific as follows:
0: terminal shows that at line justification this packet does not have payload, only comprises the content of two bytes;
1: show that this packet only comprises this sort command;
2: show that this packet only comprises opposite end order to be confirmed;
3: show that this packet comprises the order to be confirmed of this sort command and opposite end simultaneously, payload middle front part branch is the content of this sort command, and the rear section is the content of opposite end order to be confirmed;
4: show that this packet comprises step-out indication and complete synchrodata;
5: show that this packet comprises step-out indication and initial synchrodata;
6: show that this packet is synchrodata (middle data segment);
7: show that this packet is synchrodata (an end data section);
8: the synchrodata confirmation of receipt shows that this packet comprises synchrodata is received the order of accepting one's fate really;
9: show that this packet is synchronous successful directive command, promptly to the affirmation of synchronized result.
Wherein data type is inserted packet according to above-mentioned definition and the actual data conditions that sends;
Synchronous code: length is 4 bits, 16 synchronous codes of definable altogether, and synchronous code can be recycled, and is set to 0 when initial, when step-out takes place the recreation both sides, needs starting state synchronous, and synchronous code at this moment should add 1 (mould 16);
Sequence of data packet number: length is 8 bits, 256 sequence numbers of definable altogether, and sequence number can be recycled, and every packet, sequence number add 1 (mould 256);
Payload: the user data in the protocol package, payload size are according to the difference of type of data packet and difference;
Step 15: the redundant mutually transmission recreation of calling terminal and called end order comprises current operational order and historical operation order in the recreation order; Wherein the historical operation order can be one or more, step 13 is revised as 10 (a=sendtimes:10) with the redundant transmission number of times that data send in this example, then each recreation order that sends comprises current operational order and occurs in 9 the historical operation orders before of current operational order, if the historical operation order number before the current operational order is less than 9, then the number with reality is as the criterion, but can not surpass 10 operational orders at most in each recreation order that sends;
Calling terminal sends before the recreation order, at first checks whether there is effective local terminal operational order, if having, then the local terminal operational order is encapsulated into and sends in the payload again; If no, then check whether there is effectively opposite end operational order to be confirmed, if having, then opposite end operational order to be confirmed is encapsulated into transmission again in the payload; Do not send if there are valid data for a long time, then need in the time (as 3 seconds) of an inner definition, send an empty packet, do not confirm to be connected with the other side and interrupt to called end;
For the real-time (especially when called end is the user of far-end) that guarantees to play, the present invention has adopted a kind of affirmation mechanism, and detailed process is as follows:
The recreation order that the called end that receives for calling terminal is sent, after receiving, just can carry out immediately calling terminal, preserve but must should order simultaneously at local terminal, sending back to called end again confirms, show that this order receives and carry out, called end just can be carried out this order after receiving the order that calling terminal beams back;
The recreation order of sending for calling terminal, called end receives the back and preserves this order and execution immediately, and beaming back this order confirms to calling terminal, show that this order is received and carries out, calling terminal could be carried out this order in this locality after receiving that loopback that this order that called end is beamed back promptly obtains called end is confirmed;
Packet among the present invention is carried on the UDP/IP agreement, and it is also passable directly to adopt the IP agreement to carry, if with other host-host protocol, also be fine as RTP/UDP/IP;
In order to improve the efficient of data transmission, strengthen reliability of data transmission, the present invention also provides compression to send the method for recreation order on the basis of redundancy transmission and affirmation mechanism, specifically may further comprise the steps:
Step 16: a plurality of recreation orders are mapped as binary code successively by fixing rule, fixing rule is meant one group of mapping relations of prior appointment, and rule might be inequality in different application, and the figure place of the binary code after the mapping also might be different; As with four recreation orders " user from keyboard knock in<", " user from keyboard knock in>", " user knocks in L from keyboard ", " user knocks in the space from keyboard " is mapped to binary code " 00 " respectively, " 01 ", " 10 " and " 11 ", " left " represented in application corresponding to reality, " to the right ", " advance " and " retreating ", the mapping relations of this moment are prior appointment, just these mapping relations are fixed in the software program when Games Software is finished design, owing to have only four orders, binary code is as long as two bits are just much of that, if there are eight to order then binary code to need three bits, the figure place of the binary code herein that the bit number of valid data in the data that are provided with in the initial parameter (can represent 32 orders as a=validbit:5) just is meant;
Step 17: a plurality of binary codes after the described mapping are connected into a binary code stream by fixing order, fixing order is meant that order or backward couple together all binary codes one by one, if any 4 binary codes " 00 ", " 01 ", " 10 " and " 11 ", the binary code stream that forms after being linked in sequence is " 00011011 ", the binary code stream that backward connects back formation is " 11100100 ", connect finish the back by mould 8 at the end of binary code stream to add zero mode polishing figure place, the figure place of supposing binary code stream is 10 bits, then mends the binary code stream that 6 " 0 " form 16 at the end of binary code stream;
Step 18: send after converting described binary code stream to byte sequence, after 16 binary code stream is converted to two bytes, send;
Step 16 to 18 described compression methods promptly can be used for compressing when calling terminal sends the recreation order, compress in the time of also can being used to confirm recreation order that called end sends, illustrate respectively below:
Give an example one: the recreation order of calling terminal compression local terminal sends to called end
Suppose that the redundant transmission number of times that specific data sent when calling terminal was provided with initial parameter is 10 (a=sendtimes:10), the operational order effective length is 5 bit lengths, and transmission timer is 100 milliseconds; It is 10 command queue that calling terminal is at first created a row length according to the mapping ruler of above-mentioned parameter and appointment in advance at local terminal, then the recreation order in this command queue is compressed, and referring to Fig. 4, carries out following steps during calling terminal compression recreation order:
(1) every 100 milliseconds, calling terminal is sent the user by the interface operational order is translated into the recreation order, and sends in the mentioned order formation, if operation interface does not have operational order, then produces a null command (as complete zero);
(2 calling terminals move in the command queue by first in first out after current operational order is mapped to binary code, and detailed process is as follows:
To order N-8 to move to the position of order N-9, order N-7 moves to the position of order N-8 ..., order N moves to the position of order N-1, and current operational order moves to the position of order N, fills in command queue till 10 operational orders;
(3) 10 operational orders in the command queue are linked in sequence, because the effective length of each operational order is 5 bits, the binary code stream that then to form a length be 50 bits, press mould 8 then and mend 6 zero, the binary code stream that to become a length be 56 bits at the end of this binary code stream;
(4) this binary code stream is converted into the transmission order of 7 bytes, and sends to called end;
Send in the process of recreation order to called end at calling terminal, above-mentioned four steps are that circulation is carried out;
Give an example two: the calling terminal compression sends called end operational order to be confirmed
Suppose that calling terminal is specified the number of times that end data is confirmed when the initial parameter of recreation is set be 10 (a=recvacktimes:10), the operational order effective length is 5 bit lengths, and transmission timer is 100 milliseconds; It is 10 command queue that calling terminal is at first created a row length at local terminal according to the mapping ruler of above-mentioned parameter and appointment in advance, then the recreation order in this command queue is compressed, referring to Fig. 5, when ordering, calling terminal compression opposite end recreation to be confirmed carries out following steps:
(1) every 100 milliseconds, calling terminal receives the operational order that called end is sent, and sends in the mentioned order formation, if operation interface does not have operational order, then produces a null command (as complete zero);
(2 calling terminals move in the command queue by first in first out after current operational order is mapped to binary code, and detailed process is as follows:
To order M-8 to move to the position of order M-9, order M-7 moves to the position of order M-8 ..., order M moves to the position of order M-1, and current operational order moves to the position of order M, fills in command queue till 10 operational orders;
(3) 10 operational orders in the command queue are linked in sequence, because the effective length of each operational order is 5 bits, the binary code stream that then to form a length be 50 bits, press mould 8 then and mend 6 zero, the binary code stream that to become a length be 56 bits at the end of this binary code stream;
(4) order is confirmed in the opposite end that this binary code stream is converted into 7 bytes, and sends to called end;
Send in the process of the recreation order of confirming called end to called end at calling terminal, above-mentioned four steps are that circulation is carried out;
In order further to improve the present invention, the present invention also provides the step of state synchronized, and is specific as follows:
Step 19: the packet of described calling terminal has received encapsulation that described called end sends recreation order and synchrodata, the state synchronized sign indicating number in the last packet that the state synchronized sign indicating number in the described packet and described calling terminal are received compares,
If the two is identical, then do not initiate the state synchronized request, both sides' state synchronized is described;
If the two numerical value that differs is within the scope of setting, then analyze recreation order and synchrodata in the described packet, carry out state synchronized, when supposing the recreation initial start state synchronized sign indicating number being set is 0, all add 1 during each state synchronized by mould 16, be that state synchronized sign indicating number in a last packet on mould 16 add 1 if rigidly connect the state synchronized sign indicating number of receiving in the packet this moment so, illustrate that then called end initiated synchronization request, the requirement synchronous mode that gets the hang of, so calling terminal will suspend recreation and carry out the state synchronized of playing; Simultaneously also can send to called end to synchrodata, confirm that this synchrodata carries out at calling terminal; After state synchronized was finished, calling terminal was removed all operational orders of sending through local terminal operational order and all opposite ends of called end affirmation, and transmit status is successfully indicated synchronously and given called end simultaneously;
If not above-mentioned two kinds of situations, then abandon described packet, this packet is an invalid packets;
Step 20: described calling terminal need to judge whether described calling terminal to initiate the state synchronized request according to the time interval T (number of times that is sent packet by the per second that is provided with in the initial parameter can be extrapolated) that sends between the packet for twice, if then described calling terminal is initiated the request of state synchronized to called end, after described called end receives described request, carry out state synchronized; Otherwise the sequence of data packet that described calling terminal will rigidly connect in sequence of data packet number and the last legal data packet that receives in the packet of receiving number compares, if the relation of the two meets the condition of setting, both sides' state synchronized then is described, packet is legal can using, described calling terminal is not initiated the request of state synchronized, otherwise packet is an invalid packets, need abandon;
If judge that at first the time calling terminal that surpasses 10*T (also can be arranged to different values with 10 according to actual needs) also can not receive legal data packet, illustrate that then having lot of data to wrap in is delayed in the transmission course or abandons, at this time both sides' state is asynchronous, need calling terminal to initiate the state synchronized request, calling terminal can initiatively send and require to carry out the order of state synchronized to called end;
Otherwise make as judging:
The tentation data packet number is to recycle by mould 64 (also different values can be set according to actual needs), and following two kinds of situations are then arranged:
(1) if the sequence of data packet Y and the sequence of data packet X in the last legal data packet that rigidly connect in the packet of receiving are eligible: ((Y+64-X) mod 64)>9 show that then this packet is an invalid packets, need abandon;
(2) if the sequence of data packet Y and the sequence of data packet X in the last legal data packet that rigidly connect in the packet of receiving are eligible: ((Y+64-X) mod 64)<=9, both sides' state synchronized then is described, packet is legal can be used;
Wherein numerical value 9 is a concrete example, can be arranged to different numerical value according to different situations in the practical application;
When calling terminal is initiated the state synchronized request, at first suspend recreation and carry out, and the game state synchrodata is sent to called end; Calling terminal is removed all operational orders of sending through local terminal operational order and all opposite ends of called end affirmation; Send step-out indication and state synchronized data then to called end; In the process that data send, if called end is not received synchrodata, then need to carry out data re-transmitting, if called end is not repeatedly received synchrodata or do not received successfully indication synchronously, then release recreation for a long time;
In the operational process of recreation, whether calling terminal regularly (as every 100 milliseconds) inspection local terminal exists valid data, if find to exist effective synchrodata, synchronization request and successfully indication, then preferentially send these data, and then send local terminal operational order and opposite end operational order to be confirmed;
Game operation order among the present invention all is (as the media channel) that adopts the data transmission channel different with signalling path to transmit with the state synchronized data, because data traffic is very little, also can adopt the passage identical to transmit in actual applications with signalling path;
When stopping, recreation need carry out following step:
Step 21: the side decision of recreation stops recreation, sends message BYE to the other side, Exit Game; Receive the opposing party of BYE message, return 200OK, Exit Game; After the game over, session does not stop automatically, and either party of recreation can initiate to invite INVITE again, consults recreation next time.
Referring to Fig. 6, the present invention also provides a kind of device of realizing online real-time game on terminal, and described device comprises two parts: a part is a terminal module, is a whole set of high reliability transport scheme that terminal producer provides for the game developer according to the present invention; Another part is the Games Software module, is in the software developed of game developer, relates to terminal software and carries out mutual part;
Terminal module is used for connecting with the opposite end and storing the initial parameter that the user is provided with, and also is used for regularly sending the local terminal operational order and end data is analyzed and handled to the opposite end and to what receive through the opposite end operational order that local terminal is confirmed;
The Games Software module, be used to be provided with the initial parameter of recreation and send this parameter to described terminal module, also be used to change the local terminal operational order of sending by described terminal module and become the command operation sign indicating number of Games Software and return this command operation sign indicating number, also be used to move opposite end operational order of sending by described terminal module and the local terminal operational order of confirming through the opposite end and operation result is outputed to described terminal module to described terminal module.
Described terminal module comprises:
(1) communication control module is used for connecting with the opposite end;
(2) data reception module is used to receive the data that send initial parameter that described communication control module sends and opposite end, and the type, sequence number and the state synchronized sign indicating number that also are used for according to packet are analyzed and handled described data;
Find both sides operation step-out if analyze, the order that then sends the time-out recreation is to synchronization module;
Come through long-time the delay if analyze the discovery packet, show that then this packet is invalid, directly abandon;
If analyze to find that packet is effective, then the operational order of opposite end is sent to the opposite end command module in the Games Software module, send to simultaneously and in the terminal module sort command is confirmed module; The local terminal operational order that to confirm through the opposite end sends to this sort command and confirms module;
(3) data transmission blocks is used to receive the initial parameter that described communication control module is sent, also be used to send the local terminal operational order and the opposite end operational order confirmed through local terminal to the opposite end;
(4) sort command is confirmed module, be used to receive the opposite end operational order that initial parameter that described communication control module sends and data reception module are sent, also be used for regularly the opposite end operational order being sent to described data transmission blocks;
(5) local terminal command module is used to receive the initial parameter that described communication control module is sent, and also is used to preserve the local terminal operational order and regularly described order is sent to described data transmission blocks;
(6) interface module, be used for showing the video pictures of interface and game running process, also be used for the user is analyzed by the operation behavior of terminal (as keyboard, mouse, touch-screen etc.) input,, then send to translation module if user's input is operational order; If being the initial parameter that is provided with then sending to communication control module of user input;
Described Games Software module comprises:
(1) initial module is used to be provided with the initial parameter of recreation, and the recreation initial parameter that also is used for setting sends to described communication control module;
(2) this sort command is confirmed module, is used to receive the local terminal operational order that described data reception module sends confirms through the opposite end and opens up suitable cushion space and preserve this order;
(3) opposite end command module is used to receive the operational order of the opposite end that described data reception module sends and opens up suitable cushion space and preserve this order;
(4) operation module is used to receive the operational order that described sort command confirms that module and opposite end command module are sent, and also is used to move described operational order and operation result is outputed to described interface module;
(5) translation module is used to receive the local terminal operational order that described interface module is sent, and also is used for described command conversion is become the command operation sign indicating number of Games Software and sends to described local terminal command module.
Described data transmission blocks also comprises the compression submodule, be used for according to compression require and the data envelope reload request (as according to UDP, the IP agreement encapsulates) a plurality of game operation orders are mapped as binary code successively by fixing rule, also be used for a plurality of binary codes after the described mapping are connected into a binary code stream by fixing order, send to the opposite end after also being used for converting described binary code stream to byte sequence.
Described terminal module also comprises synchronization module, is used to receive the opposite end state synchronized data that described data reception module is sent, and also is used for local terminal state synchronized data and opposite end state synchronized data are sent to described data transmission blocks;
Described operation module also comprises the synchronous operation submodule, is used to receive the pause command that described synchronization module is sent, and also is used to send the game state synchrodata to described synchronization module.
More than just preferred implementation of the present invention is described, common variation and replacement that those skilled in the art carries out in the scheme scope of the technology of the present invention all should be included in protection scope of the present invention.

Claims (18)

1. a method that realizes online real-time game on terminal is characterized in that, said method comprising the steps of:
Steps A: calling terminal invites called end to participate in online real-time game;
Step B: the redundant mutually transmission recreation of described both sides order comprises current operational order and historical operation order in the described recreation order;
Step C: either party recovers described current operational order in the recreation order of follow-up reception when not receiving the current game order;
Step D: either party proposes to stop recreation, then game over.
2. the method that realizes online real-time game on terminal according to claim 1 is characterized in that described steps A specifically may further comprise the steps:
Steps A 1: calling terminal is initiated the request of the online real-time game of startup to called end, comprises the recreation initial parameter that described calling terminal is provided with in the described request;
Steps A 2: after described called end receives described request, move described recreation and send acknowledge message, after described calling terminal receives described acknowledge message, move described recreation to described calling terminal.
3. the method that realizes online real-time game on terminal according to claim 2 is characterized in that described steps A 2 is specially:
After described called end receives described request, revise the initial parameter of the recreation in the described request according to the media processing capacity of oneself, move described recreation then, and transmission comprises the affirmation message of amended recreation initial parameter to described calling terminal, after described calling terminal receives described acknowledge message, revise the initial parameter unanimity that corresponding initial parameter makes both sides, move described recreation then.
4. the method that on terminal, realizes online real-time game according to claim 1, it is characterized in that, described both sides send mutually before the recreation order all by predefined data layout encapsulation recreation order, and described predefined data layout contains state synchronized sign indicating number and sequence of data packet number.
5. the method that on terminal, realizes online real-time game according to claim 1, it is characterized in that, send mutually in the process of recreation order described both sides, described calling terminal is carried out after receiving the recreation order that called end sends immediately, preserve this order and send back to described called end to show affirmation at described calling terminal simultaneously, described called end receives carries out this order after calling terminal is beamed back the order of accepting one's fate really again.
6. on terminal, realize the method for online real-time game according to claim 1 or 5, it is characterized in that, send mutually in the process of recreation order described both sides, described called end is carried out after receiving the recreation order that calling terminal sends immediately, preserve this order and send back to described calling terminal to show affirmation at described called end simultaneously, described calling terminal receives carries out this order after called end is beamed back the order of accepting one's fate really again.
7. the method that realizes online real-time game on terminal according to claim 1 is characterized in that, sends the recreation order among the described step B and specifically may further comprise the steps:
Step B1: a plurality of recreation orders are mapped as binary code successively by fixing rule;
Step B2: a plurality of binary codes after the described mapping are connected into a binary code stream by fixing order;
Step B3: send after converting described binary code stream to byte sequence.
8. the method that realizes online real-time game on terminal according to claim 4 is characterized in that described step C also comprises the step of state synchronized:
The packet of described calling terminal has received encapsulation that described called end sends recreation order and synchrodata, the state synchronized sign indicating number in the last packet that the state synchronized sign indicating number in the described packet and described calling terminal are received compares,
If the two is identical, then do not initiate the state synchronized request;
If the two numerical value that differs is then analyzed recreation order and synchrodata in the described packet within the scope of setting, carry out state synchronized;
If not above-mentioned two kinds of situations, then abandon described packet.
9. according to claim 4 or the 8 described methods that on terminal, realize online real-time game, it is characterized in that described step C also comprises the step of state synchronized:
Described calling terminal judges whether that according to the time interval that sends between the packet for twice the described calling terminal of needs initiates the state synchronized request, if then described calling terminal is initiated the request of state synchronized to called end, after described called end receives described request, carry out state synchronized; The sequence of data packet that will rigidly connect in sequence of data packet number and the last legal data packet that receives in the packet of receiving if not described calling terminal then number compares, if the relation of the two meets the condition of setting, then described calling terminal is not initiated the request of state synchronized, otherwise described calling terminal abandons and rigidly connects the packet of receiving.
10. device of realizing online real-time game on terminal is characterized in that described device comprises:
Invite module, be used for calling terminal and invite called end to participate in online real-time game;
Sending module is used for the redundant mutually transmission recreation of described both sides order, comprises current operational order and historical operation order in the described recreation order;
Recover module, be used for either party when not receiving the current game order, in the recreation order of follow-up reception, recover described current operational order;
Stop module, be used for either party and propose to stop recreation, then game over.
11. the device of realizing online real-time game on terminal according to claim 10 is characterized in that described invitation module specifically comprises:
Request unit is used for calling terminal and initiates the request of the online real-time game of startup to called end, comprises the recreation initial parameter that described calling terminal is provided with in the described request;
The operation unit after being used for described called end and receiving described request, moves described recreation and sends acknowledge message to described calling terminal, after described calling terminal receives described acknowledge message, moves described recreation.
12. the device of realizing online real-time game on terminal according to claim 11 is characterized in that described operation unit specifically comprises:
The first operation subelement, after being used for described called end and receiving described request, initial parameter according to the recreation in the media processing capacity modification described request of oneself move described recreation then, and transmission comprises the affirmation message of amended recreation initial parameter to described calling terminal;
The second operation subelement after being used for described calling terminal and receiving described acknowledge message, is revised the initial parameter unanimity that corresponding initial parameter makes both sides, moves described recreation then.
13. the device of realizing online real-time game on terminal according to claim 10 is characterized in that described device also comprises:
Package module is used for described both sides and sends mutually before the recreation order all by predefined data layout encapsulation recreation order, and described predefined data layout contains state synchronized sign indicating number and sequence of data packet number.
14. the device of realizing online real-time game on terminal according to claim 10 is characterized in that described device also comprises:
First carries out and the affirmation module, be used for sending mutually the process of recreation order described both sides, described calling terminal is carried out after receiving the recreation order that called end sends immediately, preserve this order and send back to described called end to show affirmation at described calling terminal simultaneously, described called end receives carries out this order after calling terminal is beamed back the order of accepting one's fate really again.
15., it is characterized in that described device also comprises according to claim 10 or the 14 described devices of on terminal, realizing online real-time game:
Second carries out and the affirmation module, be used for sending mutually the process of recreation order described both sides, described called end is carried out after receiving the recreation order that calling terminal sends immediately, preserve this order and send back to described calling terminal to show affirmation at described called end simultaneously, described calling terminal receives carries out this order after called end is beamed back the order of accepting one's fate really again.
16. the device of realizing online real-time game on terminal according to claim 10 is characterized in that described sending module specifically comprises:
Map unit is used for a plurality of recreation orders are mapped as binary code successively by fixing rule;
Linkage unit is used for a plurality of binary codes after the described mapping are connected into a binary code stream by fixing order;
Transmitting element sends after being used for converting described binary code stream to byte sequence.
17. the device of realizing online real-time game on terminal according to claim 13 is characterized in that described sending module also comprises:
First lock unit, the packet that is used for recreation order that received encapsulation that described called end sends of described calling terminal and synchrodata, state synchronized sign indicating number in the last packet that state synchronized sign indicating number in the described packet and described calling terminal are received compares, if the two is identical, then do not initiate the state synchronized request; If the two numerical value that differs is then analyzed recreation order and synchrodata in the described packet within the scope of setting, carry out state synchronized; If not above-mentioned two kinds of situations, then abandon described packet.
18., it is characterized in that described sending module also comprises according to claim 13 or the 17 described devices of on terminal, realizing online real-time game:
Second lock unit, be used for described calling terminal and judge whether that according to the time interval that sends between the packet for twice the described calling terminal of needs initiates the state synchronized request, if then described calling terminal is initiated the request of state synchronized to called end, after described called end receives described request, carry out state synchronized; The sequence of data packet that will rigidly connect in sequence of data packet number and the last legal data packet that receives in the packet of receiving if not described calling terminal then number compares, if the relation of the two meets the condition of setting, then described calling terminal is not initiated the request of state synchronized, otherwise described calling terminal abandons and rigidly connects the packet of receiving.
CNB2006100986270A 2006-07-10 2006-07-10 Method and device for implementing on-line real-time game in terminal Active CN100428255C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100986270A CN100428255C (en) 2006-07-10 2006-07-10 Method and device for implementing on-line real-time game in terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100986270A CN100428255C (en) 2006-07-10 2006-07-10 Method and device for implementing on-line real-time game in terminal

Publications (2)

Publication Number Publication Date
CN1877592A CN1877592A (en) 2006-12-13
CN100428255C true CN100428255C (en) 2008-10-22

Family

ID=37510022

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100986270A Active CN100428255C (en) 2006-07-10 2006-07-10 Method and device for implementing on-line real-time game in terminal

Country Status (1)

Country Link
CN (1) CN100428255C (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101068194B (en) * 2007-06-15 2010-12-01 腾讯科技(深圳)有限公司 Method and system for realizing on-line game invitation
CN103780619B (en) * 2014-01-08 2018-02-09 深圳市掌玩网络技术有限公司 Wide area network real-time interactive game synchronization method, apparatus and system
CN106375314B (en) * 2016-08-31 2018-10-02 腾讯科技(深圳)有限公司 A kind of game synchronization method, game client and game server
CN111510447B (en) * 2020-04-10 2023-03-14 浙江无端科技股份有限公司 Network transmission method and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09140894A (en) * 1995-11-21 1997-06-03 Sophia Co Ltd Information processor for game parlor
CN1257365A (en) * 1998-11-27 2000-06-21 日本电气株式会社 Method and device for database synchronisation in network management system
CN1612252A (en) * 2003-10-31 2005-05-04 浙江中控技术股份有限公司 Real-time data on-line compression and decompression method
CN1629809A (en) * 2003-12-19 2005-06-22 英华达(上海)电子有限公司 Frame synchronizing method and device for instant network connection game

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09140894A (en) * 1995-11-21 1997-06-03 Sophia Co Ltd Information processor for game parlor
CN1257365A (en) * 1998-11-27 2000-06-21 日本电气株式会社 Method and device for database synchronisation in network management system
CN1612252A (en) * 2003-10-31 2005-05-04 浙江中控技术股份有限公司 Real-time data on-line compression and decompression method
CN1629809A (en) * 2003-12-19 2005-06-22 英华达(上海)电子有限公司 Frame synchronizing method and device for instant network connection game

Also Published As

Publication number Publication date
CN1877592A (en) 2006-12-13

Similar Documents

Publication Publication Date Title
CN102571930B (en) Distributed smooth streaming utilizing dynamic manifests
Chawathe et al. A proxy architecture for reliable multicast in heterogeneous environments
US7124195B2 (en) Broadband network system configured to transport audio or video at the transport layer, and associated method
CN1633647B (en) System and method for managing data transfers in a network
US20030074474A1 (en) Data distribution center and associated method
CN102265535A (en) Method and apparatus for streaming multiple scalable coded video content to client devices at different encoding rates
US20030074554A1 (en) Broadband interface unit and associated method
JP2006503513A (en) Common protocol hierarchy and method and common protocol packet for mutual data transmission between heterogeneous protocols.
CN101352012A (en) Media data processing using distinct elements for streaming and control processes
EP0308485A1 (en) Terminal device session management protocol
CN100428255C (en) Method and device for implementing on-line real-time game in terminal
CN101001365A (en) Method for implementing media flow balance dispatching in vedio service
CN109327493A (en) A kind of remote medical monitoring system based on cloud and monitoring method
CN101420316B (en) Video distribution system and video relay device
CN108347622A (en) Multi-medium data method for pushing, device, storage medium and equipment
CN105530553A (en) RTMP (Real Time Messaging Protocol) and RUDP (Reliable User Data Protocol) combined real-time media streaming live broadcasting system
CN110266437A (en) It throws screen message method, throw screen message treatment method, device and terminal
US7533404B2 (en) Apparatus and method for merging MPEG streams in a headend system
CN1833366B (en) Data signaling method for message based communication and communication unit
WO2011130962A1 (en) Remote processing method, device and system
CN109818901A (en) Heading compression mechanism determines method, equipment and system
CN100414877C (en) Realization system and method for lecture file using net broadcasted slide
CN1864378B (en) In-band negotiation in single transcompression scenarios related applications
McCanne Scalable multimedia communication with internet multicast, light-weight sessions, and the mbone
CN115277649A (en) Method and device for collaboratively editing document in multimedia conference scene

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