CN109040208A - Method of data synchronization, server, system and medium based on multi-client interaction - Google Patents

Method of data synchronization, server, system and medium based on multi-client interaction Download PDF

Info

Publication number
CN109040208A
CN109040208A CN201810808603.2A CN201810808603A CN109040208A CN 109040208 A CN109040208 A CN 109040208A CN 201810808603 A CN201810808603 A CN 201810808603A CN 109040208 A CN109040208 A CN 109040208A
Authority
CN
China
Prior art keywords
client
frame number
frame
server
data
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
CN201810808603.2A
Other languages
Chinese (zh)
Other versions
CN109040208B (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.)
GUANGDONG LIWEI NETWORK TECHNOLOGY CO LTD
Multi Benefit Network Co Ltd
Guangzhou Duoyi Network Co Ltd
Original Assignee
GUANGDONG LIWEI NETWORK TECHNOLOGY CO LTD
Multi Benefit Network Co Ltd
Guangzhou Duoyi Network 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 GUANGDONG LIWEI NETWORK TECHNOLOGY CO LTD, Multi Benefit Network Co Ltd, Guangzhou Duoyi Network Co Ltd filed Critical GUANGDONG LIWEI NETWORK TECHNOLOGY CO LTD
Priority to CN201810808603.2A priority Critical patent/CN109040208B/en
Publication of CN109040208A publication Critical patent/CN109040208A/en
Application granted granted Critical
Publication of CN109040208B publication Critical patent/CN109040208B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Abstract

The invention discloses a kind of method of data synchronization, server, system and computer readable storage mediums based on multi-client interaction, the first data packet uploaded at the end of its each customer frame the method includes receiving client;First data packet includes the client in the client frame number of the customer frame and received first operation in the customer frame;The corresponding server frame number of first data packet is obtained according to the client frame number;At the end of every service frame, according to the corresponding server frame number of the service frame, all first operations in all first data packets uploaded in the service frame are obtained, to generate the second operation for corresponding to each client;According to second operation corresponding to each client and the corresponding server frame number, the second data packet is issued to each client correspondence, realizes that the data of multi-client interaction are synchronous in the case where network delay, guarantees the fluency of operation.

Description

