A high-efficiency network synchronization method, device and system

The efficient network synchronization method through client pre-calculation and server correction solves the problems of high latency and poor anti-cheating capabilities in the existing technology, and achieves a low-latency and efficient game synchronization experience.

CN112999652BActive Publication Date: 2024-09-20SUZHOU XIANFENG NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110466613.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-28
Publication Date
2024-09-20
Estimated Expiration
2041-04-28

AI Technical Summary

Technical Problem

Existing online game synchronization technology has problems such as high latency, large data volume, poor anti-cheating capabilities, and difficulty in reconnection processing, and cannot provide an efficient gaming experience.

Method used

Adopting an efficient network synchronization method, the client precalculates the operation actions input by the player, synchronizes them on the logical frame, and uses the server to correct them to ensure the synchronization of all clients. It combines the advantages of frame synchronization to achieve low latency and efficient synchronization. .

Benefits of technology

It achieves low network latency, improves user operating experience, prevents cheating, and simplifies reconnection and predictive synchronization issues, improving the synchronization performance and reliability of the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112999652B
    Figure CN112999652B
Patent Text Reader

Abstract

The present invention provides an efficient network synchronization method, device and system. For the first client to which the active party belongs, the first logical frame when the operation action in the control instruction input by the player is executed is later than the current logical frame. Therefore, the current logical frame is used to drive its logical layer to execute the operation action, thereby realizing the pre-calculation of the operation action of the active party. In addition, after uploading the first control instruction to the server, the server responds to the first control instruction and generates a second control instruction issued to each client. Once the second logical frame in the second control instruction is later than the first logical frame, the first client to which the active party belongs drives its logical layer to execute the operation actions in all control instructions within the range from the previous key logical frame to the second logical frame through the second logical frame, thereby realizing the synchronization of all clients, wherein the key frame refers to the logical frame that has passed the verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and more specifically, to an efficient network synchronization method, device and system. Background Art

[0002] With the development of online games, real-time combat games are becoming more and more popular. When transmitting over the network, especially over mobile networks, delays are very common. If the game synchronization problem cannot be solved perfectly, it will not provide players with a satisfying gaming experience.

[0003] At present, there are two main ways to deal with synchronization issues: state synchronization and frame synchronization. Among them, state synchronization is to hand over all logic to the server for calculation and notify the client for performance. The advantage of state synchronization is that the logic must be consistent, because the calculations are all on the server, ensuring the game's anti-cheating ability. For example, Legend, Journey, and Demi-Gods and Semi-Devils are all state synchronization. Frame synchronization is mainly based on LockStep technology. The server only forwards the instructions for game operations, and all logic is completed by the client, and every logic of every frame of all clients must be consistent. This synchronization solution can perfectly solve the complex battle logic synchronization problem, and the data required for synchronization is relatively small. For example, Honor of Kings and Warcraft are all such synchronization solutions.

[0004] However, all synchronization operations in state synchronization require server responses, which is highly dependent on network latency. The server computing pressure and network data synchronization volume are very large, and the client performance is also very limited. All logic of frame synchronization is completed by the client, which results in very poor anti-cheating capabilities. In addition, in order to optimize the unlocking problem of lockstep, the logical frame needs to be synchronized by the server, and the core logic still needs the server to reply before it can be executed, so there is also a certain degree of latency dependence. Summary of the invention

[0005] In view of this, in order to solve the above problems, the present invention provides an efficient network synchronization method, device and system, and the technical solution is as follows:

[0006] On one hand, the present invention provides an efficient network synchronization method, which is applied to a first client whose player character is an active party, and the method comprises:

[0007] Receive a first control instruction input by a player, wherein the first control instruction includes an operation action for a corresponding player character and a first logical frame when the operation action is executed, and the time of the first logical frame is later than the current logical frame of the first client;

[0008] driving the logic layer of the first client to perform the operation through the current logic frame of the first client, and uploading the first control instruction to the server;

[0009] receiving a second control instruction issued by the server based on the first control instruction, wherein the second control instruction includes a second logic frame for driving the server and the second client to perform the operation action, the player character corresponding to the second client is a passive party, and the time of the second logic frame is no earlier than the first logic frame;

[0010] If the time of the second logical frame is equal to the first logical frame, determining the first logical frame as a key logical frame;

[0011] If the time of the second logical frame is later than that of the first logical frame, a target key logical frame closest to the current logical frame of the first client is retrieved, and the logic layer of the first client is driven by the second logical frame to execute operation actions within all control instructions from the target key logical frame to the second logical frame.

[0012] Preferably, the operating action includes a first action for indicating a change in position of the player character;

[0013] The step of driving the logic layer of the first client to perform the operation by using the current logic frame of the first client includes:

