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

文档序号:493305 发布日期:2022-01-07 浏览:25次 中文

阅读说明:本技术 游戏数据处理方法、装置、设备及计算机可读存储介质 (Game data processing method, device, equipment and computer readable storage medium ) 是由 汪胜蕾 于 2021-10-27 设计创作,主要内容包括:本申请提供了一种游戏数据处理方法、装置、设备及计算机可读存储介质;方法包括:在游戏对局过程中,获取基于游戏客户端的操作触发的游戏数据包;获取该游戏客户端所对应的虚拟对象所在的虚拟场景区域;在确定该游戏数据包满足数据缓存条件时,将该游戏数据包增加至该虚拟场景区域对应的数据缓存队列中;在确定达到数据发送时机时,将该数据缓存队列中的游戏数据包进行合并处理,得到合并后的数据包;确定该合并后的数据包的目标接收对象,并将该合并后的数据包发送至该目标接收对象。通过本申请,能够降低游戏对局中的数据传输量,提高数据传输的有效载荷。(The application provides a game data processing method, a device, equipment and a computer readable storage medium; the method comprises the following steps: in the game-playing process, obtaining a game data packet triggered based on the operation of a game client; acquiring a virtual scene area where a virtual object corresponding to the game client is located; when the game data packet is determined to meet the data caching condition, adding the game data packet into a data caching queue corresponding to the virtual scene area; when the data sending opportunity is determined to be reached, merging the game data packets in the data cache queue to obtain merged data packets; and determining a target receiving object of the merged data packet, and sending the merged data packet to the target receiving object. By the method and the device, the data transmission quantity in game match can be reduced, and the effective load of data transmission is improved.)

1. A game data processing method, characterized in that the method comprises:

in the game-playing process, obtaining a game data packet triggered based on the operation of a game client;

acquiring a virtual scene area where a virtual object corresponding to the game client is located;

when the game data packet is determined to meet the data caching condition, adding the game data packet into a data caching queue corresponding to the virtual scene area;

when the data sending opportunity is determined to be reached, merging the game data packets in the data cache queue to obtain merged data packets;

and determining a target receiving object of the merged data packet, and sending the merged data packet to the target receiving object.

2. The method of claim 1, further comprising:

acquiring attribute information of the game data packet, and determining the total number of the virtual objects in the virtual scene area;

determining whether the game data packet satisfies a data caching condition based on the total number of objects and the attribute information;

when the total number of the objects is larger than a preset total number threshold value and the attribute information is a non-real-time transmission data packet, determining that the game data packet meets a data cache condition, and when the total number of the objects is smaller than or equal to the total number threshold value or the attribute information is a real-time transmission data packet, determining that the game data packet does not meet the data cache condition.

3. The method of claim 2, further comprising:

determining a target receiving object of the game data packet when the game data packet is determined not to meet the data caching condition;

and sending the game data packet to the target receiving object.

4. The method of claim 1, further comprising:

when the time interval between the time of determining the data transmission and the time of last data transmission reaches a preset interval threshold value, determining the time of data transmission; or;

and acquiring the space occupied by the game data packet in the data cache queue, and determining that the data sending time is reached when the space is determined to reach a preset space threshold value.

5. The method of claim 4, wherein said determining the target recipient object of the merged packet comprises:

determining a contiguous region of the virtual scene region;

and determining a game client corresponding to the virtual object located in the virtual scene area and the adjacent area of the virtual scene area as a target receiving object of the merged data packet.

6. The method of claim 1, further comprising:

when the situation that a target virtual object moving out of the virtual scene area exists is monitored, determining that the data sending time is reached;

correspondingly, determining a target receiving object of the merged data packet includes:

and determining the game client corresponding to the target virtual object as a target receiving object of the merged data packet.

7. The method according to any one of claims 1 to 6, wherein before the adding the game data packet to the data buffer queue corresponding to the virtual scene area, the method further comprises:

acquiring a current data packet serial number of a data cache queue corresponding to the virtual scene area;

determining a 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 adding the game data packet to the data buffer queue corresponding to the virtual scene area includes:

and adding the game data packet and the sequence number of the game data packet to the data buffer queue.

8. The method of claim 7, further comprising:

when detecting that the virtual scene area where the virtual object is located changes, determining the virtual scene area after the virtual object is updated;

acquiring a current data packet serial number corresponding to the updated virtual scene area;

and sending the current data packet serial number corresponding to the updated virtual scene area to the game client corresponding to the virtual object.

9. A game data processing method, characterized in that the method comprises:

responding to the received game play starting instruction, and starting game play;

in the game-playing process, responding to the received game operation instruction, and sending a game data packet to a server;

receiving the merged data packet sent by the server, and analyzing the merged data packet to obtain a plurality of game data packets;

and determining a target data packet from the plurality of game data packets, and rendering and displaying based on the target data packet.

10. The method of claim 9, wherein determining a destination data packet from the plurality of game data packets comprises:

acquiring a current data packet serial number of a virtual scene area where a virtual object corresponding to a game client is located currently;

acquiring a serial number corresponding to each game data packet;

and determining the game data packet with the sequence number larger than or equal to the sequence number of the current data packet as a target data packet.

11. The method as recited in claim 10, wherein said method further comprises:

acquiring the maximum serial number in the serial numbers corresponding to the target game data packets;

and updating the maximum sequence number to the current data packet sequence number of the virtual scene area.

12. A game data processing apparatus, characterized in that the apparatus comprises:

the game system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a game data packet triggered based on the operation of a game client in the game-playing process;

the second acquisition module is used for acquiring a virtual scene area where a virtual object corresponding to the game client is located;

the data caching module is used for adding the game data packet into a data caching queue corresponding to the virtual scene area when the game data packet is determined to meet a data caching condition;

the data merging module is used for merging the game data packets in the data cache queue when the data sending opportunity is determined to be reached, so as to obtain merged data packets;

and the first sending module is used for determining a target receiving object of the merged data packet and sending the merged data packet to the target receiving object.

13. A game data processing apparatus, characterized in that the apparatus comprises:

the game starting module is used for responding to the received game-play starting instruction and starting game play;

the second sending module is used for responding to the received game operation instruction and sending a game data packet to the server in the game-playing process;

the first receiving module is used for receiving the merged data packet sent by the server and analyzing the merged data packet to obtain a plurality of game data packets;

and the first determining module is used for determining a target data packet from the plurality of game data packets and rendering and displaying based on the target data packet.

14. A computer device, characterized in that the computer device comprises:

a memory for storing executable instructions;

a processor for implementing the method of any one of claims 1 to 8, or any one of claims 9 to 11, when executing executable instructions stored in the memory.

15. A computer readable storage medium storing executable instructions, wherein the executable instructions when executed by a processor implement the method of any one of claims 1 to 8, or any one of claims 9 to 11.

16. A computer program product comprising a computer program or instructions, characterized in that the computer program or instructions, when executed by a processor, implement the method of any of claims 1 to 8, or any of claims 9 to 11.

Technical Field

The present application relates to internet technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for processing game data.

Background

In pursuit of richer and more varied play and a more drastic combat experience, modern Massively Multiplayer Online Role Playing Games (MMORPGs) may design some hundreds or even thousands of people to fight. In a game scene, characters and characters are visible to each other, and character behaviors are broadcast to other characters in a visual field in real time. The number of view broadcast packets is proportional to the square of the number of characters in the view. As the number of characters in the field of view increases, a large number of broadcast operations can cause a dramatic increase in the amount of network packets and traffic downstream from the server. A surge in network traffic can cause server downstream bandwidth and player bandwidth to become overwhelmed, causing a game jam or drop.

