CN115869616A - Game server distribution method, system and storage medium - Google Patents

Game server distribution method, system and storage medium Download PDF

Info

Publication number
CN115869616A
CN115869616A CN202211543215.9A CN202211543215A CN115869616A CN 115869616 A CN115869616 A CN 115869616A CN 202211543215 A CN202211543215 A CN 202211543215A CN 115869616 A CN115869616 A CN 115869616A
Authority
CN
China
Prior art keywords
server
target
client
information
queue
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.)
Pending
Application number
CN202211543215.9A
Other languages
Chinese (zh)
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.)
Beijing Weiling Times Technology Co Ltd
Original Assignee
Beijing Weiling Times Technology 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 Beijing Weiling Times Technology Co Ltd filed Critical Beijing Weiling Times Technology Co Ltd
Priority to CN202211543215.9A priority Critical patent/CN115869616A/en
Publication of CN115869616A publication Critical patent/CN115869616A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the application provides a game server allocation method, a game server allocation system and a storage medium, which relate to the technical field of computers, wherein the method can be executed by an Agent server and comprises the following steps: receiving an allocation request of a GS (service gateway) sent by a target PaaS server, wherein the allocation request of the GS is triggered when a login request of a target client is detected, the target client is any one of at least one client, then searching whether a queue has idle GS server information or not, the idle GS server information is stored in the queue, and if the queue has the idle GS server information, acquiring the target GS server information from the queue and storing the target GS server information to a preset storage space so that the target client establishes connection with the target GS based on the target GS server information. The game server distribution method, the game server distribution system and the storage medium can reduce waiting time of the client side, and further improve user experience.

Description

