Game data processing method, device, equipment and computer readable storage medium

By implementing data cache and merging processing for game data packets in MMORPG, the problem of excessive data transmission in group battle scenarios is solved, and game fluency and bandwidth utilization efficiency are improved.

CN113893526BActive Publication Date: 2025-03-11TENCENT TECH SHANGHAI
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111257569.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-27
Publication Date
2025-03-11
Estimated Expiration
2041-10-27

AI Technical Summary

Technical Problem

Modern large-scale multiplayer online role-playing game (MMORPG) in group battle scenarios has caused a sharp increase in the number of downstream network packets and traffic of the server, causing the game to be stuck or disconnected.

Method used

The game data packet triggered by the operation of the game client during the game gameplay, and when it is determined that the data packet meets the data cache conditions, it is added to the data cache queue corresponding to the virtual scene area. When the data transmission time is reached, the game packets in the data cache queue are merged and processed, and the merged data packets are obtained and sent to the target receiving object.

Benefits of technology

It reduces the amount of data transmission in game games, increases the payload of data transmission, thereby improving the smoothness of the game and reducing the bandwidth consumption of server and player.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113893526B_ABST
    Figure CN113893526B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, equipment and computer-readable storage medium for processing game data; the method includes: in the process of game play, obtaining a game data packet triggered by the operation of a game client; obtaining a virtual scene area where a virtual object corresponding to the game client is located; when it is determined that the game data packet meets the data cache condition, adding the game data packet to the data cache queue corresponding to the virtual scene area; when it is determined that the data transmission time has arrived, merging the game data packets in the data cache queue to obtain a merged data packet; determining the target receiving object of the merged data packet, and sending the merged data packet to the target receiving object. Through the present application, the amount of data transmission in the game play can be reduced and the effective load of data transmission can be increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to Internet technology, and in particular to a game data processing method, device, equipment and computer-readable storage medium. Background Art

[0002] In order to pursue more diverse gameplay and more intense combat experience, modern massively multiplayer online role-playing games (MMORPGs) will design some gameplays involving hundreds or even thousands of people fighting in groups. In the game scene, characters are visible to each other, and character behaviors are broadcast to other characters in the field of view in real time. The number of broadcast packets in the field of view is proportional to the square of the number of characters in the field of view. As the number of characters in the field of view increases, a large number of broadcast operations will cause a sharp increase in the number of downlink network packets and traffic on the server. The surge in network traffic will cause the server's downlink bandwidth and the player's bandwidth to be occupied, causing the game to freeze or disconnect. Summary of the invention

[0003] The embodiments of the present application provide a game data processing method, device, and computer-readable storage medium, which can reduce the amount of data transmission in a game match and increase the effective load of data transmission.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present application provides a method for processing game data, including:

[0006] During the game, obtain game data packets triggered by the operation of the game client;

[0007] Obtain the virtual scene area where the virtual object corresponding to the game client is located;

[0008] When it is determined that the game data packet meets the data cache condition, the game data packet is added to the data cache queue corresponding to the virtual scene area;

[0009] When it is determined that the data transmission time has arrived, the game data packets in the data cache queue are merged to obtain a merged data packet;

[0010] A target receiving object of the combined data packet is determined, and the combined data packet is sent to the target receiving object.

[0011] The present application provides a method for processing game data, including:

[0012] In response to the received game match start instruction, start the game match;

[0013] During the game, in response to the received game operation instructions, a game data packet is sent to the server;

[0014] Receiving the merged data packet sent by the server, parsing the merged data packet, and obtaining multiple game data packets;

[0015] A target data packet is determined from the multiple game data packets, and rendering and display are performed based on the target data packet.

[0016] The present application provides a game data processing device, including:

[0017] The first acquisition module is used to acquire game data packets triggered by operations of the game client during the game game process;

[0018] The second acquisition module is used to acquire the virtual scene area where the virtual object corresponding to the game client is located;

[0019] A cache module, for adding the game data packet to a data cache queue corresponding to the virtual scene area when determining that the game data packet meets the data cache condition;

[0020] A data merging module is used to merge the game data packets in the data cache queue to obtain a merged data packet when it is determined that the data transmission time has arrived;

[0021] The first sending module is used to determine a target receiving object of the combined data packet and send the combined data packet to the target receiving object.

[0022] In some embodiments, the apparatus further comprises:

[0023] A third acquisition module is used to acquire the attribute information of the game data packet and determine the total number of virtual objects located in the virtual scene area;

[0024] A second determination module, configured to determine whether the game data packet meets a data cache condition based on the total number of objects and the attribute information;

[0025] Among them, when the total number of objects is greater than a preset total number threshold and the attribute information is a non-real-time sending of data packets, it is determined that the game data packet meets the data caching conditions; when the total number of objects is less than or equal to the total number threshold, or the attribute information is a real-time sending of data packets, it is determined that the game data packet does not meet the data caching conditions.

[0026] In some embodiments, the apparatus further comprises:

[0027] A third determination module, configured to determine a target receiving object of the game data packet when the game data packet is determined not to satisfy the data cache condition;

[0028] The third sending module is used to send the game data packet to the target receiving object.

[0029] In some embodiments, the apparatus further comprises:

[0030] A fourth determination module, configured to determine that the timing for data transmission has arrived when the time interval between the time when the data was last transmitted reaches a preset interval threshold; or;

[0031] The fifth determination module is used to obtain the size of the space occupied by the game data packet in the data cache queue, and when it is determined that the size of the space reaches a preset space threshold, determine that the timing of data transmission has arrived.

[0032] In some embodiments, the first sending module is further used to:

[0033] Determine an adjacent area of ​​the virtual scene area;

[0034] The game client corresponding to the virtual object located in the virtual scene area and the adjacent area of ​​the virtual scene area is determined as the target receiving object of the merged data packet.

[0035] In some embodiments, the apparatus further comprises:

[0036] A sixth determination module, configured to determine that a data transmission timing has arrived when detecting that a target virtual object has moved out of the virtual scene area;

[0037] Correspondingly, the first sending module is further used for:

[0038] The game client corresponding to the target virtual object is determined as the target receiving object of the merged data packet.

[0039] In some embodiments, the apparatus further comprises:

[0040] A fourth acquisition module is used to acquire the current data packet sequence number of the data cache queue corresponding to the virtual scene area;

[0041] A seventh determination module, configured to determine the sequence number of the game data packet based on the sequence number of the current data packet;

[0042] A first updating module, used for updating the sequence number of the game data packet to the current data packet sequence number of the data cache queue;

[0043] Correspondingly, the data cache module is also used for:

[0044] The game data packet and the serial number of the game data packet are added to the data cache queue.

[0045] In some embodiments, the apparatus further comprises:

[0046] An eighth determination module, configured to determine an updated virtual scene area of ​​the virtual object when a change is detected in the virtual scene area where the virtual object is located;

[0047] A fifth acquisition module, used to acquire a current data packet sequence number corresponding to the updated virtual scene area;

[0048] The fourth sending module is used to send the current data packet sequence number corresponding to the updated virtual scene area to the game client corresponding to the virtual object.

[0049] The present application provides a game data processing device, including:

[0050] A game starting module, used to start a game in response to a received game starting instruction;

[0051] A second sending module is used to send a game data packet to the server in response to a received game operation instruction during the game game;

[0052] A first receiving module is used to receive the merged data packet sent by the server, and parse the merged data packet to obtain multiple game data packets;

[0053] The first determination module is used to determine a target data packet from the multiple game data packets, and perform rendering and display based on the target data packet.

[0054] In some embodiments, the first determining module is further configured to:

[0055] Obtain the current data packet sequence number of the virtual scene area where the virtual object corresponding to the game client is currently located;

[0056] Get the serial number corresponding to each game data packet;

[0057] A game data packet whose serial number is greater than or equal to the serial number of the current data packet is determined as a target data packet.

[0058] In some embodiments, the apparatus further comprises:

[0059] A sixth acquisition module, used to acquire the maximum sequence number among the sequence numbers corresponding to the target data packets;

[0060] The second updating module is used to update the maximum sequence number to the current data packet sequence number of the virtual scene area.