[0014] Performing dead position prediction on the corresponding player character to correct the degree of position change corresponding to the first action;

[0015] The logical layer of the first client is driven to execute the modified first action through the current logical frame of the first client.

[0016] Preferably, the operation action includes a second action for indicating the release of a target skill, and the release effect of the target skill is random;

[0017] The step of driving the logic layer of the first client to perform the operation by using the current logic frame of the first client includes:

[0018] Retrieving a random seed, where the random seed is sent in advance by the server to the first client and the second client in a specified logical frame;

[0019] The current logical frame of the first client drives the logic layer of the first client to perform the second action according to the random result of the random seed.

[0020] Preferably, the method further comprises:

[0021] Controlling the logic layer of the first client to output a first execution result of the operation action executed by the first client to the view layer of the first client;

[0022] The current view frame of the first client is retrieved, and the view layer of the first client is driven by the current view frame of the first client to display the first execution result in a smooth interpolation manner.

[0023] Another aspect of the present invention provides an efficient network synchronization device, the device comprising:

[0024] An instruction input module, configured to receive a first control instruction input by a player, wherein the first control instruction includes an operation action for a corresponding player character and a first logical frame when the operation action is executed, and the time of the first logical frame is later than the current logical frame of the first client;

[0025] An operation execution module, used to drive the logic layer of the first client to execute the operation action through the current logic frame of the first client;

[0026] A communication module is used to upload the first control instruction to a server; receive a second control instruction issued by the server based on the first control instruction, wherein the second control instruction includes a second logic frame for driving the server and the second client to perform the operation action, the player character corresponding to the second client is a passive party, and the time of the second logic frame is no earlier than that of the first logic frame;

[0027] The operation execution module is also used to determine the first logical frame as a key logical frame if the time of the second logical frame is equal to the first logical frame; if the time of the second logical frame is later than the first logical frame, call a target key logical frame closest to the current logical frame of the first client, and drive the logical layer of the first client to execute operation actions within all control instructions within the range from the target key logical frame to the second logical frame through the second logical frame.

[0028] Another aspect of the present invention provides an efficient network synchronization method, which is applied to a first client whose player character is a passive party, and comprises:

[0029] Receiving a second control instruction issued by a server based on a first control instruction, wherein the first control instruction is uploaded to the server by a first client, a player character of the first client is an active party, the first control instruction includes an operation action for a corresponding player character, and a first logical frame when the operation action is executed, the time of the first logical frame is later than the current logical frame when the first client receives the first control instruction, and the second control instruction includes a second logical frame, the time of the second logical frame is not earlier than the first logical frame;

[0030] The logic layer of the second client is driven by the second logic frame to perform the operation action.

[0031] Preferably, the method further comprises:

[0032] When the network status switches from offline to online, uploading a reconnection request to the server;

[0033] Receiving scene information sent by the server based on the reconnection request, the scene information including status information of each character in the game scene and target control instructions in execution state, the target control instructions including target operation actions for corresponding player characters and target logical frames when the target operation actions are executed;

[0034] Determining, according to a time difference between a current logical frame of the second client and the target logical frame, a portion of the target operation action that has not been executed;

[0035] Driving the logic layer of the second client to execute the partial operation action through the current logic frame, and controlling the logic layer of the second client to output a second execution result of the partial operation action to the view layer of the second client;

[0036] Retrieve the current view frame of the second client, drive the view layer of the second client to display the game scene according to the status information through the current view frame of the second client, and display the second execution result in the game scene in a smooth interpolation manner.

[0037] Another aspect of the present invention provides an efficient network synchronization device, characterized in that the device comprises:

[0038] A communication module, configured to receive a second control instruction issued by a server based on a first control instruction, wherein the first control instruction is uploaded to the server by a first client, a player character of the first client is an active party, the first control instruction includes an operation action for the corresponding player character, and a first logical frame when the operation action is executed, the time of the first logical frame is later than the current logical frame when the first client receives the first control instruction, and the second control instruction includes a second logical frame, the time of the second logical frame is no earlier than the first logical frame;

[0039] An operation execution module is used to drive the logic layer of the second client to execute the operation action through the second logical frame.

[0040] Another aspect of the present invention provides an efficient network synchronization system, the system comprising: a server and a plurality of clients, one client corresponding to one player character;

[0041] The first client whose player character belongs to the active party executes any one of the corresponding efficient network synchronization methods;

[0042] The second client whose player character belongs to the passive party executes any one of the corresponding efficient network synchronization methods.

