CN108540450B - Data transmitting and receiving method and device - Google Patents

Data transmitting and receiving method and device Download PDF

Info

Publication number
CN108540450B
CN108540450B CN201810200919.3A CN201810200919A CN108540450B CN 108540450 B CN108540450 B CN 108540450B CN 201810200919 A CN201810200919 A CN 201810200919A CN 108540450 B CN108540450 B CN 108540450B
Authority
CN
China
Prior art keywords
receiving
connection request
client
module
combat
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810200919.3A
Other languages
Chinese (zh)
Other versions
CN108540450A (en
Inventor
王家祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201810200919.3A priority Critical patent/CN108540450B/en
Publication of CN108540450A publication Critical patent/CN108540450A/en
Application granted granted Critical
Publication of CN108540450B publication Critical patent/CN108540450B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/131Protocols for games, networked simulations or virtual reality
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/85Providing additional services to players
    • A63F13/86Watching games played by other players
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/57Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of game services offered to the player
    • A63F2300/577Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of game services offered to the player for watching a game played by other players

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a data sending and receiving method and device. Wherein, the method comprises the following steps: receiving a first connection request sent by a client through a first process, wherein the first connection request is used for requesting to establish connection with the first process, and the first process provides a fighting service; after the game role starts to execute battles, battlefield data sent by a second process is received through a first process, wherein the second process provides battle services; battlefield data is sent to the client through the first process. The invention solves the technical problem of poor real-time performance of fighting and watching caused by untimely reception of the client game data in the related technology.

Description

Data transmitting and receiving method and device
Technical Field
The invention relates to the field of computers, in particular to a data sending and receiving method and device.
Background
The mode of realizing the battle watching in the related technology is realized by the modes of screenshot and video recording, for example, each frame of picture of the whole game is stored in a database of a server, and the server sends each frame of picture of the whole game stored in the database to a client when the battle watching is needed, so as to reproduce the game process; or the video is recorded in the game process and then watched through a third-party browser or a player.
The two modes of fighting observation are that pictures are stored in a database and then sent to a client, or the pictures are recorded first and then watched through a third-party browser or a player, so that a player cannot follow the game process at the beginning of the game, and the real-time performance of fighting observation is not high.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a data sending and receiving method and a device, which are used for at least solving the technical problem of poor fighting real-time performance caused by untimely client game data receiving in the related technology.
According to an aspect of the embodiments of the present invention, there is provided a data transmission method, including: receiving a first connection request sent by a client through a first process, wherein the first connection request is used for requesting to establish connection with the first process, and the first process provides a fighting service; after the game role starts to execute battles, battlefield data sent by a second process is received through a first process, wherein the second process provides battle services; battlefield data is sent to the client through the first process.
According to an aspect of the embodiments of the present invention, there is provided a data receiving method, including: sending a first connection request to a first process, wherein the first connection request is used for requesting to establish connection with the first process, and the first process provides a fighting service; after a game character starts to execute battle, battlefield data sent by a first process is received, wherein the battlefield data is acquired by the first process from a second process, and the second process provides battle service.
According to an aspect of an embodiment of the present invention, there is provided a data transmission apparatus including: the first process module is used for receiving a first connection request sent by the client and sending battlefield data acquired from the second process module to the client, wherein the first connection request is used for requesting to establish connection with the first process module, and the first process module provides a fighting service; and the second progress module is used for sending battle field data to the first progress module after the game role starts to execute battles, wherein the second progress module provides battle services.
According to an aspect of an embodiment of the present invention, there is provided a data receiving apparatus including: the system comprises a sending module, a receiving module and a sending module, wherein the sending module is used for sending a first connection request to a first process, the first connection request is used for requesting to establish connection with the first process, and the first process provides a fighting service; the receiving module is used for receiving battlefield data sent by a first process after a game role starts to execute battles, wherein the battlefield data is acquired by the first process from a second process, and the second process provides battle services.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
In the embodiment of the invention, after the game role starts to execute the battle, the second process providing the battle service sends the battle field data to the client connected with the first process through the first process providing the battle watching service, and the battle field data is sent to the client through the first process in the battle process, so that the aim of forwarding the battle field data in real time is fulfilled, the technical effect of improving the real-time performance of the battle watching is realized, and the technical problem of poor real-time performance of the battle watching caused by untimely reception of the client game data in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a schematic flow chart of a data transmission method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a data receiving method according to an embodiment of the present invention;
fig. 3 is a block diagram of a data transmission apparatus according to an embodiment of the present invention;
fig. 4 is a block diagram of a data receiving apparatus according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a connection establishment procedure between a spectator client and a server, provided in accordance with a preferred embodiment of the present invention;
fig. 6 is a schematic diagram of data flow interaction among various modules provided in accordance with a preferred embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present invention, there is provided a method embodiment of data transmission, it being noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
It should be noted that the method may be applied to a scene of multi-player online game play, and the method may be implemented based on a server, but is not limited thereto.
Fig. 1 is a schematic flow chart of a data transmission method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, receiving a first connection request sent by a client through a first process, wherein the first connection request is used for requesting to establish connection with the first process, and the first process provides a fighting service;
step S104, after the game role starts to execute battle, battlefield data sent by a second process is received through the first process, wherein the second process provides battle service;
and step S106, transmitting the battlefield data to the client through the first process.
Through the steps, after the game role starts to execute the battle, the second process providing the battle service sends the battle field data to the client connected with the first process through the first process providing the fighting service, and the battle field data is sent to the client through the first process in the fighting process, so that the purpose of real-time forwarding of the battle field data is achieved, the real-time performance of the fighting is improved, the fighting experience is improved, and the technical problem that the real-time performance of the fighting is poor due to the fact that the client game data are not received timely in the related technology is solved.
It should be noted that the battlefield data may include, but is not limited to: the game character generates behavior data in the process of executing a battle, and the battle result of the game character at the end of the battle. It should be noted that the behavior data may include, but is not limited to: position information of a game character, state information of the game character: such as an injury value subject to an enemy attack, an attack force value, or skill information, etc. The state information of the game character may include: survival status, and apoptosis status, but is not limited thereto. By sending battlefield data and directly sending pictures or videos in the related technology, the transmission capacity of the data is reduced, and the network performance consumption of the server is reduced.
In an embodiment of the present invention, before the step S102, the method further includes: receiving a second connection request sent by the client through the second process, wherein the second connection request is used for requesting to establish connection with the second process; selecting, by the second process, a first process from one or more first processes for receiving the first connection request; and sending a notification message to the client through the second process, wherein the notification message is used for notifying the client to establish connection with the determined first process. That is, the client establishes a connection with the second process, so that the client can connect to the same second process with other clients participating in the battle, that is, can enter the same "room".
It should be noted that, since it is not known whether the client connected to the second process is a client participating in battle or a spectator client, after receiving, by the second process, the second connection request sent by the client, the method further includes: and determining the client as a spectator client by utilizing the second process so as to determine a first process for receiving the first connection request from one or more first processes.
It should be noted that the spectator client and the client participating in the battle can be distinguished by using different types of tickets (tickets) when connecting the second process, so that the determination of the client as the spectator client by using the second process can be represented as: and determining the client as the spectator client according to the type of the ticket used when the client is connected with the second process.
It should be noted that, determining, by the second process, a first process for receiving the first connection request from one or more first processes may be represented as: sending a first selection request message to a selection process by using the second process, wherein the first selection request message is used for indicating the second process to request to acquire a first fighting service address, and the first fighting service address is a fighting service address of the first process used for receiving the first connection request; the selection process is used for selecting the first process; and selecting an available first process fighting service address from the fighting service address list through the selection process, and taking the selected fighting service address as the first fighting service address and sending the first fighting service address to the second process.
It should be noted that, the available sightseeing service address of the first process is selected from the sightseeing service address list through the selection process, and the available sightseeing service address of the first process can be selected according to the busy/idle state of the first process corresponding to the sightseeing service address in the sightseeing service address list. That is, the load balancing can be realized by selecting the available first process according to the busy-idle state of the first process.
It should be noted that the above selection process may also be used to update the fighting service list information when the client is connected or disconnected, such as the number of connections or the connection status of the fighting client.
It should be noted that the client may also be connected to a battle, that is, may enter the same battle room as other clients participating in the battle, and therefore, in an embodiment of the present invention, before receiving, by the second process, the second connection request sent by the client, the method may further include: receiving a combat identification of a combat to be watched, which is sent by the client, through a third process, wherein the third process provides game service; acquiring a combat service address through the third process, wherein the combat service address is address information acquired from a database according to the combat identification; and sending the combat service address to the client through the third process.
It should be noted that, receiving, by the second process, the second connection request sent by the client may be represented as: and receiving the second connection request sent by the client through a second process corresponding to the combat service address.
Considering the problems of network traffic and network load, the second process does not forward battlefield data every frame, but sends a piece of key frame data every predetermined time, the first process counts when receiving the key frame data, and sends all the accumulated key frame data to the client when the received key frames accumulate to a certain amount (predetermined threshold), so in an embodiment of the present invention, the step S104 may be represented as: receiving, by the first process, the battlefield data sent by the second process every predetermined time; the step S106 may be represented as: and sending all the received battlefield data to the client terminal when the battlefield data received by the first process is larger than a preset threshold value.
It should be noted that the predetermined time and the predetermined threshold may be adjusted and set according to actual needs, but are not limited thereto.
It should be noted that, the first process, the second process, and the third process may be executed in the same device, for example, in one server device, or may be executed in multiple devices.
It should be noted that the number of the above clients may be one or more, and is not limited to this.
It should be noted that the execution subject of the above steps may be a server, but is not limited thereto.
There is also provided, in accordance with an embodiment of the present invention, a method embodiment of data reception, it being noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than that presented herein.
Fig. 2 is a schematic flowchart of a data receiving method according to an embodiment of the present invention, and as shown in fig. 2, the method includes:
step S202, a first connection request is sent to a first process, wherein the first connection request is used for requesting to establish connection with the first process, and the first process provides a fighting service;
step S204, after the game role starts to execute battle, battle field data sent by the first process is received, wherein the battle field data is acquired by the first process from the second process, and the second process provides battle service.
Through the steps, after the game role starts to execute the battle, the second process providing the battle service sends the battle field data to the client connected with the first process through the first process providing the fighting service, and the battle field data is sent to the client through the first process in the fighting process, so that the purpose of real-time forwarding of the battle field data is achieved, the real-time performance of the fighting is improved, the fighting experience is improved, and the technical problem that the real-time performance of the fighting is poor due to the fact that the client game data are not received timely in the related technology is solved.
It should be noted that the battlefield data may include, but is not limited to: the game character generates behavior data in the process of executing a battle, and the battle result of the game character at the end of the battle. It should be noted that the behavior data may include, but is not limited to: position information of the game character, and state information of the game character. The state information of the game character may include: survival status, and apoptosis status, but is not limited thereto. By sending battlefield data and directly sending pictures or videos in the related technology, the transmission capacity of the data is reduced, and the network performance consumption of the server is reduced.
In an embodiment of the present invention, before the step S202, the method may further include: sending a second connection request to a second process, wherein the second connection request is used for requesting to establish connection with the second process; the second process provides combat services; and receiving a notification message sent by the second process, wherein the notification message is used for notifying the establishment of connection with the first process.
In an embodiment of the present invention, before sending the second connection request to the second process, the method may further include: transmitting a battle identification of a battle to be viewed to the third process, wherein the third process provides a game service; and receiving a combat service address sent by the third process, wherein the combat service address is address information acquired by the third process from a database according to the combat identification, and corresponds to the second process.
It should be noted that the correspondence between the combat service address and the second process may be expressed as: the combat service address is a service address of the second process, but is not limited thereto.
It should be noted that the execution subject of the above steps may be a client, but is not limited thereto.
According to an embodiment of the present invention, an embodiment of a data transmission product is provided, and fig. 3 is a block diagram of a data transmission apparatus according to an embodiment of the present invention, as shown in fig. 3, the apparatus includes:
a first progress module 32, configured to receive a first connection request sent by a client and send battlefield data acquired from a second progress module to the client, where the first connection request is used to request connection establishment with the first progress module, and the first progress module provides a fighting service;
and a second progress module 34, connected to the first progress module 32, for sending battle field data to the first progress module after the game character starts to execute a battle, wherein the second progress module provides a battle service.
By the device, after the game role starts to execute the battle, the second progress module 34 providing the battle service sends battlefield data to the client connected with the first progress module 32 through the first progress module 32 providing the battle watching service, and the battle field data is sent to the client through the first progress module 32 in the battle process, so that the aim of transmitting the battlefield data in real time is fulfilled, thereby not only improving the real-time performance of the battle, but also improving the experience of the battle, and further solving the technical problem that the real-time performance of the battle is poor due to untimely reception of client game data in the related technology.
It should be noted that the battlefield data may include, but is not limited to: the game character generates behavior data in the process of executing a battle, and the battle result of the game character at the end of the battle. It should be noted that the behavior data may include, but is not limited to: position information of the game character, and state information of the game character. The state information of the game character may include: survival status, and apoptosis status, but is not limited thereto. By sending battlefield data and directly sending pictures or videos in the related technology, the transmission capacity of the data is reduced, and the network performance consumption of the server is reduced.
In an embodiment of the present invention, the second process module 34 is further configured to receive a second connection request sent by the client, select a first process module 32 from the one or more first process modules 32 for receiving the first connection request, and send a notification message to the client, where the notification message is used to notify the client to establish a connection with the determined first process module 32, and the second connection request is used to request to establish a connection with the second process module 34.
It should be noted that the second process module 34 is further configured to determine that the client is a spectator client, so as to determine the first process module 32 for receiving the first connection request from one or more first process modules.
In an embodiment of the present invention, the apparatus may further include: selecting a process module; the selecting process module is connected to the second process module 34, and is configured to receive the first selecting request message sent by the second process module 34, select an available fighting service address of the first process module 32 from the fighting service address list, use the selected fighting service address as a first fighting service address, and send the first fighting service address to the second process module 34; the first selection request message is used to instruct the second process module 34 to request to acquire a first fighting service address, where the first fighting service address is the fighting service address of the first process module 32 used to receive the first connection request.
In an embodiment of the present invention, the apparatus may further include: and a third process module, configured to receive a combat identifier of a combat to be watched, which is sent by the client, obtain a combat service address from a database according to the combat identifier, and send the obtained combat service address to the client, where the third process module provides game service, and the combat service address corresponds to the second process module 34.
In one embodiment of the present invention, the second progress module 34 is further configured to send the battlefield data to the first progress module 32 every predetermined time; the first progress module 32 is further configured to send all the received battlefield data to the client if the received battlefield data is greater than a predetermined threshold.
It should be noted that the number of the above clients may be one or more, but is not limited to this.
It should be noted that the above-mentioned apparatus may be located in a server, but is not limited thereto.
According to an embodiment of the present invention, there is further provided a data receiving apparatus, and fig. 4 is a block diagram of a structure of the data receiving apparatus according to the embodiment of the present invention, as shown in fig. 4, the apparatus includes:
a sending module 42, configured to send a first connection request to a first process, where the first connection request is used to request to establish a connection with the first process, and the first process provides a fighting service;
a receiving module 44, connected to the sending module 42, for receiving battlefield data sent by the first process after the game character starts to execute battle; wherein the battlefield data is acquired by the first process from the second process, the second process providing combat services.
By the aid of the device, after the game role starts to execute battles, the second process providing battle services sends battle field data to the client connected with the first process through the first process providing battle watching services, and the battle field data are sent to the client through the first process in the battle process, so that the purpose of real-time forwarding of the battle field data is achieved, the real-time performance of the battle is improved, the experience of the battle is improved, and the technical problem that the real-time performance of the battle is poor due to the fact that the game data of the client are not received timely in the related technology is solved.
It should be noted that the battlefield data may include, but is not limited to: the game character generates behavior data in the process of executing a battle, and the battle result of the game character at the end of the battle. It should be noted that the behavior data may include, but is not limited to: position information of the game character, and state information of the game character. The state information of the game character may include: survival status, and apoptosis status, but is not limited thereto. By sending battlefield data and directly sending pictures or videos in the related technology, the transmission capacity of the data is reduced, and the network performance consumption of the server is reduced.
In an embodiment of the present invention, the sending module 42 is further configured to send a second connection request to a second process, where the second connection request is used to request to establish a connection with the second process; the second process provides combat services; the receiving module 44 is further configured to receive a notification message sent by the second process, where the notification message is used to notify that a connection is established with the first process.
In an embodiment of the present invention, the sending module 42 is further configured to send a combat id of a combat to be watched to the third process, where the third process provides a game service; the receiving module 44 is further configured to receive a combat service address sent by the third process, where the combat service address is address information obtained by the third process from a database according to the combat identifier, and the combat service address corresponds to the second process.
It should be noted that the correspondence between the combat service address and the second process may be expressed as: the combat service address is a service address of the second process, but is not limited thereto.
The device is located in the client, but is not limited to this.
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
For a better understanding of the present invention, the present invention is further explained below with reference to preferred examples.
The preferred embodiment of the invention provides a multi-player online game fighting method and a device, comprising the following steps: under the special structure of the game server, a game spectator device which can simultaneously accommodate the online of a plurality of people is implemented through the real-time forwarding of battlefield data. The device is particularly suitable for the fighting of the online game real-time playing method, the operation is stable, the data of the fighting player can be received timely, and the fighting experience is good.
The following describes the architecture of the game server, and the processes or services related to the game real-time fight service can be divided into the following:
game service process (equivalent to the third process described above): a "server" is generally understood in the concept. Some logic related to the daily play of the game is mainly used, such as login and logout of a player, data saving of the daily play, purchase of game props, friend information and the like. The player logs in to connect to the process first.
Combat service process (equivalent to the second process described above): mainly running some logic related to real-time battle play. When a player participates in a real-time battle, the player client's connection is temporarily switched from the game service process to this process. After the battle is over, the connection of the player client is switched back to the game service process.
Database (equivalent to the above database): the game data storage is mainly responsible for the storage of the game data. The function related to the invention is mainly the preservation of combat information. Multiple battles may be in the game at the same time, and information such as service process addresses of each battle may be stored in the database. The database is directly accessible to both game service processes and combat service processes.
Spectator service process (equivalent to the first process described above): mainly responsible for forwarding battlefield data to the client. The spectator will be connected to this process. The process receives the battlefield data forwarded by the battle process and then forwards the battlefield data to the client. The number of clients that the process can connect to, i.e., the number of spectators, can be set as desired.
Fig. 5 is a schematic diagram of a connection establishment procedure between the spectator client and the server according to the preferred embodiment of the present invention, and as shown in fig. 5, the specific steps are described as follows:
(1) the client sends a battle BattleId (equivalent to the battle identifier) to be watched to a game service process (GameServer);
(2) the GameServer queries a Battle process address corresponding to the Battle from a database DB according to the BattleId;
(3) the client is connected with a battle service process (BattleServer);
(4) and after receiving the connection request of the client, the BattleServer judges the identity of the client. If the client normally participates in the battle, executing normal battle connection logic; if the client terminal is the fighting client terminal, executing (5);
(5) the BattleServer searches available fighting services, and if the available fighting services are not found, the client is notified that the connection is failed; if the client is found, the client is informed to connect the corresponding fighting service;
(6) after receiving the connection request of the client, the watching service process (BroadCaster) judges the watching conditions (whether battlefield data exist or not, and the like), if the conditions are met, the initializing logic is executed, and the client is ready to send the battlefield data. And if the judgment condition fails, informing the client of the connection failure.
It should be noted that, in the preferred embodiment of the present invention, the data received by the spectator client is forwarded from the spectator service process (broadcase), and the data received by the spectator service process is forwarded from the battle service process (BattleServer). Considering the problem of network traffic, the BattleServer does not forward battlefield data every frame, but sends data of a key frame (KeyFrame) every time threshold (TimeThreshold) (corresponding to the predetermined time). The BroadCaster counts each received key frame and forwards all accumulated key frame data to all clients connected to the spectator service process when the received key frames are accumulated to a certain number (KeyFrameThreshold) (corresponding to the predetermined threshold). That is, broadcase sends battlefield data to all spectator clients once every time T ═ KeyFrameThreshold × TimeThreshold, which has reduced the network load by an appropriate amount. Wherein, the values of KeyFrameThreshold and TimeThreshold can be adjusted according to actual project requirements.
When the battle is finished, the BattleServer informs the battle result to the BroadCaster, and the BroadCaster informs all the clients of the battle result and disconnects the battle client.
Fig. 6 is a schematic diagram of data flow interaction among various modules provided in accordance with a preferred embodiment of the present invention, as shown in fig. 6,
the main functions of the game service process, the combat service process, the fighting service process and the database are explained above, and are not described herein again. The following describes a spectator-fighting progress selection module (corresponding to the above-described selection process) and a data transceiver module.
The battle-watching process selection module: the main function is to select available fighting service processes from the current server for the client to connect. The main functions that the module needs to realize are:
(1) and selecting an available fighting service address. When the battle service process initiates a battle service selection request, the module firstly needs to request a battle service address list from the game service process and select an available battle service address from the requested battle service address list according to an algorithm.
(2) And updating the information of the fighting service list. When the client is connected or disconnected, the module needs to update information such as the client connection quantity and the state of the fighting service node.
(3) And (4) processing various abnormal conditions. The method is mainly used for processing various abnormal conditions in the process of allocating the fighting service.
A data receiving and transmitting module: the main function is to transmit battlefield data and battle results from the battle service progress to the spectator service progress. It is necessary to implement transmission interval control of key frame data, encapsulation of data, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (16)

1. A data transmission method, comprising:
receiving a first connection request sent by a client through a first process, wherein the first connection request is used for requesting to establish connection with the first process, and the first process provides a fighting service;
after a game character starts to execute a battle, battlefield data sent by a second process is received through the first process, wherein the second process provides battle services;
sending the battlefield data to the client through the first process;
before receiving, by a first process, a first connection request sent by a client, the method further includes: receiving a second connection request sent by the client through the second process, wherein the second connection request is used for requesting to establish connection with the second process; selecting, by the second process, a first process from one or more first processes for receiving the first connection request; sending a notification message to the client through the second process, wherein the notification message is used for notifying the client to establish connection with the determined first process;
before receiving, by the second process, a second connection request sent by the client, the method further includes: receiving a combat identification of a combat to be watched, which is sent by the client, through a third process, wherein the third process provides game service; acquiring a combat service address through the third process, wherein the combat service address is address information acquired from a database according to the combat identification; sending the combat service address to the client through the third process;
wherein selecting a first process from the one or more first processes for receiving the first connection request is to determine the first process for receiving the first connection request according to a busy-idle status of the one or more first processes.
2. The method of claim 1, wherein the battlefield data comprises: the game character generates behavior data in the process of executing a battle, and the battle result of the game character at the end of the battle.
3. The method of claim 1, wherein after receiving, by the second process, the second connection request sent by the client, the method further comprises:
and determining the client as a spectator client by utilizing the second process so as to determine a first process for receiving the first connection request from one or more first processes.
4. The method of claim 1, wherein determining, by the second process, a first process from the one or more first processes to receive the first connection request comprises:
sending a first selection request message to a selection process by using the second process, wherein the first selection request message is used for indicating the second process to request to acquire a first fighting service address, and the first fighting service address is a fighting service address of the first process used for receiving the first connection request; the selection process is used for selecting the first process;
and selecting an available first process fighting service address from the fighting service address list through the selection process, and taking the selected fighting service address as the first fighting service address and sending the first fighting service address to the second process.
5. The method of claim 1, wherein receiving, by the second process, the second connection request sent by the client comprises: and receiving the second connection request sent by the client through a second process corresponding to the combat service address.
6. The method of claim 1,
receiving, by the first process, battlefield data sent by a second process comprises: receiving, by the first process, the battlefield data sent by the second process every predetermined time;
sending the battlefield data to the client through the first process comprises: and sending all the received battlefield data to the client terminal when the battlefield data received by the first process is larger than a preset threshold value.
7. The method according to any one of claims 1 to 6, wherein the number of the clients is one or more.
8. A data receiving method, comprising:
sending a first connection request to a first process, wherein the first connection request is used for requesting to establish connection with the first process, and the first process provides a fighting service;
after a game role starts to execute battles, receiving battlefield data sent by the first process, wherein the battlefield data is acquired by the first process from a second process, and the second process provides battle services;
wherein, prior to sending the first connection request to the first process, the method further comprises: sending a second connection request to a second process, wherein the second connection request is used for requesting to establish connection with the second process; the second process provides combat services, wherein the first process for receiving the first connection request is selected from one or more first processes through the second process so as to enable the second process to provide the combat services; receiving a notification message sent by the second process, wherein the notification message is used for notifying the establishment of connection with the first process;
wherein, before sending the second connection request to the second process, the method further comprises: transmitting a combat identification of a combat to be watched to a third process, wherein the third process provides a game service; receiving a combat service address sent by the third process, wherein the combat service address is address information obtained by the third process from a database according to the combat identification, and corresponds to the second process;
wherein selecting a first process from the one or more first processes for receiving the first connection request is to determine the first process for receiving the first connection request according to a busy-idle status of the one or more first processes.
9. The method of claim 8, wherein the battlefield data comprises: the game character generates behavior data in the process of executing a battle, and the battle result of the game character at the end of the battle.
10. A data transmission apparatus, comprising:
the system comprises a first progress module, a second progress module and a third progress module, wherein the first progress module is used for receiving a first connection request sent by a client and sending battlefield data acquired from the second progress module to the client, the first connection request is used for requesting to establish connection with the first progress module, and the first progress module provides a fighting service;
the second process module is used for sending battle field data to the first process module after the game role starts to execute battles, wherein the second process module provides battle services;
the second process module is further configured to receive a second connection request sent by the client, select, from one or more first process modules, a first process module for receiving the first connection request, and send a notification message to the client, where the notification message is used to notify the client to establish a connection with the determined first process module, and the second connection request is used to request to establish a connection with the second process module;
wherein the apparatus further comprises: a third process module; the third progress module is used for receiving a combat identification of a combat to be watched, which is sent by the client, acquiring a combat service address from a database according to the combat identification, and sending the acquired combat service address to the client, wherein the third progress module provides game service, and the combat service address corresponds to the second progress module;
wherein, the first process module selected from the one or more first process modules for receiving the first connection request is determined according to the busy and idle states of the one or more first process modules for receiving the first connection request.
11. The apparatus of claim 10, wherein the second process module is further configured to determine that the client is a spectator client, so as to determine a first process module from the one or more first process modules for receiving the first connection request.
12. The apparatus of claim 10, further comprising: selecting a process module;
the selection process module is used for receiving a first selection request message sent by the second process module, selecting an available fighting service address of the first process module from a fighting service address list, and sending the selected fighting service address to the second process module as a first fighting service address; the first selection request message is used for indicating the second process module to request to acquire a first fighting service address, and the first fighting service address is the fighting service address of the first process module used for receiving the first connection request.
13. The apparatus of claim 10, wherein the second progress module is further configured to send the battlefield data to the first progress module at predetermined intervals; the first process module is further used for sending all the received battlefield data to the client side under the condition that the received battlefield data is larger than a preset threshold value.
14. A data receiving device, comprising:
the system comprises a sending module, a receiving module and a sending module, wherein the sending module is used for sending a first connection request to a first process, the first connection request is used for requesting to establish connection with the first process, and the first process provides a fighting service;
the receiving module is used for receiving battlefield data sent by the first process after a game role starts to execute battles, wherein the battlefield data is acquired by the first process from a second process, and the second process provides battle services;
the sending module is further configured to send a second connection request to a second process, where the second connection request is used to request to establish a connection with the second process; the second process provides combat services, wherein the first process for receiving the first connection request is selected from one or more first processes through the second process so as to enable the second process to provide the combat services; the receiving module is further configured to receive a notification message sent by the second process, where the notification message is used to notify that a connection is established with the first process;
the sending module is further used for sending a combat identification of a combat to be watched to a third process, wherein the third process provides game service; the receiving module is further configured to receive a combat service address sent by the third process, where the combat service address is address information obtained by the third process from a database according to the combat identifier, and the combat service address corresponds to the second process;
wherein selecting a first process from the one or more first processes for receiving the first connection request is to determine the first process for receiving the first connection request according to a busy-idle status of the one or more first processes.
15. A storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the method of any of claims 1 to 7 or the method of claim 8 or 9 when executed.
16. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 7 or the method of claim 8 or 9.
CN201810200919.3A 2018-03-12 2018-03-12 Data transmitting and receiving method and device Active CN108540450B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810200919.3A CN108540450B (en) 2018-03-12 2018-03-12 Data transmitting and receiving method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810200919.3A CN108540450B (en) 2018-03-12 2018-03-12 Data transmitting and receiving method and device

Publications (2)

Publication Number Publication Date
CN108540450A CN108540450A (en) 2018-09-14
CN108540450B true CN108540450B (en) 2021-03-23

Family

ID=63484134

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810200919.3A Active CN108540450B (en) 2018-03-12 2018-03-12 Data transmitting and receiving method and device

Country Status (1)

Country Link
CN (1) CN108540450B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109771957B (en) * 2019-02-02 2022-08-09 网易(杭州)网络有限公司 Method and device for fighting in game, electronic equipment and storage medium
CN111416849B (en) * 2020-03-13 2021-07-13 腾讯科技(深圳)有限公司 Disconnection reconnection method, device and system and computer equipment
CN111672105A (en) * 2020-05-28 2020-09-18 腾讯科技(深圳)有限公司 Visual field data packet sending method, device, equipment and medium based on virtual environment
CN111821696B (en) * 2020-08-21 2024-02-02 网易(杭州)网络有限公司 Game sightseeing method and device, electronic equipment and storage medium
CN112148495B (en) * 2020-10-09 2023-08-08 网易(杭州)网络有限公司 Game cluster management method and device, storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1805361A (en) * 2005-11-29 2006-07-19 珠海市西山居软件有限公司 Method and apparatus for watching game play in real time through browser
CN101018237A (en) * 2007-01-16 2007-08-15 成都金山互动娱乐科技有限公司 A method for playing the online synchronization explication of the network game
KR20130127756A (en) * 2012-05-15 2013-11-25 주식회사 넥슨코리아 System for transfering a character control authority and the method thereof
CN106330917A (en) * 2016-08-26 2017-01-11 腾讯科技(深圳)有限公司 Data display method and device
CN206008008U (en) * 2016-08-30 2017-03-15 竞技世界(北京)网络技术有限公司 A kind of chess and card games based on LAN look on system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1805361A (en) * 2005-11-29 2006-07-19 珠海市西山居软件有限公司 Method and apparatus for watching game play in real time through browser
CN101018237A (en) * 2007-01-16 2007-08-15 成都金山互动娱乐科技有限公司 A method for playing the online synchronization explication of the network game
KR20130127756A (en) * 2012-05-15 2013-11-25 주식회사 넥슨코리아 System for transfering a character control authority and the method thereof
CN106330917A (en) * 2016-08-26 2017-01-11 腾讯科技(深圳)有限公司 Data display method and device
CN206008008U (en) * 2016-08-30 2017-03-15 竞技世界(北京)网络技术有限公司 A kind of chess and card games based on LAN look on system

Also Published As

Publication number Publication date
CN108540450A (en) 2018-09-14

Similar Documents

Publication Publication Date Title
CN108540450B (en) Data transmitting and receiving method and device
CN101180109B (en) Multi-player video game system
CN110830735B (en) Video generation method and device, computer equipment and storage medium
WO2017005162A1 (en) Game data processing method, game serving end and game client
CN111432158B (en) Load balancing method and device for media nodes, storage medium and electronic device
CN104009969B (en) A kind of means of communication of network game system
JP2023507817A (en) Method and system for maintaining a smooth frame rate while transmitting streaming video content
CN106033487A (en) A user matching method and device
CN109005424B (en) Object control method, device and system, storage medium and electronic device
JP2023508061A (en) ACCOUNT ACCESS METHOD AND DEVICE, STORAGE MEDIUM, AND ELECTRONIC DEVICE
CN111182321A (en) Method, device and system for processing information
CN103581197B (en) Cross-server realizes the method and system of team's data processing
CN110876078B (en) Animation picture processing method and device, storage medium and processor
CN110652730A (en) Battle matching method and device and electronic equipment
CN110351569A (en) A kind of live content processing method, device, equipment and medium
CN105450506B (en) A kind of real-time information interaction method, apparatus and system
CN111111182B (en) Game view angle determining method, device and server
CN109688225B (en) Communication method and device
CN111195432B (en) Object display method and device, storage medium and electronic device
CN109714328B (en) Capacity adjustment method and device for game cluster
CN113613029B (en) Live broadcast picture display method and device, storage medium and electronic equipment
US20190036793A1 (en) Network service implementation method, service controller, and communications system
KR101883671B1 (en) Method and management server for dtitributing node
KR20120094321A (en) Peer to peer communication method between online game clients
CN115253311A (en) Chess and card game cross-server fighting method, equipment and medium

Legal Events

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