[0061] An embodiment of the present application provides a computer device, including:

[0062] A memory for storing executable instructions;

[0063] The processor is used to implement the game data processing method provided in the embodiment of the present application when executing the executable instructions stored in the memory.

[0064] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute and implement the game data processing method provided in the embodiment of the present application.

[0065] An embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the game data processing method provided in the embodiment of the present application.

[0066] The embodiments of the present application have the following beneficial effects:

[0067] During a game, after obtaining a game data packet triggered by an operation of a game client, the server obtains a virtual scene area where a virtual object corresponding to the game client is located, and when it is determined that the game data packet meets the data caching conditions, the server adds the game data packet to a data cache queue corresponding to the virtual scene area, instead of sending it in real time. When it is determined that the timing for data transmission has arrived, the game data packets in the data cache queue are merged to obtain a merged data packet, the target receiving object of the merged data packet is determined, and the merged data packet is sent to the target receiving object. In this way, after multiple data packets are merged, the multiple data packets share a data packet header, thereby reducing the amount of data transmission in the game, increasing the payload of data transmission, and thereby improving the smoothness of the game. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1A A schematic diagram of a vision management mechanism for a virtual object in related art;

[0069] Figure 1B A schematic diagram of a downlink broadcast mechanism for game data by a server in the related art;

[0070] Figure 2 is a schematic diagram of the network architecture of the gaming system 100 provided in an embodiment of the present application;

[0071] Figure 3A is a schematic diagram of the structure of the server 400 provided in an embodiment of the present application;

[0072] Figure 3B is a schematic diagram of the structure of a game terminal 200 provided in an embodiment of the present application;

[0073] Figure 4 This is a schematic diagram of an implementation flow of the game data processing method provided in an embodiment of the present application;

[0074] Figure 5 This is another implementation flow diagram of the game data processing method provided in the embodiment of the present application;

[0075] Figure 6 This is another implementation flow diagram of the game data processing method provided in the embodiment of the present application;

[0076] Figure 7 This is a schematic diagram of a large-scale MMORPG group battle game scene;

[0077] Figure 8 It is a schematic diagram of around-based maintenance of broadcast cache provided by an embodiment of the present application;

[0078] Fig. 9 It is a schematic diagram of sending a data packet by downlink broadcast based on Around packetization provided in an embodiment of the present application;

[0079] Fig.10 It is a schematic diagram of calculating the effective load after merging data packets provided in an embodiment of the present application;

[0080] Fig.11 It is a schematic diagram of Around switching provided in an embodiment of the present application;

[0081] Fig.12 It is a schematic diagram of the implementation process of avoiding the packet string problem through serial numbers provided in an embodiment of the present application. DETAILED DESCRIPTION

[0082] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0083] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0084] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0085] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0086] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0087] 1) Online games, also known as online games, generally refer to electronic games in which multiple players interact and entertain each other through computer networks.

[0088] 2) Action games are a type of electronic games that emphasize the player's reaction ability and hand-eye coordination. There are often multiple skills that are released in succession to form a combo.

[0089] 3) Role-Playing Game (RPG) is a type of game in which players play one or more team members in a virtual world and play the game in a specific scenario. Usually, players play adventurers in the game world, and the various encounters along the way (such as fighting, talking, meeting important people, etc.) are the key to the growth of the player's character and the progress of the game.

[0090] 4) Game Skills (Spell) A way of playing in role-playing games. A skill corresponds to a series of rules and can produce specific magical effects on yourself and the target when used.

[0091] 5) Field of view: the range of the game world that the character controlled by the player can see in the game.

[0092] 6) Group battle, a game mode in which a large number of players gather together to PK in MMORPG.

[0093] 7) Online game client (Game Client) refers to the program that corresponds to the online game server and provides local services to customers. It is usually installed on ordinary user machines and needs to cooperate with the server to run.

[0094] 8) Online game server (Game Server) refers to the software program installed in the IDC that corresponds to the online game client and provides data forwarding and logic processing services for the online game client. Since the client installed on the player's machine is easy to be cracked and used for cheating, in online games, complex and critical logic needs to be calculated on the online game server.

[0095] 9) Field of view broadcasting: In online games, the characters controlled by players can see the in-game behaviors of other characters. This requires that the in-game behaviors of each character need to be broadcast to other characters in the field of view.

[0096] 10) Broadcast packets, which may also be referred to as game data packets in the embodiment of the present application, may be data that needs to be broadcast by the server to other players. For example, when a player moves within the game, a mobile broadcast packet will be generated.

[0097] 11) TCP header, the data header defined by the Transmission Control Protocol (TCP). A TCP Header generally has 20 bytes.

[0098] 12) IP header, a data header defined by the Internet Protocol (IP). An IP Header generally has 20 bytes.

[0099] 13) Frame header: Link layer frame protocol data header, usually 14 bytes.

[0100] 14) Data buffer: space used to temporarily store data.

[0101] In order to better understand the game data processing method provided in the embodiment of the present application, the game data method in the related art and its existing shortcomings are explained.

[0102] MMO vision management generally adopts conventional nine-grid vision management, such as Figure 1A As shown in the figure, the game scene map is divided into small grids of 54m*54m, each grid is called an area (Around), and each Around maintains a role list. Figure 1A As shown, the visible field of view of player character A is 9 around (3*3) Figure 1A When a player character A moves or releases a skill in the game scene, the character's behavior will be broadcasted in real time to all players in the 9 surroundings within the field of view.

[0103] Figure 1B FIG. 1 is a schematic diagram of a downlink broadcast mechanism for game data by a server in a related art. Figure 1B As shown, each area corresponds to a role list, area 1 corresponds to role list 1, area 2 corresponds to role list 2, ..., area 9 corresponds to role list 9, and a plurality of data packets are generated in the broadcast source 111. Figure 1BData packets 1, 2, 3 and 4 are exemplarily shown in the figure. In the related art, these data packets will be sent to the game clients corresponding to the respective characters in the character lists 1 to 9 corresponding to the regions 1 to 9 respectively through the gateway process.

[0104] During group battles, players move / skill frequently. It can be seen that the write diffusion effect of vision broadcast is very serious. Each player's behavior must be broadcast to other players in the field of vision. The overall downlink packet volume is proportional to the square of the number of players in the field of vision. Figure 1B Under the broadcast mechanism shown, it is assumed that the upper limit of the number of players in the group battle mode is 500. When the group battle is fierce, 500 players will gather together. The assumptions include:

[0105] 1. The broadcast range is 500;

[0106] 2. The proportion of players casting skills is a%, the request frequency is 1 time / s, and the average size of the broadcast packet is 120Byte;

[0107] 3. The proportion of mobile players is b%, the request frequency is up to 3 times / s, and the average size of the broadcast packet is 60Byte;

[0108] 4. The player's movement speed is 5m / s, the Around side length is 54m, and the field of view will switch after the player moves for about 10s;

[0109] 5. TCP payload is calculated as 80%.

[0110] Table 1 is a data volume analysis table under different battle ratios and different movement ratios. It can be seen from Table 1 that when 50% of the players are fighting and 50% of the players are moving, the total packet volume per second reaches 50w / s, the total traffic reaches 600M, and the single-player traffic is 150KB / s. Group battle activities have the following two problems: one is the package volume problem. The single-game package volume is already 50w / s. It is necessary to pre-set enough access processes for group battle activities, and the idle rate is usually high. The other is the traffic problem. Too high total traffic requires a sufficiently high bandwidth. When the bandwidth is insufficient, it is easy to cause game lag or disconnection.

[0111] Table 1. Data volume analysis table under different combat ratios and different movement ratios

[0112]

[0113] Based on this, the embodiments of the present application provide a game data processing method, device, equipment and computer-readable storage medium, which implement broadcast and packet consolidation based on maintaining a broadcast cache for each Around, and can significantly reduce the total amount of data transmission without affecting the game experience, thereby reducing the downlink broadcast pressure of group battles.

[0114] The following describes an exemplary application of the game data processing device provided in the embodiment of the present application. The device provided in the embodiment of the present application can be implemented as a server. The following describes an exemplary application when the device is implemented as a server.