Disclosure of Invention

The embodiment of the application provides a game data processing method, a game data processing device and a computer readable storage medium, which can reduce the data transmission amount in game match and improve the effective load of data transmission.

The technical scheme of the embodiment of the application is realized as follows:

the embodiment of the application provides a game data processing method, which comprises the following steps:

in the game-playing process, obtaining a game data packet triggered based on the operation of a game client;

acquiring a virtual scene area where a virtual object corresponding to the game client is located;

when the game data packet is determined to meet the data caching condition, adding the game data packet into a data caching queue corresponding to the virtual scene area;

when the data sending opportunity is determined to be reached, merging the game data packets in the data cache queue to obtain merged data packets;

and determining a target receiving object of the merged data packet, and sending the merged data packet to the target receiving object.

The embodiment of the application provides a game data processing method, which comprises the following steps:

responding to the received game play starting instruction, and starting game play;

in the game-playing process, responding to the received game operation instruction, and sending a game data packet to a server;

receiving the merged data packet sent by the server, and analyzing the merged data packet to obtain a plurality of game data packets;

and determining a target data packet from the plurality of game data packets, and rendering and displaying based on the target data packet.

An embodiment of the present application provides a game data processing apparatus, including:

the game system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a game data packet triggered based on the operation of a game client in the game-playing process;

the second acquisition module is used for acquiring a virtual scene area where a virtual object corresponding to the game client is located;

the cache module is used for adding the game data packet into a data cache queue corresponding to the virtual scene area when the game data packet is determined to meet the data cache condition;

the data merging module is used for merging the game data packets in the data cache queue when the data sending opportunity is determined to be reached, so as to obtain merged data packets;

and the first sending module is used for determining a target receiving object of the merged data packet and sending the merged data packet to the target receiving object.

In some embodiments, the apparatus further comprises:

a third obtaining module, configured to obtain attribute information of the game data packet, and determine a total number of objects of virtual objects located in the virtual scene area;

a second determining module, configured to determine whether the game data packet satisfies a data caching condition based on the total number of objects and the attribute information;

when the total number of the objects is larger than a preset total number threshold value and the attribute information is a non-real-time sending data packet, determining that the game data packet meets a data cache condition, and when the total number of the objects is smaller than or equal to the total number threshold value or the attribute information is a real-time sending data packet, determining that the game data packet does not meet the data cache condition.

In some embodiments, the apparatus further comprises:

the third determining module is used for determining a target receiving object of the game data packet when the game data packet is determined not to meet the data caching condition;

and the third sending module is used for sending the game data packet to the target receiving object.

In some embodiments, the apparatus further comprises:

the fourth determining module is used for determining the data sending time when the time interval between the time of determining the data sending time and the last time reaches the preset interval threshold; or;

and the fifth determining module is used for acquiring the space occupied by the game data packet in the data cache queue and determining that the data sending time is reached when the space is determined to reach the preset space threshold.

In some embodiments, the first sending module is further configured to:

determining a neighboring area of the virtual scene area;

and determining the game client corresponding to the virtual object in the virtual scene area and the adjacent area of the virtual scene area as the target receiving object of the merged data packet.

In some embodiments, the apparatus further comprises:

a sixth determining module, configured to determine a data sending time when it is monitored that a target virtual object moving out of the virtual scene area exists;

correspondingly, the first sending module is further configured to:

and determining the game client corresponding to the target virtual object as a target receiving object of the merged data packet.

In some embodiments, the apparatus further comprises:

a fourth obtaining module, configured to obtain a current packet sequence number of a data cache queue corresponding to the virtual scene area;

a seventh determining module, configured to determine a sequence number of the game data packet based on the sequence number of the current data packet;

the first updating module is used for updating the serial number of the game data packet into the current data packet serial number of the data cache queue;

correspondingly, the data caching module is further configured to:

and adding the game data packet and the sequence number of the game data packet into the data buffer queue.

In some embodiments, the apparatus further comprises:

an eighth determining module, configured to determine, when it is detected that a virtual scene area where the virtual object is located changes, a virtual scene area where the virtual object is updated;

a fifth obtaining module, configured to obtain a current packet sequence number corresponding to the updated virtual scene area;

and the fourth sending module is used for sending the current data packet serial number corresponding to the updated virtual scene area to the game client corresponding to the virtual object.

An embodiment of the present application provides a game data processing apparatus, including:

the game starting module is used for responding to the received game-play starting instruction and starting game play;

the second sending module is used for responding to the received game operation instruction and sending a game data packet to the server in the game-playing process;

the first receiving module is used for receiving the merged data packet sent by the server and analyzing the merged data packet to obtain a plurality of game data packets;

and the first determining module is used for determining a target data packet from the plurality of game data packets and rendering and displaying based on the target data packet.

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

acquiring a current data packet serial number of a virtual scene area where a virtual object corresponding to a game client is located currently;

acquiring a serial number corresponding to each game data packet;

and determining the game data packet with the sequence number larger than or equal to the sequence number of the current data packet as a target data packet.

In some embodiments, the apparatus further comprises:

a sixth obtaining module, configured to obtain a maximum sequence number of sequence numbers corresponding to each target data packet;

and the second updating module is used for updating the maximum sequence number to the current data packet sequence number of the virtual scene area.

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

a memory for storing executable instructions;

and the processor is used for realizing the game data processing method provided by the embodiment of the application when the processor executes the executable instructions stored in the memory.

The embodiment of the application provides a computer-readable storage medium, which stores executable instructions and is used for causing a processor to execute the executable instructions so as to realize the game data processing method provided by the embodiment of the application.

The embodiment of the present application provides a computer program product, which includes a computer program or instructions, and the computer program or instructions, when executed by a processor, implement the game data processing method provided by the embodiment of the present application.

The embodiment of the application has the following beneficial effects:

in the game-playing process, after obtaining a game data packet triggered based on the operation of a game client, a server obtains a virtual scene area where a virtual object corresponding to the game client is located, when the game data packet is determined to meet a data cache condition, the game data packet is added into a data cache queue corresponding to the virtual scene area instead of being sent in real time, when the data sending opportunity is determined to be reached, the game data packets in the data cache queue are merged to obtain a merged data packet, a target receiving object of the merged data packet is determined, and the merged data packet is sent to the target receiving object; after the plurality of data packets are merged, the plurality of data packets share one data packet header, so that the data transmission amount in game match can be reduced, the effective load of data transmission is improved, and the smoothness of the game is improved.

Drawings

FIG. 1A is a diagram illustrating a visual field management mechanism of a virtual object in the related art;

FIG. 1B is a diagram illustrating a mechanism of downlink broadcasting of game data by a server in the related art;

FIG. 2 is a schematic diagram of a network architecture of a game system 100 provided in an embodiment of the present application;

fig. 3A is a schematic structural diagram of a server 400 provided in an embodiment of the present application;

fig. 3B is a schematic structural diagram of game terminal 200 according to an embodiment of the present application;

FIG. 4 is a schematic flow chart of an implementation of a game data processing method provided in an embodiment of the present application;

FIG. 5 is a schematic flow chart of another implementation of a game data processing method provided in the embodiment of the present application;

FIG. 6 is a schematic flow chart of another implementation of the game data processing method according to the embodiment of the present application;

FIG. 7 is a schematic view of a large MMORPG group play game scenario;

fig. 8 is a schematic diagram of maintaining a broadcast buffer based on around according to an embodiment of the present application;

fig. 9 is a schematic diagram of a downlink broadcast transmission data packet based on an Around union packet according to an embodiment of the present application;

FIG. 10 is a schematic diagram of computing a payload after merging packets according to an embodiment of the present application;