Method of data synchronization, server, system and medium based on multi-client interaction
Technical field
The present invention relates to field of computer data processing more particularly to a kind of data sides of synchronization based on multi-client interaction Method, data synchronization server, system and computer readable storage medium.
Background technique
Network delay refers to that miscellaneous data are transmitted in network medium by network protocol (such as TCP/IP), If information content is excessive without restriction, it is slow that the network flow of excess will lead to equipment reaction, causes network delay.It please join Fig. 1 is read, because of the reason of there are network delays between server and client, the data packet that client is sent can pass through one After the fixed time, server can just be received.Correspondingly, the data packet sent out from server, client will also pass through one section It can just be received after time.During synchronizing interaction there are multi-client needs, under such network delay, it please join Fig. 2 is read, the first client is transferred to server after the former data for obtaining itself immediately depending on the user's operation, by one section of net Server receives the former data of the first client after network delay (T1 time), using one section of network delay (T2 time) it Afterwards, other clients receive the former data of the first client of server transport.
In the implementation of the present invention, inventor has found: when other clients receive the first visitor of server transport It when the former data at family end, is appeared to be in other clients and receives the instant former data of the first client, and actually received Be former data of first client at (T1+T2) before the time, if other clients operate the original data, and first Client in (T1+T2) former data in the period because the operation of the corresponding user of the first client is changed, due to The former data of one client have occurred that variation so that other clients for former data operation because lose work The phenomenon that with object, and can not bringing about the desired effect, leading to operation error or operation failure, seriously affect the use of user Experience, referring to Fig. 3, for example in needing to carry out game data synchronous battle game such as FPS type network game, the first visitor Family brings out data packet Born1 that is raw in coordinate (5,5), and sending changing coordinates (5,5) to server simultaneously, and the first client is logical Operation is crossed to mobile 1 distance in the direction x, while sending the data packet Move1 of movement directive to server, and set coordinate to (6,5), the first client continue to move 1 distance to the direction x, send the data packet Move2 of move to server and incite somebody to action Coordinate is set as (7,5).Server end receives the first client and sends Born1, and role is born in coordinate (5,5), and sends Client notification of the data packet Born2 to surrounding.Server receive after Move1 by the setting of the first client role coordinate (6, 5) position, while peripherad client sends data packet Move3.Server receives the Move2 that the first client is sent and disappears First client role position is arranged in coordinate (7,5), while peripherad client broadcast data packet Move4 breath.Second Client receives the Born1 that server is sent, and first role is born in coordinate (5,5).Second client receives server First role setting is arrived (6,5), while launched a offensive to first role by the Move3 sent, i.e., carries out to (6,5) position Attack sends Attack message.Server receives Attack message at this time, launches a offensive to (6,5) position, but because at this time It hits in (7,5) and determines failure in the position of first role.
Summary of the invention
In view of the above-mentioned problems, the purpose of the present invention is to provide it is a kind of based on multi-client interaction method of data synchronization, Data synchronization server, system and computer readable storage medium realize multi-client interaction in the case where network delay Data are synchronous, guarantee the fluency of operation.
In a first aspect, the embodiment of the invention provides a kind of method of data synchronization based on multi-client interaction, including with Lower step:
For each of same interaction scenarios client, receive the client at the end of its each customer frame on The first data packet passed;Wherein, first data packet include the corresponding client the customer frame client frame number, And received first operation in the customer frame;
The corresponding server frame number of first data packet is obtained according to the client frame number;
At the end of each service frame, according to the corresponding server frame number of the service frame, obtain in the service frame All first operations in all first data packets passed, to generate the second operation for corresponding to each client;
According to second operation corresponding to each client and the corresponding server frame number, to each visitor Family end correspondence issues the second data packet;Wherein, second data packet, for triggering the corresponding client according to described Two data packets synchronize operation.
In the first implementation of first aspect, further includes:
When detecting start-up operation, the start-up operation is executed, and to execute service corresponding to the start-up operation Frame distributes initial server frame number.According to the first implementation of first aspect, in second of implementation of first aspect In, further includes:
When the initialization operation for detecting the client, the corresponding client object of the client is created;
The server frame number for creating service frame corresponding to the client object is obtained, to generate initial phase to frame number;
The initial phase is cached in the client object frame number.
It is described according to institute in the third implementation of first aspect according to second of implementation of first aspect It states client frame number and obtains the corresponding server frame number of first data packet, specifically:
According to the client frame number and the corresponding initial phase of the client to frame number, first data packet pair is obtained The server frame number answered;Wherein, the server frame number=client frame number+initial phase is to frame number.
It is described according to institute in the 4th kind of implementation of first aspect according to the third implementation of first aspect The second operation and the corresponding server frame number are stated, issues the second data packet to each client correspondence, specifically:
According to the corresponding server frame number and the corresponding initial phase of each client to frame number, each client is obtained Corresponding client frame number;Wherein, the client frame number=server frame number-initial phase is to frame number;
It is operated according to each corresponding client frame number of client and second corresponding to each client, The second data packet is sent to each client;Wherein, second data packet includes the client frame number of corresponding client, And client second operation to be synchronized.
It is described every in the 5th kind of implementation of first aspect according to any of the above implementation of first aspect The runing time of one customer frame is identical as the runing time of each service frame;
First operation is including the client to the first operational order of itself or the client to another visitor At least one of second operational order at family end is multiple;Wherein, second operational order includes to another client The customer frame frame number for another client that the operational motion at end and the operational motion are acted on.
Second aspect the embodiment of the invention provides a kind of data synchronization server, including processor, memory and is deposited The computer program executed by the processor is stored up in the memory and is configured as, the processor executes the calculating The method of data synchronization based on multi-client interaction as described in any one of first aspect is realized when machine program.
The third aspect, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storage Medium includes the computer program of storage, wherein controls the computer-readable storage medium in computer program operation Equipment where matter executes the method for data synchronization based on multi-client interaction described in any one of first aspect.
Fourth aspect, the embodiment of the invention provides a kind of data synchronous systems based on multi-client interaction, including such as Data synchronization server described in second aspect and at least two clients;
Each client, for uploading the first number to the data synchronization server at the end of each customer frame According to packet;Wherein, first data packet includes the corresponding client in the client frame number of the customer frame and in the client Received first operation in frame;
The data synchronization server, the first number uploaded at the end of its each customer frame for receiving the client According to packet;The corresponding server frame number of first data packet is obtained according to the client frame number;At the end of each service frame, According to the corresponding server frame number of the service frame, the institute in all first data packets uploaded in the service frame is obtained There is the first operation, to generate the second operation for corresponding to each client;According to second behaviour corresponding to each client Work and the corresponding server frame number issue the second data packet to each client correspondence;
Each client, is also used to receive corresponding second data packet, and according to second data packet into Row simultaneously operating.
In the first implementation of fourth aspect,
First client, is also used to when detecting initialization operation, executes the initialization operation, and to execute Customer frame corresponding to the initialization operation distributes original client frame number.
According to the first implementation of fourth aspect, in second of implementation of fourth aspect,
First client is also used to carry out operating pre- performance according to first operation.
Said one embodiment has the following beneficial effects:
In the scene interacted based on multi-client by data synchronization server, the data synchronization server is connect The first data packet that the client uploads at the end of its each customer frame is received, first data packet includes corresponding described Client is in the client frame number of the customer frame and received first operation in the customer frame, then according to the client Frame number obtains the corresponding server frame number of first data packet, and at the end of each service frame, according to the service frame pair The server frame number answered obtains all first operations in all first data packets uploaded in the service frame, with life At the second operation for corresponding to each client, last the second operation and the correspondence according to described corresponding to each client Server frame number, issue the second data packet to each client correspondence, pass through setting client frame number and server frame Number, it realizes in client from server there are in the case where different life cycles, passes through client frame number and server frame number Mapping relations are established, to reach logical synchronization process, so that each client is still able to achieve together in the case where network delay The effect for walking interaction guarantees the fluency of operation and the accuracy of interaction results, and the data synchronization server is participated in the overall process Logic executes, so that the client that interaction scenarios are newly added is not necessarily to synchronize all historical operations, saves the memory source of client, Improve the operational efficiency of client.
Detailed description of the invention
In order to illustrate more clearly of technical solution of the present invention, attached drawing needed in embodiment will be made below Simply introduce, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, general for this field For logical technical staff, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the schematic diagram provided in background technique.
Fig. 2 is provided in background technique because network delay causes to receive the schematic diagram postponed.
Fig. 3 is provided in background technique because network delay leads to the schematic diagram of hit judgement inaccuracy.
Fig. 4 is the process signal for the method for data synchronization based on multi-client interaction that first embodiment of the invention provides Figure.
Fig. 5 is the schematic diagram of the corresponding relationship of the client frame number that first embodiment of the invention provides and server frame number.
Fig. 6 is the schematic diagram that the client frame number that first embodiment of the invention provides is converted by server frame number.
Fig. 7 is the schematic diagram that the second client that first embodiment of the invention provides receives message and record position.
Fig. 8 is the schematic diagram that the second client that first embodiment of the invention provides is launched a offensive according to the position of record.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Referring to Fig. 4, first embodiment of the embodiment of the present invention provides a kind of data synchronization interacted based on multi-client Method is applied to data synchronization server, the described method comprises the following steps:
S11 receives the client in its each client's frame end for each of same interaction scenarios client The first data packet of Shi Shangchuan;Wherein, first data packet includes client of the corresponding client in the customer frame Frame number and received first operation in the customer frame.
In the embodiment of the present invention, the data frame of the customer frame, that is, client, the data frame of the service frame, that is, server, It should be noted that the client and the server to be to fix the operation of same number of frames rate, then corresponding each customer frame Runing time it is identical as the runing time of each service frame, such as set frame per second as 20fps, then when the operation of each frame Between be 50ms.When detecting that user starts the start-up operation of server, the data synchronization server starting and execution institute First frame of that frame as server corresponding to start-up operation, i.e. No. 0 frame of server are stated, later every one frame of the mistake clothes of server Business device frame number adds 1, when the data synchronization server detects the initialization operation of the client, creates for the client Build corresponding client object, it should be noted that the present invention does not do any restrictions for the initialization operation, such as described Initialization operation can be the operation that client logins server, or start to operate in an interaction scenarios, specifically It can be set according to the actual situation, the client will execute that frame corresponding to the initialization operation as client The first frame at end, i.e. No. 0 frame of client, the every one frame client frame number of mistake of client adds 1 later, due to server end and client Between, there are different life cycles between client and client, so needing to carry out frame number conversion in server with synchronization The different client frame number of each client, therefore the server obtains service corresponding when creating the client object The server frame number of frame to generate initial phase to frame number, and the initial phase is cached in the client object frame number, So as to subsequent progress frame number conversion.
In embodiments of the present invention, in each of same interaction scenarios client, the client is each at its The first data packet is sent to the data synchronization server at the end of data frame, first data packet includes the corresponding visitor In the client frame number of the customer frame and received first operation in the customer frame, first operation includes described at family end Client is to the first operational order of itself or the client at least one in the second operational order of another client A or multiple, second operational order includes being acted on the operational motion of another client and the operational motion Another client customer frame frame number, such as in battle game, the client can be shifting to the operation of itself Moving itself game role, or addition equipment etc. operation, then corresponding first operational order includes moving coordinate, or Attribute etc. is equipped, the client can be the operation of another client and attack other game roles etc., then accordingly Second operational order include target of attack frame number and direction of attack etc., it should be noted that the client can It carries out operating pre- performance according to first operation, return again to without that will operate to be sent to after server authentication passes through to visitor Family end is showed, and the smooth sense of operation is increased.
S12 obtains the corresponding server frame number of first data packet according to the client frame number.
In the embodiment of the present invention, the data synchronization server is corresponding according to the client frame number and the client Initial phase obtains the corresponding server frame number of first data packet to frame number;Wherein, the server frame number=client Hold frame number+initial phase to frame number, referring to Fig. 5, No. 0 frame of the server using that frame for starting as server is (i.e. SGF0), client is to send that frame of Born message as No. 0 frame (i.e. CF0) of client, and server is to receive client The frame of the Born message sent, for No. 0 frame (i.e. SLF0) of the client, while recording server as server to receive The frame of the Born message sent to client is as initial phase to frame number (SLFG), it should be noted that from absolute time, The time point of CF0 and the time point of SLF0 are different, but by frame number, 2 scripts different time point are established and is reflected Relationship to be penetrated, achievees the purpose that identical frame number bottom is set synchronous, the initial phase of client described in Fig. 5 is SLFG=10 to frame number, Then client sends message in its No. 1 frame, and the frame number of the message can be added initial phase to frame number after receiving message by server SLFG is then converted into the message of server S GF11 frame.
S13, according to the corresponding server frame number of the service frame, is obtained in the service frame at the end of each service frame All first operations in all first data packets of interior upload, to generate the second operation for corresponding to each client.
In embodiments of the present invention, in its each frame end, acquisition receives the data synchronization server in the frame To all first data packets in it is all first operation, then for each client, will need to be sent to the client End carries out the first operation to be synchronized and is arranged and packed, and to generate the second operation, second operation includes other visitors Variation and other clients operation to itself of the family end in interaction scenarios.
S14, according to second operation corresponding to each client and the corresponding server frame number, to each institute It states client correspondence and issues the second data packet;Wherein, second data packet, for triggering the corresponding client according to institute It states the second data packet and synchronizes operation.In embodiments of the present invention, the data synchronization server is according to the corresponding clothes Business device frame number and the corresponding initial phase of each client obtain the corresponding client frame number of each client to frame number;Wherein, institute Client frame number=server frame number-initial phase is stated to frame number;Such as referring to Fig. 6, client transmission Born disappears Server is ceased, server receives the message in server frame number SGF=9, i.e. No. 9 frames, saves in corresponding client object The initial phase of the client is 9 to frame number SLFG value.Client sends message in its 1st frame, and server receives after message can be with The frame number of the message is added into SLFG, then is converted into the message of server S GF10 frame.Assuming that No. SLFG of another client It is 8, then then converts server frame number SGF to the client frame number SLF of the client when message being forwarded so far client, That is No. 2 frames;Then the data synchronization server according to the corresponding client frame number of each client and described corresponds to Second operation of each client sends the second data packet to each client;Wherein, second data packet includes pair Answer client frame number and the client second operation to be synchronized of client.
In embodiments of the present invention, such as in battle game such as FPS type network game, referring to Fig. 7, server with No. 0 frame (i.e. SGF0) of that frame as server of starting, client is to send that frame of Born message as client No. 0 frame (i.e. CF0), server is to receive the frame of the Born message that client is sent as server for the client No. 0 frame (i.e. SLF0), while server is recorded to receive the frame of the Born message that client is sent as initial phase to frame number (SLFG), after the definition for having frame number, we are assured that role in the corresponding position of each frame of server end, the position In the case where identical frame number, each client it is shown go out same character location be all it is identical, therefore, we can be Server caches the position of each frame of role, is defined as frame buffer, arrives historical frames role by the way that frame number is then available Accurate location, the first client sends message in its No. 2 frames, by operation so that itself game role changes position, clothes The frame number of the message can be added initial phase to frame number SLFG (SLFG=9) after receiving message by business device, then is converted into server The message of SGF11 frame, it is assumed that No. SLFG of the second client is 8, is forwarded that message in the data synchronization server When the second client, it converts server frame number SGF to the client frame number SLF of second client, i.e. the second client pair No. 3 frames answered, second client is in the message for receiving server broadcast, not only by first client role Changing coordinates setting on the coordinate position changed received, while also the frame number of the message being recorded, that is, remembered Coordinate position at the role of first client when X frame has been descended in record, referring to Fig. 8, when the second client is launched a offensive, The direction of attack is not only had sent, and sends the frame number for hitting target current location.When server receives the attack message, lead to The position that the frame number hit target gets role when corresponding to the frame number is crossed, the setting of target roles position is arrived in this position, Hit judgement is carried out again, has achieved the purpose that accurate hit detection, ensure that the tightness of authentication mechanism, will not be prolonged because of network The problem of causing the position for seeing target to be unable to successful hit late, realizes the accuracy of interaction results.
In conclusion first embodiment of the invention provides a kind of method of data synchronization based on multi-client interaction, In the scene interacted based on multi-client by data synchronization server, the data synchronization server receives the client The first data packet uploaded at the end of its each customer frame is held, first data packet includes the corresponding client at this The client frame number of customer frame and received first operation in the customer frame, then obtain institute according to the client frame number The corresponding server frame number of the first data packet is stated, and at the end of each service frame, according to the corresponding server of the service frame Frame number obtains all first operations in all first data packets uploaded in the service frame, is corresponded to often with generating Second operation of one client, it is last according to second operation corresponding to each client and the corresponding server frame Number, the second data packet is issued to each client correspondence, by setting client frame number and server frame number, is realized in visitor Family end, there are in the case where different life cycles, is established mapping by client frame number and server frame number and is closed from server System, to reach logical synchronization process, so that each client is still able to achieve the effect of synchronous interaction in the case where network delay Fruit, guarantee operation fluency and interaction results accuracy, and the data synchronization server participate in the overall process logic execution, make The client that interaction scenarios are newly added is obtained without synchronizing all historical operations, the memory source of client is saved, improves client Operational efficiency.
Preferably, the method for data synchronization based on multi-client interaction, further includes:
When the initialization operation for detecting the client, the corresponding client object of the client is created.
The server frame number for creating service frame corresponding to the client object is obtained, to generate initial phase to frame number.
The initial phase is cached in the client object frame number.
In embodiments of the present invention, when the data synchronization server detects the initialization operation of the client, Corresponding client object is created for the client, it should be noted that the present invention does not appoint the initialization operation What is limited, such as the initialization operation can be the operation that client logins server, or in an interaction scenarios Start operate, or birth operation for corresponding in game interaction scene game role etc. specifically can be according to practical feelings Condition is set, and the client will execute corresponding to the initialization operation that frame is as the first frame of client, i.e., No. 0 frame of client, the every one frame client frame number of mistake of client adds 1 later, due between server end and client, client with There are different life cycles between client, so needing to carry out frame number conversion in server different to synchronize each client Client frame number, therefore the server obtains the server frame of corresponding service frame when creating the client object Number, to generate initial phase to frame number, and the initial phase is cached in the client object frame number, so as to subsequent progress Frame number conversion.
Second embodiment of the invention provides a kind of data synchronization server.The data synchronization server packet of the embodiment Include: processor, memory and storage in the memory and the computer program that can run on the processor, such as Method of data synchronization program based on multi-client interaction.The processor is realized above-mentioned each when executing the computer program Step in method of data synchronization embodiment based on multi-client interaction, such as step S11 shown in Fig. 4.
Illustratively, the computer program can be divided into one or more module/units, one or more A module/unit is stored in the memory, and is executed by the processor, to complete the present invention.It is one or more A module/unit can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing institute State implementation procedure of the computer program in the data synchronization server.
The data synchronization server may include, but be not limited only to, processor, memory.Those skilled in the art can be with Understand, above-mentioned component is only the example of data synchronization server, and the restriction of structure paired data sync server, not can wrap Components more more or fewer than above-mentioned component are included, certain components or different components are perhaps combined, such as the data synchronize Server can also include input-output equipment, network access equipment, bus etc..
Alleged processor can be central processing unit (Central Processing Unit, CPU), can also be it His general processor, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng the processor is the control centre of the data synchronization server, same using various interfaces and the entire data of connection Walk the various pieces of server.
The memory can be used for storing the computer program and/or module, and the processor is by operation or executes Computer program in the memory and/or module are stored, and calls the data being stored in memory, described in realization The various functions of data synchronization server.The memory can mainly include storing program area and storage data area, wherein storage It program area can application program needed for storage program area, at least one function etc.;Storage data area can be stored according to mobile phone Use created data etc..In addition, memory may include high-speed random access memory, it can also include non-volatile deposit Reservoir, such as hard disk, memory, plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card), at least one disk memory, flush memory device or other Volatile solid-state part.
Third embodiment of the invention provides a kind of computer readable storage medium, what the data synchronization server integrated If module/unit is realized in the form of SFU software functional unit and when sold or used as an independent product, can store In one computer-readable storage medium.Based on this understanding, the present invention realize above-described embodiment method in whole or Part process can also instruct relevant hardware to complete by computer program, and the computer program can be stored in In one computer readable storage medium, the computer program is when being executed by processor, it can be achieved that above-mentioned each embodiment of the method The step of.Wherein, the computer program includes computer program code, and the computer program code can be source code shape Formula, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium may include: that can take Any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, CD, computer with the computer program code are deposited Reservoir, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the computer-readable medium The content for including can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, such as in certain departments Method administrative area does not include electric carrier signal and telecommunication signal according to legislation and patent practice, computer-readable medium.
Fourth embodiment of the invention provides a kind of data synchronous system based on multi-client interaction, including such as second party Data synchronization server described in face and at least two clients.
Each client, for uploading the first number to the data synchronization server at the end of each customer frame According to packet;Wherein, first data packet includes the corresponding client in the client frame number of the customer frame and in the client Received first operation in frame.
The data synchronization server, the first number uploaded at the end of its each customer frame for receiving the client According to packet;The corresponding server frame number of first data packet is obtained according to the client frame number;At the end of each service frame, According to the corresponding server frame number of the service frame, the institute in all first data packets uploaded in the service frame is obtained There is the first operation, to generate the second operation for corresponding to each client;According to second behaviour corresponding to each client Work and the corresponding server frame number issue the second data packet to each client correspondence.
Each client, is also used to receive corresponding second data packet, and according to second data packet into Row simultaneously operating.
In the first implementation of fourth embodiment,
First client, is also used to when detecting initialization operation, executes the initialization operation, and to execute Customer frame corresponding to the initialization operation distributes original client frame number.
According to the first implementation of fourth embodiment, in second of implementation of fourth embodiment,
First client is also used to carry out operating pre- performance according to first operation.
In the third implementation of fourth embodiment, the runing time of each customer frame and each service The runing time of frame is identical.
First operation is including the client to the first operational order of itself or the client to another visitor At least one of second operational order at family end is multiple;Wherein, second operational order includes to another client The customer frame frame number for another client that the operational motion at end and the operational motion are acted on.
The above is a preferred embodiment of the present invention, it is noted that for those skilled in the art For, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also considered as Protection scope of the present invention.