[0115] See also Figure 2 , Figure 2 is a schematic diagram of the network architecture of the game system 100 provided in an embodiment of the present application, such as Figure 2 As shown, the game system includes game terminals 200 (game terminal 200-1 and game terminal 200-2 are shown as examples), a network 300 and a server 400, wherein the game terminal 200-1 and the game terminal 200-2 are connected to the server 200 via the network 300 respectively, and the network 300 can be a wide area network or a local area network, or a combination of the two.

[0116] Game terminal 200-1 and game terminal 200-2 may be installed with a game application (ie, a game client), and game terminal 200-1 or game terminal 200-2 may also log in to the game client through a web page to start a game match.

[0117] During the game, the user can use the terminal to trigger the virtual objects in the game to move in the virtual scene, or release skills, etc., and the movement or release of skills will trigger the broadcast of data packets. Figure 2 In the example, it is assumed that game terminal 200-1 sends game data packets pkg1 and pkg2 to server 400, and game terminal 200-2 sends game data packet pkg3 to server 400. In the embodiment of the present application, when the broadcast interface of the server receives the game data packet sent by the game terminal, if it determines that the game data packet meets the data cache condition, it will cache the game data packet to the data cache queue, assuming that pkg1, pkg2 and pkg3 all exist in the data cache queue. When the time for data transmission is reached, the server merges the data packets in the data cache queue, adds a data packet header, obtains a merged data packet, and sends the merged data packet to the target receiving object, which can be the game client corresponding to all virtual objects in the virtual scene area where the virtual object is located and the adjacent area of ​​the virtual scene area. Figure 2 In the example, the game terminal 200-1 and the game terminal 200-2 are both target receiving objects. In the embodiment of the present application, there may be multiple game data packets in the merged data packet, but these multiple game data packets share a data packet header, thereby increasing the effective load of data transmission, reducing the total amount of downlink data transmission of the server, and improving the fluency of the game.

[0118] In some embodiments, the server 400 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal 400 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0119] See also Figure 3A , Figure 3A is a schematic diagram of the structure of the server 400 provided in an embodiment of the present application, Figure 3A The server 400 shown includes: at least one processor 410, a memory 450, at least one network interface 420 and a user interface 430. The various components in the server 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 440 is not described in detail. Figure 3A Various buses are labeled as bus system 440 .

[0120] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0121] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0122] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.

[0123] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0124] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0125] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0126] A network communication module 452, for reaching other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Authentication (WiFi), and Universal Serial Bus (USB);

[0127] The input processing module 453 is used to detect one or more user inputs or interactions from one of the one or more input devices 432 and translate the detected inputs or interactions.

[0128] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 3A The game data processing device 454 stored in the memory 450 is shown, which can be software in the form of a program and a plug-in, etc., and includes the following software modules: a first acquisition module 4541, a second acquisition module 4542, a data cache module 4543, a data merging module 4544 and a first sending module 4545. These modules are logical, and therefore can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.

[0129] In other embodiments, the device provided in the embodiments of the present application can be implemented in hardware. As an example, the device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the game data processing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.

[0130] The game data processing method provided in the embodiment of the present application will be explained in combination with the exemplary application and implementation of the server provided in the embodiment of the present application.

[0131] See also Figure 4 , Figure 4 This is a schematic diagram of an implementation flow of the game data processing method provided in the embodiment of the present application, which is applied to the server. Figure 4 The steps shown illustrate the game data processing method provided in the embodiment of the present application.

[0132] Step S101, during the game process, obtain a game data packet triggered by the operation of the game client.

[0133] During a game, the game client can trigger the generation of a game data packet broadcast to other players based on the player's operation of moving a virtual object, or based on the player's operation of controlling a virtual object to release a skill. The game data packet will be sent to the server, which will send and broadcast it to other players.

[0134] Step S102, obtaining the virtual scene area where the virtual object corresponding to the game client is located.

[0135] In the embodiment of the present application, the server can divide the virtual scene of the game, for example, it can be divided into multiple square areas with a side length of M meters according to a certain size, where M is a positive integer, such as 4, 10, 50, etc. And each virtual scene area can be numbered as an identifier of each virtual scene area, and the vertex coordinates of each virtual scene area can be recorded. The virtual scene area corresponds to Around in other embodiments.

[0136] When this step is implemented, the server can obtain the position information of the virtual object corresponding to the game client, and then determine the virtual scene area where the virtual object is located based on the position information of the virtual object and the vertex coordinates of each virtual scene area.

[0137] Step S103, when it is determined that the game data packet meets the data cache condition, the game data packet is added to the data cache queue corresponding to the virtual scene area.

[0138] In some embodiments, it is necessary to determine whether the game data packet meets the data caching condition before step S103. Since there are a large number of players in large-scale MMORPG games, and players move and fight in real time in the map scene, they can release a large number of skills, and the player's field of vision and attribute update are frequent, so a large number of data packets need to be sent to the game terminal. Mobile phone players are sensitive to traffic, and the player terminals are also uneven. A large number of data packets will also bring performance and power consumption to the game terminal end, affecting the fluency of the game. Therefore, it is necessary to process data packets when there are a large number of players in a certain area to achieve traffic optimization. Therefore, the data caching condition can include that the total number of virtual objects in the virtual scene area where the virtual object is located is greater than the total number threshold. In addition, for some data packets that need to be sent to the game terminal in real time, such data packets cannot be cached, so the data caching condition also includes that the game data packet is not a data packet that needs to be sent in real time.

[0139] In an embodiment of the present application, each virtual scene area maintains a data cache area, in which data is stored in the form of a queue, that is, each virtual scene area corresponds to a data cache queue, and data packets triggered by virtual objects in the same virtual scene area are cached in the data cache queue corresponding to the virtual scene area. In some embodiments, when the server adds a game data packet to the data cache queue, it also sets a serial number for each game data packet, so that the game client synchronizes data based on the serial number.

[0140] In the embodiment of the present application, the virtual scene area (Around) is used as the granularity, and each virtual scene area maintains a data cache queue. The target receiving objects of the game data packets generated by the virtual objects in the same virtual scene area are consistent. Therefore, by maintaining the data cache queue at the granularity of the virtual scene area, the memory overhead of the server will be much smaller, and the merging efficiency of the game data packets will be higher.

[0141] Step S104, when it is determined that the data transmission opportunity has arrived, the game data packets in the data cache queue are merged to obtain a merged data packet.

[0142] In some embodiments, before this step, it is necessary to determine whether the timing for data transmission has been reached, where the timing for data transmission may be when a preset data transmission interval has been reached, or when the size of the space occupied by the data packets in the data cache queue has reached a certain space threshold. In some embodiments, the timing may be when the number of data packets has reached a preset quantity threshold.

[0143] When implementing this step, each game data packet in the data cache queue can be spliced ​​in the order of entering the queue, and then the TCP header, IP header and frame header are added to the spliced ​​data packet in sequence to obtain a merged data packet. That is to say, in the embodiment of the present application, it is not necessary to allocate a TCP header, an IP header and a frame header to each game data packet, but multiple game data packets share a TCP header, an IP header and a frame header, which can greatly reduce the total amount of downlink data transmission of the server and increase the effective load of data transmission.

[0144] Step S105, determining a target receiving object of the combined data packet, and sending the combined data packet to the target receiving object.

[0145] The target receiving object is the game client corresponding to the virtual object within the field of view of the virtual character in the virtual scene area. When implementing this step, the adjacent area of ​​the virtual scene area can be obtained first, wherein the adjacent area of ​​the virtual scene area can be an area adjacent to the virtual scene area, and the adjacent area of ​​the virtual scene area and the virtual scene constitute the game world range that the virtual character in the virtual scene area can see in the game, that is, the adjacent area of ​​the virtual scene area and the virtual scene is the field of view of the virtual character in the virtual scene area. Since the data packet in the game is broadcasted in the field of view, that is, the data packet triggered by the virtual character in a virtual scene area needs to be broadcasted to other characters in the field of view, therefore, in the embodiment of the present application, the game clients corresponding to the multiple virtual objects located in the virtual scene area and the multiple adjacent areas of the virtual scene area are determined as the target receiving objects, and then the merged data packet is sent to each game client, thereby realizing the field of view broadcast of the data packet.