[0043] Preferably, the server sends the calculation result of the specified logic to each client in the form of passive instructions.

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] The present invention provides an efficient network synchronization method, device and system, which divides the entire game network world into a server, an active party and a passive party, wherein the active party refers to the game character controlled by the player in the client, and the passive party refers to other game characters seen by the player in the client. For the first client to which the active party belongs, the first logical frame when the operation action is executed in the control instruction input by the player is later than the current logical frame, so the current logical frame drives its logical layer to execute the operation action, and the pre-calculation of the operation action of the active party can be realized. In addition, after uploading the first control instruction to the server, the server responds to the first control instruction to generate a second control instruction issued to each client, and once the second logical frame in the second control instruction is later than the first logical frame, the first client to which the active party belongs drives its logical layer to execute the operation actions in all control instructions within the range from the previous key logical frame to the second logical frame through the second logical frame, thereby realizing the synchronization of all clients, wherein the key frame refers to the logical frame that has been verified. Under the C / S architecture, the present invention combines the advantages of frame synchronization to achieve efficient synchronization, which can not only ensure low network delay, but also improve user operation experience, can prevent plug-ins, and facilitate the handling of synchronization problems such as reconnection and prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0047] Figure 1 A method flow chart of an efficient network synchronization method provided by an embodiment of the present invention;

[0048] Figure 2 A schematic diagram of smooth interpolation provided by an embodiment of the present invention;

[0049] Figure 3 A schematic diagram of a scenario provided by an embodiment of the present invention;

[0050] Figure 4 A schematic diagram of the structure of an efficient network synchronization device provided by an embodiment of the present invention;

[0051] Figure 5 Another method flow chart of the efficient network synchronization method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0054] In the embodiment of the present invention, the entire online game world is divided into three parts: server, passive party, and active party. The active party refers to the game character controlled by the player in the client, and the passive party refers to other game characters seen by the player in the client. Simply put, in a player's client, the game character controlled by the player is the active party, and the game characters controlled by other players are passive parties for the player. In the present invention, the server, passive party, and active party directly follow the following principles:

[0055] 1) In terms of time, the active party is ahead of the server, and the server is ahead of the passive party;

[0056] 2) Logically, the passive side is consistent with the server, for example, the position of the game character, the game character has the same position coordinates in the same logical frame of the passive side and the server. However, the active side will deviate from the server because the active side has pre-calculation.

[0057] 3) The active party makes a dead-position prediction and the server makes a correction. Specifically, the active party predicts the possible position to be reached in the next period of time and the possible collision with other game characters based on its own position, movement status, speed, acceleration, direction, etc.; the server corrects the active party to the position of the current logical frame of the server when there is a large deviation between the pre-calculated result of the active party and the actual calculation result.

[0058] The embodiment of the present invention provides an efficient network synchronization method, which is applied to a first client whose player character is an active party. The method flow chart of the method is as follows: Figure 1 As shown, the following steps are included:

[0059] S101, receiving a first control instruction input by a player, wherein the first control instruction includes an operation action for a corresponding player character and a first logical frame when the operation action is executed, and the time of the first logical frame is later than the current logical frame of the first client.

[0060] In the embodiment of the present invention, the client corresponding to the active party is the first client. For a game character, the client operating the character is the first client, and other clients watching the character are second clients. The game character is a passive party for the second client.

[0061] The first client responds to the player's touch operation to generate a first control instruction, which includes the operation action of the player's game character and the logic frame when the operation action is performed, that is, the first logic frame. The first logic frame is predicted based on the current logic frame. Specifically, the first logic frame is calculated based on the current logic frame, taking into account the network delay and the correction amount. Assuming that the current logic frame is 13 frames, the network delay is 3 frames, and the correction amount is 1 frame, the player triggers the game character to move. At this time, the first client generates a first control instruction at the 13th frame, and the first control instruction indicates that the movement logic of the game character is executed at the 17th frame (13+3+1).

[0062] It should be noted that the logical frame refers to the frame for calculating combat logic, such as damage calculation, movement calculation, knockback, buff, etc. Strictly speaking, the larger the logical frame, the better the gaming experience, but the larger the logical frame, the greater the network performance consumption and the higher the dependence on the network. For performance, the smaller the logical frame, the better, but for the gaming experience, the larger the logical frame, the better, so in order to optimize performance, the logical frame is generally within 15 frames.

[0063] It should also be noted that the server and the client run the same set of logic codes, but the logic frame is driven by the server, and most of the logic is based on the server. That is, the server sends logic frames to all clients at a certain frequency, and the client uses the logic frame to drive its own logic, so as to achieve time calibration.

[0064] S102: driving the logic layer of the first client to perform an operation action through the current logic frame of the first client, and at the same time, uploading the first control instruction to the server.

[0065] In the embodiment of the present invention, as described above, the client has the same computing power as the server, and can be conveniently pre-calculated, that is, all control instructions are responded to immediately. In addition, the logic and view of the client are completely separated, which is a separation in design mode. The view is driven by the logic, and the behavior of the logic is passed to the view through the interface, and the logic layer does not need to care about any state of the view layer. Even without the view layer, the logic layer can also operate normally.