Game server distribution method, system and storage medium
Technical Field
The present application relates to the field of cloud game technologies, and in particular, to a method, a system, and a storage medium for allocating game servers.
Background
The cloud game is a game mode based on cloud computing, and data processing and computing of the cloud game are completed in a cloud game server in an operation mode of the cloud game. Therefore, it is necessary to allocate an appropriate cloud game server to the client at the time of client login.
At present, most of the cloud game server allocation algorithms are implemented by requesting allocation of a corresponding cloud game server by a client, and then allocating the cloud game server requested by the client to the cloud game server requested by the client, but in some cases, the cloud game server requested by the client is currently in a connection state with other clients, that is, the cloud game server requested by the client to be allocated is currently in an occupied state, so that the cloud game server needs to wait for a long time for the client to wait after the cloud game server is restarted after the cloud game server is used by other clients, and thus user experience is poor.
Disclosure of Invention
In order to solve the above technical problems, the present application provides a game server allocation method, system and storage medium.
In a first aspect, the present application provides a game server allocation method, applied to a game server allocation system, where the game server allocation system includes: the method comprises the following steps that at least one PaaS server, at least one Agent server, at least one cloud game server GS and at least one client side are adopted, wherein the PaaS server is respectively in information interaction with the at least one Agent server and the at least one client side, the at least one GS is also in information interaction with the at least one client side, and the method is executed by any Agent server and comprises the following steps:
receiving a distribution request of a GS (service gateway) sent by a target PaaS server, wherein the distribution request of the GS is triggered when a login request of a target client is detected, the target PaaS server is a PaaS server corresponding to any Agent, and the target client is any client in at least one client;
searching whether idle GS server information exists in a queue, wherein the idle GS server information is stored in the queue, and the idle GS is not occupied by a client currently;
if the queue has the server information of the free GS, acquiring the server information of the target GS from the queue and storing the server information of the target GS into a preset storage space, so that the target client establishes connection with the target GS based on the server information of the target GS;
the preset storage space is used for the target Paas server to acquire the server information of the target GS, and the server information is sent to the target client.
In a possible implementation manner, the storing to a preset storage space includes:
and storing the server information of the target GS into a hash table.
In one possible implementation, the cloud game distribution system further includes: a web service that interacts information with the at least one GS, the method further comprising:
receiving a server identifier sent by a target GS, and searching server information of the target GS based on the server identifier;
and establishing a binding relationship with the target GS based on the server information of the target GS, so that the network service and the target GS receive and transmit data based on the binding relationship.
In one possible implementation, the method further includes:
and identifying a target network connection channel based on the server identification of the target GS, wherein the target network connection channel is a connection channel created based on the binding relationship.
In a possible implementation manner, the searching queue whether there is server information of an idle GS, and then further includes:
and if the server information of the idle GS does not exist in the queue, returning an error instruction, wherein the error instruction is used for indicating that the idle GS does not exist currently.
In a second aspect, a game server allocation method is provided, which is applied to a game server allocation system, and the game server allocation system includes: the method comprises the following steps that at least one PaaS server, at least one Agent server, at least one cloud game server GS and at least one client side are arranged, wherein the at least one PaaS server is respectively in information interaction with the at least one Agent and the at least one client side, the at least one GS is also in information interaction with the at least one client side, and the method is executed by any PaaS server and comprises the following steps:
when a login request of a target client is detected, generating a distribution request of a GS (service gateway), wherein the target client is any one of the at least one client;
sending the distribution request of the GS to a corresponding Agent server so that the corresponding Agent server searches the server information of the free GS from a queue;
and obtaining server information of a target GS from a preset storage space to obtain the connection between the target client and the target GS, wherein the server information of the target GS is obtained by searching the idle GS from the queue by the corresponding Agent server and storing the idle GS in the preset storage space.
In a possible implementation manner, the obtaining of the server information of the target GS from the preset storage space includes:
acquiring server information of a target GS from the hash table;
the method comprises the steps of obtaining server information of a target GS from a preset storage space, and then obtaining the server information of the target GS;
receiving a scheduling string request message sent by the target client;
and sending a scheduling string to the target client based on the scheduling string request message, wherein the scheduling string carries server information of the target GS, so that the target client and the target GS are connected.
In one possible implementation, the method further includes any one of:
acquiring server states corresponding to the GS at intervals of preset time, and storing server information corresponding to the GS in an idle state to a queue;
receiving a notification message of the GS currently in the idle state, acquiring the server information of the GS currently in the idle state based on the notification message, and storing the acquired server information of the GS currently in the idle state into a queue, wherein the notification message is used for notifying the PaaS server that the GS is currently in the idle state.
In a third aspect, there is provided a game server distribution apparatus comprising:
the system comprises an allocation request receiving module, a target PaaS server and a server management module, wherein the allocation request receiving module is used for receiving an allocation request of a GS (service gateway) sent by the target PaaS server, the allocation request of the GS is triggered when a login request of a target client is detected, and the target PaaS server is a PaaS server corresponding to any Agent;
the first searching module is used for searching whether idle GS server information exists in a queue, the idle GS server information is stored in the queue, and the idle GS is not occupied by a client currently;
the server information acquisition module is used for acquiring the server information of the target GS from the queue when the server information of the idle GS exists in the queue, so that the target client establishes connection with the target GS based on the server information of the target GS;
the preset storage space is used for the target Paas server to obtain the server information of the target GS, and the server information is sent to the target client.
In one possible implementation, the apparatus further includes: a memory module, wherein,
and the storage module is used for storing the server information of the target GS into a hash table.
In one possible implementation, the apparatus further includes: a server identification receiving module, a second searching module and a binding relation establishing module, wherein,
the server identifier receiving module is used for receiving the server identifier sent by the target GS;
the second searching module is used for searching the server information of the target GS based on the server identification;
and the binding relationship establishing module is used for establishing a binding relationship with the target GS based on the server information of the target GS, so that the network service and the target GS receive and transmit data based on the binding relationship.
In one possible implementation, the apparatus further includes: an identification module, wherein,
and the identification module is used for identifying a target network connection channel based on the server identification of the target GS, wherein the target network connection channel is a connection channel created based on the binding relationship.
In one possible implementation, the apparatus further includes: returning to the module, wherein,
and the returning module is used for returning an error instruction when the server information of the idle GS does not exist in the queue, wherein the error instruction is used for indicating that the idle GS does not exist currently.
In a fourth aspect, there is provided a game server allocation apparatus comprising:
the distribution request generation module is used for generating a distribution request of the GS when the login request of the target client is detected;
the distribution request sending module is used for sending the distribution request of the GS to the corresponding Agent server so as to enable the corresponding Agent server to search the server information of the idle GS from the queue;
and the information acquisition module is used for acquiring server information of the target GS from a preset storage space so as to obtain the connection between the target client and the target GS, wherein the server information of the target GS is obtained by searching the idle GS from the queue by the corresponding Agent server and storing the idle GS in the preset storage space.
In a possible implementation manner, when sending an instruction to a corresponding target GS based on the server information of the target GS, the information obtaining module is specifically configured to:
acquiring server information of a target GS from a hash table, wherein the server information of the target GS is stored in the hash table by the Agent server;
the device further comprises: a request message receiving module and a scheduling string transmitting module, wherein,
the request message receiving module is used for receiving a scheduling string request message sent by the target client;
and the scheduling string sending module is used for sending a scheduling string to the target client based on the scheduling string request message, wherein the scheduling string carries server information of the target GS, so that the target client and the target GS are connected.
In one possible implementation, the apparatus further includes: a first processing module or a second processing module, wherein,
the first processing module is used for acquiring the server states respectively corresponding to the GS at intervals of preset time, and storing the server information corresponding to the GS in the idle state to the queue;
the second processing module is configured to receive a notification message of the GS currently in the idle state, acquire server information of the GS currently in the idle state based on the notification message, and store the acquired server information of the GS currently in the idle state in a queue, where the notification message is used to notify any PaaS server that the GS is currently in the idle state.
In a fifth aspect, there is provided a game server distribution system comprising: at least one PaaS server, at least one Agent server, at least one cloud game server GS and at least one client, wherein the at least one PaaS server respectively performs information interaction with the at least one Agent and the at least one client, the at least one GS also performs information interaction with the at least one client, the at least one Agent server and the at least one client are connected in series,
the at least one PaaS server is used for sending a GS allocation request to the target Agent server when a login request of a corresponding target client is detected, wherein the target client is any one of the at least one client;
the Agent server is used for searching whether the queue has idle GS server information when receiving the distribution request of the GS, and acquiring the server information of the target GS from the queue and storing the server information to a preset storage space when the queue has the idle GS server information;
the at least one PaaS server is further used for acquiring the server information of the target GS from the preset storage space, so that the target client side is connected with the target GS.
In a sixth aspect, the present application provides an Agent server, including:
at least one processor;
a memory;
at least one application, wherein the at least one application is stored in the memory and configured to be executed by the at least one processor, the at least one application configured to: the game server allocation method shown in the first aspect or any one of the possible implementations described above is performed.
A seventh aspect provides a PaaS server, including:
at least one processor;
a memory;
at least one application, wherein the at least one application is stored in the memory and configured to be executed by the at least one processor, the at least one application configured to: the game server allocation method shown in the second aspect or any one of the possible implementations described above is performed.
In an eighth aspect, the present application provides a computer-readable storage medium comprising: a computer program is stored which can be loaded by a processor and which performs the game distribution server distribution method described above.
To sum up, this application includes following beneficial technological effect:
compared with the related art, in the embodiment of the application, after the Agent server receives the distribution request of the GS, whether the idle GS exists in the queue for storing the idle GS is searched, and when the idle GS exists in the queue, the server information of the idle GS is obtained from the queue and stored to the preset storage space, so that the client can establish the link with the free-state GS, the client does not need to wait for the situation that a certain GS is changed from the occupied state to the idle state and can establish the connection after being restarted, the waiting time for the connection establishment between the client and the cloud game server can be reduced, and the user experience can be improved.
Compared with the related art, in the embodiment of the application, when the PaaS server receives a login request sent by an Agent server, the Agent server searches whether the idle GS is included in a queue or not, and stores the server information of the idle GS to a preset storage idle state, so that the PaaS server can obtain the server information of the GS currently in the idle state from a preset storage space, the GS currently in the idle state is connected with a request client side, connection can be established without waiting for a certain GS to be changed from the occupied state to the idle state and restarting, the waiting time for the client side to establish connection with the cloud game server can be reduced, and user experience can be improved.
Drawings
FIG. 1 is a schematic diagram of a game server distribution system according to an embodiment of the present application;
FIG. 2 is a schematic flow chart illustrating a method for allocating game servers according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart diagram illustrating another method for allocating game servers according to an embodiment of the present application;
FIG. 4 is a diagram illustrating an exemplary method for allocating game servers according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a game server distribution device according to an embodiment of the present application;
FIG. 6 is a schematic diagram of another game server distribution device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an Agent server according to an embodiment of the present application.
Detailed Description
The present application is described in further detail below with reference to the accompanying drawings.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
Cloud Gaming (Cloud Gaming) may also be called game on Demand (Gaming on Demand), which is a game based on Cloud computing technology. Cloud games enable light-end devices (thinclients) with relatively limited graphics processing and data manipulation capabilities to run high-quality games. In a cloud game scene, all game processes are not operated in a client of a terminal used by a user, but are operated in a game server; the game server compresses and encodes game pictures and game audio in the game process into a media stream, and then transmits the media stream to a client used by a user through a network, wherein the media stream can comprise a game video stream and a game audio stream. The client used by the user does not need to have strong graphic processing and data operation capacity, only needs to have basic streaming media playing capacity and the capacity of acquiring the operation instruction input by the user and sending the operation instruction input by the user to the game server.
The cloud computing technology provides graphics processing capacity and data operation capacity for the game server to support smooth operation of the cloud game. Cloud Computing (Cloud Computing) is a Computing model that distributes Computing tasks over a resource pool of large numbers of computers, enabling various application systems to obtain Computing power, storage space, and information services as needed. The network that provides the resources is referred to as the "cloud". Resources in the "cloud" appear to the user to be infinitely expandable and to be available at any time, available on demand, expandable at any time, and pay per use. As a basic capability provider of cloud computing, a cloud computing resource pool (referred to as a cloud platform for short) generally called an Infrastructure as a service (IaaS) platform is established, and multiple types of virtual resources are deployed in the cloud computing resource pool and are used by external customers. The cloud computing resource pool mainly comprises: computing devices (being virtualized machines, including operating systems), storage devices, network devices. According to the logic function division, a Platform as a Service (PaaS) layer can be deployed on the IaaS layer, a Software as a Service (SaaS) layer can be deployed on the PaaS layer, and the SaaS can be directly deployed on the IaaS layer. PaaS is a platform on which software (e.g., databases, web containers, etc.) runs. SaaS is a wide variety of business software (e.g., web portal, sms, etc.). Generally speaking, saaS and PaaS are upper layers relative to IaaS.
The implementation process of the cloud game comprises the following steps: different users as game players enter the cloud game through terminals (such as mobile phones, PCs (personal computers) and the like) comprising cloud game clients to play, and the game server starts a game process of the cloud game for the clients participating in the cloud game; for example, a certain player uses a client to play in a cloud game, and at this time, the game server starts and runs a game process at the cloud end, and then the game process corresponds to the client used by the player, and the game process provides a rendered game picture of the cloud game for the client. The client displays a rendered game picture returned by the corresponding game process; when a user executes various operations (such as touch screen operations and mouse and keyboard operations) in a game picture, the client reports operation data generated by the operations to the game server, the game server refreshes the game picture of the cloud game according to the operation data in a corresponding game process, and then the refreshed game picture is returned to the client for display.
An embodiment of the present application provides a game server distribution system, as shown in fig. 1, the game server distribution system includes: the system comprises at least one PaaS server, at least one Agent server, at least one cloud game server GS and at least one client, wherein the at least one PaaS server is in information interaction with the at least one Agent and the at least one client respectively, and the at least one GS is also in information interaction with the at least one client. In the embodiment of the application, one PaaS server can correspond to at least two Agent servers;
further, the game server distribution system may further include: a web service (Netserver) which performs information interaction with at least one GS; in fig. 1, the description is given by taking an example in which one PaaS server and one Agent server are included in the game server distribution system, but the game server distribution system is not limited thereto.
Further, based on the game server distribution system shown above, an embodiment of the present application provides a game server distribution method, which is executed by any Agent server, and as shown in fig. 2, the game server distribution method may include:
step S201, receives a GS allocation request sent by the target PaaS server.
The target PaaS server is a PaaS server corresponding to any Agent, the GS allocation request is triggered when the login request of the target client is detected, and the target client is any client in at least one client. In the embodiment of the application, the allocation request of the GS is used for allocating the corresponding GS to the target client according to the request.
For example, the allocation request of the GS may be a command in an Assign format, or may be a command in another format, which is not limited in the embodiment of the present application.
And step S202, searching whether the queue has server information of the free GS.
For the embodiment of the application, when the Agent server receives the distribution request of the GS sent by the target PaaS server, whether the server information of the idle GS exists or not is searched from the queue, and the GS in the idle state at present is distributed for the target client.
Further, the queue stores server information of idle GS, which is the GS not currently occupied by the client. In this embodiment, the server information may include: server identification, server processing capability information, handle information, and server location information.
And step S203, if the queue has the server information of the free GS, acquiring the server information of the target GS from the queue, and storing the server information of the target GS into a preset storage space, so that the target client establishes connection with the target GS based on the server information of the target GS.
The preset storage space is used for the target Paas server to obtain the server information of the target GS, and the server information is sent to the target client.
For the embodiment of the application, if server information of the GS exists in the queue, that is, server information of the GS which is idle exists in the queue, the server information of the target GS is also acquired from the queue in a first-in first-out mode of the queue, and then the acquired server information of the target GS is stored in a preset storage space, so that the target PaaS server can acquire the server information of the target GS from the preset storage space, and the target client is connected with the target GS.
Specifically, after the target PaaS server acquires the server information of the target GS from the preset storage space, the target client may send a scheduling string request message to the target PaaS server, and after receiving the scheduling string request message, the target PaaS server sends the corresponding scheduling string to the target client, so that the target client establishes a connection based on the scheduling string and the corresponding GS.
Specifically, in a possible implementation manner, only GSIDs of servers with idle existence may be stored in a queue, then a GSID of a GS is obtained from the queue, and then the GSID is stored in a preset storage space, so that the PaaS server may obtain a target GSID from the preset storage space, so that the target client establishes a connection with the target GS.
Compared with the prior art, in the embodiment of the application, after the Agent server receives the distribution request of the GS, whether the idle GS exists in the queue for storing the idle GS is searched, and when the idle GS exists in the queue, the server information of the idle GS is obtained from the queue and stored to the preset storage space, so that the client can establish the link with the GS in the idle state, the connection can be established without waiting for the situation that a certain GS is changed from the occupied state to the idle state and is restarted, the waiting time for the connection establishment between the client and the cloud game server can be reduced, and the user experience can be improved.
Further, in the game server distribution system, it is known that the PaaS server directly performs information exchange with the Agent server, that is, the PaaS server may send a distribution request of the GS to the Agent server. In the embodiment of the application, one PaaS server may correspond to one Agent server, or one PaaS server may correspond to a plurality of Agent servers.
Further, after the Agent server receives the distribution request of the GS, whether the queue contains the server information of the free GS is searched from the queue. In the embodiment of the present application, the queue may be one queue or multiple queues. Further, when multiple queues are included, GS may be placed in different queues according to their idle time.
Further, after searching whether the queue has server information of an idle GS, the method may further include: and if the server information of the free GS does not exist in the queue, returning an error instruction. In the embodiment of the present application, the error instruction is used to indicate that there is no idle GS currently.
Further, if the idle GS server information does not exist in the queue, the Agent server may record relevant information of the GS request client, and when the idle GS server is detected, store the idle GS server information to a preset storage space, and then send an instruction to the target PaaS server, so that the target PaaS server acquires the GS server information from the preset storage space, to establish a connection relationship between the GS request client and the corresponding GS server.
Further, if the queue has the server information of the free GS, the Agent server acquires the server information of the target GS from the queue and stores the server information of the target GS into a preset storage space. In this embodiment of the present application, storing the server information of the target GS in the preset storage space may specifically include: and storing the server information of the target GS into a hash table. Specifically, one GS corresponds to one GSID, that is, the GSID of the target GS can be stored in the hash table, wherein the KEY value in the hash table is the GS ID, so that the GS server can be quickly matched to the GS server of the user. Further, the target PaaS server may obtain the GSID of the target GS from the hash table, and establish a connection relationship between the target client and the target GS. In the embodiment of the application, the GSID of the target GS is stored in the hash table, so that the target PaaS server searches the GSID of the target GS from the hash table, and since the time complexity of the hash table is o (1), the searching efficiency can be further improved.
Further, after the target client establishes a connection relationship with the target GS, the target client performs data transceiving with the target GS to normally run the cloud game, and in order to smoothly perform data transceiving between the target client and the target GS, the method may further include: the Agent server receives a server identifier sent by a target GS (gateway application server), and searches information of the target GS based on the server identifier; and establishing a binding relationship between the server information based on the target GS and the target GS, so that the network service and the target GS receive and transmit data based on the binding relationship.
For the embodiment of the application, because the connected GS cannot be determined in the network connection, after the Websocket is successfully connected, the GSID is carried in the URL, and after the Agent server receives the GSID, the Agent server searches for other related information corresponding to the target GS according to the GSID. In the embodiment of the present application, the information of the target GS may include, in addition to the GSID: handle information of the target GS, server location information, server processing capability information, and the like. In the embodiment of the application, after the Agent server finds the information of the target GS, a binding relationship can be established between the information of the target GS and the corresponding target GS, and the subsequent Agent server sends data to the target GS according to the binding relationship.
It should be noted that, after receiving the GSID, the Agent server may also search for other information of the server corresponding to the GSID, and the method mainly includes: and the handle information of the target GS is further used for establishing a binding relationship with the target GS according to the handle information.
Further, the Agent server sends the information of the target GS (or other information of the server) to the network service, and identifies the target network connection channel based on the server identification of the target GS. In this embodiment of the present application, the target network connection channel is a network connection channel determined based on the binding relationship, and is used for performing information interaction between a network service (Netserver) and the target GS based on the determined network connection channel.
For the embodiment of the present application, the target network connection channel may be TCPConnect, and the identifier of the target network connection channel may include TCPConnect Tag, where the TCPConnect Tag may be of any type, for example, if GSID =1 of the target GS of the connection object of the TCPConnect, then TCPConnect Tag =1.
An embodiment of the present application provides another game server allocation method, which is executed by any PaaS server, and as shown in fig. 3, the method may further include:
step S301, when a login request of a target client is detected, generates an allocation request of the GS.
The target client is any one of the at least one client. In the embodiment of the application, when the PaaS server detects a login request of any client, a distribution request of the GS is generated.
And step S302, sending an allocation request of the GS to a corresponding Agent server so that the Agent server searches the server information of the free GS from the queue.
For the embodiment of the present application, the manner in which the corresponding Agent server searches for the idle server information of the GS from the queue is described in detail in the above embodiment, and details are not described herein again.
And step S303, obtaining server information of the target GS from a preset storage space to obtain the connection between the target client and the target GS.
And searching the free GS from the queue by the corresponding Agent server and storing the free GS to a preset storage space.
For the embodiment of the application, after sending the distribution request of the GS, the PaaS server may obtain the server information of the target GS from the preset storage space after a preset time, or after receiving the search confirmation message sent by the target GS, determine that the Agent server searches for the free GS, and obtain the server information of the target GS from the preset storage space.
Compared with the related art, in the embodiment of the application, when the PaaS server receives a login request sent by an Agent server, the Agent server searches whether the idle GS is included in a queue or not, and stores the server information of the idle GS to the preset storage idle, so that the PaaS server can acquire the server information of the current idle GS from the preset storage space, the current idle GS is connected with a request client side, connection can be established without waiting for a certain GS to be changed from an occupied state to an idle state and restarting, the waiting time for the client side to establish connection with the cloud game server can be reduced, and user experience can be improved.
Specifically, the step S303 of acquiring the server information of the target GS from the preset storage space may specifically include: and acquiring the server information of the target GS from the hash table. In this embodiment, the manner in which the PaaS server obtains the server information of the target GS from the hash table is described in detail in the above embodiment, and is not described herein again.
Further, obtaining server information of the target GS from a preset storage space, and then: receiving a scheduling string request message sent by a target client; and sending a scheduling string to the target client based on the scheduling string request message, wherein the scheduling string carries server information of the target GS, so that the target client and the target GS are connected. In the embodiment of the application, when the PaaS server acquires the server information of the target GS from the preset storage space, the target client side and the target GS are enabled to establish a connection relationship. In the embodiment of the present application, the preset storage space may be a hash table, or may be another type of table. When the preset storage space is a hash table, the PaaS server acquires server information of the target GS from the hash table so that the target client side and the target GS can establish a connection relation.
Further, after the target client establishes a connection relationship with the target GS, the PaaS server sends an instruction to the target GS, so that the target client and the target GS perform data transceiving.
Further, in another possible implementation manner of the embodiment of the present application, the method further includes: in any of the steps Sm (not shown in the drawings) and Sn (not shown in the drawings), in the embodiment of the present application, the step Sm or Sn may be executed before the step S301, may also be executed before the step S302, may also be executed in other execution orders, and is not limited in the embodiment of the present application, wherein,
and step Sm, acquiring the server states corresponding to the GS respectively at preset time intervals, and storing the server information corresponding to the GS which is in the idle state at present into a queue.
For example, the PaaS server acquires the server states corresponding to the GS (GS 1, GS2, GS3, and GS 4) every 10 minutes, and stores the server information corresponding to the GS1, GS2, and GS3 in the queue, specifically, GSID =1, GSID =2, and GSID =3, when detecting that the GS1, GS2, and GS3 are currently in the idle state.
For the embodiment of the application, the server information corresponding to the GS currently in the idle state is stored in the queue by the PaaS server at intervals of preset time, so that the situation that the GS currently exists in the idle state but cannot be searched from the queue is avoided, the accuracy of searching the GS in the idle state from the queue can be improved, the waiting time for establishing the connection between the client and the cloud game server can be further reduced, and the user experience can be further improved.
And Sn, receiving a notification message of the GS currently in the idle state, acquiring the server information of the GS currently in the idle state based on the notification message, and storing the acquired server information of the GS currently in the idle state into a queue.
The notification message is used for notifying the PaaS server that the GS is currently in an idle state. In the embodiment of the application, the notification message may carry server information of the GS, so that the PaaS server may determine the server information of the GS currently in the idle state.
For example, when the PaaS server receives notification messages transmitted by GS1, GS2, and GS3, the PaaS server acquires GSID =1 corresponding to GS1, GSID =2 corresponding to GS2, and GSID =3 corresponding to GS3, and stores them in the queue.
For the embodiment of the application, the notification message of the GS currently in the idle state is received to determine the GS currently in the idle state, so as to avoid the situation that the GS server currently exists in the idle state but cannot be found from the queue, so that the accuracy of finding the GS in the idle state from the queue can be improved, the waiting time for establishing the connection between the client and the cloud game server can be further reduced, and the user experience can be further improved.
The above embodiments respectively describe a cloud server allocation method from an Agent server and a PaaS server, and the following embodiments describe a specific scenario to describe the cloud server allocation method, as shown in fig. 4, wherein,
the PaaS server sends a server allocation request to an Agent server, the Agent server searches whether a queue contains idle GS, for example, the queue stores the idle GS, namely GS1 (GSID = 1), GS2 (GSID = 2) and GS3 (GSID = 3), the Agent server stores the GSID =1 in a hash table according to a first-in first-out principle, and the PaaS server acquires the GSID =1 from the hash table, so that a connection relationship is established between a client and the GS 1; further, the target GS sends GSID =1 to the Agent server, so that the Agent server searches for a corresponding GS handle, establishes a binding relationship with the GS1 based on the GS handle, that is, establishes a connection between the GS1 and the TCPconnect, and sets TCPConnectTag =1, and the network service (netserver) performs data transmission and reception with the GS1 through the binding relationship corresponding to the TCPConnectTag =1.
The foregoing embodiments describe a game server allocation method from the perspective of method flow, and the following embodiments describe a game server allocation apparatus from the perspective of virtual modules or virtual units, which are described in detail in the following embodiments.
An embodiment of the present application provides a game server distribution device, as shown in fig. 5, a game server distribution device 50 includes: a distribution request receiving module 51, a first lookup module 52, and a server information obtaining module 53, wherein,
and an allocation request receiving module 51, configured to receive an allocation request of the GS sent by the target PaaS server.
The GS allocation request is triggered when a login request of a target client is detected, and the target PaaS server is a PaaS server corresponding to any Agent.
And a first searching module 52, configured to search whether there is server information of a GS that is free in the queue.
The queue stores server information of idle GS, and the idle GS is the GS which is not occupied by the client currently.
A server information obtaining module 53, configured to, when there is server information of an idle GS in the queue, obtain server information of a target GS from the queue, so that the target client establishes a connection with the target GS based on the server information of the target GS;
the preset storage space is used for the target Paas server to acquire the server information of the target GS from the preset storage space, and the server information is sent to the target client.
In another possible implementation manner of the embodiment of the present application, the apparatus 50 further includes: a memory module, wherein,
and the storage module is used for storing the server information of the target GS into the hash table.
In another possible implementation manner of the embodiment of the present application, the apparatus 50 further includes: a server identification receiving module, a second searching module and a binding relation establishing module, wherein,
the server identifier receiving module is used for receiving the server identifier sent by the target GS;
the second searching module is used for searching the server information of the target GS based on the server identifier;
and the binding relationship establishing module is used for establishing a binding relationship between the server information based on the target GS and the target GS so as to enable the network service and the target GS to receive and transmit data based on the binding relationship.
In another possible implementation manner of the embodiment of the present application, the apparatus 50 further includes: an identification module, wherein,
and the identification module is used for identifying a target network connection channel based on the server identification of the target GS, wherein the target network connection channel is a connection channel created based on the binding relationship.
In another possible implementation manner of the embodiment of the present application, the apparatus 50 further includes: returning to the module, wherein,
and the returning module is used for returning an error instruction when the server information of the idle GS does not exist in the queue, wherein the error instruction is used for indicating that the idle GS does not exist currently.
Compared with the prior art, in the embodiment of the application, after the Agent server receives the distribution request of the GS, whether the idle GS exists in the queue for storing the idle GS is searched, and when the idle GS exists in the queue, the server information of the idle GS is obtained from the queue and stored to the preset storage space, so that the client can establish the link with the GS in the idle state, the connection can be established without waiting for the situation that a certain GS is changed from the occupied state to the idle state and is restarted, the waiting time for the connection establishment between the client and the cloud game server can be reduced, and the user experience can be improved.
In another embodiment of the present application, as shown in fig. 6, the game server allocation apparatus 60 may further include: an allocation request generation module 61, an allocation request transmission module 62, and an information acquisition module 63, wherein,
a distribution request generation module 61, configured to generate a distribution request of the GS when a login request of a target client is detected;
the distribution request sending module 62 is configured to send a distribution request of the GS to the corresponding Agent server, so that the corresponding Agent server searches for server information of an idle GS from the queue;
and the information acquisition module 63 is configured to acquire server information of a target GS from a preset storage space to obtain that the target client establishes connection with the target GS, where the server information of the target GS is obtained by searching for an idle GS from a queue by the corresponding Agent server, and storing the idle GS in the preset storage space.
In another possible implementation manner of the embodiment of the present application, when the information obtaining module 63 sends an instruction to the corresponding target GS based on the server information of the target GS, the information obtaining module is specifically configured to:
acquiring server information of a target GS from the hash table, wherein the server information of the target GS is stored in the hash table by an Agent server;
further, the apparatus 60 further comprises: a request message receiving module and a scheduling string transmitting module, wherein,
the request message receiving module is used for receiving a scheduling string request message sent by a target client;
and the scheduling string sending module is used for sending a scheduling string to the target client based on the scheduling string request message, wherein the scheduling string carries the server information of the target GS, so that the target client and the target GS are connected.
In another possible implementation manner of the embodiment of the present application, the apparatus 60 further includes: a first processing module or a second processing module, wherein,
the first processing module is used for acquiring the server states corresponding to the GS respectively at intervals of preset time, and storing the server information corresponding to the GS which is in the idle state at present into a queue;
and the second processing module is used for receiving the notification message of the GS currently in the idle state, acquiring the server information of the GS currently in the idle state based on the notification message, and storing the acquired server information of the GS currently in the idle state into the queue.
The notification message is used for notifying any PaaS server that the GS is currently in an idle state.
Compared with the related art, in the embodiment of the application, when the PaaS server receives a login request sent by an Agent server, the Agent server searches whether the idle GS is included in a queue or not, and stores the server information of the idle GS to the preset storage idle, so that the PaaS server can obtain the server information of the GS currently in the idle state from the preset storage space, the GS currently in the idle state is connected with a request client side, connection can be established without waiting for a certain GS to be changed from the occupied state to the idle state and restarting, the waiting time for the client side to establish connection with the cloud game server can be reduced, and user experience can be improved.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiment of the present application also introduces an Agent server from the perspective of an entity device, as shown in fig. 7, an Agent server 700 shown in fig. 7 includes: a processor 701 and a memory 703. The processor 701 is coupled to a memory 703, such as via a bus 702. Optionally, the electronic device 700 may also include a transceiver 704. It should be noted that the transceiver 704 is not limited to one in practical applications, and the structure of the Agent server 700 is not limited to the embodiment of the present application.
The Processor 701 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other Programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 701 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and combinations of microprocessors, and the like.
Bus 702 may include a path that transfers information between the above components. The bus 702 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 702 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 7, but that does not indicate only one bus or one type of bus.
The Memory 703 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact disk Read Only Memory) or other optical disk storage, optical disk storage (including Compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 703 is used for storing application program codes for executing the present invention, and is controlled by the processor 701. The processor 701 is configured to execute application program code stored in the memory 703 to implement the content shown in the foregoing method embodiment executed by the Agent server.
The Agent server shown in fig. 7 is only an example, and should not bring any limitation to the functions and the use range of the embodiment of the present application.
The embodiment of the application also introduces a PaaS server from the perspective of an entity device, and the structure of the PaaS server is similar to that of the Agent server shown in the embodiment, and is not described herein again.
The present application provides a computer-readable storage medium, on which a computer program is stored, which, when running on a computer, enables the computer to execute the corresponding content in the foregoing method embodiments. In the embodiment of the application, after the Agent server receives the distribution request of the GS sent by the PaaS server, whether the idle GS exists in the queue for storing the idle GS is searched, and when the idle GS exists in the queue, the server information of the idle GS is obtained from the queue and stored in the preset storage space, and the PaaS server obtains the server information of the idle GS from the preset storage space, so that the client can establish a link with the idle GS without waiting for a certain GS to change from an occupied state to an idle state and then establishing a connection after restarting, thereby reducing the waiting time for the client to establish a connection with the cloud game server, and further improving user experience.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a few embodiments of the present application and it should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present application, and that these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A game server distribution method is applied to a game server distribution system, and is characterized in that the game server distribution system comprises: the method comprises the following steps that at least one PaaS server, at least one Agent server, at least one cloud game server GS and at least one client side are adopted, wherein the at least one PaaS server is respectively in information interaction with the at least one Agent server and the at least one client side, the at least one GS is also in information interaction with the at least one client side, and the method is executed by any Agent server and comprises the following steps:
receiving a distribution request of a GS (service gateway) sent by a target PaaS server, wherein the distribution request of the GS is triggered when a login request of a target client is detected, the target PaaS server is a PaaS server corresponding to any Agent, and the target client is any client in at least one client;
searching whether idle GS server information exists in a queue, wherein the idle GS server information is stored in the queue, and the idle GS is the GS which is not occupied by a client currently;
if the queue has the server information of the free GS, acquiring the server information of the target GS from the queue and storing the server information of the target GS into a preset storage space, so that the target client establishes connection with the target GS based on the server information of the target GS;
the preset storage space is used for the target Paas server to acquire the server information of the target GS, and the server information is sent to the target client.
2. The method of claim 1, wherein storing to a predetermined storage space comprises:
and storing the server information of the target GS into a hash table.
3. The method of claim 1, wherein the cloud gaming distribution system further comprises: a web service that performs information interaction with the at least one GS;
the method further comprises the following steps:
receiving a server identifier sent by a target GS, and searching server information of the target GS based on the server identifier;
and establishing a binding relationship with the target GS based on the server information of the target GS, so that the network service and the target GS receive and send data based on the binding relationship.
4. The method of claim 3, further comprising:
and identifying a target network connection channel based on the server identification of the target GS, wherein the target network connection channel is a connection channel created based on the binding relationship.
5. The method of claim 1, wherein the lookup queue has server information for free GS, and thereafter further comprising:
and if the server information of the idle GS does not exist in the queue, returning an error instruction, wherein the error instruction is used for indicating that the idle GS does not exist currently.
6. A game server distribution method is applied to a game server distribution system, and is characterized in that the game server distribution system comprises: the method comprises the following steps that at least one PaaS server, at least one Agent server, at least one cloud game server GS and at least one client side are adopted, wherein the at least one PaaS server respectively carries out information interaction with the at least one Agent and the at least one client side, the at least one GS also carries out information interaction with the at least one client side, and the method is executed by any PaaS server and comprises the following steps:
when a login request of a target client is detected, generating a distribution request of a GS (service gateway), wherein the target client is any one of the at least one client;
sending the distribution request of the GS to a corresponding Agent server so that the corresponding Agent server searches the server information of the idle GS from a queue;
and obtaining server information of a target GS from a preset storage space to obtain the connection between the target client and the target GS, wherein the server information of the target GS is obtained by searching the idle GS from the queue by the corresponding Agent server and storing the idle GS in the preset storage space.
7. The method according to claim 6, wherein the obtaining of the server information of the target GS from the preset storage space comprises:
acquiring server information of a target GS from the hash table;
the obtaining of the server information of the target GS from the preset storage space further includes:
receiving a scheduling string request message sent by the target client;
and sending a scheduling string to the target client based on the scheduling string request message, wherein the scheduling string carries server information of the target GS, so that the target client and the target GS are connected.
8. The method of claim 6, further comprising any of:
acquiring server states corresponding to the GS at intervals of preset time, and storing server information corresponding to the GS in an idle state to a queue;
receiving a notification message of the GS currently in the idle state, acquiring the server information of the GS currently in the idle state based on the notification message, and storing the acquired server information of the GS currently in the idle state into a queue, wherein the notification message is used for notifying any PaaS server that the GS is currently in the idle state.
9. A game server distribution system, the game server distribution system comprising: at least one PaaS server, at least one Agent server, at least one cloud game server GS and at least one client, wherein the at least one PaaS server respectively performs information interaction with the at least one Agent server and the at least one client, the at least one GS also performs information interaction with the at least one client, the at least one Agent server and the at least one client are connected in series,
the at least one PaaS server is used for sending a GS allocation request to a target Agent server when a login request of a corresponding target client is detected, wherein the target client is any one of the at least one client;
the Agent server is used for searching whether the queue has idle GS server information when receiving the distribution request of the GS, and acquiring the server information of the target GS from the queue and storing the server information to a preset storage space when the queue has the idle GS server information;
the at least one PaaS server is further used for acquiring the server information of the target GS from the preset storage space, so that the target client side is connected with the target GS.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that when the computer program is executed in a computer, it causes the computer to execute the game server allocation method according to any one of claims 1 to 5 or 6 to 8.
CN202211543215.9A 2022-12-02 2022-12-02 Game server distribution method, system and storage medium Pending CN115869616A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211543215.9A CN115869616A (en) 2022-12-02 2022-12-02 Game server distribution method, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211543215.9A CN115869616A (en) 2022-12-02 2022-12-02 Game server distribution method, system and storage medium

Publications (1)

Publication Number Publication Date
CN115869616A true CN115869616A (en) 2023-03-31

Family

ID=85765728

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211543215.9A Pending CN115869616A (en) 2022-12-02 2022-12-02 Game server distribution method, system and storage medium

Country Status (1)

Country Link
CN (1) CN115869616A (en)

Similar Documents

Publication Publication Date Title
US20130254261A1 (en) System and Method of Managing Servers for Streaming Desktop Applications
US10165058B2 (en) Dynamic local function binding apparatus and method
CN109068153B (en) Video playing method and device and computer readable storage medium
CN111586164B (en) Sharing, succession and information processing method of remote cloud desktop and electronic equipment
CN112492372B (en) Comment message display method and device, electronic equipment, system and storage medium
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN111163130A (en) Network service system and data transmission method thereof
WO2024066828A1 (en) Data processing method and apparatus, and device, computer-readable storage medium and computer program product
EP4113985A1 (en) Multimedia conference data processing method and apparatus, and electronic device
CN112379982B (en) Task processing method, device, electronic equipment and computer readable storage medium
CN113553178A (en) Task processing method and device and electronic equipment
CN112835632B (en) Method and equipment for calling end capability and computer storage medium
CN111694639A (en) Method and device for updating address of process container and electronic equipment
US20230063599A1 (en) Edge computing network, data transmission method and apparatus, device and storage medium
CN115869616A (en) Game server distribution method, system and storage medium
CN115396500A (en) Service platform switching method and system based on private network and electronic equipment
CN113127561B (en) Method and device for generating service single number, electronic equipment and storage medium
CN114726657A (en) Method and device for interrupt management and data receiving and sending management and intelligent network card
CN113992989A (en) Content display method, device, system, equipment and storage medium
CN109309583B (en) Information acquisition method and device based on distributed system, electronic equipment and medium
CN112612401A (en) Prompt message processing method, device, system, equipment and storage medium
CN115348231B (en) Message processing method, device, server side and storage medium
TWI764165B (en) Cloud data sharing method supporting native applications and containerized applications and storage devices using the same
CN113114737B (en) Information sending method and device and server
CN108668142B (en) Video playing method and device

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