[0146] In the game data processing method provided in the embodiment of the present application, during the game match, after obtaining a game data packet triggered by the operation of the game client, the server obtains the virtual scene area where the virtual object corresponding to the game client is located, and when it is determined that the game data packet meets the data caching conditions, the game data packet is added to the data cache queue corresponding to the virtual scene area, instead of sending it in real time. When it is determined that the time for data transmission has arrived, the game data packets in the data cache queue are merged and processed to obtain a merged data packet, and the target receiving object of the merged data packet is determined, and then the merged data packet is sent to the target receiving object; in the embodiment of the present application, the target receiving object is the field of view of the virtual character. For the game clients corresponding to other virtual objects within the range, since the field of view of the virtual characters in the same virtual scene area is the same, the target receiving objects of the data packets generated by the virtual characters in the same virtual scene area are the same. Therefore, in an embodiment of the present application, the data packets generated by the virtual characters in the same virtual scene area are merged and processed based on the virtual scene area as the granularity, and these multiple data packets share a data packet header. In the case where there are many player characters in the virtual scene area and a huge number of data packets are generated, the effective load of data transmission can be greatly increased compared to adding a data header to each data packet, thereby reducing the amount of data transmission in the game game and improving the smoothness of the game.

[0147] In some embodiments, after step S102, Figure 5 As shown, the following steps may also be performed to determine whether the data cache condition is met, and the processing process when the data cache condition is not met. Figure 5 Each step is explained.

[0148] Step S106, obtaining the attribute information of the game data packet, and determining the total number of virtual objects located in the virtual scene area.

[0149] In an embodiment of the present application, the attribute information of the game data packet includes at least flag information indicating whether the game data packet needs to be sent in real time. When the flag information is 1, it indicates that the game data packet needs to be sent in real time, that is, it is a real-time sent data packet; when the flag information is 0, it indicates that the game data packet does not need to be sent in real time, that is, it is a non-real-time sent data packet.

[0150] In the embodiment of the present application, each virtual scene area may correspond to a virtual object list. When a new virtual object enters, the newly entered virtual object is added to the virtual object list; when a virtual object exits, the exited virtual object is deleted from the virtual object list. Determining the total number of virtual objects in the virtual scene area is to determine the total number of objects in the virtual object list.

[0151] Step S107, determining whether the game data packet meets the data caching condition based on the total number of objects and the attribute information.

[0152] Among them, when the total number of objects is greater than the preset total number threshold and the attribute information is non-real-time sending of data packets, it is determined that the game data packet meets the data caching condition, and step S103 is entered at this time; when the total number of objects is less than or equal to the total number threshold, or the attribute information is real-time sending of data packets, it is determined that the game data packet does not meet the data caching condition, and step S108 is entered at this time.

[0153] In some embodiments, the attribute information of the game data packet may also include the data packet type, and the data packet type may include a character death data packet, an attack other character data packet, a displacement data packet, a skill release data packet, etc. For some types of game data packets, it is necessary to broadcast to all virtual characters within the field of view, while for other types of game data packets, it is not necessary to broadcast to all virtual characters within the field of view. For example, for the death packet, it is necessary to broadcast to all virtual characters within the field of view, while the attack other character data packet can only be broadcast to the attacker and the attacked, and in order to reduce traffic, it may not be broadcast to all virtual characters within the field of view. During implementation, the data packet types can be classified in advance, which data types need to be broadcast to all virtual characters within the field of view, and which data packets do not need to be broadcast to all virtual characters within the field of view, all of which are pre-set.

[0154] Therefore, when determining whether a game data packet meets the data caching conditions based on the total number of objects and the attribute information, in implementation, it can be determined that the game data packet meets the data caching conditions when the total number of objects is greater than a preset total threshold, the attribute information is a non-real-time data packet, and the data packet type needs to be broadcast to virtual characters within the field of view.

[0155] Step S108, when it is determined that the game data packet does not satisfy the data caching condition, determining the target receiving object of the game data packet.

[0156] Similar to step S105, in this step, the game clients of the virtual objects located in the virtual scene area and the adjacent areas of the virtual scene area are determined as target receiving objects.

[0157] Step S109: sending the game data packet to the target receiving object.

[0158] When implementing this step, it is necessary to add a TCP header, an IP header and a frame header to the game data packet to obtain the game data packet with the added data packet header, and then send the game data packet with the added data packet header to the target receiving object.

[0159] In the game data processing method provided in the embodiment of the present application, after receiving the game data packet that needs to be broadcast, the server first needs to determine whether the game data packet meets the data caching condition through the total number of virtual objects in the virtual scene area and the attribute information of the game data packet, and then cache the game data packet to the data cache list, and when the data sending timing is reached, merge multiple game data packets and send the merged data packet to the target receiving object; and when it is determined based on the total number of objects and the attribute information of the game data packet that the data caching condition is not met, the game data packet is sent in real time, thereby ensuring the timeliness of data transmission.

[0160] In some embodiments, determining whether the timing for sending data has been reached may be implemented in at least the following two ways:

[0161] First, when it is determined that the time interval between the time when the data was last sent reaches a preset interval threshold, it is determined that the data sending opportunity has arrived.

[0162] In implementation, after the server sends data each time, a timer is started to count, and when it is determined that the timing of the timer reaches the interval threshold, it is determined that the data sending opportunity has been reached. In some embodiments, after the server completes the data sending, the timer is reset.

[0163] Second, the size of the space occupied by the game data packet in the data cache queue is obtained, and when it is determined that the size of the space reaches a preset space threshold, it is determined that the timing for sending data has arrived.

[0164] In implementation, each time a game data packet is added to the data cache queue, the total space occupied by the game data packets in the current data cache queue is counted, and it is determined whether the space size is greater than or equal to a preset space threshold. The space threshold can be the cache space size corresponding to the virtual scene area, or it can be less than the cache space size, for example, it can be a value obtained by multiplying the cache space size by 0.8. When it is determined that the space size is greater than or equal to the space threshold, it is determined that the time for data transmission has arrived.

[0165] In some embodiments, the number of game data packets in the data cache queue may also be determined, and when it is determined that the number of packets reaches a number threshold, it is determined that the timing for data transmission has arrived.

[0166] In some embodiments, during a game, due to the frequent movement of virtual objects, they may move out of the current virtual scene area and enter another virtual scene area. After the virtual object moves out of the current virtual scene area, the data packets in the data cache queue corresponding to the virtual scene area may not be sent to the game client corresponding to the virtual object. Therefore, in an embodiment of the present application, when it is detected that there is a target virtual object moving out of the virtual scene area, it is determined that the time to send data has arrived.

[0167] Correspondingly, the target receiving object of the merged data packet is determined. During implementation, the game client corresponding to the target virtual object is determined as the target receiving object of the merged data packet. That is to say, when a target virtual object moves out of the virtual scene area, in order to prevent the game client corresponding to the target virtual object from missing the game data packet of the target virtual object when it is in the virtual scene area, when it is monitored that the target virtual object moves to a new virtual scene area, the game data packets in the data cache queue corresponding to the original virtual scene area of ​​the target virtual object will be merged and sent to a single one to the game client corresponding to the target virtual object.

[0168] In some embodiments, the "determining the target receiving object of the merged data packet" in the above step S105 can be implemented through the following steps S1051 and S1052, and each step is described below.

[0169] Step S1051, determining the adjacent area of ​​the virtual scene area.

[0170] In an embodiment of the present application, the adjacent areas of the virtual scene area may be eight adjacent areas of the virtual scene area, namely, top, bottom, left, right, upper right, lower right, upper left, and lower left. Of course, when the virtual scene area is located at the edge or top corner of the game virtual scene map, the adjacent areas will be less than eight. For example, the adjacent areas of the virtual scene area at the upper left vertex only include the three adjacent areas of bottom, right, and lower right.

[0171] Step S1052: determining the game client corresponding to the virtual object located in the virtual scene area and the adjacent area of ​​the virtual scene area as the target receiving object of the merged data packet.

