Server allocation method and device, computing equipment, storage medium and program product
By setting group indexes in the central server and resource server, resource allocation is performed according to the client's target group index and load status, the problems of resource non-interoperability and high performance consumption in multi-server environments are solved, and the system response speed and service quality are improved , optimized resource utilization.
Patent Information
- Application Number
- CN202411501887.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2024-12-20
AI Technical Summary
In the multi-server environment, the frequent switching of login or interaction behavior of users leads to excessive system performance consumption, reduced response speed and service quality, and poor resource utilization, making it difficult to deal with insufficient or oversupply of resources caused by changes in the number of users.
By setting group indexes in the central server and multiple resource servers, determining the target resource server based on the target group index of the client, and allocating resources based on the load status and preset thresholds, the sharing of resource servers and cross-group resources are realized. Management to reduce communication overhead.
It improves the system response speed and service quality, optimizes the overall performance and user experience, avoids resource waste and operation and maintenance management difficulties, and realizes the rational allocation and utilization of resources.
Smart Images

Figure CN119172386A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of Internet technology, and in particular to a server allocation method and apparatus, a computing device, a storage medium, and a program product. Background Art
[0002] With the development of science and technology, distributed systems have been widely used in many fields. In order to ensure the efficient operation of the system and the rational use of resources, higher requirements are placed on the load balancing and resource management of the server.
[0003] Currently, scalable server structures usually combine multiple servers into a group. Each group shares resources, but resources between groups are not interoperable. This structure responds to changes in the number of users by independently managing the life cycle of each group of servers. In order to cope with peak load pressure, it is usually necessary to pre-configure more server resources to cope with sudden traffic at any time.
[0004] However, the above technical solution has obvious drawbacks in practical application. In a multi-server environment, users frequently switch logins or interact between servers, which will lead to excessive consumption of the overall system performance. Especially when the number of users changes greatly, the communication overhead between servers increases, which seriously affects the response speed and service quality of the system. At the same time, such frequent resource switching and transfer between servers will also lead to a decrease in system resource utilization, making some servers idle when the number of users is small, and facing insufficient resources when the number of users is large, which increases the difficulty of operation and maintenance management. Therefore, a server allocation method is urgently needed to solve the shortcomings of the existing technical solutions. Summary of the invention
[0005] In view of this, an embodiment of this specification provides a server allocation method. One or more embodiments of this specification also relate to a server allocation device, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.
[0006] According to a first aspect of an embodiment of the present specification, a server allocation method is provided, which is applied to a central server in a target server cluster, wherein the target server cluster further includes a plurality of resource servers, and any resource server is preset with at least one group index, including: receiving a server allocation request sent by a client, wherein the server allocation request carries a target group index of a target group to which the client belongs; Determine a corresponding target resource server from multiple resource servers according to the target group index; The target resource server is returned to the client, so that the client executes the target task on the target resource server.
[0007] Optionally, determining a corresponding target resource server from a plurality of resource servers according to the target group index includes: Determining, according to the target group index, a first resource server belonging to the target group from a plurality of resource servers; According to the load status of each first resource server, a corresponding target resource server is determined from each first resource server.
[0008] Optionally, determining a corresponding target resource server from each first resource server according to a load status of each first resource server includes: Comparing the load status of each first resource server with a preset load threshold; A target resource server whose load status does not exceed a preset load threshold is determined from each of the first resource servers.
[0009] Optionally, after comparing the load status of each first resource server with a preset load threshold, the method further includes: When the load status of each first resource server exceeds a preset load threshold, determining a second resource server that does not belong to the target group from the plurality of resource servers; A target resource server whose load status does not exceed a preset load threshold is determined from each second resource server.
[0010] Optionally, after returning the target resource server to the client, the method further includes: receiving a server adjustment request sent by a client, wherein the server adjustment request is generated when a target scene requested by the client is not found on a target resource server, and the server adjustment request carries a target scene identifier of the target scene; Determine a backup resource server from multiple resource servers according to the target scenario identifier; The backup resource server is returned to the client, so that the client executes the target scenario task related to the target scenario on the backup resource server.
[0011] Optionally, the server adjustment request also carries a target group index of the target group to which the client belongs; According to the target scenario identifier, a backup resource server is determined from multiple resource servers, including: Determining, according to the target group index, a first resource server belonging to the target group from a plurality of resource servers; According to the target scenario identifier, querying from each first resource server whether there is a resource server that includes the target scenario; If so, the resource server is determined to be a backup resource server.
[0012] Optionally, after querying, according to the target scenario identifier, whether there is a resource server including the target scenario from each first resource server, the method further includes: If not, comparing the load status of each first resource server with a preset load threshold; A backup resource server whose load status does not exceed a preset load threshold is determined from each first resource server, and a target scenario is added to the backup resource server.
[0013] Optionally, after comparing the load status of each first resource server with a preset load threshold, the method further includes: When the load status of each first resource server exceeds a preset load threshold, determining a second resource server that does not belong to the target group from the plurality of resource servers; A backup resource server whose load status does not exceed a preset load threshold is determined from each second resource server, and a target scenario is added to the backup resource server.
[0014] According to a second aspect of an embodiment of the present specification, a server allocation device is provided, which is applied to a central server in a target server cluster, wherein the target server cluster further comprises a plurality of resource servers, and any resource server is preset with at least one group index, including: A receiving module is configured to receive a server allocation request sent by a client, wherein the server allocation request carries a target group index of a target group where the client is located; A determination module is configured to determine a corresponding target resource server from a plurality of resource servers according to a target group index; The return module is configured to return the target resource server to the client, so that the client executes the target task on the target resource server.
[0015] According to a third aspect of an embodiment of this specification, a computing device is provided, including: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above-mentioned server allocation method are implemented.
[0016] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the above-mentioned server allocation method are implemented.
[0017] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instruction, which implements the steps of the above-mentioned server allocation method when executed by a processor.
[0018] An embodiment of the present specification implements a server allocation method, which is applied to a central server in a target server cluster, wherein the target server cluster also includes multiple resource servers, and any resource server is preset with a group index of at least one group, including: receiving a server allocation request sent by a client, wherein the server allocation request carries a target group index of the target group to which the client belongs; determining a corresponding target resource server from multiple resource servers according to the target group index; and returning the target resource server to the client so that the client performs a target task on the target resource server. By constructing a server cluster including a central server and multiple resource servers, and determining the target resource server according to the target group index carried in the server allocation request sent by the client, sharing of each resource server is achieved, and cross-group resource management between groups is achieved. While solving the problem of excessive performance consumption caused by the non-intercommunication of resources between groups in the server structure and the need for users to frequently switch between servers, the communication overhead between servers is reduced, the response speed and service quality of the system are improved, and the performance and user experience of the overall system are optimized. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a schematic diagram of an extensible server group structure; Figure 2 is a schematic diagram of a shared server group structure provided by an embodiment of this specification; Figure 3 is a flow chart of a server allocation method provided by an embodiment of this specification; Figure 4 It is a flow chart of a server allocation method provided by an embodiment of this specification; Figure 5 It is a flow chart of a server adjustment method provided by an embodiment of this specification; Figure 6 This is a schematic diagram of different groups of clients requesting the same resource server provided by an embodiment of this specification; Figure 7 is a processing flow chart of a server allocation method provided by an embodiment of this specification; Figure 8 It is a structural schematic diagram of a server allocation device provided by an embodiment of this specification; Fig. 9 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0020] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0021] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0022] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0023] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0024] First, the terms involved in one or more embodiments of this specification are explained.
[0025] Scalable Server Architecture: Scalable Server Architecture refers to a server architecture designed to support future growth, changes, or expansion needs. This architecture allows the number of users to change or load fluctuations to be accommodated by increasing or decreasing server resources without interrupting service. In the application scenario of game servers, the scalable server architecture aims to flexibly adjust resources according to the increase or decrease in the number of players to maintain a good user experience and service stability.
[0026] Server Cluster: A server cluster is an architecture consisting of multiple servers working together to improve the availability, reliability and performance of the system. In a server cluster, the central server is responsible for managing and scheduling resource servers within the cluster to ensure that requests can be processed efficiently. Resource servers are responsible for performing specific tasks or services. Server clusters can provide dynamic expansion capabilities, that is, automatically increase or decrease the number of resource servers according to the current load conditions, thereby optimizing resource usage.
[0027] Central Server: The Central Server is the core management unit in the server cluster, responsible for coordinating and managing all resource servers in the entire cluster. It mainly undertakes tasks such as scheduling, management, and monitoring. In a multi-server architecture, the Central Server is responsible for maintaining the status information of the cluster, such as the load status of each resource server, group division, etc., while also receiving client requests, allocating the best resource server according to the specific requirements of the request, and ensuring that the resources in the cluster can be reasonably used.
[0028] Resource Server: Resource Servers are service units that specifically execute client requests. They provide the actual functions or services required by clients. In a cluster, resource servers can be game servers that provide game services, data servers that store data, or other types of servers. Each resource server may be divided into different groups, with specific functions or loads, and handle client requests according to the scheduling instructions of the central server.
[0029] Scene: Scene refers to the specific situation or setting experienced when using various services provided by the server. In the field of game development, scene usually refers to a specific environment in the game world or a component of the game.
[0030] Currently, a scalable server group structure usually combines multiple resource servers into one group. Figure 1 A schematic diagram of an extensible server group structure is shown. Figure 1 As shown: For each group, each resource server in the group is a dedicated resource server for the group, and resource servers between groups are not shared, and data transmission is not interoperable. The advantage of this structure is that when the number of clients on the servers in each group changes, it is easier to manage the resource servers of each group independently. However, when such a server structure needs to perform operations such as cross-group resource server requests, data migration, and resource calls, it is impossible to directly perform data interaction and resource sharing between groups. It is often necessary to build additional servers to migrate data, which will cause the overall performance of the system to be too high. Especially when the number of clients changes greatly, the communication overhead of the server components will increase sharply, which seriously affects the response speed and service quality of the system and increases the difficulty of operation and maintenance management.
[0031] In response to the above problem, an embodiment of this specification provides a shared server group structure. Figure 2 A schematic diagram of a shared server group structure provided by an embodiment of this specification is shown. Figure 2 As shown: The shared server group includes a central server and multiple resource servers. By adding group indexes on each resource server, different groups can share and manage the resource servers. Clients in different groups can share the same resource server. At the same time, the scene management and client load that originally needed to be completed by the group management server are concentrated in the central server, and an overlapping and inert group strategy is used on the central server to manage the resource servers in each group. That is, the central server will not actively manage the data and allocation of all resource servers, but will only allocate resource servers when a client needs to request a resource server and sends a request to the central server. The advantage of such a shared server structure is that servers in different groups can share resources at the same time, which facilitates the interactive transmission of data between groups, reduces communication overhead, and still maintains group management of clients, thereby being able to reasonably allocate and utilize system resources, avoiding unreasonable resource utilization caused by too many or too few clients, and improving the user experience.
[0032] In this specification, a server allocation method is provided. This specification also relates to a server allocation device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0033] See also Figure 3 , Figure 3A flow chart of a server allocation method provided according to an embodiment of the present specification is shown, wherein the server allocation method is applied to a central server in a target server cluster, the target server cluster also includes multiple resource servers, and any resource server is preset with at least one grouping index. The server allocation method specifically includes the following steps.
[0034] Step 302: Receive a server allocation request sent by the client, wherein the server allocation request carries a target group index of the target group where the client is located.
[0035] The server cluster includes a central server and multiple resource servers, and the central server is used to manage each resource server. Optionally, the central server manages the resource servers in a grouping manner, and by setting at least one grouping index on each resource server, different resource servers are divided into different groups.
[0036] The group index is the index identifier of the group to which each resource server belongs, and is used to manage each resource server in groups. The group index can be set according to the functions of different groups, such as scene resource server group, client data resource server group, data transmission resource server group; it can also be set according to different regions, such as XX Province 1 Service Resource Server Group, XX Province 2 Service Resource Server Group, etc. In actual applications, the group index can be set according to different needs, and this manual does not make specific restrictions on this.
[0037] Optionally, the central server manages the resource servers in each group through overlapping inert group policies. The inert group policy is reflected in that the central server will not actively manage the data and allocation of resource servers in the server cluster, but will only allocate and manage resource servers when a client needs to request a resource server and sends a request to the central server. The overlapping policy is reflected in that at least one group group index is preset in any resource server, that is, any resource server can belong to multiple different groups and be shared and managed by different groups.
[0038] For example, in the application of the game field, a server cluster can be built for a game project, including a central server for managing various resource servers. Each resource server is preset with at least one group index, and the central server manages the resource servers in groups through the group index.
[0039] When the client needs to request a target resource server, it will send a server allocation request to the central server. The server allocation request will carry the group index of the target group to which the client belongs. The target group to which the client belongs is determined when the client is created in the server cluster of the project. For example, in the game field application, when client A is created in the server cluster of game project X, it selects the resource server group of XX province 1 service. Then the server allocation request sent by client A will carry the group index of the resource server group of XX province 1 service. Optionally, the server allocation request will also carry the client's IP address, client name, client verification code and other information, which is used by the central server to determine the client's identity information and whether the sent server allocation request is normal.
[0040] The central server receives the server allocation request sent by the client, obtains the target group index carried in the server allocation request, determines the group of the client, and provides a query basis for subsequent query of the target resource server.
[0041] Step 304: Determine a corresponding target resource server from multiple resource servers according to the target group index.
[0042] The target resource server is a resource server corresponding to the group index of the group to which the client belongs, and is used for the client to execute the target task.
[0043] According to the target group index carried in the allocation request, a resource server carrying the target group index among multiple resource servers is determined, that is, a resource server in the same group as the client, and the target resource server is determined from them. The target resource server can be determined by random allocation, according to the load status of each resource server, according to the target task to be performed by the client, etc., and this specification does not make specific limitations on this.
[0044] For example, in an application in the gaming field, client A requests the central server in the server cluster of game project X to allocate a resource server. The target group to which client A belongs is the resource server group of XX province 1 server. The target group index carried in the server allocation request sent by the client is the group index of the resource server group of XX province 1 server. Based on the index, the central server determines the resource server carrying the same group index of the resource server group of XX province 1 server from the server cluster, and determines the target resource server requested by client A therefrom.
[0045] By having the central server determine the resource server in the same group as the client from multiple resource servers according to the target group index, and determine the corresponding target resource server from them, the system can more accurately determine the target resource server, thereby improving the overall processing efficiency of the system.
[0046] Step 306: Return the target resource server to the client, so that the client executes the target task on the target resource server.
[0047] After determining the target resource server, the central server returns the target resource server to the client, and the client can perform the target task on the target resource server. The target task is a specific task or operation that the client needs to cooperate with the target resource server or complete on the target resource server in order to achieve a certain purpose. The target task includes but is not limited to: login task, scene request task, resource call task, data migration task, etc. The login task means that the client needs to log in to the target resource server to establish a network connection; the scene request task means that the client needs to request the target scene to enter the target scene or perform other operations on the target scene, such as editing, adding, deleting, etc.; the resource call task means that the client needs to call various resources in the resource server, such as calling data transmission resources, calling particle rendering resources, etc.; the data migration task means that the client needs to migrate the target data from the target resource server or migrate the target data to the target resource server, etc.
[0048] For example, in the application of the gaming field, the target task of client A is a login task. When determining the target resource server from multiple resource servers, the target resource server XX Province 1 Server 1 District resource server that can load the login of client A can be determined according to the load status of each resource server in the XX Province 1 Server resource server group, and the determined target resource server is returned to client A, so that client A logs in to the target resource server XX Province 1 Server 1 District resource server.
[0049] The determined target resource server is returned to the client through the central server, so that the client can efficiently perform the target task on the target resource server, improving the system's response speed and service quality, enhancing the system's stability and reliability, and optimizing the user experience.
[0050] In the embodiments of the present specification, by constructing a server cluster including a central server and multiple resource servers, and determining the target resource server by the target group index carried in the server allocation request sent by the client, sharing of the resource servers is achieved, and cross-group resource management between groups is achieved. While solving the problem of excessive performance consumption caused by the lack of intercommunication between resources between groups in the server structure and the need for users to frequently switch between servers, it also reduces the communication overhead between servers, improves the system's response speed and service quality, and optimizes the overall system performance and user experience. In an optional embodiment of the present specification, determining a corresponding target resource server from a plurality of resource servers according to a target group index includes: Determining, according to the target group index, a first resource server belonging to the target group from a plurality of resource servers; According to the load status of each first resource server, a corresponding target resource server is determined from each first resource server.
[0051] When determining the corresponding target resource server from multiple resource servers according to the target group index, first determine the server including the same target group index according to the target group index, that is, the resource server belonging to the target group, as the first resource server; determine the target resource server according to the load status of each first resource server. The load status of the resource server can be determined according to parameters such as the number of clients loaded on the resource server, the number of interfaces that call the resource server, and the amount of data transmitted between resource servers. For example, the load status of the resource server is determined according to the number of clients loaded on the resource server, and the load status includes but is not limited to: full load status, that is, the upper limit of the number of clients that the resource server can load is reached; empty load status, that is, there is no loaded client on the resource server; a certain number of load status, that is, a certain number of clients have been loaded on the resource server.
[0052] Exemplarily, in the application of the game field, according to the grouping index of the resource server group of XX Province 1 Server, the first resource server belonging to the resource server group of XX Province 1 Server in the server cluster is determined, such as the resource server of XX Province 1 Server District 1, the resource server of XX Province 1 Server District 2...; the target resource server is determined according to the load status of each first resource server. For example, it is necessary to determine a resource server in an empty load state as the target resource server, and the load state of the resource server of XX Province 1 Server District 1 is a full load state, and the load state of the resource server of XX Province 1 Server District 2 is an empty load state, then the resource server of XX Province 1 Server District 2 is the target resource server.
[0053] In the embodiments of the present specification, by determining the first resource server belonging to the target group according to the target group index, and selecting the target resource server according to the load status of each first resource server, reasonable utilization and efficient management of server resources within the group are achieved, communication overhead between servers is reduced, and the response speed and service quality of the system are improved, thereby significantly optimizing the user experience and enhancing the stability and reliability of the system.
[0054] In an optional embodiment of the present specification, determining a corresponding target resource server from each first resource server according to a load status of each first resource server includes: Comparing the load status of each first resource server with a preset load threshold; A target resource server whose load status does not exceed a preset load threshold is determined from each of the first resource servers.
[0055] When determining the target resource server according to the load status of the resource server, the target resource server may be determined by comparing the load status of the server with a preset load threshold.
[0056] The preset load threshold is a preset value of the number of clients that a preset resource server can load. The preset load threshold can be set to the maximum number of clients that the resource server can load, or it can be set to a threshold value less than the maximum value for the stability and security of the resource server's operating status.
[0057] After the load status of each first resource server is obtained, a first resource server whose load status does not exceed a preset load threshold is determined as a target resource server.
[0058] Optionally, when there are multiple first resource servers whose load status does not exceed the preset load threshold, the target resource server can be determined according to different allocation strategies, for example: if the allocation strategy is to prioritize loading the current resource server before loading the next resource server, then the first resource server closest to the preset load threshold among the multiple first resource servers whose load status does not exceed the preset load threshold is used as the target resource server; if the allocation strategy is to prioritize averaging the load of each resource server, then the first resource server whose load status is lower than the average load of each first resource server among the multiple first resource servers whose load status does not exceed the preset load threshold is used as the target resource server; if the allocation strategy is to prioritize loading the lowest load resource server, then the first resource server with the lowest load status among the multiple first resource servers whose load status does not exceed the preset load threshold is used as the target resource server. In actual applications, the allocation strategy can be set according to different needs, and this specification does not make specific restrictions on this.
[0059] Exemplarily, in the application of the game field, the maximum number of clients that each first resource server belonging to the resource server group of server 1 in Province XX is 1000, and the preset load threshold is set to 800; the load status of each first resource server is: resource server of zone 1, server 1 in Province XX, load status is 950; resource server of zone 2, server 1 in Province XX, load status is 650; resource server of zone 3, server 1 in Province XX, load status is 300…; the allocation strategy is to give priority to the first resource server with the lowest load, and the resource server of zone 3, server 1 in Province XX is used as the target resource server.
[0060] In the embodiments of the present specification, by comparing the load status of each first resource server with a preset load threshold and determining the target resource server accordingly, reasonable allocation and efficient utilization of resources within the group are achieved. According to different allocation strategies, the target resource server that meets the actual needs can be further determined, ensuring the reasonable utilization of server resources, avoiding the waste of server resources or the problem of unstable server operation status, enhancing the stability and reliability of the system, improving the system's response speed and service quality, and optimizing the user experience.
[0061] In an optional embodiment of the present specification, after comparing the load status of each first resource server with the preset load threshold, the method further includes: When the load status of each first resource server exceeds a preset load threshold, determining a second resource server that does not belong to the target group from the plurality of resource servers; A target resource server whose load status does not exceed a preset load threshold is determined from each second resource server.
[0062] The second resource server is a resource server in the server cluster that does not belong to the target group, that is, a resource server that is not set with a target group index.
[0063] When the load status of each first resource server exceeds the preset load threshold, it is impossible to allocate a target resource server to the client from the target group. It is necessary to determine a resource server whose load status does not exceed the preset load threshold from the second resource servers that do not belong to the target group as the target resource server.
[0064] Optionally, after determining the target resource server from the second resource server, the target resource server can be included in the target group, that is, a target group index is added to the target resource server, so that the central server can manage the target resource server at the same time when managing each resource server according to the target group. At the same time, when the subsequent client performs the target task on the target resource server, there is no need to transmit data across groups, which reduces the communication overhead between groups, and optimizes the overall performance of the system while facilitating group management.
[0065] Exemplarily, in the application of the game field, the maximum number of clients that each first resource server belonging to the resource server group of server 1 in province XX is 1000, and the preset load threshold is set to 800; the load status of each first resource server is: resource server of zone 1, server 1 in province XX, with a load status of 950; resource server of zone 2, server 1 in province XX, with a load status of 850; resource server of zone 3, server 1 in province XX, with a load status of 830, all of which exceed the preset load threshold of 800; then the second servers that do not belong to the resource server group of server 1 in province XX are determined: resource server of zone 1, server 2 in province XX, resource server of zone 2, server 2 in province XX...; the load status of each second resource server is: resource server of zone 2, server 1 in province XX, with a load status of 950; resource server of zone 2, server 2 in province XX, with a load status of 650; then the resource server of zone 2, server 2 in province XX is taken as the target resource server, and the grouping index of the resource server group of server 1 in province XX is added to the target resource server, that is, the resource server of zone 4, server 1 in province XX is included in the resource server group of server 1 in province XX.
[0066] In the embodiments of the present specification, when the load status of each first resource server exceeds the preset load threshold, a target resource server whose load status does not exceed the preset load threshold is determined from the second resource servers that do not belong to the target group, and the target resource server is included in the target group, thereby achieving reasonable allocation and efficient utilization of each resource server in the server cluster, avoiding resource waste, and improving the response speed and service quality of the system. Including the target resource server in the target group facilitates the group management of the system, reduces the communication overhead between groups, optimizes the overall performance of the system, enhances the stability and reliability of the system, and thus significantly improves the user experience.
[0067] In an optional embodiment of the present specification, after allocating the target resource server to the client, the method further includes: Update the load status of the target resource server.
[0068] After the target resource server is assigned to the client, the client can establish a connection relationship with the target resource server. However, the process of establishing the connection relationship between the client and the target resource server, and the subsequent process of executing the target task (such as the login task) are not completed instantly. Therefore, after the target resource server is assigned to the client, the load status of the target resource server needs to be updated in the central server, such as pre-increasing the load status, that is, when the target resource server is assigned to the client, the load status of the target resource server is increased by one, instead of waiting for the client to complete the connection with the target resource server and complete the execution of the target task, and then increasing the load status of the target resource server by one.
[0069] The purpose of doing this is to avoid the situation where multiple clients request the same target resource server. When the target resource server has been assigned to one of the clients and the client has not yet completed the connection establishment and execution of the target task, the central server cannot accurately allocate resources to other clients based on the load status of the target resource server.
[0070] Exemplarily, the maximum number of clients that the target resource server can load is 100, and the load status is 97. At this time, if 5 clients 1-5 request the target resource server, if the load status of the target resource server is not updated respectively after the target resource server is assigned to clients 1-3 (that is, updated to 98, 99, and 100 respectively), then when clients 4-5 request the target resource server, the central server will still judge that the load status of the target resource server does not exceed 100 based on the load status of the target resource server being 97, and assign the target resource server to clients 4-5. Then, after clients 1-3 complete the connection with the target resource server and execute the target task, the target resource server reaches the maximum load value, which causes the connection establishment failure of clients 4-5.
[0071] In the embodiments of the present specification, by immediately updating the load status of the target resource server after allocating the target resource server to the client, the real-time accuracy of the load information is ensured, and the resource server overload problem caused by the load status lag caused during the client connection establishment process is avoided. This not only improves the system's response speed and service quality, but also reduces the connection failure caused by resource server overload, enhances the system's stability and reliability, and thus significantly improves the user experience.
[0072] Figure 4 A schematic diagram of the flow structure of a server allocation method provided by an embodiment of this specification is shown. Figure 4 As shown: The client of target group 1 requests a resource server from the central server. The central server manages multiple groups and records the resource servers contained in each group. The central server queries whether there is a resource server whose load status does not exceed the preset load threshold in the target group 1 where the client is located. If so, the target resource server whose load status does not exceed the preset load threshold is returned to the client and a pre-allocation count is performed. If not, the resource server whose load status does not exceed the preset load threshold is searched outside the group 1 list, and the target resource server whose load status does not exceed the preset load threshold is added to the group 1 list. The determined target resource server is then returned to the client, and the client executes the target task on the target resource server.
[0073] The central server dynamically detects and manages the load of resource servers under each group, ensuring that the client can obtain support from resource servers with reasonable loads in a timely manner, and realizing efficient allocation when the client requests resource servers. This not only optimizes the utilization efficiency of server resources, reduces data migration between servers and communication overhead between groups, but also improves the user experience.
[0074] In an optional embodiment of the present specification, after returning the target resource server to the client, the method further includes: receiving a server adjustment request sent by a client, wherein the server adjustment request is generated when a target scene requested by the client is not found on a target resource server, and the server adjustment request carries a target scene identifier of the target scene; Determine a backup resource server from multiple resource servers according to the target scenario identifier; The backup resource server is returned to the client, so that the client executes the target scenario task related to the target scenario on the backup resource server.
[0075] The target scene is the scene that the client requests to enter. The scene is a specific function or service environment provided by the server. For example, in the application of the game field, the scene refers to a specific environment in the game world or a component of the game. Each scene has its own layout, objects, characters and other elements, which together constitute the game space where players can interact. After the game players log in to the resource server through the client, they are actually connected to the network server of the game, and then they can enter a specific scene through this connection to play the game. For example, in a multiplayer online game, the scene may be an environment where players coexist and interact with other online players, such as a town square, a battle area, etc. The scene may include but is not limited to the following elements: terrain and buildings, characters, items, interaction points, effects, etc.
[0076] When the client requests a target scene, it will query whether the target resource server currently assigned to the client contains the target scene. If the target resource server contains the target scene, there is no need to adjust the resource server; if the target scene is not found in the target resource server, the client will send a server adjustment request to the central server. The server adjustment request carries the scene identifier of the target scene requested by the client. The scene identifier is an indicator identifier of the target scene, which is used for the central server to query the target scene in each resource server.
[0077] After receiving the adjustment request from the client, the central server determines the backup resource server that contains the target scene identifier, i.e., has the target scene, from among the multiple resource servers according to the target scene identifier contained in the adjustment request from the client, and returns the backup resource server to the client, so that the client executes the target scene task on the backup resource server. The target scene task is a task related to the target scene, which may be entering the target scene, or other tasks related to the target scene, such as modifying scene parameters, monitoring scene performance, etc., and this specification does not make specific limitations on this.
[0078] For example, in a game application, client A requests scene 10001, but scene 10001 is not found in the resource server of zone 1, server 1 in province XX where client A is located, a server adjustment request including the scene identifier 10001 is sent to the central server; after receiving the server adjustment request, the central server searches the server cluster for the resource server of zone X, server X in province XX according to the scene identifier 10001, and returns the resource server of zone X, server X in province XX as a backup resource server to client A, and client A executes the task of entering scene 10001 in the resource server of zone X, server X in province XX.
[0079] In the embodiments of the present specification, when the target resource server fails to find the target scene requested by the client, a server adjustment request sent by the client is received, and a backup resource server containing the target scene is determined from multiple resource servers according to the target scene identifier, and finally the backup resource server is returned to the client to execute the target scene task, thereby ensuring that the client can smoothly enter the requested target scene, avoiding connection failure or delay problems caused by the lack of the target scene, improving the system's response speed and service quality, enhancing the system's stability and reliability, and significantly optimizing the user experience.
[0080] In an optional embodiment of the present specification, the server adjustment request further carries a target group index of the target group to which the client belongs; According to the target scenario identifier, a backup resource server is determined from multiple resource servers, including: Determining, according to the target group index, a first resource server belonging to the target group from a plurality of resource servers; According to the target scenario identifier, querying from each first resource server whether there is a resource server that includes the target scenario; If so, the resource server is determined to be a backup resource server.
[0081] After receiving the server adjustment request, the central server searches for the backup server containing the target scene according to the target scene identifier, and at the same time searches for the first resource server containing the target group index (i.e., the same group as the client) according to the target group index contained in the server adjustment request. If there is a resource server containing the target scene in the first resource server, the resource server is determined as the backup resource server.
[0082] For example, in a gaming application, client A requests scene 10001, but scene 10001 is not found in the resource server of region 1, server 1 in province XX where client A is located. Then, a server adjustment request including the scene identifier 10001 is sent to the central server. After receiving the server adjustment request, the central server searches the resource server group of region 1, server 3 in province XX based on the scene identifier 10001 and the group index of the resource server of region 1 in province XX. Then, the resource server of region 3 in province XX is returned to client A as a backup resource server. Client A executes the task of entering scene 10001 in the resource server of region 3 in province XX.
[0083] In the embodiments of the present specification, the target group index of the target group to which the client belongs is additionally carried in the server adjustment request, and the backup resource server containing the target scene is queried from the first resource server belonging to the same group according to the target scene identifier and the target group index, and finally the backup resource server containing the target scene is returned to the client to execute the target scene task, thereby ensuring that the client can find the required scene within its own group first, avoiding the additional inter-group communication overhead caused by cross-group search, improving the system's response speed and service quality, and thus significantly optimizing the user experience.
[0084] In an optional embodiment of the present specification, after querying from each first resource server whether there is a resource server including the target scenario according to the target scenario identifier, the method further includes: If not, comparing the load status of each first resource server with a preset load threshold; A backup resource server whose load status does not exceed a preset load threshold is determined from each first resource server, and a target scenario is added to the backup resource server.
[0085] When the central server fails to find the target scene on the first resource servers of the target group, it compares the load status of each first resource server with the preset load threshold, determines the backup resource server whose load status does not exceed the preset load threshold, and then adds the target scene to the backup resource server.
[0086] Specifically, how to compare the load status of each first resource server and the preset load threshold has been described in detail in the previous embodiment and will not be repeated here. After determining the backup resource server, the target scene requested by the client can be added to the backup resource server and returned to the client, so that the client can perform the target scene task related to the target scene on the backup resource server.
[0087] Exemplarily, in a game field application, client A requests scene 10001, but scene 10001 is not found in the resource server of zone 1, server 1, province XX where client A is located, then a server adjustment request containing the scene identifier 10001 is sent to the central server; after receiving the server adjustment request, the central server, based on the scene identifier 10001 and the group index of the resource server of server 1, province XX, does not find a resource server containing the target scene in the resource server group of server 1, province XX, and the maximum number of clients that can be loaded by each first resource server belonging to the resource server group of server 1, province XX is 1000, and a preset load threshold is set to 800; according to the load status of each first resource server: the resource server of zone 1, server 1, province XX has a load status of 950; the resource server of zone 2, server 1, province XX has a load status of 650... then the resource server of zone 2, server 1, province XX is used as a backup resource server, and scene 10001 is established therein, and then returned to client A, and client A executes the task of entering scene 10001 in the resource server of zone 2, server 1, province XX.
[0088] In the embodiments of the present specification, when the target scene is not found in the first resource servers of the target group, the load status of each first resource server is compared with the preset load threshold, a backup resource server whose load status does not exceed the preset load threshold is determined, and the target scene is added to the backup resource server, thereby achieving efficient management and rational utilization of resource servers, ensuring that the client can enter the required target scene in a timely manner, avoiding connection failure or delay problems caused by the lack of the target scene, reducing unnecessary waste of resources, and improving the response speed and service quality of the system, thereby significantly optimizing the user experience.
[0089] In an optional embodiment of the present specification, after comparing the load status of each first resource server with the preset load threshold, the method further includes: When the load status of each first resource server exceeds a preset load threshold, determining a second resource server that does not belong to the target group from the plurality of resource servers; A backup resource server whose load status does not exceed a preset load threshold is determined from each second resource server, and a target scenario is added to the backup resource server.
[0090] When the load status of each first resource server exceeds the preset load threshold, and a backup resource server whose load status does not exceed the preset load threshold cannot be determined from the target group, it is necessary to determine a resource server whose load status does not exceed the preset load threshold from the second resource servers that do not belong to the target group as a backup resource server, add the target scenario in the backup resource server, and then return it to the client.
[0091] Optionally, after determining the backup resource server from the second resource server, the target resource server can be included in the target group, that is, the target group index is added to the backup resource server, so that when the central server queries the same target scene in the future, it can be queried in the target group without having to query again in the second resource servers outside the group. At the same time, when the client subsequently performs the target scene task on the backup resource server, there is no need to transmit data across groups, which reduces the communication overhead between groups, and optimizes the overall performance of the system while facilitating group management.
[0092] For example, in a game application, client A requests scene 10001, but scene 10001 is not found in the resource server of zone 1, server 1, province XX where client A is located, then a server adjustment request containing the scene identifier 10001 is sent to the central server; after receiving the server adjustment request, the central server, based on the scene identifier 10001 and the group index of the resource server of server 1, province XX, does not find a resource server containing the target scene in the resource server group of server 1, province XX, and the maximum number of clients that can be loaded by each first resource server belonging to the resource server group of server 1, province XX is 1000, and a preset load threshold is set to 800; the load status of each first resource server is: the resource server of zone 1, server 1, province XX, has a load status of 950; the resource server of zone 2, server 1, province XX, has a load status of 850; The resource server in zone 3 of service XX has a load status of 830, which exceeds the preset load threshold of 800; then the second servers that do not belong to the resource server group of service 1 in Province XX are determined: the resource server in zone 1 of service XX in Province XX, the resource server in zone 2 of service XX in Province XX...; the load status of each second resource server is: the resource server in zone 2 of service XX in Province XX, has a load status of 950; the resource server in zone 2 of service XX in Province XX, has a load status of 650; then the resource server in zone 2 of service XX in Province XX is used as a backup resource server, and scene 10001 is established in it, and then returned to client A, and client A executes the task of entering scene 10001 in the resource server in zone 2 of service XX in Province XX. At the same time, the grouping index of the resource server group of service 1 in Province XX is added to the backup resource server, that is, it is included in the resource server group of service 1 in Province XX as the resource server in zone 4 of service XX in Province XX.
[0093] In the embodiments of the present specification, when the load status of each first resource server exceeds the preset load threshold, a backup resource server whose load status does not exceed the preset load threshold is determined from the second resource servers that do not belong to the target group, and the target scene is added to the backup resource server. This not only avoids waste of resources, realizes reasonable allocation and efficient utilization of resources, improves the response speed and service quality of the system, but also ensures that the client can enter the required target scene in time, avoids connection failure or delay problems caused by the lack of the target scene, further reduces the communication overhead between groups, optimizes the overall performance of the system, and thus significantly improves the user experience.
[0094] Figure 5 A schematic diagram of the flow structure of a server adjustment method provided by an embodiment of this specification is shown. Figure 5 As shown: When the client requests target scene 1 on resource server 1 in group 1, it queries whether there is target scene 1 in resource server 1. If so, the client directly executes the target scene task on target resource server 1; if not, a server adjustment request is generated and sent to the central server; the central server manages multiple groups and records the resource servers and scenes contained in each group; the central server queries whether there is a backup resource server with target scene 1 in the list of group 1. If so, the backup resource server with target scene 1 is returned to the client for pre-allocation counting; if not, the group queries whether there is a backup resource server whose load status does not exceed the preset load threshold in the list of group 1. If so, the target scene 1 is created on the backup resource server whose load status does not exceed the preset load threshold; if not, a backup resource server whose load status does not exceed the preset load threshold is searched outside the list of group 1, and the backup resource server whose load status does not exceed the preset load threshold is added outside the list of group 1 to the list of group 1; then the client can execute the target scene task on the backup resource server.
[0095] By dynamically adjusting and allocating resource servers through the central server, it is ensured that the client can efficiently access the required target scene. Even if the target resource server lacks the required target scene, it can quickly find or create a suitable scene for the client to use, thereby effectively avoiding resource waste and uneven load problems, and improving the utilization of server resources and user experience.
[0096] Figure 6 FIG. 1 shows a schematic diagram of different groups of clients requesting the same resource server provided by an embodiment of the present specification, such as Figure 6 As shown: The same resource server can be set with multiple group indexes, so it can belong to multiple groups at the same time. Then, clients of multiple groups can request the same resource server together, thus realizing resource server sharing.
[0097] By setting up group indexes for multiple groups on the same resource server, clients from multiple groups can jointly request the same resource server, thus achieving resource server sharing. This not only improves resource utilization and reduces redundant server deployment, but also optimizes the system's response speed and service quality, thereby significantly improving user experience.
[0098] The following combination Figure 7 , taking the application of the server allocation method provided in this specification in the field of games as an example, the server allocation method is further explained. Figure 7 A processing flow chart of a server allocation method provided by an embodiment of the present specification is shown, wherein the server allocation method is applied to a central server in a target game server cluster, the target server cluster also includes multiple game resource servers, and any game resource server is preset with a grouping index of at least one game server group. The server allocation method specifically includes the following steps.
[0099] Step 702: Receive a server allocation request sent by player client A, wherein the server allocation request carries a target group index of the target game server group where player client A is located.
[0100] Step 704: Determine a first game resource server belonging to the target game server group from a plurality of game resource servers according to the target group index.
[0101] Step 706: Compare the number of online player clients of each first game resource server with the maximum number of player clients that the game resource server can carry.
[0102] Step 708: Determine, from among the first game resource servers, a target game resource server whose number of online player clients does not exceed the maximum number of player clients that the game resource server can carry.
[0103] Step 710: When the number of online player clients of each first game resource server exceeds the maximum number of player clients that the game resource server can carry, determine a second game resource server that does not belong to the target game zone server group from multiple game resource servers.
[0104] Step 712: Determine, from among the second game resource servers, a target game resource server whose number of online player clients does not exceed the maximum number of player clients that the game resource server can carry.
[0105] Step 714: Return the target game resource server to player client A, so that player client A logs in to the target game resource server.
[0106] Step 716: Update the number of online player clients of the target game resource server.
[0107] Step 718: When the game battle scene requested by player client A is not found on the target game resource server, the server adjusts the request to carry the game battle scene identifier of the game battle scene and the target grouping index of the target game server group where player client A is located.
[0108] Step 720: According to the game battle scene identifier, query from each first game resource server whether there is a game resource server that includes the game battle scene.
[0109] Step 722: If yes, determine that the game resource server is a backup game resource server; if no, execute steps 724-730.
[0110] Step 724: Compare the number of online player clients of each first game resource server with the maximum number of player clients that the game resource server can carry.
[0111] Step 726: Determine a backup game resource server from each first game resource server whose number of online player clients does not exceed the maximum number of player clients that the game resource server can carry, and add a game battle scene to the backup game resource server.
[0112] Step 728: When the number of online player clients of each first game resource server exceeds the maximum number of player clients that the game resource server can carry, determine a second game resource server that does not belong to the target game zone server group from multiple game resource servers.
[0113] Step 730: Determine a backup game resource server from each second game resource server whose number of online player clients does not exceed the maximum number of player clients that the game resource server can carry, and add a game battle scene to the backup game resource server.
[0114] Step 732: Return the backup game resource server to the player client A, so that the player client A performs the player online task in the game battle scene on the backup game resource server.
[0115] In the embodiments of the present specification, reasonable resource allocation is achieved by receiving a server allocation request sent by a client and determining a first resource server belonging to a target group according to a target group index; by comparing the load status of each first resource server with a preset load threshold, a target resource server whose load status does not exceed the preset load threshold is selected, thereby ensuring effective use of server resources and avoiding waste of resources; when the load status of the first resource servers of the target group exceeds the preset load threshold, the system can determine a target resource server whose load status does not exceed the preset load threshold from a second resource server that does not belong to the target group, thereby solving the problem of resource shortage within the group; after determining the target resource server, the system returns it to the client and updates it. The load status of the new target resource server ensures the real-time accuracy of the load information and avoids the resource overload problem caused by the load status lag caused by the client connection establishment process; when the target scene requested by the client is not queried on the target resource server, the system generates a server adjustment request and queries the resource server containing the target scene according to the target scene identifier. If it is not found, the target scene is added to the backup resource server whose load status does not exceed the preset load threshold, and the backup resource server is returned to the client to execute the target scene task. This not only improves the system's response speed and service quality, reduces unnecessary resource waste and inter-group communication overhead, enhances the system's stability and reliability, but also significantly optimizes the user experience.
[0116] Corresponding to the above method embodiment, this specification also provides a server allocation device embodiment, Figure 8 The schematic diagram of the structure of a server allocation device provided by an embodiment of the present specification is shown. The server allocation device is applied to a central server in a target server cluster. The target server cluster also includes multiple resource servers. Each resource server is preset with at least one group index. Figure 8 As shown, the device comprises: The receiving module 802 is configured to receive a server allocation request sent by a client, wherein the server allocation request carries a target group index of a target group where the client is located; The determination module 804 is configured to determine a corresponding target resource server from a plurality of resource servers according to the target group index; The returning module 806 is configured to return the target resource server to the client, so that the client executes the target task on the target resource server.
[0117] Optionally, the determination module 804 is further configured to: Determining, according to the target group index, a first resource server belonging to the target group from a plurality of resource servers; According to the load status of each first resource server, a corresponding target resource server is determined from each first resource server.
[0118] Optionally, the determination module 804 is further configured to: Comparing the load status of each first resource server with a preset load threshold; A target resource server whose load status does not exceed a preset load threshold is determined from each of the first resource servers.
[0119] Optionally, the determination module 804 is further configured to: When the load status of each first resource server exceeds a preset load threshold, determining a second resource server that does not belong to the target group from the plurality of resource servers; A target resource server whose load status does not exceed a preset load threshold is determined from each second resource server.
[0120] Optionally, the device further comprises: The adjustment module is configured to receive a server adjustment request sent by a client, wherein the server adjustment request is generated when a target scene requested by the client is not found on a target resource server, and the server adjustment request carries a target scene identifier of the target scene; Determine a backup resource server from multiple resource servers according to the target scenario identifier; The backup resource server is returned to the client, so that the client executes the target scenario task related to the target scenario on the backup resource server.
[0121] Optionally, the server adjustment request also carries a target group index of the target group to which the client belongs; Correspondingly, the adjustment module is further configured as follows: Determining, according to the target group index, a first resource server belonging to the target group from a plurality of resource servers; According to the target scenario identifier, querying from each first resource server whether there is a resource server that includes the target scenario; If so, the resource server is determined to be a backup resource server.
[0122] Optionally, the adjustment module is further configured to: If not, comparing the load status of each first resource server with a preset load threshold; A backup resource server whose load status does not exceed a preset load threshold is determined from each first resource server, and a target scenario is added to the backup resource server.
[0123] Optionally, the adjustment module is further configured to: When the load status of each first resource server exceeds a preset load threshold, determining a second resource server that does not belong to the target group from the plurality of resource servers; A backup resource server whose load status does not exceed a preset load threshold is determined from each second resource server, and a target scenario is added to the backup resource server.
[0124] The above is a schematic scheme of a server allocation device of this embodiment. It should be noted that the technical scheme of the server allocation device and the technical scheme of the above-mentioned server allocation method belong to the same concept, and the details not described in detail in the technical scheme of the server allocation device can be referred to the description of the technical scheme of the above-mentioned server allocation method.
[0125] Fig. 9 The structure block diagram of a computing device provided by an embodiment of the present specification is shown. The components of the computing device 900 include but are not limited to a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and the database 950 is used to store data.
[0126] The computing device 900 also includes an access device 940, which enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 940 may include one or more of any type of network interface (e.g., a Network Interface Controller (NIC)) of wired or wireless type, such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, and a Near Field Communication (NFC).
[0127] In one embodiment of the present specification, the above components of the computing device 900 and Fig. 9Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig. 9 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0128] The computing device 900 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 900 may also be a mobile or stationary server.
[0129] The processor 920 is used to execute the following computer program / instruction, which implements the steps of the above-mentioned server allocation method when executed by the processor.
[0130] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above server allocation method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above server allocation method.
[0131] An embodiment of the present specification also provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above-mentioned server allocation method when executed by a processor.
[0132] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above server allocation method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above server allocation method.
[0133] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned server allocation method when executed by a processor.
[0134] The above is a schematic solution of a computer program product of this embodiment. It should be noted that the technical solution of the computer program product and the technical solution of the above-mentioned server allocation method belong to the same concept, and the details not described in detail in the technical solution of the computer program product can be referred to the description of the technical solution of the above-mentioned server allocation method.
[0135] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0136] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the contents contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0137] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0138] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0139] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A server allocation method, characterized in that: A central server applied to a target server cluster, wherein the target server cluster further includes a plurality of resource servers, and any resource server is preset with at least one group index, including: receiving a server allocation request sent by a client, wherein the server allocation request carries a target group index of a target group to which the client belongs; Determining a corresponding target resource server from the multiple resource servers according to the target group index; The target resource server is returned to the client, so that the client executes the target task on the target resource server.
2. The method according to claim 1, characterized in that The determining, according to the target group index, a corresponding target resource server from the multiple resource servers comprises: Determining, according to the target grouping index, a first resource server belonging to the target group from the plurality of resource servers; According to the load status of each of the first resource servers, a corresponding target resource server is determined from each of the first resource servers.
3. The method according to claim 2, characterized in that The determining a corresponding target resource server from each of the first resource servers according to the load status of each of the first resource servers includes: Comparing the load status of each of the first resource servers with a preset load threshold; A target resource server whose load status does not exceed the preset load threshold is determined from each of the first resource servers.
4. The method according to claim 3, characterized in that After comparing the load status of each of the first resource servers with the preset load threshold, the method further includes: When the load status of each of the first resource servers exceeds the preset load threshold, determining a second resource server that does not belong to the target group from the multiple resource servers; A target resource server whose load status does not exceed the preset load threshold is determined from each of the second resource servers.
5. The method according to any one of claims 1 to 4, characterized in that: After returning the target resource server to the client, the method further includes: Receiving a server adjustment request sent by the client, wherein the server adjustment request is generated when the target scene requested by the client is not found on the target resource server, and the server adjustment request carries a target scene identifier of the target scene; Determining a backup resource server from the multiple resource servers according to the target scenario identifier; The backup resource server is returned to the client, so that the client executes the target scenario task related to the target scenario on the backup resource server.
6. The method according to claim 5, characterized in that The server adjustment request also carries a target group index of the target group where the client is located; The step of determining a backup resource server from the plurality of resource servers according to the target scenario identifier includes: Determining, according to the target grouping index, a first resource server belonging to the target group from a plurality of resource servers; According to the target scenario identifier, querying from each of the first resource servers whether there is a resource server that includes the target scenario; If so, it is determined that the resource server is a backup resource server.
7. The method according to claim 6, characterized in that After querying, according to the target scenario identifier, from each of the first resource servers whether there is a resource server that includes the target scenario, the method further includes: If not, comparing the load status of each of the first resource servers with a preset load threshold; A backup resource server whose load status does not exceed the preset load threshold is determined from each of the first resource servers, and the target scenario is added to the backup resource server.
8. The method according to claim 7, characterized in that After comparing the load status of each of the first resource servers with the preset load threshold, the method further includes: When the load status of each of the first resource servers exceeds the preset load threshold, determining a second resource server that does not belong to the target group from the multiple resource servers; A backup resource server whose load status does not exceed the preset load threshold is determined from each of the second resource servers, and the target scenario is added to the backup resource server.
9. A server allocation device, characterized in that: A central server applied to a target server cluster, wherein the target server cluster further includes a plurality of resource servers, and any resource server is preset with at least one group index, including: A receiving module is configured to receive a server allocation request sent by a client, wherein the server allocation request carries a target group index of a target group where the client is located; a determination module, configured to determine a corresponding target resource server from the plurality of resource servers according to the target group index; The returning module is configured to return the target resource server to the client, so that the client executes the target task on the target resource server.
10. A computing device, characterized in that include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the server allocation method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium, characterized in that: It stores a computer program / instruction, which, when executed by a processor, implements the steps of the server allocation method described in any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the server allocation method according to any one of claims 1 to 8.