[0066] The logic layer is the logic running on the client, such as the movement logic that considers the relationship between distance and speed; the view layer refers to the game screen seen by the player, such as an animation or a special effect. The logic layer is driven by the logic frame, and the view layer is driven by the view frame.

[0067] Therefore, in terms of logic, for the active party, it drives its logic layer to perform corresponding operations through the current logic frame, so as to complete the logic calculation in advance of the server and the passive party. Of course, the logic layer will pass the calculation results to the view layer through the interface, and the view layer will be driven by the current view frame to complete the display of the screen. In the specific implementation process, in order to ensure that the game does not rely on network fluctuations, the logic frame is defined within 15 frames, and the view layer performs smooth interpolation on the logic layer. The details are as follows:

[0068] The logic layer of the first client is controlled to output a first execution result of the operation performed by the first client to the view layer of the first client; the current view frame of the first client is retrieved, and the view layer of the first client is driven by the current view frame of the first client to display the first execution result in a smooth interpolation manner.

[0069] In the embodiment of the present invention, the logic layer of the first client outputs the execution result of the operation action to the view layer. For example, the execution result of the operation action is "straight line moving distance a". After the view layer obtains the execution result, the current view frame drives the view layer to output multiple view frames in a smooth interpolation manner, so as to express the "straight line moving distance a" with multiple continuous view frames. Of course, in order to ensure the visual experience of the player, the straight line moving distance in multiple view frames can be expressed by a smooth straight line / curve.

[0070] For details, see Figure 2The smooth interpolation diagram is shown in the figure. The view layer can use the shadow following algorithm, taking the execution result of the logic layer as the target, and following according to the matching step size. The faster the logic layer executes, the faster the view layer outputs the view frame. At the beginning, the step size of the logic is 10 and the step size of the view is 1. If the view is about to catch up with the logic, the step size of the view will become smaller to prevent it from overtaking; if the distance between the view and the logic is too far, the step size of the view will become larger to catch up with the logic.

[0071] It should be noted that the view frame refers to the frame rate of client rendering. In order to ensure the continuous flow of the picture, the view frame should generally be above 30 frames.

[0072] S103, receiving a second control instruction issued by the server based on the first control instruction, wherein the second control instruction includes a second logic frame for driving the server and the second client to perform an operation, the player character corresponding to the second client is a passive party, and the time of the second logic frame is no earlier than the first logic frame.

[0073] In the embodiment of the present invention, due to the network delay between the client and the server, the first control instruction uploaded by the client to the server in the current logical frame will be received by the server in the subsequent logical frame.

[0074] Continuing with the example of the first client uploading the first control instruction to the server when the current logical frame is 13, the first logical frame contained in the first control instruction is 17, that is, the first client instructs the server to perform the operation at logical frame 17. Obviously, when the server receives the first control instruction, the current logical frame of the server is later than 13 frames, which leads to the following two situations:

[0075] 1) The server receives the first control instruction before logical frame 17 (including 17 frames). Assume that when the server receives the first control instruction, its current logical frame is 15 frames. After comparing it with the first logical frame "17 frames" in the first control instruction, it is determined that the time is earlier than the time indicated by the first client, and the second control instruction is sent to all clients (including the first client and the second client). At this time, the second control instruction is the same as the first control instruction, that is, the second logical frame in the second control instruction is also 17 frames, and the operation action in the second control instruction is also the same as the operation action in the first control instruction. Since the first client has completed the pre-calculation, that is, the operation action has been performed when the logical frame is 13 frames, the first client no longer performs the operation action, and the server and the second client perform the operation action when the logical frame is 17 frames.

[0076] Furthermore, when the first client receives the second control instruction sent by the server, it determines that the second logical frame "frame 17" in the second control instruction is the same as the first logical frame "frame 17" in the first control instruction uploaded to the server, then it determines that the logical frame "frame 17" has passed the verification and defines it as a key logical frame.

[0077] 2) The server receives the first control instruction after logical frame 18.

[0078] See also Figure 3 The scene diagram shown. When the server receives the first control instruction, its current logical frame is 18 frames. After comparing it with the first logical frame "17 frames" in the first control instruction, it determines that the time is later than the time indicated by the first client, and sends the second control instruction to all clients (including the first client and the second client). At this time, the second logical frame in the second control instruction is 18 frames, and the operation action is the same as the operation action in the first control instruction.

[0079] The first client and the second client receive the second control instruction at the 18th logical frame. Since the logical frame predicted by the first client is deviated, the first client calls the last verified key logical frame "12th frame" and executes all the operation actions in the control instructions issued by the server between 12th and 18th frames at the 18th frame. The operation is completed by the logical layer driven by the 18th logical frame, which is equivalent to a quick correction driven by the server. The second client executes the operation action at the 18th logical frame.

[0080] S104: If the time of the second logical frame is equal to that of the first logical frame, the first logical frame is determined as a key logical frame.

[0081] S105, if the time of the second logical frame is later than that of the first logical frame, retrieve a target key logical frame closest to the current logical frame of the first client, and drive the logic layer of the first client to execute operation actions within all control instructions from the target key logical frame to the second logical frame through the second logical frame.

[0082] In some other embodiments, the position information in the game, including the position of the character, the trajectory of the bullet, the position of the collision body, etc., is key information. Therefore, the embodiment of the present invention can correct the position information in the control instruction by performing dead position prediction by the active party. Specifically:

[0083] The operation action includes a first action for indicating a change in the position of the player character. Accordingly, in step S20, "driving the logic layer of the first client to perform the operation action through the current logic frame of the first client" may include the following steps:

[0084] The dead position prediction is performed on the corresponding player character to correct the position change degree corresponding to the first action; and the logic layer of the first client is driven to execute the corrected first action through the current logic frame of the first client.

[0085] In the embodiment of the present invention, considering the positions of obstacles, enemy characters, etc. in the game scene, before executing the operation action of changing the position of the player character, it is first corrected. For example, the operation action in the first control instruction instructs the player character to move a straight line distance b, but considering the existence of obstacles during the movement, the dead position prediction is "the player character moves a straight line distance c", where c is less than b, then the operation action in the first control instruction is corrected to "instruct the player character to move a straight line distance c".

[0086] In some other embodiments, generally speaking, the server has all the status data, including the position, health, magic points, buffs and passive effects of the game character, so there are rarely random problems, but there are still some complex scenarios that require random solutions, such as a skill effect that randomly generates many spherical tracking bullets nearby. In this regard, in the embodiments of the present invention, the server and the client can synchronize a random seed to achieve the same set of random algorithms for the server and the client to calculate the same random results. Specifically:

[0087] The operation action includes a second action for indicating the release of a target skill, and the release effect of the target skill is random. Accordingly, in step S20, "driving the logic layer of the first client to perform the operation action through the current logic frame of the first client" may include the following steps:

[0088] Retrieve a random seed, which is sent by the server to the first client and the second client in advance under a specified logical frame; and drive the logic layer of the first client to perform the second action according to the random result of the random seed through the current logical frame of the first client.

[0089] In an embodiment of the present invention, the server sends a random seed to all clients in advance in a specified logical frame. The client maintains the same random algorithm as the server from the beginning of the logical frame receiving the random seed and calculates the same random result. Therefore, the random seed can ensure that the random results of the server and each client are the same each time the random seed is retrieved.

[0090] Taking the random function of the system as an example, the function algorithm adopts linear modulus. As long as the random seeds between the server and the client are the same, the random results of each subsequent call are the same. For example, if the random seed is 100, the random results of the server, the active party, and the passive party are all 0.2 in the first call, and the random results of the second call are all 0.4. Therefore, based on the same random result, the server, the active party, and the passive party will produce the same operation action with the same skill random release effect during the logical calculation.

[0091] In summary, the core of the present invention is to make full use of the frame synchronization technology in the C / S architecture, but it is not absolutely complete synchronization. The server and the client have the same computing power, which facilitates the switching of computing power and allows the game to have a better game synchronization experience. Compared with state synchronization, the present invention solves the problems of large amount of network transmission data, simple battle synchronization logic, poor synchronization experience, and high network delay. Compared with frame synchronization, the present invention solves the problems of low safety performance, small scope of use, high debugging difficulty, serious disconnection and reconnection problems, and poor preprocessing capabilities. In addition, the game developed using the present invention can dodge bullets, can be knocked back in multiple stages, and can prevent plug-ins.

[0092] Based on the efficient network synchronization method provided in the above embodiment, an embodiment of the present invention provides a device for executing the method, and the structural diagram of the device is shown in FIG. Figure 4 As shown, including:

[0093] The instruction input module 10 is used to receive a first control instruction input by a player, wherein the first control instruction includes an operation action for a corresponding player character and a first logical frame when the operation action is executed, and the time of the first logical frame is later than the current logical frame of the first client;

[0094] An operation execution module 20, configured to drive the logic layer of the first client to execute an operation action through the current logic frame of the first client;

[0095] The communication module 30 is used to upload the first control instruction to the server; receive the second control instruction issued by the server based on the first control instruction, wherein the second control instruction includes a second logic frame for driving the server and the second client to perform the operation action, the player character corresponding to the second client is a passive party, and the time of the second logic frame is not earlier than the first logic frame;