fig. 11 is an arc switching diagram provided in an embodiment of the present application;

fig. 12 is a schematic diagram of an implementation process for avoiding a packet collision problem through sequence numbers according to an embodiment of the present application.

Detailed Description

In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is 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.

In the following description, references to the terms "first \ second \ third" are only to distinguish similar objects and do not denote a particular order, but rather the terms "first \ second \ third" are used to interchange specific orders or sequences, where appropriate, so as to enable the embodiments of the application described herein to be practiced in other than the order shown or described herein.

Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.

Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.

1) An Online Game (Online Game), also called an Online Game, generally refers to an electronic Game in which multiple players play interactively through a computer network.

2) An Action Game (Action Game) is one of electronic games, which emphasizes the reaction ability and hand-eye coordination of players. There are often multiple skills that are released in a coordinated fashion to form a continuous-hit form of play.

3) A Role-Playing Game (RPG), which is a type of Game in which a player plays a Role of one or several players in a virtual world in a specific scene. In general, such games are played by players as adventures and roaming in the game world, and various encounters (such as battles, conversations, meeting important characters, etc.) in one way are important keys for the growth of the player characters and the game progress.

4) Game skill (Spell) a play in role-playing games, a skill corresponding to a set of rules that, when used, may produce specific magic effects on itself and objects.

5) The field of view, the world of play that a player's manipulated character can see within the game.

6) Group battles, game play where a large number of players are grouped together in a PK in a MMORPG.

7) The Game Client (Game Client) is a program corresponding to the Game server and providing local services to the Client. The system is generally installed on a common user machine and needs to be matched with a server side to operate.

8) The network Game Server (Game Server) is a software program which corresponds to the network Game client, is installed in the IDC and provides data forwarding and logic processing services for the network Game client. In network games, complex and critical logic requires computation on the network game server, since clients installed on player machines are easily cracked and used for cheating.

9) Visual field broadcast, in a network game, a character manipulated by a player can see the in-game behaviors of other characters in the game. This requires that the in-game behavior of each character needs to be broadcast to other characters in view.

10) The broadcast packet, which may also be referred to as a game data packet in this embodiment of the present application, may be data that needs to be broadcast by the server to other players, for example, a player moving within a game may generate a mobile broadcast packet.

11) TCP Header (TCP Header), a data Header defined by Transmission Control Protocol (TCP), and one TCP Header generally has 20 bytes.

12) An IP Header (IP Header), a data Header defined by an Internet Protocol (IP), and an IP Header generally has 20 bytes.

13) Frame header (Frame header): a link layer frame protocol data header, typically 14 bytes.

14) A data buffer (buffer) for temporarily storing a space of data.

In order to better understand the game data processing method provided by the embodiment of the application, the game data method and the existing defects in the related art are explained.

The visual field management of MMO generally adopts the conventional nine-grid visual field management, as shown in fig. 1A, the game scene map is divided into 54m × 54m cells, each cell is called an area (Around), and each Around maintains a character list. As shown in fig. 1A, the player character a can see 9 arcs (shaded portion 101 in fig. 1A) with a field of view of 3 × 3. As a player character a moves within the game scene or releases skills, the character behavior is broadcast in real time to all players in 9 Around in view.

Fig. 1B is a schematic diagram of a downlink broadcast mechanism of a server for game data in the related art, as shown in fig. 1B, each area corresponds to one role list, an area 1 corresponds to a role list 1, an area 2 corresponds to a role list 2, …, and an area 9 corresponds to a role list 9, a plurality of data packets are generated at a broadcast source 111, fig. 1B exemplarily shows a data packet 1, a data packet 2, a data packet 3, and a data packet 4, and in the related art, the data packets are respectively sent to game clients corresponding to respective roles in the role lists 1 to 9 corresponding to the areas 1 to 9 through a gateway process.

The movement/skill manipulation of players during group play is also very frequent. It can be seen that the write-diffusion effect of the view broadcast is severe, and the behavior of each player is broadcast to the other players in the view. The overall number of downlink packages is proportional to the square of the number of players in the field of view. Under the broadcast scheme shown in fig. 1B, it is assumed that the upper limit of the number of persons in the group play is 500. When the group battle is violent, 500 players are gathered together, and the assumed conditions comprise:

1. the broadcast range is 500;

2. the player who releases the skill is a%, the request frequency is 1 time/s, and the average size of the broadcast packet is 120 bytes;

3. b% of moving players, the highest request frequency of 3 times/s, and the average size of the broadcast packet is 60 bytes;

4. the moving speed of the player is 5m/s, the side length of the round is 54m, and the visual field can be switched when the player moves about 10 s;

5. the TCP payload is calculated as 80%.

Table 1 is a table for analyzing data amount under different combat proportions and different move proportions, and it can be seen from table 1 that when 50% of players are in combat, 50% of players are moving. The total package amount per second reaches 50w/s, the total flow amount reaches 600M, and the single-person flow amount is 150 KB/s. The group battle activity has the following two problems, one is the packet volume problem, the single field packet volume is already 50w/s, enough access processes need to be preset for the group battle activity, and the idle rate is high at ordinary times. One is the traffic problem, where too high of a total flow requires bandwidth that is high enough to easily cause a game to jam or drop when the bandwidth is insufficient.

TABLE 1 data analysis table for different combat proportions and different movement proportions

Based on this, embodiments of the present application provide a game data processing method, apparatus, device, and computer-readable storage medium, which implement broadcast combining by maintaining a broadcast cache based on each Around, and can greatly reduce the total amount of data transmission without affecting game experience, thereby greatly reducing the downlink broadcast pressure of a group battle.

An exemplary application of the game data processing device provided in the embodiment of the present application is described below, and the device provided in the embodiment of the present application may be implemented as a server. In the following, an exemplary application will be explained when the device is implemented as a server.

Referring to fig. 2, fig. 2 is a schematic diagram of a network architecture of game system 100 provided in an embodiment of the present application, and as shown in fig. 2, the game system includes game terminal 200 (game terminal 200-1 and game terminal 200-2 are exemplarily shown), network 300 and server 400, where game terminal 200-1 and game terminal 200-2 are respectively connected to server 200 through network 300, and network 300 may be a wide area network or a local area network, or a combination of both.

Game terminal 200-1 and game terminal 200-2 may have a game application (i.e., a game client) installed therein, and game terminal 200-1 or game terminal 200-2 may also log in to the game client through a web page to start game play.

In the game-play process, a user can trigger operations such as movement of a virtual object in a game virtual scene through a terminal, or skill release, and the operations such as movement or skill release can trigger broadcast of a data packet. In fig. 2, assuming that game terminal 200-1 has transmitted game data packets pk g1 and pkg2 to server 400 and game terminal 200-2 has transmitted game data packet pkg3 to server 400, in the embodiment of the present application, when receiving a game data packet transmitted by a game terminal, the broadcast interface of the server buffers the game data packet in the data buffer queue if it is determined that the game data packet satisfies the data buffer condition, and it is assumed that pkg1, pkg2, and pkg3 all exist in the data buffer queue. When the server reaches the data sending opportunity, merging the data packets in the data cache queue, adding a data packet header to obtain a merged data packet, and sending the merged data packet to a target receiving object, wherein the target receiving object can be a virtual scene area where a virtual object is located and game clients corresponding to all virtual objects in an adjacent area of the virtual scene area. In FIG. 2, it is exemplarily shown that both game terminal 200-1 and game terminal 200-2 are target reception objects. In the embodiment of the application, a plurality of game data packets can be contained in the merged data packet, but the plurality of game data packets share one data packet header, so that the effective load of data transmission can be improved, the total downlink data transmission amount of the server can be reduced, and the smoothness of the game can be improved.