Claims (10)

1. a kind of method of data synchronization based on multi-client interaction, which comprises the following steps:
For each of same interaction scenarios client, receive what the client uploaded at the end of its each customer frame First data packet;Wherein, first data packet include the corresponding client the client frame number of the customer frame and Received first operation in the customer frame;
The corresponding server frame number of first data packet is obtained according to the client frame number;
At the end of each service frame, uploaded in the service frame according to the corresponding server frame number of the service frame, acquisition All first operations in all first data packets, to generate the second operation for corresponding to each client;
According to second operation corresponding to each client and the corresponding server frame number, to each client Correspondence issues the second data packet;Wherein, second data packet, for triggering the corresponding client according to second number Operation is synchronized according to packet.
2. the method for data synchronization according to claim 1 based on multi-client interaction, which is characterized in that further include:
When detecting start-up operation, the start-up operation is executed, and to execute service frame corresponding to the start-up operation point With initial server frame number.
3. the method for data synchronization according to claim 2 based on multi-client interaction, which is characterized in that further include:
When the initialization operation for detecting the client, the corresponding client object of the client is created;
The server frame number for creating service frame corresponding to the client object is obtained, to generate initial phase to frame number;
The initial phase is cached in the client object frame number.
4. the method for data synchronization according to claim 3 based on multi-client interaction, which is characterized in that described according to institute It states client frame number and obtains the corresponding server frame number of first data packet, specifically:
According to the client frame number and the corresponding initial phase of the client to frame number, it is corresponding to obtain first data packet Server frame number;Wherein, the server frame number=client frame number+initial phase is to frame number.
5. the method for data synchronization according to claim 4 based on multi-client interaction, which is characterized in that described according to institute The second operation and the corresponding server frame number are stated, issues the second data packet to each client correspondence, specifically:
According to the corresponding server frame number and the corresponding initial phase of each client to frame number, it is corresponding to obtain each client Client frame number;Wherein, the client frame number=server frame number-initial phase is to frame number;
According to each corresponding client frame number of client and second operation corresponding to each client, to institute It states each client and sends the second data packet;Wherein, second data packet includes client frame number and the institute of corresponding client State client second operation to be synchronized.
6. according to claim 1 to the method for data synchronization based on multi-client interaction described in 5 any one, feature exists In the runing time of each customer frame is identical as the runing time of each service frame;
First operation is including the client to the first operational order of itself or the client to another client At least one of the second operational order or multiple;Wherein, second operational order includes to another client The customer frame frame number for another client that operational motion and the operational motion are acted on.
7. a kind of data synchronization server, including processor, memory and storage in the memory and be configured as by The computer program that the processor executes, the processor are realized when executing the computer program as in claim 1 to 6 Method of data synchronization based on multi-client interaction described in any one.
8. a kind of computer readable storage medium, which is characterized in that the computer readable storage medium includes the calculating of storage Machine program, wherein equipment where controlling the computer readable storage medium in computer program operation is executed as weighed Benefit require any one of 1 to 6 described in based on multi-client interaction method of data synchronization.
9. a kind of data synchronous system based on multi-client interaction, which is characterized in that including data as claimed in claim 7 Sync server and at least two clients;
Each client, for uploading the first data packet to the data synchronization server at the end of each customer frame; Wherein, first data packet includes the corresponding client in the client frame number of the customer frame and in the customer frame Received first operation;
The data synchronization server, the first data uploaded at the end of its each customer frame for receiving the client Packet;The corresponding server frame number of first data packet is obtained according to the client frame number;At the end of each service frame, root According to the corresponding server frame number of the service frame, obtain all in all first data packets uploaded in the service frame First operation, to generate the second operation for corresponding to each client;According to second operation corresponding to each client And the corresponding server frame number, the second data packet is issued to each client correspondence;
Each client is also used to receive corresponding second data packet, and is carried out together according to second data packet Step operation.
10. the data synchronous system according to claim 9 based on multi-client interaction, which is characterized in that
First client, is also used to when detecting initialization operation, executes the initialization operation, and for described in execution Customer frame corresponding to initialization operation distributes original client frame number;
First client is also used to carry out operating pre- performance according to first operation.
CN201810808603.2A 2018-07-18 2018-07-18 Data synchronization method, server, system and medium based on multi-client interaction Active CN109040208B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810808603.2A CN109040208B (en) 2018-07-18 2018-07-18 Data synchronization method, server, system and medium based on multi-client interaction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810808603.2A CN109040208B (en) 2018-07-18 2018-07-18 Data synchronization method, server, system and medium based on multi-client interaction

