Disclosure of Invention
The embodiment of the invention provides a game server communication method and device, which can solve the technical problems that the server data intercommunication in the prior art can not provide richer services for game players and is greatly restricted by external factors.
In a first aspect, an embodiment of the present invention provides a method for game server communication, where the method is applied to a first server of a game service system, and the game service system further includes: at least one second server and at least one third server, the method comprising:
receiving a cross-server login request sent by a client communicating with the first server, wherein the cross-server login request at least comprises a service identifier;
sending the cross-server login request to the third server, so as to distribute a target second server for the client through the third server and generate corresponding distribution information;
receiving the distribution information sent by the third server;
sending the allocation information to the client to instruct the client to communicate with the target second server.
Optionally, the allocating, by the third server, a target second server to the client and generating corresponding allocation information includes: and determining a target second server configured with the service corresponding to the service identifier in the at least one second server through the third server, and generating the distribution information according to the number of the target second server.
Optionally, the method further includes:
determining, by the third server, a target second server configured with a service corresponding to the service identifier in the at least one second server, including:
and determining a target second server which is configured with the service corresponding to the service identifier and has a load state meeting a preset condition in the at least one second server through the third server.
Optionally, after the sending the cross-server login request to the third server, the method further includes: acquiring user information of the client;
the allocating, by the third server, a target second server to the client includes:
and distributing the target second server to the client by the third server according to the service identifier and the user information.
Optionally, the cross-server login request further includes: user information of the client;
the allocating, by the third server, a target second server to the client includes:
and distributing the target second server to the client by the third server according to the service identifier and the user information.
Optionally, the user information includes at least one of:
and the client corresponds to the attribute information of the user account, the operating system, the region and the language.
Optionally, different service resources are configured on the first server and the second server.
Optionally, after sending the allocation information to the client, the method further includes:
and disconnecting the communication connection with the client.
A second aspect of an embodiment of the present invention provides a method for game server communication, which is applied to a third server of a game service system, where the game service system further includes: a first server and at least one second server, the method comprising:
receiving a cross-server login request sent by the first server, wherein the cross-server login request comprises a service identifier;
allocating a target second server for the client and generating corresponding allocation information;
sending the allocation information to the first server, wherein the allocation information is used for indicating the client to communicate with the target second server.
The allocating a target second server to the client and generating corresponding allocation information includes:
and distributing a target second server for the client according to the service identifier, and generating corresponding distribution information.
Optionally, the cross-server login request further includes: user information of the client;
the allocating a target second server to the client comprises:
and distributing a target second server to the client according to the service identifier and the user information.
Optionally, the method further includes:
acquiring the load state of the at least one second server;
the allocating a target second server to the client according to the service identifier includes:
and determining a target second server which is configured with the service corresponding to the service identifier and has a load state meeting a preset condition in the at least one second server.
A third aspect of an embodiment of the present invention provides a method for game server communication, which is applied to a game service system, where the game service system includes: the system comprises a first server, at least one second server and at least one third server; the method comprises the following steps:
the first server receives a cross-server login request sent by a client communicating with the first server, wherein the cross-server login request at least comprises a service identifier;
the first server sends the cross-server login request to the third server;
the third server distributes a target second server for the client and generates corresponding distribution information;
the third server sends the allocation information to the first server;
the first server receives the distribution information sent by the third server;
the first server sends the allocation information to the client to instruct the client to communicate with the target second server.
A fourth aspect of the embodiments of the present invention provides a game server communication apparatus, which is applied to a first server of a game service system, where the game service system further includes: at least one second server and at least one third server, the apparatus comprising:
a first receiving module, configured to receive a cross-server login request sent by a client that communicates with the first server, where the cross-server login request at least includes a service identifier;
the first sending module is used for sending the cross-server login request to the third server so as to distribute a target second server for the client through the third server and generate corresponding distribution information;
a second receiving module, configured to receive the allocation information sent by the third server;
and the second sending module is used for sending the distribution information to the client so as to indicate the client to communicate with the target second server.
Optionally, the first sending module is specifically configured to: and determining a target second server configured with the service corresponding to the service identifier in the at least one second server through the third server, and generating the distribution information according to the number of the target second server.
Optionally, the determining, by the third server, a target second server configured with a service corresponding to the service identifier in the at least one second server includes: and the third server determines a target second server which is configured with the service corresponding to the service identifier and has a load state meeting a preset condition in the at least one second server.
Optionally, the target second server is allocated to the client by the third server according to the service identifier and the user information.
Optionally, the cross-server login request further includes: user information of the client; and the target second server allocates a target second server to the client for the third server according to the service identifier and the user information.
Optionally, the user information includes at least one of:
and the client corresponds to the attribute information of the user account, the operating system, the region and the language.
Optionally, different service resources are configured on the first server and the second server.
Optionally, the method further includes:
and the disconnection module is used for disconnecting the communication connection with the client.
A fifth aspect of an embodiment of the present invention provides a game server communication device, which is applied to a third server of a game service system, where the game service system further includes: a first server and at least one second server, the apparatus comprising:
the receiving module is used for receiving a cross-server login request sent by the first server, wherein the cross-server login request comprises a service identifier;
the distribution module is used for distributing a target second server for the client and generating corresponding distribution information;
a sending module, configured to send the allocation information to the first server, where the allocation information is used to instruct the client to communicate with the target second server.
Optionally, the allocation module is specifically configured to:
and distributing a target second server for the client according to the service identifier, and generating corresponding distribution information.
Optionally, the cross-server login request further includes: user information of the client;
the allocation module is specifically further configured to:
and distributing a target second server to the client according to the service identifier and the user information.
Optionally, the method further includes:
an obtaining module, configured to obtain a load status of the at least one second server;
the allocation module is specifically further configured to:
and determining a target second server which is configured with the service corresponding to the service identifier and has a load state meeting a preset condition in the at least one second server.
A sixth aspect of an embodiment of the present invention provides a game server communication system, where the game service system includes: a first server, at least one second server, and at least one third server, wherein,
the first server is used for receiving a cross-server login request sent by a client communicating with the first server, wherein the cross-server login request at least comprises a service identifier;
the first server is further used for sending the cross-server login request to the third server;
the third server is used for distributing a target second server for the client and generating corresponding distribution information;
the third server is further configured to send the allocation information to the first server;
the first server is further used for receiving the distribution information sent by the third server;
the first server is further configured to send the allocation information to the client to instruct the client to communicate with the target second server.
A seventh aspect of the embodiments of the present invention provides an electronic device, including: a processor, a memory, and a computer program; wherein the computer program is stored in the memory and configured to be executed by the processor, the computer program comprising instructions for performing the method of any of the preceding first aspects.
An eighth aspect of the embodiments of the present invention provides an electronic device, including: a processor, a memory, and a computer program; wherein the computer program is stored in the memory and configured to be executed by the processor, the computer program comprising instructions for performing the method of any of the preceding second aspects.
A ninth aspect of embodiments of the present invention provides a computer-readable storage medium, which stores a computer program that, when executed, implements a method according to any one of the preceding first aspects.
A tenth aspect of embodiments of the present invention provides a computer-readable storage medium, storing a computer program which, when executed, implements a method according to any one of the preceding second aspects.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a method and a device for game server communication, which are applied to a game service system.A first server in communication with a client receives a cross-server login request which is sent by the client and comprises a service identifier, and can send the cross-server login request to a third server, so that the third server can distribute a target second server for the client according to the cross-server login request and generate corresponding distribution information; further, the first server may send allocation information to the client, the allocation information being used to instruct the client to communicate with information of the target second server. That is, in the embodiment of the present invention, an independent game service can be set in the second server, thereby implementing flexible setting of the game service on the second server and providing richer services for users; and when users in different regions, languages or platforms need to realize the service, the third server can allocate a target second server for realizing the service to the users only through the communication process, and then the users can realize the corresponding game service through the connection with the target second server. In the embodiment of the invention, through the arrangement, the users in different regions, languages, platforms or the like can realize the intercommunication of corresponding game services based on the connection between the game client and the second server. In addition, the third server is only responsible for the allocation of the second server according to the cross-server login request of the user as an intermediate server, so that the load of the game server (namely, the first server) is reduced.
Detailed Description
The technical solutions in the embodiments of the present invention will be 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 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.
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
It should be understood that the described embodiments are only some embodiments of the invention, and not all 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.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It is to be understood that the terms "first," "second," "third," "fourth," and the like (if any) in the description and claims of this invention and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.
Generally, because servers are limited by their own load, regional factors, operators or channels, and the like, most of multiplayer online games have multiple groups of servers simultaneously set up during online operation to meet different regional requirements, or increase the number of online players that can be accommodated simultaneously in the game, and the like, for example, as shown in fig. 1, a general server architecture diagram for providing services to game players is shown, where a game player may be a user playing a game based on a mobile terminal, a game host, or a PC terminal, but game players among the groups of servers cannot intercommunicate without any interaction, and game players on different server groups (or clusters) cannot intercommunicate to realize simultaneous games.
The game players on different server groups are difficult to intercommunicate to realize simultaneous game, often because data among different servers are not intercommunicated or technical difficulties are faced in realization. Specifically, for example, games are often restricted by territories, laws, copyrights, or the like, so that flexible communication is not possible between players logged in servers of different territories.
In the embodiment of the invention, all services of a game are usually distributed in the same server or a group of servers in the game, so that flexible communication cannot be realized among the servers as long as limited services exist in the game. Therefore, in the embodiment of the invention, the game is divided at a business level, the business which can realize the intercommunication of the multiple servers is extracted from the game, and the extracted business is deployed in the universal server, so that when the game player plays the game, the universal server can be used for providing corresponding services for the game players in different areas. For example, even if a plurality of game players are on different groups of servers across the country, the game players can share the same server for playing, and since the extracted service provides the same service for all the game players, the extraction of the game service is beneficial to the design of the whole game system except for the service related to the original server, so that the game system can provide the same service for users with different sources without distinguishing the sources of the game players, and is beneficial to server expansion.
Specifically, the embodiment of the invention provides a method and a device for game server communication, which are applied to a game service system, wherein a first server in communication with a client in the system receives a cross-server login request which is sent by the client and comprises a service identifier, and can send the cross-server login request to a third server, so that the third server can allocate a target second server to the client according to the cross-server login request and generate corresponding allocation information; further, the first server may send allocation information to the client, the allocation information being used to instruct the client to communicate with information of the target second server. That is, in the embodiment of the present invention, an independent game service can be set in the second server, thereby implementing flexible setting of the game service on the second server and providing richer services for users; and when users in different regions, languages or platforms need to realize the service, the third server can allocate a target second server for realizing the service to the users only through the communication process, and then the users can realize the corresponding game service through the connection with the target second server. In the embodiment of the invention, through the arrangement, the users in different regions, languages, platforms or the like can realize the intercommunication of corresponding game services based on the connection between the game client and the second server. In addition, the third server is only responsible for the allocation of the second server according to the cross-server login request of the user as an intermediate server, so that the load of the game server (namely, the first server) is reduced.
The service provided in the second server in the embodiment of the present invention may be a general service suitable for pull-out, which is not limited by regions, laws, or copyrights in the game. Accordingly, the service in the first server described in the embodiment of the present invention may be a limited, non-universal service, and a service that is not suitable for pull-away. For example, in the case of a battle game, the service in the first server may be a fee-based service (since the fee is often limited differently by an agent, etc.), and the service in the second server may be a battle service in the game, a chat service, etc. It can be understood that, in an actual application scenario, specific service contents of the service in the first server and the service in the second server may be set according to the actual application scenario, which is not specifically limited in this embodiment of the present invention.
The first server in the embodiment of the present invention may be a server that communicates with a client of a user, for example, the user may perform operations such as login in the first server.
The third server in the embodiment of the present invention may be used to allocate an intermediate server of the target second server to the first server, and the third server may be a logic module, a hardware circuit, or the like to implement the function of the third server.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
As shown in fig. 2, fig. 2 is a schematic flowchart of a game server communication method according to an embodiment of the present invention. A first server applied to a game service system, the game service system further comprising: at least one second server(s), and at least one third server. The method specifically comprises the following steps:
step S101: and receiving a cross-server login request sent by a client communicating with the first server, wherein the cross-server login request at least comprises a service identifier.
In the embodiment of the invention, a user can log in a first server through a client, and after the login is successful, a cross-server login request can be sent to the first server, wherein the cross-server login request at least comprises a service identifier. The service identifier corresponds to a service to be responded, the service corresponding to the service identifier may be set in the second server, and the service identifier may be used to indicate which type of second server the client will subsequently connect or log in.
Step S102: and sending the cross-server login request to the third server so as to distribute a target second server for the client through the third server and generate corresponding distribution information.
In the embodiment of the present invention, the first server may forward the cross-server login request including the service identifier to the third server, and the third server may allocate, to the user, the target second server provided with the service corresponding to the service identifier according to the service identifier. The third server may generate allocation information for identifying the target second server, for example, the allocation information may include a server identifier of the target second server, and the like, so that the subsequent client may implement a service corresponding to the service identifier based on the service provided by the second server.
In an optional implementation manner, the third server determines, in the at least one second server, a target second server configured with a service corresponding to the service identifier, and generates the allocation information according to a number of the target second server.
In the embodiment of the present invention, the third server may match the service identifier with the identifier of the service in the one or more second servers, thereby obtaining the target second server configured with the service corresponding to the service identifier, and generate the allocation information according to the number of the target server.
In an optional implementation manner, the third server may further obtain a load status of the at least one target second server. The third server determining, in the at least one second server, a target second server configured with a service corresponding to the service identifier, including: and the third server determines a target second server which is configured with the service corresponding to the service identifier and has a load state meeting a preset condition in the at least one second server.
In this embodiment of the present invention, the load status may be embodied as an application resource status of the second server, for example, an idle status of a Central Processing Unit (CPU) configured on the second server, or a memory occupation ratio. In a specific implementation, there may be a plurality of second servers configured with the service corresponding to the service identifier, and therefore, the third server may select, as the target second server, a second server whose load state satisfies a preset condition, for example, a server in an idle state or a second server whose current memory proportion is lower than a preset threshold (which may be adaptively set according to an actual application scenario) may be selected as the target second server, so that the target second server may subsequently implement a better service.
In an optional implementation manner, the method further includes: acquiring user information of the client;
and the target second server is distributed to the client by the third server according to the service identifier and the user information.
In the embodiment of the invention, the user information of the client can be acquired by the first server, and the acquisition by the first server has higher security than the self-transmission by the client in consideration of data security. It is to be understood that, in practical applications, the cross-server login request may also be sent to the first server by the client, for example, the cross-server login request further includes: user information of the client; the embodiment of the present invention is not particularly limited thereto.
Optionally, the user information includes at least one of: and the client corresponds to the attribute information of the user account, the operating system, the region and the language.
For example, the user account attribute information corresponding to the client may include a nickname, a gender, a role type, an equipment prop, a decoration prop, and the like of the user account, the operating system or the platform may be an iOS system or an android system, an App Store based on the iOS system, or various game download platforms such as Google Play based on the android system, and the like, the region may be obtained according to the location of the client, and the language may be a corresponding setting of the user in creating the account, and the like, which is not specifically limited in this embodiment of the present invention.
In the embodiment of the invention, the third server can select the adaptive target second server for the user according to the region where the client is located, the used language and the like, so that the target second server can provide better service for the user.
Step S103: and receiving the distribution information sent by the third server.
In the embodiment of the present invention, after determining the target second server, the third server sends, to the first server, allocation information including information of the target second server, where the information of the target second server may be, for example, address information, identification information, and the like of the target second server, so that a client connected to the first server may implement communication with the target second server through the allocation information.
Step S104: sending the allocation information to the client to instruct the client to communicate with the target second server.
In the embodiment of the present invention, the first server may forward the allocation information to the client, and the user may implement the service corresponding to the service identifier based on the communication with the target second server.
In the embodiment of the present invention, the communication method between the first server and the third server, the communication method between the first server and the client, and the communication method between the client and the second server may all adopt any existing communication form, and the embodiment of the present invention is not particularly limited in this respect.
Optionally, after the first server sends the allocation information to the client, because the client implements the corresponding service based on the target second server, the first server may disconnect the communication connection with the client, so that the communication resource of the first server may be saved.
Optionally, different service resources are configured on the first server and the second server. Exemplarily, a service resource corresponding to a first service is configured in a first server, and a service resource corresponding to a second service is configured in a second server, the method of the embodiment of the present invention further includes: the first server receives a message sent by the client, wherein the message comprises the user information and an identifier of a first service; the first server is in communication with the client for implementing the first service.
In the embodiment of the present invention, the first service is a service that is not extracted from a game, and differences may exist in the first services in different regions, so that a service resource of the first service is set in the first server, and when a client requests to implement the first service, a message including user information and an identifier of the first service may be sent to the first server, and then the client may implement the first service based on communication with the first server.
In summary, the embodiments of the present invention provide a method and an apparatus for game server communication, which are applied to a game service system, in which a first server in communication with a client receives a cross-server login request including a service identifier sent by the client, and can send the cross-server login request to a third server, and then the third server can allocate a target second server to the client according to the cross-server login request, and generate corresponding allocation information; further, the first server may send allocation information to the client, the allocation information being used to instruct the client to communicate with information of the target second server. That is, in the embodiment of the present invention, an independent game service can be set in the second server, thereby implementing flexible setting of the game service on the second server and providing richer services for users; and when users in different regions, languages or platforms need to realize the service, the third server can allocate a target second server for realizing the service to the users only through the communication process, and then the users can realize the corresponding game service through the connection with the target second server. In the embodiment of the invention, through the arrangement, the users in different regions, languages, platforms or the like can realize the intercommunication of corresponding game services based on the connection between the game client and the second server. In addition, the third server is only responsible for the allocation of the second server according to the cross-server login request of the user as an intermediate server, so that the load of the game server (namely, the first server) is reduced.
Fig. 3 is another flowchart of a method for game server communication according to an embodiment of the present invention. A third server applied to a game service system, the game service system further comprising: as shown in fig. 3, the method for communication between a first server and at least one second server provided by the present invention may specifically include:
step S201: and receiving a cross-server login request sent by the first server, wherein the cross-server login request comprises a service identifier.
Step S202: and allocating a target second server for the client and generating corresponding allocation information.
Step S203: sending the allocation information to the first server, wherein the allocation information is used for indicating the client to communicate with the target second server.
Different from the embodiment corresponding to fig. 2, in the embodiment of the present invention, a third server is taken as an execution subject, and it can be understood that, when each method step is executed, in the embodiment corresponding to fig. 2, a step of sending to the third server corresponds to a step of receiving by the third server in the embodiment of the present invention, and a step of receiving content by the third server corresponds to a step of sending by the third server in the embodiment of the present invention, which is specifically implemented similar to the embodiment corresponding to fig. 2, and the obtained effect is similar to the embodiment corresponding to fig. 2, and is not described again.
The embodiment of the invention provides a method and a device for game server communication, which are applied to a game service system.A first server in communication with a client receives a cross-server login request which is sent by the client and comprises a service identifier, and can send the cross-server login request to a third server, so that the third server can distribute a target second server for the client according to the cross-server login request and generate corresponding distribution information; further, the first server may send allocation information to the client, the allocation information being used to instruct the client to communicate with information of the target second server. That is, in the embodiment of the present invention, an independent game service can be set in the second server, thereby implementing flexible setting of the game service on the second server and providing richer services for users; and when users in different regions, languages or platforms need to realize the service, the third server can allocate a target second server for realizing the service to the users only through the communication process, and then the users can realize the corresponding game service through the connection with the target second server. In the embodiment of the invention, through the arrangement, the users in different regions, languages, platforms or the like can realize the intercommunication of corresponding game services based on the connection between the game client and the second server. In addition, the third server is only responsible for the allocation of the second server according to the cross-server login request of the user as an intermediate server, so that the load of the game server (namely, the first server) is reduced.
For example, the service in the first server is a paid service, and the service in the second server is a combat service. As shown in fig. 4, a particular game application scenario is shown.
As shown in fig. 4, the first server cluster may include the first server 1, the first server 2, and the first server 3 of the area 1, and the first server 1, the first server 2, and the first server 3 of the area 2. The second server cluster may include a second server 1, a second server 2, and a second server 3. The third server may be in communication with both the first cluster of servers and the second cluster of servers. By pulling out the "combat" function in the game and deploying the combat function separately in the second cluster of servers to serve players, players from both zone 1 and zone 2 can be collectively engaged in combat based on the assignment of a third server to be commonly connected to the set of second clusters of servers.
When the same service is extracted, the entry function related to the corresponding function also needs to be extracted. And, when the specific implementation is implemented, the second service of the pull-out may be adaptively adjusted according to the actual situation of the game, for example, the result of the pull-out is a "battle" function, and the battle function includes many sub-functions, such as battle playing in battle, available hero, etc., because these sub-functions in the game may be influenced and restricted by political, cultural, and planned delivery plans, therefore, the speech of the game player may be filtered by different sensitive words according to the actual application scenario and the source of the game player; and different heroes and playing methods can be put in according to the composition condition of the same game player.
In an alternative implementation, as shown in FIG. 5, another specific game application scenario is shown. Unlike the gaming application scenario of fig. 4, in the application scenario of fig. 5, the second server cluster is further distinguished, the exemplary second server cluster area a includes the second server 1 and the second server 2 of the area a, and the second server cluster area B includes the second server 1 and the second server 2 of the area B.
In this embodiment, grouping the second server clusters can solve the problem of high physical delay caused by the second server being too far away from the first server, or solve the problem of cost or availability. For example, when the game user a is closer to the second server 1 of the second server cluster area a and the game user B is closer to the second server 1 of the second server cluster area B, the third server may preferentially allocate the second server 1 of the second server cluster area a to the game user a and preferentially allocate the second server 1 of the second server cluster area B to the game user B, so that the physical delay caused by too far distance between the second server and the first server may be avoided. For another example, the availability of the second servers of different groups is different, and the higher the cost, the better the availability of the second server group, so that one group of high-availability second servers and multiple groups of low-availability but low-cost second servers can be set according to specific situations, when the third server selects the second server group, the game player with high payment can be preferentially distributed to the high-availability servers, and the like.
It can be understood that, in the implementation application, the second servers may also be grouped in other ways according to the actual application scenario, which is not specifically limited in this embodiment of the present invention.
In summary, the embodiments of the present invention provide a method and an apparatus for game server communication, which are applied to a game service system, in which a first server in communication with a client receives a cross-server login request including a service identifier sent by the client, and can send the cross-server login request to a third server, and then the third server can allocate a target second server to the client according to the cross-server login request, and generate corresponding allocation information; further, the first server may send allocation information to the client, the allocation information being used to instruct the client to communicate with information of the target second server. That is, in the embodiment of the present invention, an independent game service can be set in the second server, thereby implementing flexible setting of the game service on the second server and providing richer services for users; and when users in different regions, languages or platforms need to realize the service, the third server can allocate a target second server for realizing the service to the users only through the communication process, and then the users can realize the corresponding game service through the connection with the target second server. In the embodiment of the invention, through the arrangement, the users in different regions, languages, platforms or the like can realize the intercommunication of corresponding game services based on the connection between the game client and the second server. In addition, the third server is only responsible for the allocation of the second server according to the cross-server login request of the user as an intermediate server, so that the load of the game server (namely, the first server) is reduced.
Fig. 6 is a schematic structural diagram of an embodiment of a game server communication apparatus provided in the present invention. A first server applied to a game service system, the game service system further comprising: at least one second server and at least one third server. As shown in fig. 6, the game server communication apparatus provided in the present embodiment includes:
afirst receiving module 31, configured to receive a cross-server login request sent by a client in communication with the first server, where the cross-server login request includes at least a service identifier;
afirst sending module 32, configured to send the cross-server login request to the third server, so as to allocate a target second server to the client through the third server, and generate corresponding allocation information;
asecond receiving module 33, configured to receive the allocation information sent by the third server;
asecond sending module 34, configured to send the allocation information to the client to instruct the client to communicate with the target second server.
Optionally, the first sending module is specifically configured to: and determining a target second server configured with the service corresponding to the service identifier in the at least one second server through the third server, and generating the distribution information according to the number of the target second server.
Optionally, the determining, by the third server, a target second server configured with a service corresponding to the service identifier in the at least one second server includes: and the third server determines a target second server which is configured with the service corresponding to the service identifier and has a load state meeting a preset condition in the at least one second server.
Optionally, the target second server is allocated to the client by the third server according to the service identifier and the user information.
Optionally, the cross-server login request further includes: user information of the client; and the target second server allocates a target second server to the client for the third server according to the service identifier and the user information.
Optionally, the user information includes at least one of:
and the client corresponds to the attribute information of the user account, the operating system, the region and the language.
Optionally, different service resources are configured on the first server and the second server.
Optionally, the method further includes:
and the disconnection module is used for disconnecting the communication connection with the client.
To sum up, the method is applied to a game service system, in the system, a first server which is communicated with a client receives a cross-server login request which is sent by the client and comprises a service identifier, and can send the cross-server login request to a third server, so that the third server can allocate a target second server to the client according to the cross-server login request and generate corresponding allocation information; further, the first server may send allocation information to the client, the allocation information being used to instruct the client to communicate with information of the target second server. That is, in the embodiment of the present invention, an independent game service can be set in the second server, thereby implementing flexible setting of the game service on the second server and providing richer services for users; and when users in different regions, languages or platforms need to realize the service, the third server can allocate a target second server for realizing the service to the users only through the communication process, and then the users can realize the corresponding game service through the connection with the target second server. In the embodiment of the invention, through the arrangement, the users in different regions, languages, platforms or the like can realize the intercommunication of corresponding game services based on the connection between the game client and the second server. In addition, the third server is only responsible for the allocation of the second server according to the cross-server login request of the user as an intermediate server, so that the load of the game server (namely, the first server) is reduced.
Fig. 7 is a schematic structural diagram of an embodiment of a game server communication apparatus provided in the present invention. A third server applied to a game service system, the game service system further comprising: a first server and at least one second server, the apparatus comprising:
a receivingmodule 41, configured to receive a cross-server login request sent by the first server, where the cross-server login request includes a service identifier;
thedistribution module 42 is configured to distribute the target second server to the client and generate corresponding distribution information;
a sendingmodule 43, configured to send the allocation information to the first server, where the allocation information is used to instruct the client to communicate with the target second server.
Optionally, the allocation module is specifically configured to:
and distributing a target second server for the client according to the service identifier, and generating corresponding distribution information.
Optionally, the cross-server login request further includes: user information of the client;
the allocation module is specifically further configured to:
and distributing a target second server to the client according to the service identifier and the user information.
Optionally, the method further includes:
an obtaining module, configured to obtain a load status of the at least one second server;
the allocation module is specifically further configured to:
and determining a target second server which is configured with the service corresponding to the service identifier and has a load state meeting a preset condition in the at least one second server.
In summary, the embodiments of the present invention provide a method and an apparatus for game server communication, which are applied to a game service system, in which a first server in communication with a client receives a cross-server login request including a service identifier sent by the client, and can send the cross-server login request to a third server, and then the third server can allocate a target second server to the client according to the cross-server login request, and generate corresponding allocation information; further, the first server may send allocation information to the client, the allocation information being used to instruct the client to communicate with information of the target second server. That is, in the embodiment of the present invention, an independent game service can be set in the second server, thereby implementing flexible setting of the game service on the second server and providing richer services for users; and when users in different regions, languages or platforms need to realize the service, the third server can allocate a target second server for realizing the service to the users only through the communication process, and then the users can realize the corresponding game service through the connection with the target second server. In the embodiment of the invention, through the arrangement, the users in different regions, languages, platforms or the like can realize the intercommunication of corresponding game services based on the connection between the game client and the second server. In addition, the third server is only responsible for the allocation of the second server according to the cross-server login request of the user as an intermediate server, so that the load of the game server (namely, the first server) is reduced.
The game server communication device provided by each embodiment of the present invention can be used to execute the method shown in each corresponding embodiment, and the implementation manner and principle thereof are the same, and are not described again.
An embodiment of the present invention further provides an electronic device, including: a processor, a memory, and a computer program; wherein the computer program is stored in the memory and configured to be executed by the processor, the computer program comprising instructions for performing the method of any of the preceding embodiments.
Embodiments of the present invention also provide a computer-readable storage medium, which stores a computer program, and when the computer program is executed, the computer program implements the method according to any one of the foregoing embodiments.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.