In some embodiments, the server 400 may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform. The terminal 400 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the embodiment of the present application is not limited.

Referring to fig. 3A, fig. 3A is a schematic structural diagram of a server 400 according to an embodiment of the present application, where the server 400 shown in fig. 3A includes: at least one processor 410, memory 450, at least one network interface 420, and a user interface 430. The various components in server 400 are coupled together by a bus system 440. It is understood that the bus system 440 is used to enable communications among the components. The bus system 440 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 440 in fig. 3A.

The Processor 410 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.

The user interface 430 includes one or more output devices 431, including one or more speakers and/or one or more visual displays, that enable the presentation of media content. 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.

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, and the like. Memory 450 optionally includes one or more storage devices physically located remote from processor 410.

The memory 450 includes either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. The nonvolatile memory may be a Read Only Memory (ROM), and the volatile memory may be a Random Access Memory (RAM). The memory 450 described in embodiments herein is intended to comprise any suitable type of memory.

In some embodiments, memory 450 is capable of storing data, examples of which include programs, modules, and data structures, or a subset or superset thereof, to support various operations, as exemplified below.

An operating system 451, including system programs for handling 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 handling hardware-based tasks;

a network communication module 452 for communicating to other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;

an input processing module 453 for detecting one or more user inputs or interactions from one of the one or more input devices 432 and translating the detected inputs or interactions.

In some embodiments, the apparatus provided by the embodiments of the present application may be implemented in software, and fig. 3A illustrates a game data processing apparatus 454 stored in a memory 450, which may be software in the form of programs and plug-ins, and the like, and includes the following software modules: a first obtaining module 4541, a second obtaining module 4542, a data caching module 4543, a data merging module 4544 and a first sending module 4545, which are logical and thus may be arbitrarily combined or further split depending on the functions implemented. The functions of the respective modules will be explained below.

In other embodiments, the apparatus provided in the embodiments of the present Application may be implemented in hardware, and for example, the apparatus provided in the embodiments of the present Application may 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 the hardware decoding processor may be 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.

The game data processing method provided by the embodiment of the present application will be described in conjunction with exemplary applications and implementations of the server provided by the embodiment of the present application.

Referring to fig. 4, fig. 4 is a schematic flow chart of an implementation of the game data processing method provided in the embodiment of the present application, and is applied to a server, and the game data processing method provided in the embodiment of the present application will be described below with reference to the steps shown in fig. 4.

Step S101, in the game-playing process, obtaining a game data packet triggered based on the operation of the game client.

In the game-play process, the game client can trigger the generation of a game data packet broadcasted to other players based on the operation of the player to move the virtual object or the operation of the player to control the virtual object to release skills, and the game data packet is transmitted to the server and is transmitted and broadcasted to other players by the server.

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

In this embodiment of the application, the server may divide the virtual scene of the game, for example, the virtual scene may be divided into a plurality of square areas with a side length of M meters according to a certain size, where M is a positive integer and may be 4, 10, 50, and the like. And the respective virtual scene areas may be numbered as identifications of the respective virtual scene areas, and vertex coordinates of the respective virtual scene areas may be recorded. The virtual scene area corresponds to Around in other embodiments.

When the step is implemented, the server may 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.

Step S103, when it is determined that the game data packet satisfies the data caching condition, adding the game data packet to a data caching queue corresponding to the virtual scene area.

In some embodiments, it is necessary to determine whether the game data packet satisfies the data buffering condition before step S103. Because there are a large number of players in a large MMORPG game, and the players are moving and fighting in real time in a map scene, the skills are released in a large amount, and the field of view and attributes of the players are updated frequently, a large number of data packets are generated and need to be sent to the game terminal. The mobile phone players are sensitive to the flow, the player terminals are uneven, and a large number of data packets bring performance and electric quantity consumption to the game terminal, so that the game fluency is affected, and therefore the data packets need to be processed under the condition that the number of players in a certain area is large, and the flow optimization is realized. Therefore, the data buffering condition may include that the total number of the virtual objects in the virtual scene area where the virtual object is located is greater than the total number threshold, and in addition, for some data packets, which need to be sent to the game terminal in real time, the data packets cannot be buffered, so the data buffering condition further includes that the game data packets are not data packets which need to be sent in real time.

In the embodiment of the application, each virtual scene area maintains a data buffer area, data is stored in the data buffer area in a queue form, that is, each virtual scene area corresponds to a data buffer queue, and data packets triggered by virtual objects in the same virtual scene area are buffered in the data buffer queue corresponding to the virtual scene area. In some embodiments, the server also sets a sequence number for each game data packet when adding the game data packet to the data buffer queue, so that the game client performs data synchronization based on the sequence number.

In the embodiment of the application, each virtual scene area (Around) is used as a granularity, each virtual scene area maintains one data cache queue, and target receiving objects of game data packets generated by virtual objects in the same virtual scene area are consistent, so that the data cache queues are maintained by using the virtual scene areas as the granularity, the memory overhead of a server is much smaller, and the merging efficiency is higher when the game data packets are merged.

And step S104, merging the game data packets in the data buffer queue when the data sending opportunity is determined to be reached, so as to obtain merged data packets.

In some embodiments, before this step, it is necessary to determine whether a data sending opportunity is reached, where the data sending opportunity may reach a preset data sending interval duration, or may reach a certain space threshold for the size of a space occupied by data packets of the data buffer queue, and in some embodiments, the number of data packets may reach a preset number threshold.

When the step is implemented, all game data packets in the data cache queue can be spliced according to the sequence of entering the queue, and then a TCP (transmission control protocol) head, an IP (Internet protocol) head and a frame head are sequentially added to the spliced data packets, so that the merged data packets are obtained. That is to say, in the embodiment of the present application, instead of allocating a TCP header, an IP header, and a frame header to each game data packet, a plurality of game data packets share one TCP header, one IP header, and one frame header, so that the total amount of downlink data transmission of the server can be reduced to a great extent, and the payload of data transmission can be improved.

Step S105, determining a target receiving object of the merged data packet, and sending the merged data packet to the target receiving object.

The target receiving object is a game client corresponding to a virtual object in the virtual character view field range in the virtual scene area. In the implementation of this step, an adjacent area of the virtual scene area may be obtained first, where the adjacent area of the virtual scene area may be an area adjacent to the virtual scene area, and the virtual scene area and the adjacent area of the virtual scene constitute a game world range that a virtual character in the virtual scene area can see in a game, that is, the virtual scene area and the adjacent area of the virtual scene are visual field ranges of the virtual character in the virtual scene area, and since a data packet is broadcasted in a visual field in the game, that is, a data packet generated by triggering of the virtual character in one virtual scene area needs to be broadcasted to other characters in the visual field, in this embodiment of the present application, game clients corresponding to a plurality of virtual objects located in the virtual scene area and a plurality of adjacent areas of the virtual scene area are determined as target receiving objects, and then sending the combined data packet to each game client, thereby realizing the visual field broadcast of the data packet.

In the game data processing method provided by the embodiment of the application, in the game-playing process, after a game data packet triggered by the operation of a game client is acquired, a virtual scene area where a virtual object corresponding to the game client is located is acquired by a server, when the game data packet is determined to meet a data cache condition, the game data packet is added to a data cache queue corresponding to the virtual scene area instead of being sent in real time, when the data sending opportunity is determined to be reached, the game data packets in the data cache queue are merged to obtain a merged data packet, a 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 recipient objects are game clients corresponding to other virtual objects within the visual field range of the virtual character, and since the visual field ranges of the virtual characters in the same virtual scene area are the same, the target recipient objects of the data packets generated by the virtual characters in the same virtual scene area are the same, in the embodiment of the present application, the data packets generated by the virtual characters in the same virtual scene area are merged with the virtual scene area as a granularity, and the multiple data packets share one data packet header, so that when there are many player characters in the virtual scene area and a large number of data packets are generated, compared with adding one data header to each data packet, the data transmission payload of data transmission can be greatly increased, thereby reducing the data transmission amount in the game partner, thereby improving the fluency of the game.