Publications (2)

Publication Number Publication Date
CN109040208A true CN109040208A (en) 2018-12-18
CN109040208B CN109040208B (en) 2021-06-01

Family

ID=64644073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810808603.2A Active CN109040208B (en) 2018-07-18 2018-07-18 Data synchronization method, server, system and medium based on multi-client interaction

Country Status (1)

Country Link
CN (1) CN109040208B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111953782A (en) * 2020-08-14 2020-11-17 上海曼恒数字技术股份有限公司 Method, device, medium and equipment for synchronizing multi-channel data
CN113746931A (en) * 2021-09-10 2021-12-03 联想(北京)有限公司 Data synchronization method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1794855A (en) * 2005-06-27 2006-06-28 华为技术有限公司 Method and device synchronous operating time in equipment management
CN101577715A (en) * 2009-06-19 2009-11-11 腾讯科技(深圳)有限公司 Method and device for synchronizing online game time
US20100022302A1 (en) * 2008-07-28 2010-01-28 Namco Bandai Games Inc. Information storage medium, synchronization control method, and computer terminal
US20100257280A1 (en) * 2007-12-05 2010-10-07 Koninklijke Kpn N.V. Method and System for Synchronizing the Output of Terminals
CN103796341A (en) * 2012-11-02 2014-05-14 展讯通信(天津)有限公司 Mobile terminal, mobile-terminal frame position determining method and device, and mobile-terminal frame reception method
CN106375314A (en) * 2016-08-31 2017-02-01 腾讯科技(深圳)有限公司 Game synchronization method, game client and game server
CN107404514A (en) * 2017-06-08 2017-11-28 腾讯科技(深圳)有限公司 Data processing method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1794855A (en) * 2005-06-27 2006-06-28 华为技术有限公司 Method and device synchronous operating time in equipment management
US20100257280A1 (en) * 2007-12-05 2010-10-07 Koninklijke Kpn N.V. Method and System for Synchronizing the Output of Terminals
US20100022302A1 (en) * 2008-07-28 2010-01-28 Namco Bandai Games Inc. Information storage medium, synchronization control method, and computer terminal
CN101577715A (en) * 2009-06-19 2009-11-11 腾讯科技(深圳)有限公司 Method and device for synchronizing online game time
CN103796341A (en) * 2012-11-02 2014-05-14 展讯通信(天津)有限公司 Mobile terminal, mobile-terminal frame position determining method and device, and mobile-terminal frame reception method
CN106375314A (en) * 2016-08-31 2017-02-01 腾讯科技(深圳)有限公司 Game synchronization method, game client and game server
CN107404514A (en) * 2017-06-08 2017-11-28 腾讯科技(深圳)有限公司 Data processing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111953782A (en) * 2020-08-14 2020-11-17 上海曼恒数字技术股份有限公司 Method, device, medium and equipment for synchronizing multi-channel data
CN113746931A (en) * 2021-09-10 2021-12-03 联想(北京)有限公司 Data synchronization method and device