[0096] The operation execution module 20 is also used to determine the first logical frame as a key logical frame if the time of the second logical frame is equal to the first logical frame; if the time of the second logical frame is later than the first logical frame, call a target key logical frame closest to the current logical frame of the first client, and drive the logical layer of the first client to execute all operation actions within the control instructions from the target key logical frame to the second logical frame through the second logical frame.

[0097] Optionally, the operation action includes a first action for indicating a position change of a player character; and the process in which the operation execution module 20 drives the logic layer of the first client to execute the operation action through the current logic frame of the first client includes:

[0098] The dead position prediction is performed on the corresponding player character to correct the position change degree corresponding to the first action; and the logic layer of the first client is driven to execute the corrected first action through the current logic frame of the first client.

[0099] Optionally, the operation action includes a second action for indicating the release of a target skill, and the release effect of the target skill is random; the process in which the operation execution module 20 drives the logic layer of the first client to execute the operation action through the current logic frame of the first client includes:

[0100] Retrieve a random seed, which is sent by the server to the first client and the second client in advance under a specified logical frame; and drive the logic layer of the first client to perform the second action according to the random result of the random seed through the current logical frame of the first client.

[0101] Optionally, the operation execution module 20 is further used to:

[0102] The logic layer of the first client is controlled to output a first execution result of the operation performed by the first client to the view layer of the first client; the current view frame of the first client is retrieved, and the view layer of the first client is driven by the current view frame of the first client to display the first execution result in a smooth interpolation manner.

[0103] Based on the efficient network synchronization method provided in the above embodiment, the embodiment of the present invention provides another efficient network synchronization method, which is applied to the second client where the player character belongs to the passive party. The method flow chart of the method is as follows Figure 5 As shown, the following steps are included:

[0104] S201, receiving a second control instruction issued by the server based on the first control instruction, the first control instruction is uploaded to the server by the first client, the player character of the first client is the active party, the first control instruction includes an operation action for the corresponding player character, and a first logical frame when the operation action is executed, the time of the first logical frame is later than the current logical frame when the first client receives the first control instruction, the second control instruction includes a second logical frame, and the time of the second logical frame is no earlier than the first logical frame.

[0105] In the embodiment of the present invention, the process of the first client uploading the first control instruction to the server, and the server issuing the second control instruction based on the first control instruction, can be referred to the corresponding disclosed part of the above embodiment, and will not be repeated here.

[0106] S202: Drive the logic layer of the second client to perform an operation action through the second logic frame.

[0107] In the embodiment of the present invention, the same client can be an active party or a passive party for different game characters. For a game character controlled by a player through a client, the client is an active party, and for a game character controlled by other players through other clients, the client is a passive party.

[0108] When the client acts as a passive party, it receives a control instruction sent by the server, namely, a second control instruction, and then parses the second control instruction to obtain a second logic frame and an operation action, and drives its logic layer to execute the operation action through the second logic frame.

[0109] In some other embodiments, to achieve fast disconnection and reconnection, the embodiments of the present invention further include the following steps:

[0110] When the network status switches from offline to online, a reconnection request is uploaded to the server;

[0111] Receiving scene information sent by the server based on the reconnection request, the scene information includes status information of each character in the game scene, and target control instructions in execution state, the target control instructions include target operation actions for corresponding player characters, and target logic frames when the target operation actions are executed;

[0112] Determine, according to a time difference between a current logical frame of the second client and a target logical frame, a portion of the target operation action that has not been executed;

[0113] Driving the logic layer of the second client to perform a part of the operation action through the current logic frame, and controlling the logic layer of the second client to output a second execution result of the part of the operation action to the view layer of the second client;

[0114] The current view frame of the second client is retrieved, and the view layer of the second client is driven to display the game scene according to the state information through the current view frame of the second client, and the second execution result is displayed in the game scene in a smooth interpolation manner.

[0115] In the embodiment of the present invention, the client can monitor its own network status in real time. Once it detects that the connection is switched from offline to disconnected, it will upload a new request to the server, so that the server can send its status information and the control instruction being executed, that is, the target control instruction, to the client. Of course, the target control instruction includes the target operation action of the relevant player character and the target logical frame when executing the target operation action.

[0116] Since the target operation is being executed, the current logical frame must be later than the target logical frame. At this time, the part of the target operation that has not been executed can be predicted based on the time difference between the current logical frame and the target logical frame, and then the current logical frame drives the logic layer to execute the part of the operation, and drives the view layer through the current view frame to display the relevant scenes and the part of the operation.

[0117] It should be noted that the process of the client's view layer displaying the second execution result in a smooth interpolation manner can refer to the public part of displaying the first execution result in a smooth interpolation manner in the above embodiment, and will not be repeated here.

[0118] For example, character A starts moving forward at position 0, with a speed of 1. After 5 logical frames, the client of character B disconnects and reconnects. For the client that disconnects and reconnects, if it wants to see the correct behavior of character A, the server needs to send the current position of character B, which is 5, to the client, and on the other hand, send the control instructions uploaded by the client to which character A belongs 5 ​​logical frames ago to the client. After the client that disconnects and reconnects obtains these two pieces of information, it can calculate the time difference between the current logical frame and the logical frame when A starts moving, combined with the current position and speed, that character A is now at position 5 and continues to move forward. In this way, the movement process of character A can be obtained.

[0119] In addition, this solution is also applicable to the scene when a new player enters, which can be understood as the offline state before the new player enters. It can be used in various types of games, such as MMO, RTS, FPS, etc., without the need to open a room to enter and exit at the same time. When a new player enters during operation, it only needs to synchronize the information of all characters in the current scene plus the last executed control instruction to the new character, and the client can quickly calculate the information of other characters.

[0120] Therefore, the present invention can solve the reconnection problem of lockstep, which requires a quick recalculation from beginning to end, which is very performance-consuming and very unstable. It is not feasible for MMO games that do not have the concept of one round after another (for example, if a player has fought a battle 3 days ago, he needs to calculate the battle logic of 3 days when reconnecting). The present invention only needs to send down the last control instruction after the status information of the character, and it can be synchronized to the current status.

[0121] Based on the efficient network synchronization method provided in the above embodiment, the embodiment of the present invention provides a device for executing the method, see Figure 4 The structural diagram shown in FIG.

[0122] The communication module 30 is used to receive a second control instruction issued by the server based on the first control instruction, wherein the first control instruction is uploaded to the server by the first client, the player character of the first client is an active party, the first control instruction includes an operation action for the corresponding player character, and a first logical frame when the operation action is executed, the time of the first logical frame is later than the current logical frame when the first client receives the first control instruction, and the second control instruction includes a second logical frame, and the time of the second logical frame is not earlier than the first logical frame;

[0123] The operation execution module 20 is used to drive the logic layer of the second client to execute the operation action through the second logic frame.

[0124] Optionally, the operation execution module 20 is further used to:

[0125] When the network status switches from offline to online, a reconnection request is uploaded to the server; scene information sent by the server based on the reconnection request is received, the scene information includes status information of each character in the game scene, and target control instructions in execution state, the target control instructions include target operation actions for the corresponding player characters, and target logical frames when the target operation actions are executed; according to the time difference between the current logical frame and the target logical frame of the second client, part of the operation actions that have not been executed in the target operation actions are determined; the logic layer of the second client is driven to execute part of the operation actions through the current logical frame, and the logic layer of the second client is controlled to output the second execution result of the part of the operation actions to the view layer of the second client; the current view frame of the second client is retrieved, and the view layer of the second client is driven to display the game scene according to the status information through the current view frame of the second client, and the second execution result is displayed in the game scene in a smooth interpolation manner.

[0126] Based on the efficient network synchronization methods provided in the above embodiments, an embodiment of the present invention provides an efficient network synchronization system, which includes: a server and multiple clients, one client corresponding to one player character;

[0127] The first client that the player character belongs to is the active party. Figure 1 The efficient network synchronization method described above; the second client whose player character is the passive party executes Figure 5 The efficient network synchronization method described.

[0128] In addition, the server sends the calculation results of the specified logic to each client in the form of passive instructions. The specified logic includes but is not limited to server logic such as AI behavior, skill effects, numerical calculations, and Buff effects. The client usually does not process these logics unless there is a special need. After the calculation is completed, the server sends the results to each client in the form of passive instructions.

[0129] The above is a detailed introduction to an efficient network synchronization method, device and system provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in the field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

[0130] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0131] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device that includes a series of elements is inherent to the elements, or also includes elements inherent to these processes, methods, articles or devices. In the absence of further restrictions, the elements defined by the sentence "including a..." do not exclude the presence of other identical elements in the process, method, article or device that includes the elements.

[0132] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An efficient network synchronization method, characterized in that: The method is applied to a first client whose player character belongs to an active party, and the method comprises: Receive a first control instruction input by a player, wherein the first control instruction includes an operation action for a corresponding player character and a first logical frame when the operation action is executed, and the time of the first logical frame is later than the current logical frame of the first client; driving the logic layer of the first client to perform the operation through the current logic frame of the first client, and uploading the first control instruction to the server; receiving a second control instruction issued by the server based on the first control instruction, wherein the second control instruction includes a second logic frame for driving the server and the second client to perform the operation action, the player character corresponding to the second client is a passive party, and the time of the second logic frame is no earlier than the first logic frame; If the time of the second logical frame is equal to the first logical frame, determining the first logical frame as a key logical frame; If the time of the second logical frame is later than that of the first logical frame, a target key logical frame closest to the current logical frame of the first client is retrieved, and the logic layer of the first client is driven by the second logical frame to execute operation actions within all control instructions from the target key logical frame to the second logical frame.