[0172] In some embodiments, a virtual scene area and the adjacent area of ​​the virtual scene area can also be referred to as the field of view of the virtual scene area. Therefore, in implementation, the game client corresponding to the virtual objects included in the multiple virtual scene areas in the field of view of the virtual scene area is determined as the target receiving object of the merged data packet.

[0173] Based on the above embodiments, the present application further provides a game data processing method, which is applied to Figure 2 The network architecture shown, Figure 6 A schematic diagram of another implementation flow of the game data processing method provided in the embodiment of the present application is shown below in combination with Figure 6 Each step is explained.

[0174] Step S201: The game terminal starts a game in response to a received game start instruction.

[0175] Before starting a game match, the game client may be started first, and the game client may be started by clicking or touching the game application icon in the game terminal, or by logging into the website of the game client. After starting the game client, the player may select the game match to join and the virtual object, virtual object skin, skill, etc. to use, after which the player may trigger the game match start instruction through the game terminal and start the game match.

[0176] Step S202: During the game, the game terminal sends a game data packet to the server in response to the received game operation instruction.

[0177] During the game, players can trigger the movement of virtual objects, kill enemy virtual objects, pick up game props, and other operations through the game terminal. These operations will generate game data packets and send them to the server so that the server can broadcast them.

[0178] Step S203: the server obtains the virtual scene area where the virtual object corresponding to the game terminal is located.

[0179] After the server obtains the game data packet, in order to determine whether the game data packet meets the data caching conditions or determine the target receiving object of the game data packet, it is necessary to first determine the virtual scene area where the virtual object is located. In implementation, the virtual scene area where the virtual object is located can be determined based on the location information of the virtual object.

[0180] Step S204: the server determines whether the game data packet meets the data caching condition.

[0181] During implementation, it can be first determined whether the game data packet is a data packet that needs to be sent in real time. If the game data packet is not a data packet that needs to be sent in real time, it can be further determined whether the total number of virtual objects in the virtual scene area is greater than the total number threshold. When the total number of objects is greater than the total number threshold, it is determined that the game data packet meets the data caching condition; and when it is determined in the first step that the game data packet is a data packet that needs to be sent in real time, it is determined that the game data packet does not meet the data caching condition; or when it is determined in the first step that the game data packet is not a data packet that needs to be sent in real time, when it is determined in the second step that the total number of virtual objects is less than or equal to the total number threshold, it means that there are fewer virtual objects in the virtual scene area and the amount of data packets sent is relatively small, then the data is temporarily not cached, and it is also determined that the game data packet does not meet the data caching condition.

[0182] In the embodiment of the present application, when it is determined that the game data packet does not meet the data caching condition, the process proceeds to step S205; when it is determined that the game data packet meets the data caching condition, the process proceeds to step S207.

[0183] Step S205: the server determines a target receiving object of the game data packet based on the virtual scene area.

[0184] The target receiving object includes at least the game terminal, and may also include a game terminal corresponding to a virtual object in a virtual scene area and an adjacent area of ​​the virtual scene area.

[0185] Step S206: The server sends the game data packet to the target receiving object.

[0186] In some embodiments, after receiving the game data packet, the target receiving object performs rendering and display based on the game data packet.

[0187] Step S207: the server obtains the current data packet sequence number of the data cache queue corresponding to the virtual scene area.

[0188] In an embodiment of the present application, in order to ensure the synchronization of data packet transmission, a data packet sequence number can be assigned to each data cache queue. Every time the server receives a game data packet to be stored in a data cache queue, it first obtains the current data packet sequence number of the data cache queue. The current data packet sequence number is also the sequence number of the tail data packet in the data cache queue.

[0189] Step S208: The server determines the serial number of the game data packet based on the current data packet serial number.

[0190] During implementation, the current data packet sequence number is increased by 1, that is, the sequence number of the game data packet is obtained. For example, the current data packet sequence number of the data cache queue is 35, and the sequence number of a game data packet to be stored in the data cache queue is 36.

[0191] Step S209: The server updates the serial number of the game data packet to the current data packet serial number of the data cache queue.

[0192] After the game data packet is cached in the data cache queue, there is one more data packet in the data cache queue, and the game data packet just cached is the data packet at the end of the queue, so the sequence number of the game data packet can be updated to the current data packet sequence number of the data cache queue. Continuing with the above example, if the sequence number of the game data packet newly added to the data cache queue is 36, then the current data packet sequence number of the data cache queue is also updated to 36.

[0193] Step S210: The server adds the game data packet and the serial number of the game data packet to the data cache queue.

[0194] During implementation, the serial number of the game data packet can be used as one of the newly added attribute information of the game data packet and added to the data cache queue together with the game data packet.

[0195] Step S211, when the server determines that the data transmission time has arrived, it merges the game data packets in the data cache queue to obtain a merged data packet.

[0196] In some embodiments, when a preset time interval is reached or when the occupied space size of the data packets in the data buffer queue reaches a certain threshold, it is determined that the data transmission opportunity has been reached. In addition, when the virtual object moves out of the virtual scene area, it is also regarded as a situation where the data transmission opportunity has been reached.

[0197] Merging the game data packets means splicing all the data packets in the current data cache queue in the order of joining the queue, and adding the TCP header, IP header and frame header in sequence to obtain the merged data packet.

[0198] Step S212: The server determines a target receiving object of the combined data packet, and sends the combined data packet to the target receiving object.

[0199] In the case where the timing for data transmission is determined to have arrived due to the virtual object moving out of the virtual scene area, the game terminal (game client) corresponding to the target virtual object moving out of the virtual scene area is determined as the target receiving object. In the case where the timing for data transmission is determined to have arrived when the preset time interval is reached or the size of the space occupied by the data packet in the data cache queue reaches a certain threshold, the game terminal corresponding to the virtual object in the virtual scene area and the adjacent area of ​​the virtual scene area is determined as the target receiving object. After determining the target receiving object, the server sends the merged data packet to the target receiving object through the network.

[0200] Step S213: the game terminal receives the merged data packet sent by the server, and parses the merged data packet to obtain multiple game data packets.

[0201] When this step is implemented, after receiving the merged data packet, the game terminal parses the merged data packet and removes the frame header, IP header and TCP header in sequence, thereby obtaining multiple game data packets.

[0202] Step S214: the game terminal determines a target data packet from the multiple game data packets, and performs rendering and display based on the target data packet.

[0203] In the implementation of this step, the game terminal first obtains the current data packet serial number of the virtual scene area where the virtual object corresponding to the game client is currently located, and then obtains the serial numbers corresponding to each parsed game data packet, and determines the game data packet with a serial number greater than or equal to the current data packet serial number as the target data packet.

[0204] Among them, the game terminal obtains the current data packet sequence number of the virtual scene area where the virtual object corresponding to the game client is currently located. When implemented, it can be the current data packet sequence number sent by the receiving server, or it can be updated based on the sequence number of the game data packet previously received. When the virtual object corresponding to the game terminal is newly added to another virtual scene area (called the second virtual scene area) from other virtual scene areas (called the first virtual scene area), the server will send the current data packet sequence number of the second virtual scene area to the game terminal when it detects that the virtual scene area where the virtual object is located has changed. If the virtual scene area where the virtual object is located has not changed, then each time the game terminal receives a game data packet, the maximum sequence number among the received multiple game data packets will be updated to the current data packet sequence number. When the game terminal receives the game data packet again, it will determine the game data packet with a sequence number greater than or equal to the current data packet sequence as the target data packet.

[0205] It should be noted that the following steps S215 to S227 are not Figure 6 Shown in.

[0206] Step S215, when the server detects that the virtual scene area where the virtual object is located has changed, the server determines the virtual scene area before the update and the virtual scene area after the update of the virtual object.

[0207] In an embodiment of the present application, the virtual scene area before the update may be referred to as the first virtual scene area, and the virtual scene area after the update may be referred to as the second virtual scene area. In some embodiments, when the virtual scene area where the virtual object is located changes, the identifier of the virtual object will be correspondingly deleted from the object list of the first virtual scene area and added to the object list of the second virtual scene area.

[0208] In step S216, the server merges the multiple game data packets in the data cache queue corresponding to the virtual scene area before the update to obtain a merged data packet.

[0209] In an embodiment of the present application, when a change in the virtual scene area where the virtual object is located is monitored, it is determined that the time for data transmission has arrived. At this time, multiple game data packets in the data cache queue corresponding to the virtual scene area before the update are merged to obtain a merged data packet.

[0210] Step S217: the server sends the combined data packet to the game terminal.

[0211] That is to say, at this time, only the merged data packet is sent to the game terminal corresponding to the virtual object where the virtual scene area transformation occurs.

[0212] Step S218: The server obtains the current data packet sequence number corresponding to the updated virtual scene area.

[0213] After the virtual object moves to the updated virtual scene area, the game data packets triggered by each virtual object in the updated virtual scene area should be sent to the virtual object, and the game data packets generated before the virtual object moves to the updated virtual scene area are invalid and meaningless for the virtual object. Therefore, in order to enable the game terminal to distinguish which are the required game data packets and which are the unnecessary game data packets, in this step, the server will obtain the current data packet serial number corresponding to the updated virtual scene area, so that the game terminal determines the judgment criterion based on the current data packet serial number.

[0214] Step S219: The server sends the current data packet sequence number corresponding to the updated virtual scene area to the game terminal corresponding to the virtual object.

[0215] Step S220: the game terminal receives the current data packet sequence number of the virtual scene area sent by the server.

[0216] In the embodiment of the present application, after the game terminal receives the current data packet sequence number of the virtual scene area sent by the server, it will update the current data packet sequence number stored in itself.

[0217] For example, the virtual object moves from the first virtual scene area to the second virtual scene area. The game terminal itself stores the current data packet sequence number corresponding to the first virtual scene area, for example, 378. When the virtual object moves to the second virtual scene area, the server sends the current data packet sequence number corresponding to the second virtual scene area to the game terminal, for example, 543. The game terminal will then update the current data packet sequence number to 543.

[0218] Step S221, when the server determines that the time for data transmission has arrived, it merges the data packets in the data cache queue corresponding to the updated virtual scene area to obtain a merged data packet.

[0219] Step S222: The server sends the combined data packet to target receiving objects including the game terminal.

[0220] Step S223: the game terminal receives the merged data packet sent by the server, and parses the merged data packet to obtain multiple game data packets.

[0221] Step S224: the game terminal obtains the serial number corresponding to each game data packet.

[0222] In step S225, the game terminal determines a game data packet whose serial number is greater than or equal to the serial number of the current data packet as a target data packet, and performs rendering and display based on the target data packet.

[0223] Since the game terminal is newly added to the updated virtual scene area, the game data packets before the current data packet sequence number are useless game data packets for the game terminal. Therefore, in an embodiment of the present application, this part of the game data packets are not rendered and displayed. Instead, only the game data packets after the virtual object enters the updated virtual scene area are rendered and displayed, thereby improving rendering efficiency and improving the smoothness of the game.

[0224] Step S226: the game terminal obtains the maximum sequence number among the sequence numbers corresponding to the target data packets.

[0225] Step S227: the game terminal updates the maximum sequence number to the current data packet sequence number of the virtual scene area.

[0226] Since the virtual object corresponding to the game terminal has moved to the updated virtual scene area, the server will no longer send the latest current data packet sequence number to the game terminal before sending data again. Therefore, the game terminal itself needs to update the current data packet sequence number based on the maximum sequence number among the sequence numbers corresponding to the received game data packets.

[0227] In the game data processing method provided in the embodiment of the present application, when the player starts the game client through the terminal, the player's operations such as moving virtual objects, killing enemy objects, and releasing skills during the game will trigger the generation of a game data packet that needs to be broadcast to other virtual objects. The game data packet will be sent from the game terminal to the server and broadcast by the server. In an embodiment of the present application, after receiving a game data packet, the server first determines whether the game data packet needs to be sent in real time. If it needs to be sent in real time, a data packet header is directly added to send the game data packet; if it does not need to be sent in real time, the game data packet is cached in a data cache queue corresponding to the virtual scene area where the virtual object is located. When the data sending opportunity is reached, multiple game data packets in the data cache queue are combined, and then the combined data packets are sent at one time, which can effectively increase the payload of data transmission; in addition, when the server adds the game data packet to the data cache queue, a serial number is assigned to each game data packet, and each data cache queue corresponds to a current data packet serial number. When it is determined that the virtual scene area where the virtual object is located has changed, the server will merge the data packets in the data cache queue of the virtual scene area before the update, and only send them to the game client corresponding to the virtual object; the server will also send the current data packet serial number of the data cache queue corresponding to the updated virtual scene area to the game terminal, so that when the game terminal receives the game data packet corresponding to the updated virtual scene area, it can determine which game data packets need to be rendered and displayed and which game data packets need to be discarded based on the current data packet serial number, which can improve the game rendering efficiency and improve the game fluency.

[0228] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.

[0229] The game data processing method provided in the embodiment of the present application is applicable to but not limited to Figure 7 The MMORP G group battle scene shown in Figure 7It can be seen that in the group battle scene, the number of virtual characters in the game is huge, so the movement of the virtual characters and the release of skills can generate an even larger number of data packets. The game data processing method provided in the embodiment of the present application can be used to combine data packets in the same Around (corresponding to the virtual scene area in other embodiments) to achieve broadcast optimization. For players, they can better experience real-time interactivity and more advanced gaming experiences such as thousands of people on the same screen with lower bandwidth.

[0230] Considering that the broadcast packets (corresponding to the game data packets in other embodiments) received by players in the same Around are the same, a broadcast cache queue can be maintained based on each Around. The server's broadcast interface first puts the broadcast packet into the Around cache queue, and then sends the broadcast packets in the broadcast cache to the players in the Around at a certain time. The broadcast cache queue is a space for temporarily storing broadcast packets. Broadcast packets triggered by a virtual character in an Around will be placed in the broadcast cache queue corresponding to the Around in chronological order.

[0231] For example, if player A is in Around1, the virtual character corresponding to player A moves in the virtual scene map of the game to generate mobile broadcast packet pkg1, which will be stored in the Around1 broadcast cache. Then, the player releases skills to generate broadcast packets pkg2 and pkg3, which are also placed in the broadcast cache. Figure 8 As shown, there are three broadcast packets pkg1, pkg2, and pkg3 in the broadcast buffer 801.

[0232] If the method of merging packets is not used, the broadcast packets generated in Around will be directly broadcasted to the player list actor_list in Around. The method of merging packets is that the broadcast packets in Around will be put into the broadcast buffer in order, and then the packets in the broadcast buffer will be sent together after a certain time. There are two broadcasting times: one is when the broadcast buffer is full, and the other is scheduled sending. For example, the player generates three broadcast packets pkg1, pkg2, and pkg3 in the game, and puts them into the broadcast buffer (pkg_buffer). After waiting for the interval time of sending the merging packets, if Figure 8 As shown, the three broadcast packets in the broadcast buffer pkg_buffer are broadcasted to the Around player list actor_list. actor_list includes at least Figure 8 Player A and Player B shown.

[0233] Fig. 9 A schematic diagram of a downlink broadcast data packet based on Around packetization provided for this application of real-time exchange rate is shown in FIG. Fig. 9As shown, players trigger broadcast packets 1, 2 and 3 through operations in the game. These broadcast packets are received by the broadcast interface of the server and stored in the broadcast cache 901 of the Around. Each Around also maintains a player list 902. When the time for data transmission is reached, the broadcast packets in the broadcast cache are combined and sent to other players through the gateway 903.

[0234] This method can effectively take advantage of the fact that the broadcast packets are large in volume but each packet is short, and merge a large number of broadcast packets together for sending, greatly reducing the packet volume and increasing the payload of the downlink packet. Based on the Around broadcast cache mechanism, a certain amount of memory overhead is added. To address this problem, in fact, in most gameplays, the concentration of players is not high, and there is actually no need to merge packets. It is only enabled when the number of people around the broadcast target exceeds a certain threshold, which can avoid excessive memory overhead.