In some embodiments, after step S102, as shown in fig. 5, the following steps may also be performed to determine whether the data caching condition is satisfied, and a processing procedure in the case that the data caching condition is not satisfied, and the respective steps are described below with reference to fig. 5.

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

In the embodiment of the application, the attribute information of the game data packet at least comprises flag bit information representing whether the game data packet needs to be sent in real time, and when the flag bit information is 1, the game data packet needs to be sent in real time, that is, the game data packet is sent in real time; when the flag bit information is 0, it indicates that the game data packet does not need to be transmitted in real time, i.e., the game data packet is transmitted in non-real time.

In the embodiment of the application, each virtual scene area can correspond to a virtual object list, and when a new virtual object enters, the newly-entered virtual object is added to the virtual object list; and when the virtual object exits, deleting the exited virtual object from the virtual object list. The total number of objects of the virtual objects in the virtual scene area is determined, that is, the total number of objects in the virtual object list is determined.

Step S107, whether the game data packet meets the data caching condition is determined based on the object total number and the attribute information.

When the total number of the objects is greater than a preset total number threshold value and the attribute information is a non-real-time transmission data packet, determining that the game data packet meets a data cache condition, and then entering step S103; when the total number of the objects is less than or equal to the total number threshold value or the attribute information is a real-time transmission data packet, it is determined that the game data packet does not satisfy the data caching condition, and then the process proceeds to step S108.

In some embodiments, the attribute information of the game data packet may further include a 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 release skill data packet, and the like, wherein for some types of game data packets, the data packet needs to be broadcast to all virtual characters in the visual field, and for other types of game data packets, the data packet does not need to be broadcast to all virtual characters in the visual field. For example, for a dead packet, it is desirable to broadcast all avatars in view, while attacking other character packets may be broadcast only to attackers and attackers, and may not be broadcast to all avatars in view in order to reduce traffic. In implementation, the types of the data packets may be classified in advance, which data types belong to all virtual roles that need to be broadcast in the view range, and which data packets do not need to be broadcast to all virtual roles in the view range, which are preset.

Therefore, whether the game data packet meets the data caching condition is determined based on the total number of the objects and the attribute information, and when the game data packet meets the data caching condition, the total number of the objects is larger than a preset total number threshold value, the attribute information is a non-real-time transmission data packet, and the type of the data packet is required to be broadcasted to the virtual character in the visual field range.

And step S108, when the game data packet is determined not to meet the data caching condition, determining a target receiving object of the game data packet.

Similarly to step S105, in this step, the game client of the virtual object located in the virtual scene area and the adjoining area of the virtual scene area is determined as the target reception object.

Step S109, the game data packet is transmitted to the target receiving object.

When the step is realized, a TCP (transmission control protocol) head, an IP (Internet protocol) head and a frame head are required to be added to the game data packet to obtain the game data packet with the added data packet head, and then the game data packet with the added data packet head is sent to a target receiving object.

In the game data processing method provided by the embodiment of the application, after receiving a game data packet to be broadcasted, a server firstly needs to determine whether the game data packet meets a data cache condition through the total number of objects of virtual objects in a virtual scene area and attribute information of the game data packet, cache the game data packet in a data cache list, merge a plurality of game data packets when a data sending opportunity is reached, and send the merged data packet to a target receiving object; and when the data caching condition is determined not to be met based on the total number of the objects and the attribute information of the game data packet, the game data packet is sent in real time, so that the timeliness of data transmission is guaranteed.

In some embodiments, determining whether the data transmission opportunity is reached may be implemented by at least the following two implementation manners:

first, when it is determined that a time interval from a time when data was last transmitted reaches a preset interval threshold, it is determined that a data transmission timing is reached.

In implementation, the timer may be started to time after the server sends data once, and when it is determined that the time duration of the timer reaches the interval threshold, it is determined that the data sending time is reached. In some embodiments, after the server completes the data transmission, the timer is cleared.

And secondly, acquiring the space occupied by the game data packet in the data cache queue, and determining that the data sending time is reached when the space is determined to reach a preset space threshold.

In implementation, after adding one game data packet to the data cache queue, the total space occupied by the game data packet in the current data cache queue is counted, and whether the space size is greater than or equal to a preset space threshold is determined, where the space threshold may be a cache space size corresponding to the virtual scene area, and may also be smaller than the cache space size, and may be, for example, a value obtained by multiplying the cache space size by 0.8. Upon determining that the space size is greater than or equal to the space threshold, determining that a data transmission opportunity is reached.

In some embodiments, the number of packets of the game data packets in the data buffer queue may also be determined, and when it is determined that the number of packets reaches the number threshold, it is determined that the data transmission timing is reached.

In some embodiments, in the game match process, since the virtual object moves frequently, the virtual object may move out of the current virtual scene area and enter another virtual scene area, and after the virtual object moves out of the current virtual scene area, a packet of the data cache queue corresponding to the virtual scene area may not be sent to the game client corresponding to the virtual object, so in this embodiment of the present application, when it is monitored that a target virtual object that moves out of the virtual scene area exists, it is determined that a data sending time is reached.

Correspondingly, the target receiving object of the merged data packet is determined, and when the merging is achieved, the game client corresponding to the target virtual object is determined as the target receiving object of the merged data packet, that is, when the target virtual object moves out of the virtual scene area, in order to avoid that the game client corresponding to the target virtual object misses the game data packet of the target virtual object 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 are merged and are sent to the game client corresponding to the target virtual object.

In some embodiments, the aforementioned "determining the target receiving object of the merged data packet" in step S105 can be realized by steps S1051 and S1052, which are described below.

In step S1051, the adjacent area of the virtual scene area is determined.

In the embodiment of the present application, the adjacent areas of the virtual scene area may be eight adjacent areas, namely, upper, lower, left, right, upper right, lower right, upper left, and lower left, of the virtual scene area, of course, when the virtual scene area is located at an edge or a vertex of the game virtual scene map, the adjacent areas may be less than eight adjacent areas, for example, the adjacent area of the virtual scene area at the top left vertex includes only three adjacent areas, namely, lower, right, and lower right.

In step S1052, the game client corresponding to the virtual object located in the adjacent area between the virtual scene area and the virtual scene area is determined as the target receiving object of the merged data packet.

In some embodiments, a certain virtual scene area and a neighboring area of the virtual scene area may also be referred to as a visual field range of the virtual scene area, and thus, in implementation, a game client corresponding to a virtual object included in a plurality of virtual scene areas in the visual field range of the virtual scene area is determined as a target receiving object of the merged data packet.

Based on the foregoing embodiments, a game data processing method is further provided in the embodiments of the present application, and is applied to the network architecture shown in fig. 2, fig. 6 is a schematic diagram of a further implementation flow of the game data processing method provided in the embodiments of the present application, and the following describes steps with reference to fig. 6.

In step S201, the game terminal starts game play in response to the received game play start instruction.

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

Step S202, in the game-playing process, the game terminal responds to the received game operation instruction and sends a game data packet to the server.