2. The method according to claim 1, characterized in that The operation action includes a first action for indicating a change in the position of the player character; The step of driving the logic layer of the first client to perform the operation by using the current logic frame of the first client includes: Performing dead position prediction on the corresponding player character to correct the degree of position change corresponding to the first action; The logical layer of the first client is driven to execute the modified first action through the current logical frame of the first client.

3. The method according to claim 1, characterized in that The operation action includes a second action for instructing to release a target skill, and the release effect of the target skill is random; The step of driving the logic layer of the first client to perform the operation by using the current logic frame of the first client includes: Retrieving a random seed, where the random seed is sent in advance by the server to the first client and the second client in a specified logical frame; The current logical frame of the first client drives the logic layer of the first client to perform the second action according to the random result of the random seed.

4. The method according to claim 1, characterized in that: The method further comprises: Controlling the logic layer of the first client to output a first execution result of the operation action executed by the first client to the view layer of the first client; The current view frame of the first client is retrieved, and the view layer of the first client is driven by the current view frame of the first client to display the first execution result in a smooth interpolation manner.

5. An efficient network synchronization device, characterized in that: Applied to a first client where the player character is an active party, the device comprises: An instruction input module, configured to receive a first control instruction input by a player, wherein the first control instruction includes an operation action for a corresponding player character and a first logical frame when the operation action is executed, and the time of the first logical frame is later than the current logical frame of the first client; An operation execution module, used to drive the logic layer of the first client to execute the operation action through the current logic frame of the first client; A communication module is used to upload the first control instruction to a server; receive a second control instruction issued by the server based on the first control instruction, wherein the second control instruction includes a second logic frame for driving the server and the second client to perform the operation action, the player character corresponding to the second client is a passive party, and the time of the second logic frame is no earlier than that of the first logic frame; The operation execution module is also used to determine the first logical frame as a key logical frame if the time of the second logical frame is equal to the first logical frame; if the time of the second logical frame is later than the first logical frame, call a target key logical frame closest to the current logical frame of the first client, and drive the logical layer of the first client to execute operation actions within all control instructions within the range from the target key logical frame to the second logical frame through the second logical frame.

6. An efficient network synchronization method, characterized in that: The method is applied to a second client whose player character belongs to a passive party, and the method comprises: Receiving a second control instruction issued by a server based on a first control instruction, wherein the first control instruction is uploaded to the server by a first client, a player character of the first client is an active party, the first control instruction includes an operation action for a corresponding player character, and a first logical frame when the operation action is executed, the time of the first logical frame is later than the current logical frame when the first client receives the first control instruction, and the second control instruction includes a second logical frame, the time of the second logical frame is not earlier than the first logical frame; The logic layer of the second client is driven by the second logic frame to perform the operation action.

7. The method according to claim 6, characterized in that The method further comprises: When the network status switches from offline to online, uploading a reconnection request to the server; Receiving scene information sent by the server based on the reconnection request, the scene information including status information of each character in the game scene and target control instructions in execution state, the target control instructions including target operation actions for corresponding player characters and target logical frames when the target operation actions are executed; determining, according to a time difference between a current logical frame of the second client and the target logical frame, a portion of the operation actions that have not been executed in the target operation action; Driving the logic layer of the second client to execute the partial operation action through the current logic frame, and controlling the logic layer of the second client to output a second execution result of the partial operation action to the view layer of the second client; Retrieve the current view frame of the second client, drive the view layer of the second client to display the game scene according to the status information through the current view frame of the second client, and display the second execution result in the game scene in a smooth interpolation manner.

8. An efficient network synchronization device, characterized in that: Applied to a second client where the player character belongs to a passive party, the device comprises: A communication module, configured to receive a second control instruction issued by a server based on a first control instruction, wherein the first control instruction is uploaded to the server by a first client, a player character of the first client is an active party, the first control instruction includes an operation action for the corresponding player character, and a first logical frame when the operation action is executed, the time of the first logical frame is later than the current logical frame when the first client receives the first control instruction, and the second control instruction includes a second logical frame, the time of the second logical frame is no earlier than the first logical frame; An operation execution module is used to drive the logic layer of the second client to execute the operation action through the second logical frame.

9. An efficient network synchronization system, characterized in that: The system comprises: a server and a plurality of clients, one client corresponding to one player character; The first client whose player character is the active party executes the efficient network synchronization method according to any one of claims 1 to 4; The second client whose player character belongs to the passive party executes the efficient network synchronization method described in any one of claims 6 to 7.

10. The system according to claim 9, characterized in that The server sends the operation results of the specified logic to each client in the form of passive instructions.