[0235] The Around-based packet merging method reduces the amount of broadcast packets by merging packets, and also reduces the downlink broadcast traffic by increasing the effective load rate. For example, assuming that the broadcast packet data length is 75 bytes, when it is sent to the client in the downlink, Fig.10 As shown in the figure, the network protocol stack will add TCP header 1001, IP header 1002 and Frame header 1003, where TCP header 1001 is 20 bytes, IP header 1002 is 20 bytes and Frame header 1003 is 14 bytes. Then the data size received by the client network card is 75+20+20+14=129 bytes. The effective load rate is 75 / 129=58%. Packet consolidation can combine multiple small broadcast packets together. If 20 broadcast packets are combined together, the broadcast data length is 20*75=1500 bytes, and the effective load rate is 1500 / 1554=96.5%. The effective load rate is significantly improved.

[0236] In the actual game, the player's virtual object will constantly move between different Areas, that is, the virtual object will constantly switch between different buffers. Fig.11 is a schematic diagram of Around switching provided in an embodiment of the present application, such as Fig.11As shown in the figure, after the virtual object moves from Around a to Around b, the packet cache queue corresponding to the virtual object is also switched from pkg_buffer_a to pkg_buffer_b. However, the broadcast packets cached in pkg_buffer_a by Around_a have to wait for timeout before they can be sent. This will cause two problems: first, the broadcast packets cached in pkg_buffer_a by Around_a should be sent to the player but are not sent; second, the packets cached in pkg_buffer_b by Around_b were sent to Around_b before the player entered, and should not be sent to the player, but are waiting to be sent.

[0237] For the first problem, you only need to send the current cache content of pkg_buffer_a to the client separately when the player moves to Around b.

[0238] For the second problem, the packet synchronization problem can be solved by the following steps in the embodiment of the present application:

[0239] The first step is to introduce a broadcast packet sequence number seq for each Around.

[0240] Step 2: Every time a broadcast packet is broadcast to the Around, the sequence number is increased by 1.

[0241] Step 3: When the player enters a new Around, the client synchronizes the serial number (because the current serial number of each Around is different).

[0242] Step 4: If the client receives a broadcast packet with a sequence number smaller than the current sequence number, it can be discarded directly.

[0243] Fig.12 Schematic diagram of the implementation process of avoiding the packet string problem by using the serial number provided in the embodiment of the present application, such as Fig.12 As shown, when a player joins a new Around, the cache queue of the Around contains pkg i-n To pkg i , the serial number is i, then the server will synchronize the serial number i to the client, the client will store the serial number, and the server will continue to cache the data, such as Fig.12 As shown, pkg is added to the packet cache queue i+m When the time comes to send data, the server caches the pkg i-n To pkg i+m Sent to the player client, the player receives pkg i-n To pkg i+mAfter that, discard the pkg according to the serial number i-n To pkg i-1 , only save pkg i To pkg i+m .

[0244] The game data processing method provided in the embodiment of the present application can reduce the amount of broadcast packets during group battles, alleviate the pressure on the gateway layer, reduce the required server resources, and reduce server and player bandwidth consumption, avoid problems such as player disconnection, and also reduce game operating costs.

[0245] The following is a description of an exemplary structure of the game data processing device 454 provided in the present application as a software module. In some embodiments, Figure 3A As shown, the software modules stored in the game data processing device 454 of the memory 440 may include:

[0246] The first acquisition module 4541 is used to acquire a game data packet triggered by an operation of a game client during a game match;

[0247] The second acquisition module 4542 is used to acquire the virtual scene area where the virtual object corresponding to the game client is located;

[0248] The data cache module 4543 is used to add the game data packet to the data cache queue corresponding to the virtual scene area when it is determined that the game data packet meets the data cache condition;

[0249] The data merging module 4544 is used to merge the game data packets in the data cache queue to obtain a merged data packet when it is determined that the data transmission time has arrived;

[0250] The first sending module 4545 is used to determine a target receiving object of the combined data packet and send the combined data packet to the target receiving object.

[0251] In some embodiments, the apparatus further comprises:

[0252] A third acquisition module is used to acquire the attribute information of the game data packet and determine the total number of virtual objects located in the virtual scene area;

[0253] A second determination module, configured to determine whether the game data packet meets a data cache condition based on the total number of objects and the attribute information;

[0254] Among them, when the total number of objects is greater than a preset total number threshold and the attribute information is a non-real-time sending of data packets, it is determined that the game data packet meets the data caching conditions; when the total number of objects is less than or equal to the total number threshold, or the attribute information is a real-time sending of data packets, it is determined that the game data packet does not meet the data caching conditions.

[0255] In some embodiments, the apparatus further comprises:

[0256] A third determination module, configured to determine a target receiving object of the game data packet when the game data packet is determined not to satisfy the data cache condition;

[0257] The third sending module is used to send the game data packet to the target receiving object.

[0258] In some embodiments, the apparatus further comprises:

[0259] A fourth determination module, configured to determine that the timing for data transmission has arrived when the time interval between the time when the data was last transmitted reaches a preset interval threshold; or;

[0260] The fifth determination module is used to obtain the size of the space occupied by the game data packet in the data cache queue, and when it is determined that the size of the space reaches a preset space threshold, determine that the timing of data transmission has arrived.

[0261] In some embodiments, the first sending module is further used to:

[0262] Determine an adjacent area of ​​the virtual scene area;

[0263] The game client corresponding to the virtual object located in the virtual scene area and the adjacent area of ​​the virtual scene area is determined as the target receiving object of the merged data packet.

[0264] In some embodiments, the apparatus further comprises:

[0265] A sixth determination module, configured to determine that a data transmission timing has arrived when detecting that a target virtual object has moved out of the virtual scene area;

[0266] Correspondingly, the first sending module is further used for:

[0267] The game client corresponding to the target virtual object is determined as the target receiving object of the merged data packet.

[0268] In some embodiments, the apparatus further comprises:

[0269] A fourth acquisition module is used to acquire the current data packet sequence number of the data cache queue corresponding to the virtual scene area;

[0270] A seventh determination module, configured to determine the sequence number of the game data packet based on the sequence number of the current data packet;

[0271] A first updating module, used for updating the sequence number of the game data packet to the current data packet sequence number of the data cache queue;

[0272] Correspondingly, the data cache module is also used for:

[0273] The game data packet and the serial number of the game data packet are added to the data cache queue.

[0274] In some embodiments, the apparatus further comprises:

[0275] an eighth determination module, configured to determine an updated virtual scene area of ​​the virtual object when a change is detected in the virtual scene area where the virtual object is located;

[0276] A fifth acquisition module, used to acquire a current data packet sequence number corresponding to the updated virtual scene area;

[0277] The fourth sending module is used to send the current data packet sequence number corresponding to the updated virtual scene area to the game client corresponding to the virtual object.

[0278] It should be noted that the description of the game data processing device in the embodiment of the present application is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiment of the device, please refer to the description of the method embodiment of the present application for understanding.

[0279] See also Figure 3B , Figure 3B is a schematic diagram of the structure of a game terminal 200 provided in an embodiment of the present application, Figure 3B The game terminal 200 shown includes: at least one processor 210, at least one network interface 220, a user interface 230, a bus system 240 and a memory 250. The user interface 230 includes an output device 231 and an input device 232, and the memory 250 includes an operating system 251, a network communication module 252, a presentation module 253, an input processing module 254 and a game processing device 255. The game processing device can be implemented in software. Figure 3B The game data processing device 255 stored in the memory 250 is shown. Figure 3B As shown, the device comprises:

[0280] The game starting module 2551 is used to start the game in response to the received game starting instruction;

[0281] The second sending module 2552 is used to send a game data packet to the server in response to a received game operation instruction during the game game process;

[0282] The first receiving module 2553 is used to receive the merged data packet sent by the server, and parse the merged data packet to obtain multiple game data packets;

[0283] The first determination module 2554 is used to determine a target data packet from the multiple game data packets, and render and display based on the target data packet.

[0284] In some embodiments, the first determining module is further configured to:

[0285] Obtain the current data packet sequence number of the virtual scene area where the virtual object corresponding to the game client is currently located;