In the game match process, a player can trigger the virtual object to move through the game terminal, or hit a killer virtual object, pick up a game item and the like, and all the operations generate game data packets and send the game data packets to the server, so that the server broadcasts the game data packets.

In step S203, the server acquires a virtual scene area where a virtual object corresponding to the game terminal is located.

After the server acquires the game data packet, in order to determine whether the game data packet meets the data caching condition or determine that the target receiving object of the game data packet needs to determine the virtual scene area where the virtual object is located. In implementation, a virtual scene area where a virtual object is located may be determined based on the location information where the virtual object is located.

In step S204, the server determines whether the game data packet satisfies a data caching condition.

In implementation, it may be first determined whether the game data packet is a data packet that needs to be sent in real time, and if the game data packet is not a data packet that needs to be sent in real time, it is further determined whether the total number of objects of the virtual objects in the virtual scene area is greater than a total number threshold, and when the total number of objects is greater than the total number threshold, it is determined that the game data packet satisfies a data caching condition; and when the game data packet is determined to be the data packet needing to be sent in real time in the first step, determining that the game data packet does not meet the data caching condition, or when the game data packet is determined not to be the data packet needing to be sent in real time in the first step, and when the total number of the virtual objects is determined to be smaller than or equal to the total number threshold value in the second step, indicating that the virtual objects in the virtual scene area are fewer, and the sending quantity of the data packet is relatively less, temporarily not caching the data, and similarly determining that the game data packet does not meet the data caching condition.

In the embodiment of the present application, when it is determined that the game data packet does not satisfy the data caching condition, the process proceeds to step S205; if it is determined that the game data packet satisfies the data buffering condition, the process proceeds to step S207.

In step S205, the server determines a target reception object of the game packet based on the virtual scene area.

The target receiving object at least comprises the game terminal, and can also comprise a virtual scene area and a game terminal corresponding to the virtual object in the adjacent area of the virtual scene area.

In step S206, the server transmits the game packet to the target receiving object.

In some embodiments, the target receiving object, upon receiving the game data packet, renders a display based on the game data packet.

Step S207, the server obtains the current data packet sequence number of the data buffer queue corresponding to the virtual scene area.

In this embodiment of the present application, in order to ensure the synchronism of data packet transmission, a data packet sequence number may be allocated to each data buffer queue, and when a server receives a game data packet to be stored in a certain data buffer queue, the server first obtains a current data packet sequence number of the data buffer queue, where the current data packet sequence number is also a sequence number of a data packet at the end of the data buffer queue in the data buffer queue.

In step S208, the server determines the serial number of the game data packet based on the current data packet serial number.

When the game data packet is realized, the serial number of the current data packet is added with 1, namely the serial number of the game data packet is obtained. For example, the current packet sequence number of the data buffer queue is 35, and the sequence number of a game packet to be stored in the data buffer queue is 36 when a game packet is received.

In step S209, the server updates the serial number of the game packet to the current packet serial number of the data buffer queue.

After the game data packets are buffered in the data buffer queue, the number of the data packets in the data buffer queue is equal to one more data packet, and the game data packet just buffered is the data packet at the tail of the data buffer queue, so that the sequence number of the game data packet can be updated to the current sequence number of the data packet in the data buffer queue. Taking the above example as a support, the sequence number of the game data packet newly added to the data buffer queue is 36, and then the sequence number of the current data packet in the data buffer queue is also updated to 36.

In step S210, the server adds the game data packet and the sequence number of the game data packet to the data buffer queue.

When the method is implemented, the sequence number of the game data packet can be used as one of the newly added attribute information of the game data packet, and the game data packet are added into the data cache queue.

And step S211, when the server determines that the data sending opportunity is reached, merging the game data packets in the data cache queue to obtain merged data packets.

In some embodiments, the data sending opportunity is determined to be reached when a preset time interval duration is reached or when it is determined that the size of the occupied space of the data packets in the data buffer queue reaches a certain threshold. In addition, when the virtual object moves out of the virtual scene area, the data transmission timing is reached.

The merging of the game data packets means that all the data packets in the current data cache queue are spliced according to the sequence of adding the data packets into the queue, and a TCP (transmission control protocol) header, an IP (Internet protocol) header and a frame header are sequentially added to obtain the merged data packets.

In step S212, the server determines a target receiving object of the merged data packet, and sends the merged data packet to the target receiving object.

In the case where it is determined that the data transmission timing is reached because the virtual object moves out of the virtual scene area, the game terminal (game client) corresponding to the target virtual object that moves out of the virtual scene area is determined as the target reception object. When the preset time interval duration is reached or the occupied space of the data packets in the data buffer queue is determined to reach a certain threshold value, and the data sending opportunity is determined to be reached, 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 a target receiving object. And after determining the target receiving object, the server sends the combined data packet to the target receiving object through the network.

In step S213, the game terminal receives the merged packet sent by the server, and analyzes the merged packet to obtain a plurality of game packets.

When the step is realized, the game terminal analyzes the merged data packet after receiving the merged data packet, and removes the frame header, the IP header and the TCP header in sequence, thereby obtaining a plurality of game data packets.

In step S214, the game terminal determines a target data packet from the plurality of game data packets, and performs rendering display based on the target data packet.

The method is realized by that a game terminal firstly obtains the serial number of a current data packet of a virtual scene area where a virtual object corresponding to a game client is located, then obtains the serial number corresponding to each analyzed game data packet, and determines the game data packet with the serial number larger than or equal to the serial number of the current data packet as a target data packet.

The game terminal obtains a current data packet sequence number of a virtual scene area where a virtual object corresponding to the game client is currently located, and when the game terminal is implemented, the current data packet sequence number sent by the server is received, or the current data packet sequence number is updated based on a sequence number of a previously received game data packet. When a virtual object corresponding to the game terminal is newly added to another virtual scene area (called a second virtual scene area) from another virtual scene area (called a first virtual scene area), the server sends the current data packet serial number of the second virtual scene area to the game terminal when monitoring that the virtual scene area where the virtual object is located changes. If the virtual scene area where the virtual object is located does not change, the game terminal updates the maximum sequence number in the received multiple game data packets to the current data packet sequence number every time the game terminal receives a game data packet. And when the game terminal receives the game data packet again, determining the game data packet with the sequence number greater than or equal to the current data packet sequence as the target data packet.

Note that steps S215 to S227 described below are not shown in fig. 6.

In step S215, when the server detects that the virtual scene area where the virtual object is located changes, the server determines a virtual scene area before the virtual object is updated and a virtual scene area after the virtual object is updated.

In the embodiment of the present application, the virtual scene area before updating may be referred to as a first virtual scene area, and the virtual scene area after updating may be referred to as a 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 is deleted from the object list of the first virtual scene area and added to the object list of the second virtual scene area.

Step S216 is executed by the server to merge the plurality of game data packets in the data cache queue corresponding to the pre-updated virtual scene area, so as to obtain a merged data packet.

In the embodiment of the application, when it is monitored that the virtual scene area where the virtual object is located changes, it is determined that the data sending time is reached, and at this time, a plurality of game data packets in the data cache queue corresponding to the virtual scene area before updating are merged, so that merged data packets are obtained.

In step S217, the server transmits the merged data packet to the game terminal.

That is, at this time, only the merged packet is transmitted to the game terminal corresponding to the virtual object in which the virtual scene area change has occurred.

In step S218, the server obtains the current packet sequence number corresponding to the updated virtual scene area.

After the virtual object moves to the updated virtual scene area, the game data packets triggered and generated by each virtual object in the updated virtual scene area are all 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, so that in order to enable the game terminal to distinguish which game data packets are required from which game data packets are not required, in the step, the server acquires the current data packet serial number corresponding to the updated virtual scene area, so that the game terminal is determined as a judgment standard based on the current data packet serial number.

In step S219, the server sends the current packet serial number corresponding to the updated virtual scene area to the game terminal corresponding to the virtual object.

In step S220, the game terminal receives the current packet sequence number of the virtual scene area sent by the server.

In the embodiment of the application, after receiving the current data packet serial number of the virtual scene area sent by the server, the game terminal updates the current data packet serial number stored by the game terminal.

For example, when the virtual object moves from the first virtual scene area to the second virtual scene area, the game terminal itself stores the current packet serial number corresponding to the first virtual scene area, for example, 378, and after the virtual object moves to the second virtual scene area, the server sends the current packet serial number corresponding to the second virtual scene area to the game terminal, for example, 543, and then the game terminal updates the current packet serial number to 543.

Step S221, when the server determines that the data sending time is reached, merging the data packets in the data cache queue corresponding to the updated virtual scene area to obtain merged data packets.

In step S222, the server transmits the merged packet to a target receiving object including the game terminal.

In step S223, the game terminal receives the merged data packet sent by the server, and analyzes the merged data packet to obtain a plurality of game data packets.

In step S224, the game terminal obtains the serial number corresponding to each game data packet.

Step S225, the game terminal determines the game data packet with the serial number larger than or equal to the serial number of the current data packet as a target data packet, and renders and displays the data packet based on the target data packet.

Since the game terminal is newly added to the updated virtual scene area, the game data packet before the serial number of the current data packet is a useless game data packet for the game terminal, and therefore, in the embodiment of the application, the part of the game data packet is not rendered and displayed, but only the game data packet after the virtual object enters the updated virtual scene area is rendered and displayed, so that the rendering efficiency can be improved, and the game fluency can be improved.

In step S226, the game terminal obtains the largest serial number among the serial numbers corresponding to the respective target data packets.

In step S227, the game terminal updates the maximum sequence number to the current packet sequence number of the virtual scene area.

Since the virtual object corresponding to the game terminal has moved to the updated virtual scene area, then if the server does not send the latest current data packet sequence number to the game terminal before the server sends data again, the game terminal itself needs to update to the current data packet sequence number according to the maximum sequence number in the received sequence numbers corresponding to the game data packets.

In the game data processing method provided by the embodiment of the application, a game client is started by a player through a terminal, the player moves a virtual object, hits a killer object, releases skills and other operations in the game match process can trigger generation of a game data packet which needs to be broadcast to other virtual objects, and the game data packet is sent to a server through the game terminal and is broadcast by the server. In the embodiment of the application, after receiving a game data packet, a server firstly judges whether the game data packet needs to be sent in real time, and if the game data packet needs to be sent in real time, a data packet header is directly added to send the game data packet; if the real-time transmission is not needed, caching the game data packets into a data cache queue corresponding to a virtual scene area where the virtual object is located, merging a plurality of game data packets in the data cache queue when the data transmission time is reached, and then transmitting the merged data packets at one time, so that the effective load of data transmission can be effectively improved; in addition, when the server adds game data packets to the data cache queues, a serial number is distributed to each game data packet, each data cache queue corresponds to a current data packet serial number, and when the virtual scene area where the virtual object is located is determined to be changed, the server merges the data packets of the data cache queues in the virtual scene area before updating and only sends the data packets to the game client side corresponding to the virtual object; the server also sends 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, the game terminal 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, the game rendering efficiency can be improved, and the game fluency can be improved.

Next, an exemplary application of the embodiment of the present application in a practical application scenario will be described.

The game data processing method provided by the embodiment of the application is applicable to, but not limited to, the MMORP G group battle scene shown in fig. 7, and as can be seen from fig. 7, the number of virtual characters in a game in the group battle scene is huge, so that a huge number of data packets can be generated in the process of movement and skill release of the virtual characters.

Considering that the broadcast packets (corresponding to the game data packets in other embodiments) received by players in the same Around are identical, a broadcast buffer queue may be maintained on a per Around basis. The broadcasting interface of the server firstly puts the broadcasting packet into the Around buffer queue, and sends the broadcasting packet in the broadcasting buffer pair to the players in the Around after a certain time. The broadcast buffer queue is a space for temporarily storing the broadcast packets, and the broadcast packets triggered by the virtual roles in the Around are put into the broadcast buffer queue corresponding to the Around according to the time sequence.

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 a moving broadcast packet pkg1, pkg1 is stored in Around1 broadcast buffer, and then player release skill generation broadcast packet pkg2 and broadcast packet pkg3 are also stored in broadcast buffer. At this time, as shown in fig. 8, three broadcast packets pkg1, pkg2, and pkg3 exist in the broadcast buffer 801.

If packet merging is not used, the broadcast packet generated in Around is broadcast directly to the player list operator _ list in Around. The packet merging method is that the broadcast packets in the Around are put into the broadcast buffer in sequence, and the packets in the broadcast buffer are sent together after waiting for a certain time. There are two broadcast occasions: one is when the broadcast buffer is full, one is timed transmission. For example, three broadcast packets pkg1, pkg2, pkg3 are generated by the player in the game and are all put into the broadcast buffer (pkg _ buffer). After waiting for the parallel packet transmission interval, as shown in fig. 8, the three broadcast packets in the broadcast buffer pkg _ buffer are broadcast to the Around player list, action _ list, which includes at least player a and player B shown in fig. 8.

Fig. 9 is a schematic diagram of a downlink broadcast transmission data packet based on an Around union packet provided by the present application at a real-time exchange rate, as shown in fig. 9, a player triggers broadcast packet 1, broadcast packet 2, and broadcast packet 3 through operations in a game partner, these broadcast packets are received by a broadcast interface of a server and stored in a broadcast buffer 901 of the Around, each Around also maintains a player list 902, and when a data transmission opportunity is reached, the broadcast packets in the broadcast buffer are merged and transmitted to other players through a gateway 903.

The method can effectively utilize the characteristics of large broadcast packet quantity and small length of each packet, and a large number of broadcast packets are combined together for transmission, thereby greatly reducing the packet quantity and improving the effective load of downlink packets. And a certain memory overhead is increased based on the Around broadcast caching mechanism. In order to solve the problem, the aggregation degree of players under most playing methods is not high, and the merging bag is not needed. The system is started only when the number of people broadcasting the target Around exceeds a certain threshold value, so that excessive memory overhead can be avoided.

The method based on the Around packet reduces the amount of broadcast packets through packet inclusion, and reduces the downlink broadcast flow by improving the effective load rate. For example, assuming that the length of the broadcast packet data is 75 bytes, when the broadcast packet data is sent downstream to the client, as shown in fig. 10, a TCP header 1001, an IP header 1002, and a Frame header 1003 are added to the network protocol stack, where the TCP header 1001 is 20 bytes, the IP header 1002 is 20 bytes, and the Frame header 1003 is 14 bytes, and then the size of the data received by the network card of the client is 75+20+20+14, 129 bytes. The payload rate is 75/129-58%. The combined packet can combine a plurality of small broadcast packets, if 20 broadcast packets are combined together, the broadcast data length is 20 × 75-1500 bytes, the payload rate is 1500/1554-96.5%, and the payload rate is obviously improved.

In an actual game session, the virtual object of the player will move between different areas continuously, that is, the virtual object will switch between different buffers continuously, fig. 11 is an area switching diagram provided in the embodiment of the present application, as shown in fig. 11, after the virtual object moves from area a to area b, the packet buffer queue corresponding to the virtual object is also switched from pkg _ buffer _ a to pkg _ buffer _ b accordingly. And the broadcast packet with the address _ a buffered in pkg _ buffer _ a can be sent only by waiting for a timeout. Two problems arise at this time: first, broadcast packets buffered in pkg _ buffer _ a by Around _ a should be sent to the player but not sent; second, packets buffered in pkg _ buffer _ b are sent to Around _ b before the player enters, should not be sent to the player, but are waiting to be sent.

For the first problem, it is only necessary to send pkg _ buffer _ a current buffer content to the client separately when the player moves to Around b.

As for the second problem, the packet synchronization problem can be solved in the embodiment of the present application by the following steps:

in the first step, a broadcast packet sequence number seq is introduced for each round.

And secondly, when every broadcast packet broadcasts the Around, adding 1 to the sequence number.

Third, when the player enters a new Around, the client synchronizes the sequence numbers (because the current sequence number is different for each Around).

And fourthly, if the client receives the broadcast packet with the sequence number smaller than the current sequence number, the broadcast packet can be directly discarded.

FIG. 12 is a schematic diagram of an implementation process for avoiding the problem of packet string by sequence number according to an embodiment of the present application, as shown in FIG. 12, when a player joins a new round, pkg is buffered in the packet buffer queue of the round at this timei-nTo pkgiIf the sequence number is i, the server synchronizes the sequence number i to the client, the client stores the sequence number, and the server continues to cache data, as shown in fig. 12, pkg is added to the packet cache queuei+mWhen the data sending opportunity is reached, the server buffers pkg in the data queuei-nTo pkgi+mSent to the player client, and the player receives pkgi-nTo pkgi+mThereafter, pkg are discarded based on the sequence numberi-nTo pkgi-1Save only pkgiTo pkgi+m

The game data processing method provided by the embodiment of the application can reduce the broadcast packet amount during the group battle period, reduce the gateway layer pressure, reduce the required server resources, reduce the bandwidth consumption of the server and the players, avoid the problems of disconnection of the players and the like, and reduce the game operation cost.

Continuing with the exemplary structure of the game data processing device 454 provided by the embodiments of the present application as software modules, in some embodiments, as shown in fig. 3A, the software modules stored in the game data processing device 454 of the memory 440 may include:

a first obtaining module 4541, configured to obtain a game data packet triggered based on an operation of a game client during a game match;

a second obtaining module 4542, configured to obtain a virtual scene area where a virtual object corresponding to the game client is located;

a data caching module 4543, configured to add the game data packet to a data caching queue corresponding to the virtual scene area when it is determined that the game data packet meets a data caching condition;

a data merging module 4544, configured to merge the game data packets in the data buffer queue when it is determined that the data sending opportunity is reached, so as to obtain a merged data packet;

a first sending module 4545, configured to determine a target receiving object of the merged data packet, and send the merged data packet to the target receiving object.

In some embodiments, the apparatus further comprises:

a third obtaining module, configured to obtain attribute information of the game data packet, and determine a total number of objects of virtual objects located in the virtual scene area;

a second determining module, configured to determine whether the game data packet satisfies a data caching condition based on the total number of objects and the attribute information;

when the total number of the objects is larger than a preset total number threshold value and the attribute information is a non-real-time sending data packet, determining that the game data packet meets a data cache condition, and when the total number of the objects is smaller than or equal to the total number threshold value or the attribute information is a real-time sending data packet, determining that the game data packet does not meet the data cache condition.

In some embodiments, the apparatus further comprises:

the third determining module is used for determining a target receiving object of the game data packet when the game data packet is determined not to meet the data caching condition;

and the third sending module is used for sending the game data packet to the target receiving object.

In some embodiments, the apparatus further comprises:

the fourth determining module is used for determining the data sending time when the time interval between the time of determining the data sending time and the last time reaches the preset interval threshold; or;

and the fifth determining module is used for acquiring the space occupied by the game data packet in the data cache queue and determining that the data sending time is reached when the space is determined to reach the preset space threshold.

In some embodiments, the first sending module is further configured to:

determining a neighboring area of the virtual scene area;

and determining the game client corresponding to the virtual object in the virtual scene area and the adjacent area of the virtual scene area as the target receiving object of the merged data packet.

In some embodiments, the apparatus further comprises:

a sixth determining module, configured to determine a data sending time when it is monitored that a target virtual object moving out of the virtual scene area exists;

correspondingly, the first sending module is further configured to:

and determining the game client corresponding to the target virtual object as a target receiving object of the merged data packet.

In some embodiments, the apparatus further comprises:

a fourth obtaining module, configured to obtain a current packet sequence number of a data cache queue corresponding to the virtual scene area;

a seventh determining module, configured to determine a sequence number of the game data packet based on the sequence number of the current data packet;

the first updating module is used for updating the serial number of the game data packet into the current data packet serial number of the data cache queue;

correspondingly, the data caching module is further configured to:

and adding the game data packet and the sequence number of the game data packet into the data buffer queue.

In some embodiments, the apparatus further comprises:

an eighth determining module, configured to determine, when it is detected that a virtual scene area where the virtual object is located changes, a virtual scene area where the virtual object is updated;

a fifth obtaining module, configured to obtain a current packet sequence number corresponding to the updated virtual scene area;

and the fourth sending module is used for sending the current data packet serial number corresponding to the updated virtual scene area to the game client corresponding to the virtual object.

It should be noted that, the embodiments of the present application are described with respect to a game data processing device, and similar to the description of the method embodiments described above, and have similar advantageous effects to the method embodiments. For technical details not disclosed in the embodiments of the apparatus, reference is made to the description of the embodiments of the method of the present application for understanding.

Referring to fig. 3B, fig. 3B is a schematic structural diagram of game terminal 200 according to an embodiment of the present application, and game terminal 200 shown in fig. 3B includes: at least one processor 210, at least one network interface 220, a user interface 230, a bus system 240, and a memory 250. Wherein the user interface 230 includes an output device 231 and an input device 232, 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, which may be implemented in software, fig. 3B shows the game data processing device 255 stored in the memory 250, as shown in fig. 3B, which includes:

a game starting module 2551, configured to respond to the received game play starting instruction, start a game play;

a second sending module 2552, configured to send a game data packet to the server in response to the received game operation instruction during the game match;

a first receiving module 2553, configured to receive the merged data packet sent by the server, and analyze the merged data packet to obtain a plurality of game data packets;

a first determining module 2554, configured to determine a target data packet from the plurality of game data packets, and render and display based on the target data packet.

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

acquiring a current data packet serial number of a virtual scene area where a virtual object corresponding to a game client is located currently;

acquiring a serial number corresponding to each game data packet;

and determining the game data packet with the sequence number larger than or equal to the sequence number of the current data packet as a target data packet.

In some embodiments, the apparatus further comprises:

a sixth obtaining module, configured to obtain a maximum sequence number of sequence numbers corresponding to each target data packet;

and the second updating module is used for updating the maximum sequence number to the current data packet sequence number of the virtual scene area.

It should be noted that, the embodiments of the present application are described with respect to a game data processing device, and similar to the description of the method embodiments described above, and have similar advantageous effects to the method embodiments. For technical details not disclosed in the embodiments of the apparatus, reference is made to the description of the embodiments of the method of the present application for understanding.

Embodiments of the present application provide a computer program product or computer program comprising 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.

Embodiments of the present application provide a computer-readable storage medium storing executable instructions, which when executed by a processor, will cause the processor to perform a game data processing method provided by embodiments of the present application, for example, a game data processing method as illustrated in fig. 4, 5 and 6.

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

In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, 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.

By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds 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 that store one or more modules, sub-programs, or portions of code).

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

The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

33页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种交互控制方法、装置、电子设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类