Also Published As

Publication number Publication date
CN109040208B (en) 2021-06-01

Similar Documents

Publication Publication Date Title
EP3713653B1 (en) Temporary game control by user simulation following loss of active control
US11050823B2 (en) Method, apparatus, and system for playing scene animation
US11654354B2 (en) Resolution-based scaling of real-time interactive graphics
JP7169338B2 (en) Method, apparatus and computer program for synchronous display of game content
CN109847361B (en) Method and device for synchronizing motion states, storage medium and electronic device
EP4287634A1 (en) Game data processing method and apparatus, and storage medium
CN107222510B (en) A kind of game synchronization method, system and relevant device
EP3807766B1 (en) Shadow tracking of real-time interactive simulations for complex system analysis
CN111167116A (en) Smooth display method, terminal and computer storage medium
CN109672918B (en) Animation synchronous playing method and device
CN105516262B (en) Application program remote control method and system
CN109568948B (en) Method and device for synchronizing motion states of objects in online game
CN108668158A (en) A kind of barrage synchronous method, client and barrage server
CN109040208A (en) Method of data synchronization, server, system and medium based on multi-client interaction
US9118977B2 (en) Content synchronization system, content-synchronization control device, and content playback device
CN108055304A (en) Synchronous method, device, server, equipment and the storage medium of teledata
WO2019024766A1 (en) Virtual object control method, apparatus, computer device, and computer storage medium
CN103780619A (en) Wide area network real-time interactive game synchronization method and device, and system
CN102571687B (en) Method for building synchronous status information among real-time media streams, device adopting same and SCC AS
CN107948703B (en) Method and device for synchronizing playing progress
CN110113495A (en) Long-range control method, device, electronic equipment and the system of APP
US20160285576A1 (en) Gateway for interconnection of heterogeneous middleware and time synchronization method thereof
CN109529355A (en) Information synchronization method, device, processor and the server of virtual reality scenario
CN112771875B (en) Improving video bit rate while maintaining video quality
CN112386906B (en) Media resource playing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant