Server, client frame synchronization method, electronic device and storage medium

By creating a unique index for each player and establishing a mapping relationship table, the problem of large space occupied by account ids in frame synchronization data packets is solved, and the data transmission volume and efficiency are reduced.

CN118846499BActive Publication Date: 2024-12-20EZFUN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411329732.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2024-12-20
Estimated Expiration
2044-09-24

AI Technical Summary

Technical Problem

In the existing frame synchronization technology, the player account id occupies a large amount of data packet space, resulting in data bloat and inefficiency.

Method used

By creating a unique index for each player and establishing a mapping relationship table between the index and the player account, synchronously indexing replaces the account information and reduces the amount of data transmission.

Benefits of technology

It significantly reduces the size of frame synchronization packets, reduces the bandwidth pressure of clients and servers, and improves the efficiency of frame synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118846499B_ABST
    Figure CN118846499B_ABST
Patent Text Reader

Abstract

The present application relates to the field of game software, and provides a server and client frame synchronization method, an electronic device and a storage medium. The server frame synchronization method includes: when creating the current game environment, creating a unique index for each player in this game; creating a mapping relationship table between the index and the player account, and synchronizing it to all clients participating in this game; receiving synchronization data from a client, the synchronization data including behavior data; parsing the synchronization data through the mapping relationship table, and synchronizing the index and behavior data to all clients in this game. The present application sets an index for the player account when creating a game battlefield, and when performing frame synchronization, replaces the player account with the index, and then converts it to the player account through the mapping table on the client and performs the display, so as to reduce the amount of data transmission during synchronization. This solution greatly reduces the size of the frame synchronization data packet, reduces the bandwidth pressure on the client and server, and greatly improves the efficiency of frame synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of game software technology, and in particular to a server, a client frame synchronization method, an electronic device and a storage medium. Background Art

[0002] Frame synchronization technology is mainly used in scenarios with high real-time requirements, especially in online games. For example, in multiplayer online games, frame synchronization is used to ensure that all players' operations can be performed synchronously, thereby maintaining the consistency of the game state. The frame synchronization solution has the following advantages: 1. Frame synchronization only requires sending operation instructions and frame numbers, which reduces the transmission of a large amount of state data compared to state synchronization; 2. The playback and spectator functions of frame synchronization are simple to implement, and only the operations of everyone in each game need to be saved; 3. The battle logic of frame synchronization is on the client, which can fully utilize the computing power of the client.

[0003] Frame synchronization technology is widely used in the synchronization of multiplayer battlefield data in games. Its existing implementation method is: each operation of the client generates a data packet, which generally includes two values: behavior type and behavior data, and sends it to the server. After receiving the data packet from the client, the server will merge the account and data packet corresponding to the client into a frame synchronization data packet. The data includes the player account ID, behavior type and behavior data, which are used to describe which player has performed which operations, and synchronize them to all clients in the battlefield. After receiving the frame synchronization data packet, the client parses the player account ID, behavior type and behavior data from it, and then performs the display.

[0004] However, this existing solution has certain disadvantages. A frame synchronization data packet consists of three parts: player account ID, behavior type, and behavior data. The player account ID is usually a relatively large value. For example, if there are 1 million players in the game, at least 4 bytes are required to describe the player account ID. The behavior type generally does not exceed 500, which means that it can be described with a maximum of 2 bytes. Similarly, the behavior data is relatively small in most cases. For example, the location information corresponding to the moving behavior and the skill ID corresponding to the skill release behavior can be described with a maximum of 4 bytes. It can be seen that during the frame synchronization process, the player account ID occupies a large amount of space in the frame synchronization packet, resulting in bloated data and reduced efficiency of frame synchronization. Summary of the invention

[0005] In order to help improve the problems of large data packets, bloated data, and low frame synchronization efficiency in frame synchronization, the present application provides a server, a client frame synchronization method, an electronic device, and a storage medium.

[0006] In a first aspect, the present application provides a server frame synchronization method, which is applied to a multiplayer game server, and the method comprises:

[0007] When creating the current game environment, create a unique index for each player in this game;

[0008] Create a mapping table between indexes and player accounts, and synchronize it to all clients participating in the game;

[0009] Receiving synchronization data from a client, wherein the synchronization data includes behavior data;

[0010] The synchronization data is parsed through the mapping relationship table, and the index and behavior data are synchronized to all clients of the bureau.

[0011] By adopting the above technical solution, the player account is mapped into an index mechanism and the player account information is reduced to less than 1 byte, which can greatly reduce the amount of communication data between the client and the server in the frame synchronization gameplay.

[0012] In a second aspect, the present application proposes a client frame synchronization method, which is applied to a multiplayer game client, and the method includes:

[0013] When starting a game, a mapping table between player accounts and indexes of the game is received from the server, where the index is a unique identifier of the player of the game;

[0014] When playing the game, create synchronization data and send it to the server; the synchronization data includes the behavior data of the player;

[0015] Receive the index and behavior data of other players from the server, and present the data after parsing through the mapping relationship table.

[0016] In a third aspect, the present application provides an electronic device, which adopts the following technical solution:

[0017] An electronic device, comprising:

[0018] at least one processor;

[0019] Memory;

[0020] At least one application, wherein the at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute the server frame synchronization method as described above.

[0021] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:

[0022] A computer-readable storage medium stores a computer program, which, when executed in a computer, causes the computer to execute any one of the server frame synchronization methods provided in the first aspect.

[0023] In summary, this application sets an index for the player when creating a game battlefield. When performing frame synchronization transmission, the player account is replaced by the index, and then converted to the player account through a mapping table on the client and displayed, thereby reducing the data transmission size during synchronization. This solution greatly reduces the size of the frame synchronization data packet, reduces the bandwidth pressure on the client and server, and greatly improves the efficiency of frame synchronization. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a flow chart of a server frame synchronization method provided in an embodiment of the present application;

[0025] Figure 2 It is a flow chart of a client frame synchronization method provided in an embodiment of the present application;

[0026] Figure 3 It is a module schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figures 1 to 3 It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0028] The embodiments of the present application provide a server, a client frame synchronization method, an electronic device and a storage medium for use in a multi-person online network system.

[0029] This embodiment uses a multiplayer online network system as an application example to specifically illustrate the above method. In actual implementation, the above method can also be used in other game software or communication software, etc., and this embodiment does not limit this.

[0030] Specific reference Figure 1 As shown, the present invention proposes a server frame synchronization method, which is applied to a multiplayer game server, and the method includes:

[0031] S10: When creating the current game environment, a unique index is created for each player in the current game, that is, the index corresponds one-to-one to the player account in the current game;

[0032] S20: Create a mapping relationship table between indexes and player accounts, and synchronize it to all clients participating in the current game;

[0033] S30: receiving synchronization data from a client, the synchronization data including behavior data, the behavior data including behavior type and behavior data; it can be understood that the behavior type can be: moving, releasing skills, etc.; and the behavior data is the location information corresponding to the moving behavior, the skill ID corresponding to the releasing skill behavior, etc.;

[0034] S40: Parse the synchronization data through the mapping table, and synchronize the index and behavior data to all clients of the game. For example, in this embodiment, there is a four-player game, and at this time, the data of one client is synchronized from the server to the other three servers for display.

[0035] This application sets an index for the player when creating a game battlefield. When performing frame synchronization, the player account is replaced by the index, and then converted to the player account through a mapping table on the client and displayed, thereby reducing the data transmission size during synchronization. Since the number of players in a single game is much smaller than the total player data of the game, the space occupied by the index is smaller than the space required for the traditional player account. This solution greatly reduces the size of the frame synchronization data packet, reduces the bandwidth pressure on the client and server, and greatly improves the efficiency of frame synchronization.

[0036] On the basis of this embodiment, further, the index is represented by consecutive numbers starting from 0, and the maximum value of the index number is the number of participants in the current game minus one.

[0037] For example, assuming that the game has a total of 1 million players, if the existing solution is used, at least 4 bytes are used to describe the player account in each frame synchronization data. If there are 4 players participating in the battlefield, the unique indexes of the 4 players are 0, 1, 2, and 3 respectively. At this time, in the frame synchronization data of the game, the data of the player account part can be clearly described with one byte. This embodiment can save 3 bytes of space through this method. In games with high-frequency frame synchronization, it can well reduce the bandwidth pressure between the client and the server and improve work efficiency.

[0038] In this embodiment, the mapping relationship table includes: a mapping table 1 from index to player account, and a mapping table 2 from player account to index. The above two tables are used to realize the mutual conversion between index and player account.

[0039] In the embodiment of the present invention, the synchronization data includes player accounts and behavior data. After receiving the synchronization data from the client, the player accounts in the synchronization data are replaced with indexes through the mapping relationship table, and the indexes and behavior data are synchronized to all clients in the game. That is, the player accounts are used when data is transmitted from the client to the server. The server converts the player accounts into indexes that occupy less data space through the mapping relationship table, and transmits them to all clients for synchronization, and the clients then perform parsing and presentation respectively.

[0040] The above method is an embodiment of the technical solution of the present invention, and is not limited to the description in this embodiment. Of course, the player account can also be converted into an index on the client, synchronized to other clients through the server, and then resolved by the server and the client into the corresponding player account for storage, display and other actions.

[0041] See attached Figure 2 As shown, on the other hand, the present invention also proposes a client frame synchronization method, which is applied to a multiplayer game client, and the method includes:

[0042] A10: When starting a game, the server sends a mapping table between the player account and index of the game. The index is the unique identifier of the player in the game.

[0043] The index is represented by a continuous number starting from 0, and the maximum value of the index number is the number of participants in the current game minus 1. The mapping relationship table includes: a mapping table 1 from index to player account, and a mapping table 2 from player account to index.

[0044] A20: When playing games, create synchronization data and send it to the server; the synchronization data includes the player's behavior data; the synchronization data includes the player's account and behavior data;

[0045] A30: Receives the index and behavior data of other players from the server, and displays the data after parsing through a mapping relationship table.

[0046] After receiving the index and behavior data of other players from the server, the index is replaced with the player account through the mapping relationship table, and the behavior data corresponding to the player account is displayed in this client.

[0047] In another embodiment of the present invention, the solution involves both the game client and the server.

[0048] When the server creates a frame-synchronized multiplayer battlefield, it assigns a unique index to each account. The maximum value of this index is the maximum number of participants in the battlefield minus one. For example, if there are 4 participants in the battlefield, the unique indexes of the 4 people are 0, 1, 2, and 3 respectively.

[0049] After the server assigns the unique index, it generates a mapping relationship between the account and the unique index, including: mapping relationship one, which is the unique index corresponding to the player account; mapping relationship two, which is the player account corresponding to the unique index.

[0050] When the client enters the battlefield, it will obtain mapping relationship 1 from the server. When the server receives the player's frame synchronization packet, it will find the player's unique index through mapping relationship 2, and generate a data packet with this unique index and the frame synchronization packet data, and synchronize it to all players in the battlefield. When the client receives the frame synchronization data packet, it will parse the account unique index from it, confirm the account through index relationship 1, and perform the display.

[0051] The solution for reducing the amount of communication data between the client and the server in the frame synchronization gameplay proposed in the embodiment of the present invention includes:

[0052] When creating a frame-synchronized multiplayer battlefield, a unique index is assigned to each account. When the server creates a battlefield, it traverses all accounts and assigns an index starting from 0 to each account in the traversal order. (For example, if there are 4 people participating in the battlefield, the unique indexes of the 4 people are 0, 1, 2, and 3 respectively).

[0053] After the server assigns the unique index, it generates a mapping relationship between the account and the unique index. In this embodiment, the server can generate two mapping relationships: mapping relationship one, the unique index corresponds to the player account; mapping relationship two, the player account corresponds to the unique index.

[0054] When the client enters the battlefield, it will obtain mapping relationship 1 from the server and save it in memory.

[0055] When the server receives the player's frame synchronization packet, it will find the player's unique index through mapping relationship 2, and generate a data packet with this unique index and the frame synchronization packet data, and synchronize it to all players in the battlefield.

[0056] When the server receives the frame synchronization data from the client (the data generally contains two fields: behavior type and behavior data), it finds the unique index of the account through the client's account and mapping relationship 2, and then merges the unique index, behavior type and behavior data into a data packet according to certain rules, and synchronizes the data packet to all players on the battlefield.

[0057] When the client receives the frame synchronization data packet, it will parse the unique index of the account from it, confirm the account through index relationship one, and display it.

[0058] When the client receives the frame synchronization data packet, it separates the unique index, behavior type and behavior data according to the rules, and then searches the account through the unique index to the mapping relationship table for display.

[0059] By mapping player accounts into indexes and reducing player account information to less than 1 byte, the amount of communication data between the client and server in frame synchronization can be greatly reduced. This solves the problem of accounts occupying too much space in frame synchronization packages, resulting in excessive data volume between the client and server.

[0060] The present application also provides an electronic device, such as Figure 3 As shown, Figure 3 The electronic device 700 shown includes: a processor 701 and a memory 703. The processor 701 and the memory 703 are connected, such as through a bus 702. Optionally, the electronic device 700 may also include a transceiver 704. It should be noted that in actual applications, the transceiver 704 is not limited to one, and the structure of the electronic device 700 does not constitute a limitation on the embodiments of the present application.

[0061] Processor 701 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 701 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0062] The bus 702 may include a path to transmit information between the above components. The bus 702 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 702 may be divided into an address bus, a data bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0063] The memory 703 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0064] The memory 703 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 701. The processor 701 is used to execute the application code stored in the memory 703 to implement the contents shown in the above method embodiment.

[0065] The electronic devices include, but are not limited to, mobile terminals such as mobile phones, notebook computers, PDAs (personal digital assistants), PADs (tablet computers), etc., and fixed terminals such as digital TVs, desktop computers, etc. It can also be a server, etc. Figure 3 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0066] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the server frame synchronization method provided in the above embodiment.

[0067] It should be understood that although the steps in the flowchart of the accompanying drawings are shown in sequence according to the instructions of the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise clearly stated in this document, the execution of these steps is not strictly limited in order and can be performed in other orders.

[0068] The above are only some implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A server frame synchronization method, applied to a multiplayer game server, characterized in that: The method comprises: When creating the current game environment, a unique index is created for each player account of the current game; wherein the index is represented by consecutive numbers starting from 0, and the maximum value of the index number is the number of participants in the current game minus one; Create a mapping table between indexes and player accounts, and synchronize it to all clients participating in the game; Receiving synchronization data from a client, wherein the synchronization data includes behavior data; The synchronization data is parsed through the mapping relationship table, and the index and behavior data are synchronized to all clients of the bureau.

2. The server frame synchronization method according to claim 1, characterized in that: The mapping relationship table includes: a mapping table 1 from index to player account, and a mapping table 2 from player account to index.

3. The server frame synchronization method according to claim 1, characterized in that: The synchronization data includes player accounts and behavior data. After receiving the synchronization data from the client, the player accounts in the synchronization data are replaced with indexes through a mapping relationship table, and the indexes and behavior data are synchronized to all clients of the game.

4. A client frame synchronization method, applied to a multiplayer game client, characterized in that: The method comprises: When starting a game, a mapping table between player accounts and indexes of the game is received from a server, where the index is a unique identifier of the player of the game; wherein the index is represented by consecutive numbers starting from 0, and the maximum value of the index number is the number of participants in the game minus one; When playing the game, create synchronization data and send it to the server; the synchronization data includes the behavior data of the player; Receive the index and behavior data of other players from the server, and present the data after parsing through the mapping relationship table.

5. The client frame synchronization method according to claim 4, characterized in that: The mapping relationship table includes: a mapping table 1 from index to player account, and a mapping table 2 from player account to index.

6. The client frame synchronization method according to claim 4, characterized in that: The synchronization data includes player account and behavior data; After receiving the index and behavior data of other players from the server, the index is replaced with the player account through the mapping relationship table, and the behavior data corresponding to the player account is displayed in this client.

7. An electronic device, characterized in that: The electronic device includes: at least one processor; Memory; At least one application, wherein the at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute the server frame synchronization method according to any one of claims 1 to 3.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed in a computer, the computer is caused to execute the server frame synchronization method according to any one of claims 1 to 3.