[0286] Get the serial number corresponding to each game data packet;

[0287] A game data packet whose serial number is greater than or equal to the serial number of the current data packet is determined as a target data packet.

[0288] In some embodiments, the apparatus further comprises:

[0289] A sixth acquisition module, used to acquire the maximum sequence number among the sequence numbers corresponding to the target data packets;

[0290] The second updating module is used to update the maximum sequence number to the current data packet sequence number of the virtual scene area.

[0291] It should be noted that the description of the game data processing device in the embodiment of the present application is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiment of the device, please refer to the description of the method embodiment of the present application for understanding.

[0292] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the game data processing method described in the embodiment of the present application.

[0293] The present application embodiment provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the game data processing method provided by the present application embodiment, for example, Figure 4 , Figure 5 and Figure 6The game data processing method is shown.

[0294] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0295] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0296] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0297] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0298] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for processing game data, characterized in that: Applied to a server, the method comprises: During the game match, obtaining a game data packet triggered by an operation of the first game client; Obtaining a virtual scene area where the virtual object corresponding to the first game client is located; When it is determined that the game data packet meets the data caching condition, the game data packet is added to the data caching queue corresponding to the virtual scene area; wherein, when the total number of virtual objects located in the virtual scene area is greater than a preset total number threshold, and the game data packet is a non-real-time transmission data packet, it is determined that the game data packet meets the data caching condition; When it is determined that the data transmission time has arrived, the game data packets in the data cache queue are merged to obtain a merged data packet; Determine an adjacent area of ​​the virtual scene area; determine a second game client corresponding to a virtual object located in the virtual scene area and an adjacent area of ​​the virtual scene area as a target receiving object of the merged data packet, and send the merged data packet to the target receiving object.

2. The method according to claim 1, characterized in that The method further comprises: Acquire attribute information of the game data packet, and determine the total number of virtual objects located in the virtual scene area; Determining whether the game data packet meets a data caching condition based on the total number of objects and the attribute information; Among them, when the total number of objects is greater than a preset total number threshold and the attribute information is a non-real-time sending of data packets, it is determined that the game data packet meets the data caching condition; when the total number of objects is less than or equal to the total number threshold, or the attribute information is a real-time sending of data packets, it is determined that the game data packet does not meet the data caching condition.

3. The method according to claim 2, characterized in that The method further comprises: When the game data packet is determined not to satisfy the data cache condition, determining a target receiving object of the game data packet; The game data packet is sent to the target receiving object.

4. The method according to claim 1, characterized in that The method further comprises: When it is determined that the time interval between the time when the data was last sent reaches a preset interval threshold, it is determined that the data sending opportunity has arrived; or; The size of the space occupied by the game data packet in the data cache queue is obtained, and when it is determined that the size of the space reaches a preset space threshold, it is determined that the timing for data transmission has arrived.

5. The method according to claim 1, characterized in that The method further comprises: When it is detected that there is a target virtual object moving out of the virtual scene area, it is determined that a data sending timing has been reached.

6. The method according to any one of claims 1 to 5, characterized in that: Before adding the game data packet to the data cache queue corresponding to the virtual scene area, the method further includes: Obtaining a current data packet sequence number of a data cache queue corresponding to the virtual scene area; Determining the sequence number of the game data packet based on the current data packet sequence number; Updating the sequence number of the game data packet to the current data packet sequence number of the data cache queue; Correspondingly, the step of adding the game data packet to a data cache queue corresponding to the virtual scene area includes: The game data packet and the serial number of the game data packet are added to the data cache queue.

7. The method according to claim 6, characterized in that The method further comprises: When it is detected that the virtual scene area where the virtual object corresponding to the first game client is located has changed, determining the updated virtual scene area of ​​the virtual object corresponding to the first game client; Obtaining a current data packet sequence number corresponding to the updated virtual scene area; The current data packet sequence number corresponding to the updated virtual scene area is sent to the first game client.

8. A method for processing game data, characterized in that: The method comprises: In response to the received game match start instruction, start the game match; During a game match, in response to a game operation instruction received based on a first game client, a game data packet is sent to a server; so that when the server determines that the game data packet meets the data cache condition, the game data packet is added to a data cache queue, wherein when the total number of virtual objects located in a virtual scene area is greater than a preset total threshold, and the game data packet is a non-real-time sending data packet, it is determined that the game data packet meets the data cache condition, and the virtual scene area is the area where the virtual object corresponding to the first game client is located; and when it is determined that the data sending time has arrived, the game data packets are merged to obtain a merged data packet; the adjacent area of ​​the virtual scene is determined, and when the virtual object corresponding to the second game client is located in the virtual scene area or the adjacent area, the second game client is determined as a target receiving object, and the merged data packet is sent to the target receiving object; receiving the merged data packet sent by the server, parsing the merged data packet, and obtaining a plurality of game data packets; A target data packet is determined from the multiple game data packets, and rendering and display are performed based on the target data packet.

9. The method according to claim 8, characterized in that Determining a target data packet from the plurality of game data packets comprises: Obtaining a current data packet sequence number of a virtual scene area where a virtual object corresponding to the first game client is currently located; Get the serial number corresponding to each game data packet; A game data packet whose serial number is greater than or equal to the serial number of the current data packet is determined as a target data packet.

10. The method according to claim 9, characterized in that The method further comprises: Obtain the maximum sequence number among the sequence numbers corresponding to each target game data packet; The maximum sequence number is updated to the current data packet sequence number of the virtual scene area.

11. A game data processing device, characterized in that: The device comprises: A first acquisition module is used to acquire a game data packet triggered by an operation of a first game client during a game match; A second acquisition module is used to acquire a virtual scene area where the virtual object corresponding to the first game client is located; A data cache module, configured to add the game data packet to a data cache queue corresponding to the virtual scene area when it is determined that the game data packet meets the data cache condition; wherein, when the total number of virtual objects located in the virtual scene area is greater than a preset total number threshold and the game data packet is a non-real-time transmission data packet, it is determined that the game data packet meets the data cache condition; A data merging module, used for merging the game data packets in the data cache queue to obtain a merged data packet when it is determined that the data transmission opportunity has arrived; The first sending module is used to determine the adjacent area of ​​the virtual scene area; determine the second game client corresponding to the virtual object located in the virtual scene area and the adjacent area of ​​the virtual scene area as the target receiving object of the merged data packet, and send the merged data packet to the target receiving object.

12. A game data processing device, characterized in that: The device comprises: A game starting module, used to start a game in response to a received game starting instruction; A second sending module is used to send a game data packet to the server in response to a game operation instruction received based on the first game client during the game match process; so that when the server determines that the game data packet meets the data caching condition, the game data packet is added to the data caching queue, wherein when the total number of virtual objects located in the virtual scene area is greater than a preset total number threshold, and the game data packet is a non-real-time sending data packet, it is determined that the game data packet meets the data caching condition, and the virtual scene area is the area where the virtual object corresponding to the first game client is located; and when it is determined that the data sending time has arrived, the game data packets are merged to obtain a merged data packet; the adjacent area of ​​the virtual scene is determined, and when the virtual object corresponding to the second game client is located in the virtual scene area or the adjacent area, the second game client is determined as a target receiving object, and the merged data packet is sent to the target receiving object; A first receiving module, configured to receive the merged data packet sent by the server, and parse the merged data packet to obtain a plurality of game data packets; The first determination module is used to determine a target data packet from the multiple game data packets, and perform rendering and display based on the target data packet.

13. A computer device, characterized in that: The computer device comprises: A memory for storing executable instructions; A processor, used to implement the method described in any one of claims 1 to 7 or any one of claims 8 to 10 when executing the executable instructions stored in the memory.

14. A computer-readable storage medium storing executable instructions, characterized in that: When the executable instructions are executed by a processor, the method described in any one of claims 1 to 7 or any one of claims 8 to 10 is implemented.

15. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the method according to any one of claims 1 to 7 or any one of claims 8 to 10 is implemented.

Citation Information

Patent Citations

  • Virtual object information acquisition method and device, server and readable storage medium

    CN111298432A