Resource allocation method and device, storage medium and electronic equipment

By obtaining the multi-dimensional load index and determining the dimension with the maximum load pressure, virtual resources are allocated to the server, which solves the problem of unbalanced resource allocation and improves the accuracy of resource allocation and the overall performance of the server.

CN120448080APending Publication Date: 2025-08-08TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410172214.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-06
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the prior art, resource allocation is only relied on CPU usage to cause unbalanced resource utilization in the server cluster, some servers are overloaded while other servers are idle, and resource allocation accuracy is low.

Method used

Obtain the server's load index in N dimensions, determine the index with the maximum load pressure, allocate virtual resources to the server based on these indexes, and dynamically adjust the resource allocation strategy.

Benefits of technology

It realizes more accurate resource allocation, avoids resource waste and insufficient resources, and improves the overall performance and stability of the server cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448080A_ABST
    Figure CN120448080A_ABST
Patent Text Reader

Abstract

The invention discloses a resource allocation method and device, a storage medium and electronic equipment. The method comprises the steps that N first load indexes of a first server in N dimensions are obtained, N second load indexes of a second server in N dimensions are obtained, and N is an integer larger than 1; a first index is determined from the N first load indexes, a second index is determined from the N second load indexes, the first index is the index, representing the maximum load pressure of the first server, in the N first load indexes, and the second index is the index, representing the maximum load pressure of the second server, in the N second load indexes; according to the first index and the second index, virtual resources are allocated to the first server and the second server, and the method can be applied to artificial intelligence scenes and relates to technologies such as machine learning. According to the invention, the technical problem of low resource allocation accuracy is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a resource allocation method, device, storage medium, and electronic device. Background Art

[0002] In resource allocation scenarios, server resources are usually allocated based on actual CPU usage. This approach is effective to a certain extent because it is directly related to the processing power of the server.

[0003] However, when faced with complex resource allocation scenarios, relying solely on CPU usage to make decisions often leads to improper resource allocation, resulting in some servers performing normally in terms of CPU usage but being overloaded in other resource dimensions, while other servers may be overloaded in terms of CPU usage but have a large surplus in other resources.

[0004] This situation leads to unbalanced resource utilization in the server cluster, causing some servers to bear excessive load while other servers are idle, which in turn leads to the problem of low resource allocation accuracy. Therefore, there is a problem of low resource allocation accuracy.

[0005] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0006] The embodiments of the present application provide a resource allocation method, apparatus, storage medium, and electronic device to at least solve the technical problem of low resource allocation accuracy.

[0007] According to one aspect of an embodiment of the present application, a resource allocation method is provided, including: obtaining N first load indices of a first server in N dimensions, and obtaining N second load indices of a second server in the above N dimensions, wherein N is an integer greater than 1; determining a first index from the above N first load indices, and determining a second index from the above N second load indices, wherein the above first index is an index among the above N first load indices, indicating that the load pressure of the above first server is the largest, and the above second index is an index among the above N second load indices, indicating that the load pressure of the above second server is the largest; and allocating virtual resources to the above first server and the above second server according to the above first index and the above second index.

[0008] According to another aspect of an embodiment of the present application, a resource allocation device is also provided, including: a first acquisition unit, used to obtain N first load indices of the first server in N dimensions, and obtain N second load indices of the second server in the above N dimensions, wherein N is an integer greater than 1; a first determination unit, used to determine a first index from the above N first load indices, and to determine a second index from the above N second load indices, wherein the above first index is the index among the above N first load indices, indicating that the load pressure of the above first server is the largest, and the above second index is the index among the above N second load indices, indicating that the load pressure of the above second server is the largest; an allocation unit, used to allocate virtual resources to the above first server and the above second server according to the above first index and the above second index.

[0009] As an optional solution, the first acquisition unit includes: a first acquisition module for acquiring a first load value of the first server in a first dimension, a second load value of the first server in a second dimension, an upper limit of the first load value of the first server in the first dimension, and an upper limit of the second load value of the first server in the second dimension, wherein the N dimensions include the first dimension and the second dimension; a second acquisition module for acquiring a first ratio between the first load value and the upper limit of the first load value, and a second ratio between the second load value and the upper limit of the second load value, and determining the first ratio and the second ratio as the first load value; the first acquisition unit includes: a third acquisition module for acquiring a third load value of the second server in the first dimension, a fourth load value of the second server in the second dimension, an upper limit of the third load value of the second server in the first dimension, and an upper limit of the fourth load value of the second server in the second dimension; a fourth acquisition module for acquiring a third ratio between the third load value and the upper limit of the third load value, and a fourth ratio between the fourth load value and the upper limit of the fourth load value, and determining the third ratio and the fourth ratio as the second load value.

[0010] As an optional solution, the first acquisition module includes: a first acquisition submodule, used to acquire the first virtual resource allocated to the first server, and a first expected consumption value of the first virtual resource in at least one test dimension, wherein the first expected consumption value is the resource consumption value obtained when the first virtual resource is subjected to performance testing, the at least one test dimension includes the first dimension, and the first expected consumption value includes the first load value; a second acquisition submodule, used to acquire the first actual consumption value of the first server in at least one real dimension, wherein the first actual consumption value is the resource consumption value obtained when the first server is actually running, the at least one real dimension includes the second dimension, and the first actual consumption value includes the second load value; a third acquisition submodule, used to acquire the first expected consumption value upper limit of the first server in the at least one test dimension, and the first actual consumption value upper limit of the first server in the at least one real dimension, wherein the first expected consumption value upper limit includes the first load value upper limit, and the The first actual consumption value upper limit includes the above-mentioned second load value upper limit; the above-mentioned third acquisition module includes: a fourth acquisition sub-module, used to obtain the second virtual resource allocated to the above-mentioned second server, and the second expected consumption value of the above-mentioned second virtual resource in at least one test dimension, wherein the above-mentioned second expected consumption value is the resource consumption value obtained when the above-mentioned second virtual resource is subjected to performance testing, and the above-mentioned second expected consumption value includes the above-mentioned third load value; a fifth acquisition sub-module, used to obtain the second actual consumption value of the above-mentioned second server in the above-mentioned at least one real dimension, wherein the above-mentioned second actual consumption value is the resource consumption value obtained when the above-mentioned second server is actually running, and the above-mentioned second actual consumption value includes the above-mentioned fourth load value; a sixth acquisition sub-module, used to obtain the second expected consumption value upper limit of the above-mentioned second server in the above-mentioned at least one test dimension, and the second actual consumption value upper limit of the above-mentioned second server in the above-mentioned at least one real dimension, wherein the above-mentioned second expected consumption value upper limit includes the above-mentioned third load value upper limit, and the above-mentioned second actual consumption value upper limit includes the above-mentioned fourth load value upper limit.

[0011] As an optional solution, the above-mentioned device also includes: a second acquisition unit, used to obtain the first resource allocation information of the first resource container allocated to the above-mentioned first server when the above-mentioned virtual resource is a resource container; a first processing unit, used to perform a first preprocessing operation on the above-mentioned first server according to the above-mentioned first resource allocation information when the above-mentioned virtual resource is a resource container, wherein the above-mentioned first preprocessing operation includes a pre-creation operation of a new resource container on the above-mentioned first server and a pre-destruction operation of the above-mentioned first resource container on the above-mentioned first server; and a third acquisition unit, used to obtain the second resource allocation information of the second resource container allocated to the above-mentioned second server when the above-mentioned virtual resource is a resource container; a second processing unit, used to perform a second preprocessing operation on the above-mentioned second server according to the above-mentioned second resource allocation information when the above-mentioned virtual resource is a resource container, wherein the above-mentioned second preprocessing operation includes a pre-creation operation of a new resource container on the above-mentioned second server and a pre-destruction operation of the above-mentioned second resource container on the above-mentioned second server.

[0012] As an optional solution, the above-mentioned device also includes: a fourth acquisition unit, which is used to obtain the first quantity corresponding to each type of resource container preconfigured for the above-mentioned first server, the first available space allowed to be allocated by the above-mentioned first server, and the consumption weight corresponding to the above-mentioned each type of resource container before the above-mentioned first preprocessing operation is performed on the above-mentioned first server according to the above-mentioned first resource allocation information, wherein the above-mentioned consumption weight is used to represent the resource consumption corresponding to the above-mentioned resource container; a fifth acquisition unit, which is used to obtain the first expected consumption value corresponding to the above-mentioned first server and the above-mentioned first server before the above-mentioned first preprocessing operation is performed on the above-mentioned first server according to the above-mentioned first resource allocation information. The first actual consumption value corresponding to the server, wherein the first expected consumption value is the product of the first quantity and the consumption weight, and the first actual consumption value is the consumption value corresponding to the first available space; the third processing unit is used to, before performing the first preprocessing operation on the first server according to the first resource allocation information, proportionally reduce the resource containers of various types preconfigured on the first server when the first expected consumption value is greater than the first actual consumption value, until the expected consumption value corresponding to the first resource container set obtained by reduction is less than or equal to the first actual consumption value; the first processing unit includes: a first processing module, which is used to The first server is pre-created with the first resource container set; the apparatus further comprises: a sixth acquisition unit for acquiring, before performing the second pre-processing operation on the second server according to the second resource allocation information, the second quantity corresponding to each type of resource container pre-configured for the second server, the second available space allowed to be allocated by the second server, and the consumption weight; a seventh acquisition unit for acquiring, before performing the second pre-processing operation on the second server according to the second resource allocation information, the second expected consumption value corresponding to the second server and the second actual consumption value corresponding to the second server, wherein the second expected consumption value is The value is the product of the above-mentioned second quantity and the above-mentioned consumption weight, and the above-mentioned second actual consumption value is the consumption value corresponding to the above-mentioned second available space; the fourth processing unit is used to, before performing the second preprocessing operation on the above-mentioned second server according to the above-mentioned second resource allocation information, when the above-mentioned second expected consumption value is greater than the above-mentioned second actual consumption value, proportionally reduce the resource containers of various types pre-configured on the above-mentioned second server, until the expected consumption value corresponding to the reduced second resource container set is less than or equal to the above-mentioned second actual consumption value; the above-mentioned second processing unit includes: a second processing module, used to perform the pre-creation operation of the above-mentioned second resource container set on the above-mentioned second server.

[0013] As an optional solution, the above-mentioned device also includes: an eighth acquisition unit, which is used to obtain the first number corresponding to each type of resource container preconfigured for the above-mentioned first server and the concurrency corresponding to each type of resource container before performing the first preprocessing operation on the above-mentioned first server according to the above-mentioned first resource allocation information, wherein the above-mentioned concurrency is used to represent the number of requests or operations processed by the above-mentioned resource container within the same time interval; the above-mentioned first processing unit includes: a third processing module, which is used to perform the pre-creation operation of the resource container of the above-mentioned concurrency on the above-mentioned first server when the above-mentioned concurrency is greater than the above-mentioned first number; a fourth processing module, which is used to perform the pre-creation operation of the resource container of the above-mentioned concurrency on the above-mentioned first server when the above-mentioned concurrency is less than the above-mentioned first number The apparatus further comprises: a ninth acquisition unit configured to acquire the second quantity of resource containers pre-configured for the second server and the concurrency before performing the second preprocessing operation on the second server according to the second resource allocation information; the second processing unit comprises: a fifth processing module configured to pre-create the resource containers for the concurrency on the second server when the concurrency is greater than the second quantity; and a sixth processing module configured to pre-create the resource containers for the second server when the concurrency is less than the second quantity.

[0014] As an optional solution, the above-mentioned first processing unit includes: a first sending module, used to send a first preprocessing request to the above-mentioned first server, wherein the above-mentioned first preprocessing request is used to indicate that the above-mentioned first preprocessing operation is performed on the above-mentioned first server, and the above-mentioned first preprocessing request carries the above-mentioned first resource allocation information, and the above-mentioned first server is set to prohibit responding to preprocessing requests carrying the same resource allocation information; the above-mentioned second processing unit includes: a second sending module, used to send a second preprocessing request to the above-mentioned second server, wherein the above-mentioned second preprocessing request is used to indicate that the above-mentioned second preprocessing operation is performed on the above-mentioned second server, and the above-mentioned second preprocessing request carries the above-mentioned second resource allocation information.

[0015] As an optional solution, the allocation unit includes: a first allocation module, used to allocate M resource containers to the first server and the second server according to the first index and the second index, where M is a positive integer; the device also includes: a first determination unit, used to determine P unfilled containers from the M resource containers after allocating the M resource containers to the first server and the second server according to the first index and the second index, where P is a positive integer less than M; a second determination unit, used to determine at least one unfilled container from the P unfilled containers after allocating the M resource containers to the first server and the second server according to the first index and the second index, and use the at least one unfilled container as a candidate allocation target, where the candidate allocation target is set to give priority to accepting the addition of load objects.

[0016] As an optional solution, the above-mentioned device also includes: a tenth acquisition unit, which is used to obtain the average number of the above-mentioned load objects joining the above-mentioned candidate allocation targets per unit time and a preset delay time after randomly determining at least one less-than-full container from the above-mentioned P less-than-full containers and selecting the at least one less-than-full container as a candidate allocation target; an eleventh acquisition unit, which is used to obtain an estimated number of the above-mentioned load objects joining the above-mentioned candidate allocation targets in a future time period based on the above-mentioned average number and the above-mentioned delay time after randomly determining at least one less-than-full container from the above-mentioned P less-than-full containers and selecting the at least one less-than-full container as a candidate allocation target; and a prohibition unit, which is used to prohibit new load objects from joining the above-mentioned candidate allocation target if the sum of the above-mentioned estimated number and the number of load objects that have joined the above-mentioned candidate allocation target is greater than the upper limit of the number of load objects of the above-mentioned candidate allocation target after randomly determining at least one less-than-full container from the above-mentioned P less-than-full containers and selecting the at least one less-than-full container as a candidate allocation target.

[0017] As an optional solution, the above-mentioned device also includes: a twelfth acquisition unit, which is used to obtain the container occupancy information of the above-mentioned candidate allocation target in response to a joining request triggered by a new load object after at least one unfull container is determined from the above-mentioned P unfull containers and the at least one unfull container is used as a candidate allocation target, wherein the above-mentioned container occupancy information is used to indicate the load object status of the above-mentioned candidate allocation target; an updating unit, which is used to add the above-mentioned new load object to the above-mentioned unfull resource container and update the above-mentioned container occupancy information after at least one unfull container is determined from the above-mentioned P unfull containers and the at least one unfull container is used as a candidate allocation target.

[0018] As an optional solution, the above-mentioned allocation unit includes: a second allocation module, which is used to preferentially allocate resources with lower load in the dimension corresponding to the above-mentioned first index to the above-mentioned first server, and preferentially allocate resources with lower load in the dimension corresponding to the above-mentioned second index to the above-mentioned second server.

[0019] According to another aspect of the embodiments of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the resource allocation method described above.

[0020] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the resource allocation method through the computer program.

[0021] In an embodiment of the present application, N first load indices of the first server in N dimensions are obtained, and N second load indices of the second server in the above N dimensions are obtained, wherein N is an integer greater than 1; a first index is determined from the above N first load indices, and a second index is determined from the above N second load indices, wherein the above first index is the index among the above N first load indices, indicating that the load pressure of the above first server is the largest, and the above second index is the index among the above N second load indices, indicating that the load pressure of the above second server is the largest; virtual resources are allocated to the above first server and the above second server according to the above first index and the above second index.

[0022] For each server (for example, the first server and the second server), its load index in all N dimensions will be obtained, and these load indices can more comprehensively reflect the actual load situation of the server. After obtaining the multi-dimensional load index, this embodiment will find the index (for example, the first index and the second index) that represents the greatest load pressure from the N load indices of each server, and because the overall performance bottleneck of the server is usually determined by its busiest resource dimension, this embodiment can more accurately judge the overall load status of the server by focusing on the largest load index of each server, thereby achieving the purpose of ensuring more accurate allocation of resources, which will neither cause waste of resources (allocated to servers with lighter loads) nor lead to insufficient resources (heavier-loaded servers cannot obtain sufficient resources), thereby achieving the technical effect of improving the accuracy of resource allocation, and thus solving the technical problem of low resource allocation accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0024] Figure 1 is a schematic diagram of an application environment of an optional resource allocation method according to an embodiment of the present application;

[0025] Figure 2 is a schematic diagram of a process of an optional resource allocation method according to an embodiment of the present application;

[0026] Figure 3 is a schematic diagram of an optional resource allocation method according to an embodiment of the present application;

[0027] Figure 4 is a schematic diagram of another optional resource allocation method according to an embodiment of the present application;

[0028] Figure 5 is a schematic diagram of another optional resource allocation method according to an embodiment of the present application;

[0029] Figure 6 is a schematic diagram of another optional resource allocation method according to an embodiment of the present application;

[0030] Figure 7 is a schematic diagram of another optional resource allocation method according to an embodiment of the present application;

[0031] Figure 8 is a schematic diagram of another optional resource allocation method according to an embodiment of the present application;

[0032] Figure 9 is a schematic diagram of another optional resource allocation method according to an embodiment of the present application;

[0033] Figure 10 is a schematic diagram of another optional resource allocation method according to an embodiment of the present application;

[0034] Figure 11 is a schematic diagram of another optional resource allocation method according to an embodiment of the present application;

[0035] Figure 12 is a schematic diagram of an optional resource allocation device according to an embodiment of the present application;

[0036] Figure 13 It is a schematic structural diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0039] For ease of understanding, the following terms are explained:

[0040] Resources: Basic resources refer to the machine's memory and CPU. A higher level of abstraction refers to resource containers.

[0041] Resource consumption unit: refers to the player object in the game. Each player object consumes a certain amount of memory and CPU, and it belongs to a certain resource container.

[0042] Resource Containers: These refer to the game's overworld lanes and instances. Each lane and instance can accommodate a fixed maximum number of players, which varies depending on the lane and instance. Resource containers must be created before they can be used, and this process takes anywhere from tens of milliseconds to two seconds.

[0043] Lanes: The game has several large worlds. For performance and user experience reasons, each lane can only accommodate a certain number of players. Players exceeding the limit will be assigned to another lane instance. Each lane has multiple instances, each representing a lane. Players in a lane can exit at any time, and the lane will be replenished to the limit by new players entering the lane. Lanes with players remain in place and are not reclaimed.

[0044] Instances: Instances of single-game scenarios or team-based scenarios like settlements. Each instance can accommodate a certain number of players. Single-game instances are typically short-lived and reclaimed at the end of the game. Settlement instances are permanent instances and do not reclaim while players are present.

[0045] Planar Instances: These instances share the same scenery as the Overworld Instances and can be seamlessly accessed from the Overworld Instances. Players can seamlessly enter the Planar Instances upon entering a triggering area, and seamlessly return to the Overworld Instances while remaining within the Planar Instance area.

[0046] Settlements: Equivalent to guilds or factions in games. Settlements are instances of scenarios where players from the same settlement can participate in activities. They have low and high peak loads. During normal times, the number of players participating in a settling dungeon is low, resulting in lower resource consumption. However, during lunch and evening hours, the number of players participating in a settling dungeon is high, resulting in higher resource consumption.

[0047] Aggregate allocation: This approach prioritizes filling a resource container before allocating the next one, rather than distributing resource consumption units across all containers. With focused container allocation, multiple processes running concurrently in a single container can easily cause the container's consumption units to exceed the upper limit.

[0048] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.

[0049] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, pre-trained models, operating / interaction systems, and mechatronics. Pre-trained models, also known as large models or basic models, can be fine-tuned and widely applied to downstream tasks across various AI disciplines. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0050] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning. Pretrained models are the latest development in deep learning, integrating these techniques.

[0051] The solutions provided in the embodiments of this application involve technologies such as machine learning based on artificial intelligence, and are specifically described through the following embodiments:

[0052] According to one aspect of the embodiment of the present application, a resource allocation method is provided. Optionally, as an optional implementation, the resource allocation method can be applied to, but is not limited to, Figure 1 In the environment shown, the environment may include, but is not limited to, a user device 102 and a server 112 . The user device 102 may include, but is not limited to, a display 104 , a processor 106 , and a memory 108 . The server 112 includes a database 114 and a processing engine 116 .

[0053] The specific process can be as follows:

[0054] Step S102: The user equipment 102 obtains a resource allocation request, wherein the resource allocation request is used to request allocation of virtual resources to the first server and the second server;

[0055] Step S104, sending the resource allocation request to the server 112 via the network 110;

[0056] In steps S106-S110, the server 112 responds to the resource allocation request and obtains, through the processing engine 116, N first load indices of the first server in N dimensions and N second load indices of the second server in N dimensions, and further determines a first index from the N first load indices and a second index from the N second load indices; allocates virtual resources to the first server and the second server according to the first indices and the second indices, thereby obtaining a resource allocation result.

[0057] In step S112 , the resource allocation result is sent to the user equipment 102 via the network 110 . The user equipment 102 displays the resource allocation result on the display 104 via the processor 106 and stores the resource allocation result in the memory 108 .

[0058] remove Figure 1 In addition to the examples shown, the above-mentioned terminal device can be a terminal device configured with a target client, which can include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop computer, a tablet computer, a PDA, an MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The target client can be a video client, an instant messaging client, a browser client, an education client, etc. The above-mentioned network can include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The above-mentioned server can be a single server, or it can be a server cluster composed of multiple servers, or a cloud server. The above is only an example, and no limitation is made to this in this embodiment.

[0059] Alternatively, as an optional implementation, Figure 2 As shown, the resource allocation method can be executed by an electronic device, which can be, for example, Figure 1 The user device or server shown in the figure includes the following steps:

[0060] S202, obtaining N first load indexes of the first server in N dimensions, and obtaining N second load indexes of the second server in N dimensions, where N is an integer greater than 1;

[0061] S204: Determine a first index from the N first load indices, and determine a second index from the N second load indices, wherein the first index is an index among the N first load indices indicating the maximum load pressure on the first server, and the second index is an index among the N second load indices indicating the maximum load pressure on the second server;

[0062] S206: Allocate virtual resources to the first server and the second server according to the first index and the second index.

[0063] Optionally, in this embodiment, the resource allocation method described above can be applied, but is not limited to, in virtual gaming scenarios. In these scenarios, server resource allocation is crucial for ensuring game performance, avoiding latency, and ensuring a positive player experience. Because games often involve complex graphics rendering, real-time data processing, and multi-user interaction, resource allocation methods need to be more sophisticated and dynamic.

[0064] To this end, this embodiment adopts the aforementioned resource allocation method, obtaining real-time load indices of N dimensions for the first and second servers in the game scenario (these servers may support different game areas or functions). These dimensions may include CPU usage, GPU load, memory usage, network bandwidth, number of player connections, and other key factors affecting game performance and stability.

[0065] By quantifying the load in each dimension, this embodiment can obtain a comprehensive server load portrait, thereby more accurately understanding which resources are being highly utilized and which resources are still in surplus.

[0066] After collecting multi-dimensional load indices, this embodiment analyzes and determines the primary and secondary indices for each server. These indices represent the resource dimensions with the greatest load pressure on the server, typically representing bottlenecks. For example, if the GPU load index of the first server is particularly high, while the network bandwidth of the second server becomes a bottleneck, these two indices will be selected as the key load indices for each server.

[0067] Based on the determined first and second indices, the resource allocation method of this embodiment intelligently allocates virtual resources to the first and second servers. This may involve dynamically adjusting the server's computing resources, storage resources, or network bandwidth. In gaming scenarios, this allocation may occur in real time to ensure that server resources continue to meet demand as player behavior changes and the game progresses.

[0068] Alternatively, the resource allocation method described above, applied to gaming scenarios, can ensure smooth gameplay even under high loads by allocating resources in real time and accurately, reducing lag and delays and thus improving overall player satisfaction. This approach also avoids resource waste and over-provisioning, ensuring that each server receives just the right amount of resources to support its current load. Furthermore, as the number of game users grows or new game features are added, server resources can be flexibly expanded to adapt to changing demands.

[0069] Alternatively, in the area of server resource management and allocation, the load index is a key metric for measuring server workload status. It reflects the server's usage across different resource dimensions, helping system administrators or automated tools understand the server's real-time performance status. Accurately obtaining the load index is crucial for resource optimization and performance assurance, especially in complex virtual environments, such as server clusters supporting massively multiplayer online games.

[0070] In this embodiment, in order to comprehensively evaluate the load of the server, we can not only focus on a single resource (such as only looking at CPU usage), but also consider multiple resource dimensions (such as N dimensions) at the same time. The load index on each dimension together constitutes the overall picture of the server load.

[0071] For further example, assume N = 3, and the three dimensions are CPU utilization, memory utilization, and network bandwidth. For the first server, the load indices obtained include CPU utilization of 60%, memory utilization of 70%, and network bandwidth utilization of 40%. For the second server, the load indices obtained are CPU utilization of 50%, memory utilization of 80%, and network bandwidth utilization of 60%.

[0072] Alternatively, in resource management and performance optimization of a server cluster, it is crucial to identify the most critical load pressure points on each server. This helps ensure that resource allocation strategies can accurately address performance bottlenecks, thereby maximizing the overall efficiency of the system.

[0073] In this embodiment, servers typically run tasks simultaneously across multiple resource dimensions, each of which can become a performance bottleneck. The first and second indices are used to indicate the most critical load pressure points on the first and second servers, respectively. The purpose of determining these indices is to prioritize resolving the issues that have the greatest impact on server performance, namely, bottleneck resources.

[0074] For further example, let's assume that the load indices for the first server are 70% for CPU utilization, 50% for memory usage, and 85% for network bandwidth. Here, network bandwidth has the highest load index, so it is selected as the first index. For the second server, if its CPU utilization is 60%, its memory utilization is 90%, and its network bandwidth utilization is 70%, then memory utilization is selected as the second index because it represents the greatest load on the second server.

[0075] Optionally, in this embodiment, targeted virtual resource allocation is performed based on the previously determined maximum load pressure points of the first server and the second server (i.e., the first index and the second index). This means that resources will be allocated preferentially to server components that have or are about to reach performance bottlenecks. In a virtualized environment, physical hardware resources (such as CPU, memory, storage, network, etc.) are abstracted into logical resources that can be flexibly allocated. These logical resources can be dynamically allocated to different virtual machines or containers based on the real-time load requirements of the server.

[0076] To further illustrate, assuming that a first index for a first server indicates a severe shortage of network bandwidth, while a second index for a second server indicates a shortage of memory resources, the resource allocation policy might increase the bandwidth of the virtual network interface for the first server while allocating more virtual memory to the second server.

[0077] Optionally, in this embodiment, virtual resource allocation is not limited to increasing or decreasing a single resource, but may also involve conversion or optimization of resource types. For example, on some virtualization platforms, unused CPU resources can be converted to memory resources to meet the needs of specific workloads.

[0078] Optionally, in this embodiment, the allocation strategy can also be dynamic, and periodically adjusted according to real-time changes in server load. This requires a continuous detection system to collect load data and a resource scheduler to respond quickly based on this data.

[0079] Alternatively, virtual resources may refer to logical resources abstracted from physical hardware resources through virtualization technology. These logical resources can be dynamically allocated to virtual machines or containers in the server based on actual needs.

[0080] In this embodiment, the virtual resources allocated to the first server and the second server may include first virtual resources to be allocated and second virtual resources that have been allocated, and these two virtual resources have different roles and meanings in the resource allocation process.

[0081] Specifically, the first virtual resources to be allocated may refer to virtual resources that have not yet been allocated to any server or virtual machine. These resources are idle and can be allocated at any time based on server load requirements. When a node in the server cluster experiences increased load, the required amount of resources can be drawn from these unallocated resources to alleviate the node's load.

[0082] Allocated secondary virtual resources refer to virtual resources already assigned to a specific server or virtual machine. These resources are currently in use, supporting applications or gaming services running on the server. Allocated resources reflect the current resource utilization of the server cluster. In resource allocation strategies, in addition to considering how to allocate new resources, it's also important to consider how to optimize or reallocate existing resources to improve overall resource utilization.

[0083] It should be noted that for each server (e.g., the first server and the second server), this embodiment comprehensively obtains its load index in N different dimensions. These multi-dimensional load indices together constitute a comprehensive and accurate portrayal of the actual load situation of the server. In this way, the one-sidedness and misleading nature of single-dimensional evaluation can be avoided.

[0084] After collecting these multi-dimensional load indices, this embodiment further identifies the key indices with the greatest load pressure (such as the first index and the second index) from the load index of each server. Since the overall performance of a server is often limited by its busiest resource dimension, by focusing on these maximum load indices, the overall load status of the server can be more accurately assessed.

[0085] Based on the above evaluation, this embodiment ensures accurate resource allocation. This avoids wasting resources on lightly loaded servers while also preventing performance bottlenecks on heavily loaded servers due to insufficient resources. This precise resource allocation strategy not only improves resource utilization efficiency but also effectively addresses the technical issue of low resource allocation accuracy, significantly enhancing the overall performance and stability of the system.

[0086] To further illustrate, the optional Figure 3 As shown, assuming that N is 3, three first load indices 306 of the first server 302 in three dimensions are further obtained, and three second load indices 308 of the second server 304 in three dimensions are obtained; a first index is determined from the three first load indices 306, and a second index is determined from the three second load indices 308, wherein the first index is the index with the largest load pressure on the first server 302 among the three first load indices 306, and the second index is the index with the largest load pressure on the second server 304 among the three second load indices 308; virtual resources 310 are allocated to the first server 302 and the second server 304 according to the first index and the second index.

[0087] Through the embodiments provided by the present application, N first load indices of the first server in N dimensions are obtained, and N second load indices of the second server in N dimensions are obtained, wherein N is an integer greater than 1; a first index is determined from the N first load indices, and a second index is determined from the N second load indices, wherein the first index is the index among the N first load indices, indicating that the load pressure of the first server is the largest, and the second index is the index among the N second load indices, indicating that the load pressure of the second server is the largest; virtual resources are allocated to the first server and the second server according to the first index and the second index.

[0088] For each server (for example, the first server and the second server), its load index in all N dimensions will be obtained, and these load indices can more comprehensively reflect the actual load situation of the server. After obtaining the multi-dimensional load index, this embodiment will find the index (for example, the first index and the second index) that represents the greatest load pressure from the N load indices of each server, and because the overall performance bottleneck of the server is usually determined by its busiest resource dimension, this embodiment can more accurately judge the overall load status of the server by focusing on the largest load index of each server, thereby achieving the purpose of ensuring more accurate allocation of resources, which will neither cause waste of resources (allocated to servers with lighter loads) nor lead to insufficient resources (heavier-loaded servers cannot obtain sufficient resources), thereby achieving the technical effect of improving the accuracy of resource allocation.

[0089] As an optional solution, obtaining N first load indexes of the first server in N dimensions includes:

[0090] S1-1, obtaining a first load value of the first server in a first dimension, a second load value of the first server in a second dimension, an upper limit of the first load value of the first server in the first dimension, and an upper limit of the second load value of the first server in the second dimension, where the N dimensions include the first dimension and the second dimension;

[0091] S1-2, obtaining a first ratio between the first load value and an upper limit of the first load value, and a second ratio between the second load value and the upper limit of the second load value, and determining the first ratio and the second ratio as the first load value;

[0092] As an optional solution, obtaining N second load indexes of the second server in N dimensions includes:

[0093] S2-1, obtaining a third load value of the second server in the first dimension, a fourth load value of the second server in the second dimension, an upper limit of the third load value of the second server in the first dimension, and an upper limit of the fourth load value of the second server in the second dimension;

[0094] S2-2, obtaining a third ratio between the third load value and the third load value upper limit, and a fourth ratio between the fourth load value and the fourth load value upper limit, and determining the third ratio and the fourth ratio as the second load value.

[0095] Optionally, the multi-dimensional load assessment method of this embodiment is applicable not only to two dimensions; the first and second dimensions are merely examples and can be easily extended to more dimensions, such as disk I / O, network bandwidth, etc. By comprehensively considering the load index of multiple dimensions, a more comprehensive and accurate assessment of the overall server load can be obtained.

[0096] It should be noted that in the field of server cluster management, in order to more accurately evaluate the load status of the server and allocate appropriate resources to it, this embodiment obtains the server load index from multiple dimensions, and then makes more reasonable and timely resource allocation decisions based on these load indices to ensure the efficient and stable operation of the server cluster.

[0097] To further illustrate, let's optionally assume that the first load value of the first server is 60, and the upper limit of the first load value is 80. Therefore, the first ratio (i.e., the first load index) is 60 / 80 = 0.75. The second load value of the first server is 40, and the upper limit of the second load value is 50. Therefore, the second ratio (i.e., the second load index) is 40 / 50 = 0.8. Similarly, the load index of the second server in each dimension can also be calculated in the same way.

[0098] Through the embodiments provided in the present application, a first load value of the first server in a first dimension, a second load value of the first server in a second dimension, an upper limit of the first load value of the first server in the first dimension, and an upper limit of the second load value of the first server in the second dimension are obtained, wherein the N dimensions include the first dimension and the second dimension; a first ratio between the first load value and the upper limit of the first load value, and a second ratio between the second load value and the upper limit of the second load value are obtained, and the first ratio and the second ratio are determined as the first load value; a third load value of the second server in the first dimension, a fourth load value of the second server in the second dimension, an upper limit of the third load value of the second server in the first dimension, and an upper limit of the fourth load value of the second server in the second dimension are obtained; a third ratio between the third load value and the upper limit of the third load value, and a fourth ratio between the fourth load value and the upper limit of the fourth load value are obtained, and the third ratio and the fourth ratio are determined as the second load value, thereby achieving the purpose of more accurately evaluating the load status of the server and allocating appropriate resources to it, thereby achieving the technical effect of improving the accuracy of resource allocation.

[0099] As an optional solution, obtaining a first load value of the first server in the first dimension, a second load value of the first server in the second dimension, an upper limit of the first load value of the first server in the first dimension, and an upper limit of the second load value of the first server in the second dimension includes:

[0100] S3-1, obtaining a first virtual resource allocated to a first server and a first expected consumption value of the first virtual resource in at least one test dimension, wherein the first expected consumption value is a resource consumption value obtained when performing a performance test on the first virtual resource, the at least one test dimension includes the first dimension, and the first expected consumption value includes a first load value;

[0101] S3-2, obtaining a first actual consumption value of the first server in at least one real dimension, wherein the first actual consumption value is a resource consumption value obtained by the first server during real operation, the at least one real dimension includes the second dimension, and the first actual consumption value includes the second load value;

[0102] S3-3, obtaining a first expected consumption upper limit value of the first server in at least one test dimension and a first actual consumption upper limit value of the first server in at least one real dimension, wherein the first expected consumption upper limit value includes a first load upper limit value, and the first actual consumption upper limit value includes a second load upper limit value;

[0103] As an optional solution, obtaining a third load value of the second server in the first dimension, a fourth load value of the second server in the second dimension, an upper limit of the third load value of the second server in the first dimension, and an upper limit of the fourth load value of the second server in the second dimension includes:

[0104] S4-1, obtaining a second virtual resource allocated to a second server and a second expected consumption value of the second virtual resource in at least one test dimension, wherein the second expected consumption value is a resource consumption value obtained when the second virtual resource is subjected to a performance test, and the second expected consumption value includes a third load value;

[0105] S4-2, obtaining a second actual consumption value of the second server in at least one real dimension, wherein the second actual consumption value is a resource consumption value obtained when the second server is actually running, and the second actual consumption value includes a fourth load value;

[0106] S4-3, obtain the second expected consumption numerical upper limit of the second server in at least one test dimension, and the second actual consumption numerical upper limit of the second server in at least one real dimension, wherein the second expected consumption numerical upper limit includes the third load numerical upper limit, and the second actual consumption numerical upper limit includes the fourth load numerical upper limit.

[0107] Optionally, in this embodiment, the expected consumption value may be the amount of resources that the virtual resources are expected to consume in a corresponding dimension during a performance test of the server.

[0108] Optionally, in this embodiment, the actual consumption value may be the amount of resources actually consumed in the corresponding dimension when the server is actually running.

[0109] It should be noted that this embodiment proposes to consider the expected consumption of the server during performance testing and the actual consumption during actual operation in order to obtain the load values and upper limits of two servers (the first server and the second server) in two different dimensions (the first dimension and the second dimension), so as to fully and accurately understand the load status of each server in different resource dimensions, which helps to timely discover and solve the bottlenecks or problems in the server's resource usage.

[0110] To further illustrate, it is optional to assume that the first dimension is CPU usage and the second dimension is memory occupancy. For the first server, this embodiment obtains its expected consumption (such as the value obtained during performance testing) and actual consumption (such as the value continuously detected during actual operation) in terms of CPU usage, as well as the upper limit of these consumptions. Similarly, this embodiment also obtains relevant data on the memory usage of the first server. For the second server, this embodiment performs the same operation.

[0111] Through the embodiments provided by the present application, a first virtual resource allocated to a first server and a first expected consumption value of the first virtual resource in at least one test dimension are obtained, wherein the first expected consumption value is a resource consumption value obtained when the first virtual resource is subjected to a performance test, the at least one test dimension includes a first dimension, and the first expected consumption value includes a first load value; a first actual consumption value of the first server in at least one real dimension is obtained, wherein the first actual consumption value is a resource consumption value obtained when the first server is actually running, the at least one real dimension includes a second dimension, and the first actual consumption value includes a second load value; an upper limit of the first expected consumption value of the first server in at least one test dimension and an upper limit of the first actual consumption value of the first server in at least one real dimension are obtained, wherein the upper limit of the first expected consumption value includes a first load value upper limit, and the upper limit of the first actual consumption value includes a second load value upper limit; The second virtual resources of the second server, and the second expected consumption value of the second virtual resources in at least one test dimension, wherein the second expected consumption value is the resource consumption value obtained when the second virtual resource is subjected to performance testing, and the second expected consumption value includes a third load value; obtaining the second actual consumption value of the second server in at least one real dimension, wherein the second actual consumption value is the resource consumption value obtained when the second server is actually running, and the second actual consumption value includes a fourth load value; obtaining the second expected consumption value upper limit of the second server in at least one test dimension, and the second actual consumption value upper limit of the second server in at least one real dimension, wherein the second expected consumption value upper limit includes the third load value upper limit, and the second actual consumption value upper limit includes the fourth load value upper limit, thereby achieving the purpose of comprehensively and accurately understanding the load status of each server in different resource dimensions, thereby realizing the technical effect of improving the accuracy of resource allocation.

[0112] As an optional solution, when the virtual resource is a resource container, the method further includes:

[0113] S5-1, obtaining first resource allocation information of a first resource container allocated by a first server;

[0114] S5-2, performing a first preprocessing operation on the first server according to the first resource allocation information, wherein the first preprocessing operation includes pre-creating a new resource container on the first server and pre-destroying the first resource container on the first server; and,

[0115] S5-3, obtaining second resource allocation information of a second resource container allocated by the second server;

[0116] S5-4, performing a second preprocessing operation on the second server according to the second resource allocation information, wherein the second preprocessing operation includes pre-creating a new resource container on the second server and pre-destroying a second resource container on the second server.

[0117] Optionally, in this embodiment, the resource container can be understood as a virtualization technology used to package an application and its dependencies into an independent, portable computing unit.

[0118] Optionally, in this embodiment, the allocation information may refer to detailed information of resource containers allocated on the server, such as the number of containers, configuration parameters, etc.

[0119] Optionally, in this embodiment, the pre-processing operation may be a preparatory operation performed on the server according to corresponding resource allocation information, including pre-creation and pre-destruction of resource containers.

[0120] It should be noted that, when the virtual resource is a resource container (such as a Docker container), this embodiment performs resource allocation preprocessing operations on the first server and the second server, specifically obtaining information about the resource containers allocated to each server, and performing preprocessing operations based on this information, such as pre-creating and pre-destroying resource containers.

[0121] To further illustrate, let's assume that a first server has been allocated five Docker containers for running different application services, while a second server has been allocated three Docker containers. For the first server, this embodiment obtains allocation information for these five containers (e.g., container IDs, configuration parameters, etc.), and then performs pre-processing operations based on this information, such as pre-creating additional containers to cope with possible future increases in resource demand, or pre-destroying some no longer needed containers to free up resources. For the second server, this embodiment performs similar operations, but based on the information of the three containers already allocated on that server.

[0122] In addition, in this embodiment, in addition to pre-creation and pre-destruction operations, other dynamic resource adjustment strategies can also be considered, such as dynamically adjusting container resource allocation (such as CPU and memory limits) based on the real-time load of the server. Container orchestration tools (such as Kubernetes) can also be used to automate these resource allocation and pre-processing operations, improving the adaptability and maintainability of this embodiment.

[0123] By pre-creating and pre-destroying resource containers, server resources can be more efficiently utilized, avoiding resource waste or shortages. Pre-creating additional resource containers can shorten the time it takes to deploy new services when needed, improving the responsiveness and flexibility of this embodiment. Furthermore, by promptly destroying no longer needed containers, resources can be freed up, reducing the load on this embodiment, thereby enhancing its stability and reliability.

[0124] As an optional solution, before performing the first preprocessing operation on the first server according to the first resource allocation information, the method further includes:

[0125] S6-1, obtaining a first quantity corresponding to each type of resource container preconfigured for the first server, a first available space allowed to be allocated by the first server, and a consumption weight corresponding to each type of resource container, wherein the consumption weight is used to represent resource consumption corresponding to the resource container;

[0126] S6-2, obtaining a first expected consumption value corresponding to the first server and a first actual consumption value corresponding to the first server, wherein the first expected consumption value is the product of the first quantity and the consumption weight, and the first actual consumption value is the consumption value corresponding to the first available space;

[0127] S6-3: If the first expected consumption value is greater than the first actual consumption value, proportionally reduce the resource containers of each type preconfigured on the first server until the expected consumption value corresponding to the first resource container set obtained by the reduction is less than or equal to the first actual consumption value;

[0128] As an optional solution, performing a first pre-processing operation on the first server according to the first resource allocation information includes: performing a pre-creation operation on the first server for a first resource container set;

[0129] As an optional solution, before performing the second preprocessing operation on the second server according to the second resource allocation information, the method further includes:

[0130] S7-1, obtaining a second quantity corresponding to each type of resource container preconfigured for the second server, a second available space allowed to be allocated by the second server, and a consumption weight;

[0131] S7-2, obtaining a second expected consumption value corresponding to the second server and a second actual consumption value corresponding to the second server, wherein the second expected consumption value is the product of the second quantity and the consumption weight, and the second actual consumption value is the consumption value corresponding to the second available space;

[0132] S7-3, if the second expected consumption value is greater than the second actual consumption value, proportionally reducing the resource containers of each type preconfigured on the second server until the expected consumption value corresponding to the second resource container set obtained by the reduction is less than or equal to the second actual consumption value;

[0133] As an optional solution, performing a second preprocessing operation on the second server according to the second resource allocation information includes: performing a pre-creation operation on the second server for a second resource container set.

[0134] It should be noted that before executing the resource container pre-creation operation for the first and second servers, this embodiment performs a series of pre-processing steps. Specifically, these steps include obtaining the server's pre-configured resource container quantity, available space, and consumption weights, calculating the expected and actual consumption values, and proportionally reducing the number of pre-configured resource containers based on these values to ensure that the pre-created resource container set does not exceed the server's available space limit.

[0135] To further illustrate, it is optional to assume that the first server is pre-configured with 10 resource containers of type A and 5 resource containers of type B, the consumption weight of type A containers is 2, the consumption weight of type B containers is 1, and the consumption value corresponding to the available space of the first server is 15.

[0136] Calculate the first expected consumption value: (10*2)+(5*1)=25

[0137] Since the first expected consumption value is greater than the first actual consumption value (15), the pre-configured resource container needs to be scaled down.

[0138] Assuming that the number of type A containers is reduced to 6 and the number of type B containers is reduced to 3, the new expected consumption value is: (6*2)+(3*1)=15, which is equal to the first actual consumption value.

[0139] Therefore, the first pre-processing operation will pre-create these 6 type A containers and 3 type B containers.

[0140] In addition to scaling down, other dynamic adjustment strategies can be considered in this embodiment, such as dynamically adjusting container resource allocation based on the real-time load of the server. Container orchestration tools (such as Kubernetes) can also be used to automate these resource allocation and preprocessing operations, improving the adaptability and maintainability of this embodiment.

[0141] By calculating the expected and actual consumption values and proportionally reducing the number of pre-configured resource containers, we can ensure that the pre-created resource container set does not exceed the server's available space limit, thereby avoiding resource waste. At the same time, by rationally allocating the number of resource containers, we can reduce the load of this embodiment and improve its stability and reliability. Furthermore, by proportionally reducing the consumption weights of different types of resource containers, we can more efficiently utilize server resources and improve the overall performance of this embodiment.

[0142] As an optional solution, before performing the first preprocessing operation on the first server according to the first resource allocation information, the method further includes:

[0143] Obtaining a first quantity corresponding to each type of resource container preconfigured for the first server and a concurrency corresponding to each type of resource container, wherein the concurrency represents the number of requests or operations processed by the resource container within the same time interval;

[0144] As an optional solution, performing a first preprocessing operation on the first server according to the first resource allocation information includes:

[0145] S8-1, when the concurrency is greater than the first number, performing a pre-creation operation of a resource container of the concurrency on the first server;

[0146] S8-2, when the concurrency is less than the first number, pre-create a first number of resource containers on the first server;

[0147] S8-3, before performing a second preprocessing operation on the second server according to the second resource allocation information, the method further includes:

[0148] S8-4, obtaining a second quantity and concurrency corresponding to each type of resource container preconfigured for the second server;

[0149] As an optional solution, performing a second preprocessing operation on the second server according to the second resource allocation information includes:

[0150] S9-1, when the concurrency is greater than the second number, performing a pre-creation operation of a resource container of the concurrency on the second server;

[0151] S9-2: When the concurrency is less than the second number, pre-create a second number of resource containers on the second server.

[0152] Optionally, in this embodiment, the concurrency may be used to indicate the maximum number of requests or operations that a resource container can process within the same time interval.

[0153] It should be noted that before performing the pre-creation operation of resource containers on the first server and the second server, this embodiment determines the actual number of pre-created containers based on the pre-configured number of containers and the concurrency of the containers. The pre-creation operation is to prepare sufficient resources to cope with possible future requests or operations.

[0154] For further explanation, it is optionally assumed that the first server pre-configures 10 resource containers of type A, but the concurrency of type A containers is 20.

[0155] In this case, since the concurrency (20) is greater than the pre-configured number (10), this embodiment will perform a pre-creation operation of the concurrency (20) type A containers on the first server.

[0156] Similarly, if the second server is pre-configured with 15 resource containers of type B, the concurrency of the type B containers is 10.

[0157] In this case, since the concurrency (10) is less than the pre-configured number (15), this embodiment will perform a pre-creation operation on the second server for the pre-configured number (15) of B-type containers.

[0158] In addition to pre-creation, this embodiment also dynamically adjusts the number of created containers based on real-time load. For example, when the load is low, some containers may be destroyed to save resources, while when the load is high, more containers may be created to meet demand. The pre-creation strategy can also be further optimized based on the performance and resource consumption of the container. For example, a container type with higher performance but higher resource consumption may be selected, or a container type with lower performance but lower resource consumption may be selected.

[0159] By creating a sufficient number of resource containers in advance, you can quickly respond to actual demand and reduce waiting time. Furthermore, by comparing the concurrency level with the pre-configured number, the actual number of containers created can be determined to avoid wasted or insufficient resources. The number of resource containers can also be dynamically adjusted based on changes in concurrency, better responding to traffic fluctuations and sudden loads.

[0160] As an optional solution, performing a first preprocessing operation on the first server according to the first resource allocation information includes: sending a first preprocessing request to the first server, wherein the first preprocessing request is used to instruct to perform the first preprocessing operation on the first server, the first preprocessing request carries the first resource allocation information, and the first server is configured to prohibit responding to preprocessing requests carrying the same resource allocation information;

[0161] As an optional solution, performing a second preprocessing operation on the second server according to the second resource allocation information includes: sending a second preprocessing request to the second server, wherein the second preprocessing request is used to indicate the second preprocessing operation on the second server, and the second preprocessing request carries the second resource allocation information.

[0162] Optionally, in this embodiment, the resource allocation information may be used to describe the allocation of resource containers on the server, such as the type and quantity of the containers.

[0163] Optionally, in this embodiment, responding to pre-processing requests with the same resource allocation information is prohibited. It can be understood that the server is configured to not respond to a pre-processing request again if it receives the pre-processing request carrying the same resource allocation information as a previously processed request.

[0164] It should be noted that this embodiment performs preprocessing operations on resource allocation on the first server and the second server by sending preprocessing requests. Each preprocessing request includes corresponding resource allocation information, and the server is set not to respond to repeated preprocessing requests carrying the same resource allocation information to avoid repeated operations.

[0165] To further illustrate, let's assume that the first server has previously processed a preprocessing request carrying resource allocation information A and performed the corresponding preprocessing operations. If a preprocessing request carrying the same resource allocation information A is sent to the first server again, the first server will not respond to this duplicate request because the server is configured to prohibit responding to preprocessing requests with the same resource allocation information. Similarly, the same processing logic applies to the second server.

[0166] In addition, in this embodiment, in addition to comparing resource allocation information, duplicate processing can also be avoided by generating a unique identifier for each pre-processing request. The server can also maintain a request processing log to record processed pre-processing requests and their resource allocation information for subsequent comparison and verification.

[0167] The embodiments provided herein ensure that the server does not repeatedly process the same pre-processing request, saving system resources. This also reduces unnecessary repetitive work, allowing the system to more efficiently handle other tasks. Furthermore, this avoids system state inconsistencies or resource conflicts that may result from repeated operations.

[0168] As an optional solution, allocating virtual resources to the first server and the second server according to the first index and the second index includes: allocating M resource containers to the first server and the second server according to the first index and the second index, where M is a positive integer;

[0169] As an optional solution, after allocating M resource containers to the first server and the second server according to the first index and the second index, the method further includes:

[0170] S10-1, determining P unfilled containers from the M resource containers, where P is a positive integer less than M;

[0171] S10-2: Determine at least one unfull container from the P unfull containers, and use the at least one unfull container as a candidate allocation target, wherein the candidate allocation target is set to take priority in accepting the addition of the load object.

[0172] Optionally, in this embodiment, an unfull container may refer to a resource container that has been allocated but has not reached its maximum capacity or performance.

[0173] Optionally, in this embodiment, the candidate allocation target may refer to a resource container selected from an unfull container and preferentially used to take on a new load object (such as a new application instance).

[0174] It should be noted that, with regard to how to allocate virtual resources (specifically, resource containers) to the first server and the second server according to the first index and the second index, and how to handle unfilled resource containers after allocation so as to utilize these resources more efficiently, this embodiment allocates resource containers according to the index, identifies unfilled containers, and uses unfilled containers as candidate targets for preferentially taking over the load.

[0175] To further illustrate, assume that there are 10 resource containers that need to be allocated to the first and second servers according to the first and second indices. After allocation, it is found that three of the containers are not full. This embodiment identifies these three unfull containers and selects at least one as a candidate allocation target. When new load objects need to be added, this embodiment prioritizes allocating these load objects to the selected candidate allocation targets.

[0176] Furthermore, in addition to the initial allocation, this embodiment can also dynamically adjust the allocation of resource containers based on real-time load and performance data. If necessary, this embodiment can migrate the load from one container to another partially full container to achieve more efficient resource utilization. In addition to the first and second indices, this embodiment can also consider other factors (such as the container's historical performance, failure rate, etc.) to make more comprehensive resource allocation decisions.

[0177] By prioritizing load allocation to partially full containers, we can reduce resource waste and improve overall resource utilization. Furthermore, through proper resource allocation, we can better balance the load between the first and second servers, improving system stability and performance. Furthermore, by factoring in multiple factors (such as index and real-time load) when allocating resources, we can optimize overall system performance.

[0178] As an optional solution, after randomly determining at least one unfull container from the P unfull containers and using the at least one unfull container as a candidate allocation target, the method further includes:

[0179] S11-1, obtaining the average number of load objects added to candidate allocation targets per unit time and a preset delay duration;

[0180] S11-2, obtaining an estimated number of load objects that will be added to candidate allocation targets in the future time period based on the average number and delay duration;

[0181] S11-3, when the sum of the estimated number and the number of load objects that have been added to the candidate allocation target is greater than the upper limit of the number of load objects of the candidate allocation target, prohibiting new load objects from being added to the candidate allocation target.

[0182] Optionally, in this embodiment, the average number may be the average number of load objects added to candidate allocation targets per unit time, which is used to measure the adding rate.

[0183] Optionally, in this embodiment, the delay duration may be a preset time duration, which is used to estimate the addition of load objects in a future time period in combination with the average quantity.

[0184] Optionally, in this embodiment, the estimated number may be calculated based on the average number and the delay duration, and is the number of load objects that may be added to the candidate allocation targets in a future time period.

[0185] Optionally, in this embodiment, the upper limit of the number of load objects may be the maximum number of load objects that the candidate allocation target can accommodate.

[0186] It should be noted that after randomly selecting at least one from P unfull containers as a candidate allocation target, this embodiment further predicts the number of load objects joining the candidate allocation targets in the future time period based on the average number of load objects joining the candidate allocation targets and the pre-set delay duration, and takes measures to prohibit new load objects from joining when the predicted number exceeds the upper limit of the candidate allocation target capacity.

[0187] To further illustrate, it is optional to assume that a candidate allocation target has an average of 5 load objects added per unit time, and the preset delay period is 10 minutes. Then, in the next 10 minutes, it is estimated that 50 load objects will attempt to join this candidate allocation target. If the upper limit of the number of load objects for this candidate allocation target is 60, and 15 load objects have currently been added, then in the next 10 minutes, the estimated total number (15+50=65) will exceed the upper limit. In this case, this embodiment will prohibit new load objects from joining this candidate allocation target to avoid exceeding the capacity limit.

[0188] In addition to prohibiting the addition of new load objects, this embodiment can also consider dynamically adjusting the capacity of candidate allocation targets or migrating some load objects to other unfilled containers. Load balancing can also be performed across multiple candidate allocation targets to ensure overall system stability and efficiency.

[0189] The embodiments provided herein effectively prevent performance degradation or resource exhaustion caused by an excessive number of load objects in candidate allocation targets. Furthermore, through rational load management and resource allocation, system stability and reliability are enhanced. Furthermore, while ensuring that the capacity limit is not exceeded, the resources of the candidate allocation targets are maximized.

[0190] As an optional solution, after determining at least one unfull container from the P unfull containers and using the at least one unfull container as a candidate allocation target, the method further includes:

[0191] S12-1, in response to a join request triggered by a new load object, obtaining container occupancy information of a candidate allocation target, wherein the container occupancy information is used to indicate a load object status to which the candidate allocation target has joined;

[0192] S12-2: When the container occupancy information indicates that there are unfilled resource containers in the candidate allocation targets, the new load object is added to the unfilled resource container, and the container occupancy information is updated.

[0193] Optionally, in this embodiment, the load object may refer to a task or application instance that requires system resources to be processed.

[0194] Optionally, in this embodiment, the container occupancy information may be used to describe the current load object occupancy status of each resource container in the candidate allocation target.

[0195] Optionally, in this embodiment, the unfull resource container may refer to a resource container among candidate allocation targets that has remaining capacity to accommodate a new load object.

[0196] It should be noted that after selecting at least one unfilled container as a candidate allocation target, when a new load object wishes to join, this embodiment first checks the current container occupancy of these candidate allocation targets. If any unfilled resource container is found, the new load object is added to it, and this embodiment updates the corresponding container occupancy information to reflect this change.

[0197] To further illustrate, assume there are three resource containers among the candidate allocation targets, two of which are full, and one has remaining capacity. At this point, a new load object requests to join. This embodiment first checks the container occupancy information of the candidate allocation targets and finds one resource container that is not full. This embodiment then adds the new load object to the unfull resource container and updates the container occupancy information to reflect that the resource container is now partially or fully occupied.

[0198] Furthermore, in this embodiment, if all resource containers in candidate allocation targets are full, dynamic resource expansion (e.g., creating new resource containers) or load balancing can be considered to accommodate the new load object. Furthermore, when processing join requests, the priority of the load object can be considered, with higher-priority load objects being added to less-full resource containers first.

[0199] The embodiments provided herein ensure that resource containers will not reject new load objects before they are fully utilized, thereby improving overall resource utilization. Furthermore, by distributing load objects across multiple resource containers, overloading a single resource container can be avoided, achieving balanced load distribution. Furthermore, reasonable load distribution helps improve overall system performance and responsiveness.

[0200] As an optional solution, allocating virtual resources to the first server and the second server according to the first index and the second index includes:

[0201] Resources with a lower load in the dimension corresponding to the first index are preferentially allocated to the first server, and resources with a lower load in the dimension corresponding to the second index are preferentially allocated to the second server.

[0202] Optionally, in this embodiment, the resources with lower load can be understood as, in a certain dimension, resources with lower load refer to those resources that are currently less used or have a larger remaining capacity.

[0203] It should be noted that, regarding how to allocate virtual resources to the first server and the second server according to the first index and the second index, the allocation principle of this embodiment is to preferentially allocate to each server resources with lower load in the dimension indicated by its corresponding index.

[0204] For further example, assuming that the first index primarily measures CPU usage and the second index primarily measures memory usage, if the first server currently has a lower CPU usage and the second server currently has a lower memory usage, then this embodiment will prioritize allocating more CPU resources to the first server and more memory resources to the second server.

[0205] Furthermore, in this embodiment, in addition to initial resource allocation, resource allocation can be dynamically adjusted based on real-time load data to ensure that each server always operates in its dominant dimension. In addition to the dimensions represented by the first and second indices, multiple other dimensions (such as storage I / O, network latency, etc.) can also be considered for more comprehensive resource allocation.

[0206] Through the embodiments provided herein, each server is able to handle loads in the dimension in which it excels, thereby preventing certain servers from becoming performance bottlenecks due to excessive load. Furthermore, by rationally allocating resources, each server's resources are fully utilized, reducing resource waste. Furthermore, when each server operates at its optimal level, the overall performance of the system is significantly improved.

[0207] As an optional solution, for ease of understanding, the above resource allocation method is applied to resource allocation scenarios where clustered allocation is required at the resource container layer, aiming to achieve a high-concurrency, high-reliability, low-latency, and load-balanced resource allocation system. Existing resource allocation technology solutions are generally categorized into two approaches: divide-and-conquer and minimum load first. However, existing resource allocation technology solutions have significant shortcomings when faced with specific requirements, such as clustered allocation under high concurrency, low-latency allocation, and multi-dimensional load balancing.

[0208] This embodiment aims to make up for these deficiencies through a series of innovative measures. First, Figure 4 The parallel peer-to-peer architecture shown achieves high concurrency and high reliability in resource allocation. In this parallel peer-to-peer architecture, each allocation process (allocation server) maintains complete information about all resource containers (arenasvr) and can be dynamically scaled to support high concurrency. Furthermore, through conflict prediction, conflict mitigation, and conflict retry mechanisms, conflicts arising from clustered allocation under high concurrency are resolved, ensuring high system reliability.

[0209] Secondly, to address low-latency allocation, particularly in high-concurrency and unstable scenarios, this embodiment employs methods such as rolling pre-creation of resource containers, adaptive pre-creation quantity and ratio, and dynamic recycling. These methods enable rapid allocation of resource containers and significantly reduce allocation latency.

[0210] Furthermore, this embodiment employs a multi-dimensional load balancing algorithm for load balancing. Each resource container is assigned a different weight based not only on its peak and off-peak loads, but also on memory usage and actual CPU load. This multi-dimensional load balancing algorithm utilizes system resources more efficiently than traditional methods, avoiding resource waste.

[0211] In the specific implementation, for example Figure 4 In the parallel peer-to-peer architecture shown, a player client (client) logs in to a lobby server (hallsvr) and is randomly assigned to an allocation server (allocsvr) to request a resource container. The allocation server then selects a suitable resource container from all area servers (arenasvr) and returns it to the player. A similar process occurs when a player switches resource containers. In this architecture, both allocation servers and area servers can dynamically adjust their number based on system load, achieving high flexibility and scalability.

[0212] In order to further optimize resource allocation, this embodiment also introduces a container pre-creation mechanism, such as Figure 5 As shown, rolling pre-creation and recycling of containers of different types are performed in real time based on the actual application and release of different types of containers. The number and ratio of pre-created containers are dynamically adjusted based on the remaining space and the number of concurrent container applications. Furthermore, a special algorithm ensures that the number of pre-created containers does not waste excessive space while still being able to cope with high-concurrency application scenarios.

[0213] Specifically, all regional servers report information about all used and pre-created containers to all allocation servers. Each allocation server determines whether to pre-create or destroy a container based on container usage information, the amount of space available for container creation, and the number of concurrent container requests. When a player requests a container from any allocation server, the allocation server selects a container from among the pre-created containers that are already in use but have free space, or are completely unused, and allocates it to the player. This eliminates the need to wait for container creation and ensures low-latency allocation.

[0214] There are several main issues that need to be addressed when pre-creating containers:

[0215] Problem 1: Because there are various types of containers (corresponding to different lanes and instances in the game), it's impossible to determine in advance how many containers of each type will be needed. Therefore, rolling pre-creation and recycling are required in real time based on the actual application and release of different types of containers. Pre-creating too many containers wastes space, preventing other containers from requesting space when they want to be created. Pre-creating too few containers will make it difficult to cope with high-concurrency container requests. Therefore, the number of containers to pre-create for each type must be determined based on the remaining free space.

[0216] Question 2: The number of containers that need to be pre-created is related to the concurrency. New containers must be pre-created before the pre-created containers are consumed. The higher the concurrency, the faster the consumption, and the larger the number of pre-created containers should be. Because concurrency is unstable and the maximum concurrency cannot be estimated in advance, constantly pre-creating containers based on the maximum possible concurrency wastes space. Therefore, a sufficient number of containers should be pre-created dynamically and adaptively based on the actual concurrency.

[0217] Problem 3: Because multiple allocation server nodes each calculate the number of containers to pre-create in real time, if one allocation server node completes pre-creation on the regional server and reports it to all other allocation servers, the other nodes will then calculate whether to pre-create. In this case, the other nodes will not create containers repeatedly. However, it is possible that multiple allocation servers simultaneously calculate and request pre-creation from the regional server. This situation may cause multiple allocation servers to create containers repeatedly, resulting in an excessive number of pre-created containers. Therefore, a mechanism is needed to alleviate this situation. The solution is for each allocation server to try to create containers on the same regional server based on the same data and algorithm. The regional server detects duplicate creations and discards subsequent requests.

[0218] For question 1, an algorithm is needed to determine the actual number of containers to be pre-created. The idea of the algorithm is to configure a fixed number of pre-created containers for each type of container, and only use a portion of the remaining available space on the regional server for pre-creation. When the space required for the configured number of pre-created containers is greater than the space available for pre-creation, the containers are created according to the actual proportion. The specific steps are as follows: Figure 6 As shown:

[0219] S602, configure the maximum number of pre-created containers for each type, such as n1 and n2;

[0220] S604, configuring the consumption weight of each container, such as w1 and w2;

[0221] S606, calculating the weight C=n1*w1+n2*w2 that needs to be pre-created;

[0222] S608: Calculate the idle weight T, which includes the sum of the remaining weight of the allocated container, the total weight of the pre-created unallocated space, and the weight of the space that can be created;

[0223] S610, configuring the percentage r of idle weight used for pre-creation;

[0224] S612, calculate the pre-creation ratio P = (T*r) / C*100%, and take 1 if it is greater than 1;

[0225] S614, calculate the pre-created number of each container N1 = n1 * P, N2 = n2 * F;

[0226] Where C is the total weights required to pre-create containers according to a fixed configuration, and T*r is the total weights available for allocation (including the space available for creation). When the available weights are insufficient to pre-create all configured containers, each container type is pre-created at a certain ratio P.

[0227] For question 2, in addition to the pre-created quantity calculated based on the fixed configuration, the pre-created quantity needs to be calculated based on the concurrency of the container application, and then the maximum of the two is taken as the final pre-created quantity. The process of calculating the pre-created quantity based on the concurrency is as follows: Figure 7 As shown:

[0228] S702, each allocation server records the number of allocation container requests per second for each type of container in the last 5 seconds;

[0229] S704, obtain the maximum number of requests M in one second within 5 seconds;

[0230] S706, configure the pre-creation period in seconds T;

[0231] S708, obtain the number n of allocated server processes;

[0232] S710, configure the adaptive percentage r;

[0233] S712, obtain the number S of consumable units (players) that a container can accommodate;

[0234] S714: The pre-created number of the container adapted to the concurrency is N = M*T*n*r / S.

[0235] The maximum of the pre-created number calculated based on the fixed configuration and the pre-created number calculated based on the concurrency count is the number of containers that need to be pre-created. This number of containers is compared with the total weighted number of available containers that have actually been created. If the pre-created number is insufficient, sufficient containers are created. If the number is excessive, the excess pre-created containers are recycled.

[0236] For the third question, each allocation server will use the multi-dimensional minimum load priority algorithm to select the same regional server for creation based on the information reported by all regional servers. When the allocation server requests creation from the regional server, it will bring the current number of containers recorded by the allocation server in the request. The regional server will determine whether this number of containers is consistent with the local one. If they are consistent, it is considered that the allocation server has requested pre-creation with the latest number of containers, thereby allowing the allocation server to pre-create. This sequential pre-creation process is as follows: Figure 8 As shown:

[0237] Allocation server 1 requests pre-creation (current container number: 1). The regional server confirms that the requested number of containers is consistent with the current number of containers, allows the creation, and returns a message to allocation server 1. Allocation server 1 records the current number of containers: 2. At the same time, the regional server notifies allocation server 2 of the current number of containers (2). Allocation server 2 records the current number of containers: 2 and requests pre-creation (current container number: 2) from the regional server. The regional server confirms that the requested number of containers is consistent with the current number of containers, allows the creation, and returns a message to allocation server 2.

[0238] If two allocation servers request to create at the same time, that is, the second allocation server requests to create without obtaining the latest number of containers, the request of the second allocation server will be rejected. The process is based on Figure 8 The scene shown, continue as Figure 9 As shown:

[0239] Allocation server 1 requests a pre-creation request (current container number: 1) from the regional server. The regional server determines that the creation is allowed and changes the current container number to 2. Furthermore, allocation server 2 requests a pre-creation request (current container number: 1) from the regional server. The regional server determines that the container numbers are inconsistent, prohibits the creation, and returns a message to allocation server 1 stating that the creation was successful and the container number is 2. It also notifies allocation server 2 of the current container number: 2.

[0240] The regional server solves the problem of multiple allocation servers requesting creation at the same time by checking whether the number of containers in the request is consistent with the number of containers on the current regional server, thereby avoiding repeated pre-creation of containers.

[0241] Alternatively, clustered container allocation means allocating players to a container only after it is fully occupied, avoiding overly dispersed container allocation. This can cause players to notice a lack of nearby players, negatively impacting user experience. For disaster recovery and reliability reasons, multiple allocation servers can allocate players to the same container in parallel and equally. This addresses the issue of exceeding the upper limit of the container capacity during high-concurrency allocations.

[0242] Since the actual number of people in each container saved by each allocation server depends on the report from the regional server, there may be a delay in the reporting process. Therefore, the number of people in the container saved on each allocation server may be less than the number of people in the container on the regional server. In this case, it is easy to exceed the upper limit when multiple allocation servers simultaneously allocate players to a container. Figure 10 As shown:

[0243] Find a certain number of unallocated containers and perform random allocation among them. This reduces the allocation concurrency of a single container and avoids high-concurrency allocations that cause instantaneous container overcrowding.

[0244] We further include a prediction of the number of players who have been assigned but not yet reported. This is because it takes time for the allocation server to send a request to the regional server for allocation and return it to the player. It takes time for the player to enter the container and report the number of players to the allocation server. This total time can be called the reporting delay, set to T. Each allocation server records the number of requests Q per unit time. Assuming the number of allocation server processes is n, the estimated number of assigned but unreported players is A = Q * n * T. When determining whether a container is full, the current number of players in the container should be added to the estimated number of unreported players A. T is a configured value. To avoid uneven requests over time and across allocation servers, which may lead to insufficient predictions, T can be configured to be larger than the actual number.

[0245] Another approach is to pre-occupy a spot. After the allocation server assigns a container to a player on a regional server, it takes a long time for the player client to load the scene and enter the container, potentially taking several to ten seconds. This makes it difficult to predict the number of players who have not yet entered the container. An optimization approach is to pre-occupy a spot on the container after distributing it to the regional server, assuming a player already exists there. This information is then broadcast to all allocation servers, keeping the actual reporting delay T mentioned above to under 100 milliseconds.

[0246] This embodiment employs a clever mechanism to address the issue of multiple allocation servers simultaneously requesting to create the same container. Each allocation server includes its currently recorded container number when requesting to create a container. The regional server checks whether this container number matches its local container number to determine whether to allow the allocation server to pre-create the container. This mechanism effectively avoids the problem of duplicate pre-created containers.

[0247] Optionally, in this embodiment, in order to maximize the use of machine resources, when creating resource containers such as lines and replicas, it is necessary to allocate the containers to appropriate machines so that the load of each machine is more balanced, avoiding machine overload and affecting user experience, and avoiding machine waste.

[0248] Specifically, there are several types of resource containers, such as memory-consuming, normal CPU-consuming, and peak CPU-consuming. Memory-consuming containers accommodate a large number of players, and therefore use more memory. A memory-consuming container may have fewer players fighting, thus using less CPU, or it may have players engaging in battles, which also results in higher CPU usage. Normal CPU-consuming containers have more players during normal times, and players engaging in battles consume more CPU. However, during peak hours like midday or evening when gaming activities occur, players migrate to other active instances, resulting in fewer containers and lower consumption. Peak CPU-consuming containers have fewer players during normal times, but when gaming activities occur midday or evening, players flock to participate in intense battles, resulting in higher CPU consumption during peak times.

[0249] The goal of resource container allocation is to ensure that memory resources are load-balanced across regional servers, and that CPU resources are load-balanced across regional servers during normal and peak periods. In other words, load balancing is required across multiple targets.

[0250] Intuitively, a reasonable combination of the above containers can allow for the proper utilization of the machine's memory, CPU resources during normal periods, and CPU resources during peak periods, resulting in a more balanced memory and CPU usage across each machine at different times.

[0251] In practice, the memory consumption, normal CPU consumption, and peak CPU consumption of different types of containers can be assigned certain weights based on test results. Each regional server can accumulate the total weight of the above three consumptions and then divide them by the maximum weight allowed by the regional server to obtain the percentage of each weight. The best way to handle load balancing is to prioritize allocation based on the minimum load, that is, to prioritize allocation based on the minimum load based on the above three dimensions. When prioritizing allocation based on the above three dimensions, you can first find the maximum percentage of the three dimensions for each regional server as the load of this regional server, and then prioritize allocation based on the minimum load among all regional servers.

[0252] Considering that the weights of the test configuration may differ from the actual load situation, we can add the actual memory consumption percentage and the actual CPU consumption percentage to form five dimensions together with the previous three dimensions to perform minimum load priority allocation. The specific process is as follows: Figure 11 As shown:

[0253] S1102, accumulating the sum of the three configuration weights of all containers in each regional server;

[0254] S1104, calculating the sum of the three configuration weights after adding the container to be allocated;

[0255] S1106, calculating the percentage of the total weight of the three configurations to the maximum allowable weight of the regional server;

[0256] S1108, calculating the sum of the percentage of the container memory consumption weight to be allocated to the total allowed weight and the actual memory usage percentage;

[0257] S1110, calculating the sum of the percentage of the normal CPU consumption weight of the container to be allocated to the total allowed weight and the actual CPU usage percentage;

[0258] S1112, record the maximum value M of the percentages of the above five dimensions;

[0259] S1114, select the regional server with the smallest M value among all regional servers and return it as the result;

[0260] Among them, this multi-dimensional load-priority algorithm can be used to allocate containers with lower consumption in a certain dimension when the load on a regional server is too high. After multiple allocations, each regional server can achieve load balancing in all dimensions.

[0261] The embodiments provided in this application provide a resource allocation system with high concurrency, high reliability, low latency, and load balancing under complex requirements. This system can be applied not only in the gaming field, but also in other business scenarios requiring efficient resource allocation.

[0262] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0263] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain 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 this application.

[0264] According to another aspect of the embodiment of the present application, a resource allocation device for implementing the above resource allocation method is also provided. Figure 12 As shown, the device includes:

[0265] A first acquiring unit 1202 is configured to acquire N first load indexes of the first server in N dimensions, and acquire N second load indexes of the second server in N dimensions, where N is an integer greater than 1;

[0266] The first determining unit 1204 is configured to determine a first index from the N first load indices and a second index from the N second load indices, wherein the first index is an index among the N first load indices indicating the maximum load pressure on the first server, and the second index is an index among the N second load indices indicating the maximum load pressure on the second server;

[0267] The allocating unit 1206 is configured to allocate virtual resources to the first server and the second server according to the first index and the second index.

[0268] For specific embodiments, reference may be made to the examples shown in the above resource allocation method, which will not be described in detail in this example.

[0269] As an optional solution, the first acquiring unit 1202 includes:

[0270] A first acquisition module is configured to acquire a first load value of the first server in a first dimension, a second load value of the first server in a second dimension, an upper limit of the first load value of the first server in the first dimension, and an upper limit of the second load value of the first server in the second dimension, wherein the N dimensions include the first dimension and the second dimension;

[0271] a second acquisition module, configured to acquire a first ratio between the first load value and an upper limit of the first load value, and a second ratio between the second load value and the upper limit of the second load value, and determine the first ratio and the second ratio as the first load value;

[0272] The first acquiring unit 1202 includes:

[0273] a third acquisition module, configured to acquire a third load value of the second server in the first dimension, a fourth load value of the second server in the second dimension, an upper limit of the third load value of the second server in the first dimension, and an upper limit of the fourth load value of the second server in the second dimension;

[0274] The fourth acquisition module is used to obtain a third ratio between the third load value and the third load value upper limit, and a fourth ratio between the fourth load value and the fourth load value upper limit, and determine the third ratio and the fourth ratio as the second load value.

[0275] For specific embodiments, reference may be made to the examples shown in the above resource allocation method, which will not be described in detail in this example.

[0276] As an optional solution, the first acquisition module includes:

[0277] A first acquisition submodule is configured to acquire a first virtual resource allocated to the first server and a first expected consumption value of the first virtual resource in at least one test dimension, wherein the first expected consumption value is a resource consumption value obtained when the first virtual resource is subjected to a performance test, the at least one test dimension includes the first dimension, and the first expected consumption value includes a first load value;

[0278] a second acquisition submodule, configured to acquire a first actual consumption value of the first server in at least one real dimension, wherein the first actual consumption value is a resource consumption value obtained by the first server during real operation, the at least one real dimension includes the second dimension, and the first actual consumption value includes a second load value;

[0279] a third acquisition submodule, configured to acquire a first expected consumption upper limit of the first server in at least one test dimension and a first actual consumption upper limit of the first server in at least one real dimension, wherein the first expected consumption upper limit includes a first load upper limit, and the first actual consumption upper limit includes a second load upper limit;

[0280] The third acquisition module includes:

[0281] a fourth acquisition submodule, configured to acquire a second virtual resource allocated to the second server and a second expected consumption value of the second virtual resource in at least one test dimension, wherein the second expected consumption value is a resource consumption value obtained when the second virtual resource is subjected to a performance test, and the second expected consumption value includes a third load value;

[0282] a fifth acquisition submodule, configured to acquire a second actual consumption value of the second server in at least one real dimension, wherein the second actual consumption value is a resource consumption value obtained when the second server is actually running, and the second actual consumption value includes a fourth load value;

[0283] The sixth acquisition submodule is used to obtain the second expected consumption numerical upper limit of the second server in at least one test dimension, and the second actual consumption numerical upper limit of the second server in at least one real dimension, wherein the second expected consumption numerical upper limit includes the third load numerical upper limit, and the second actual consumption numerical upper limit includes the fourth load numerical upper limit.

[0284] For specific embodiments, reference may be made to the examples shown in the above resource allocation method, which will not be described in detail in this example.

[0285] As an optional solution, the device further includes:

[0286] A second obtaining unit is configured to obtain, when the virtual resource is a resource container, first resource allocation information of a first resource container that has been allocated by the first server;

[0287] a first processing unit, configured to, when the virtual resource is a resource container, perform a first preprocessing operation on the first server according to the first resource allocation information, wherein the first preprocessing operation includes pre-creating a new resource container on the first server and pre-destroying the first resource container on the first server; and

[0288] a third acquiring unit, configured to acquire, when the virtual resource is a resource container, second resource allocation information of a second resource container that has been allocated by the second server;

[0289] The second processing unit is used to perform a second preprocessing operation on the second server according to the second resource allocation information when the virtual resource is a resource container, wherein the second preprocessing operation includes a pre-creation operation of a new resource container on the second server and a pre-destruction operation of the second resource container on the second server.

[0290] For specific embodiments, reference may be made to the examples shown in the above resource allocation method, which will not be described in detail in this example.

[0291] As an optional solution, the device further includes:

[0292] a fourth acquiring unit, configured to acquire, before performing a first preprocessing operation on the first server according to the first resource allocation information, a first quantity corresponding to each type of resource container preconfigured for the first server, a first available space allowed to be allocated by the first server, and a consumption weight corresponding to each type of resource container, wherein the consumption weight is used to indicate resource consumption corresponding to the resource container;

[0293] a fifth acquiring unit, configured to acquire, before performing the first preprocessing operation on the first server according to the first resource allocation information, a first expected consumption value corresponding to the first server and a first actual consumption value corresponding to the first server, wherein the first expected consumption value is the product of the first quantity and the consumption weight, and the first actual consumption value is the consumption value corresponding to the first available space;

[0294] a third processing unit configured to, before performing a first preprocessing operation on the first server according to the first resource allocation information, proportionally reduce resource containers of various types preconfigured on the first server if the first expected consumption value is greater than the first actual consumption value, until the expected consumption value corresponding to the reduced first resource container set is less than or equal to the first actual consumption value;

[0295] The first processing unit includes: a first processing module, configured to perform a pre-creation operation of a first resource container set on the first server;

[0296] The device also includes:

[0297] a sixth acquiring unit, configured to acquire, before performing a second preprocessing operation on the second server according to the second resource allocation information, a second number of resource containers of each type preconfigured for the second server, a second available space allowed to be allocated by the second server, and a consumption weight;

[0298] a seventh acquiring unit, configured to acquire, before performing a second preprocessing operation on the second server according to the second resource allocation information, a second expected consumption value corresponding to the second server and a second actual consumption value corresponding to the second server, wherein the second expected consumption value is a product of the second quantity and the consumption weight, and the second actual consumption value is a consumption value corresponding to the second available space;

[0299] a fourth processing unit, configured to, before performing a second preprocessing operation on the second server according to the second resource allocation information, proportionally reduce resource containers of various types preconfigured on the second server if the second expected consumption value is greater than the second actual consumption value, until the expected consumption value corresponding to the reduced second resource container set is less than or equal to the second actual consumption value;

[0300] The second processing unit includes: a second processing module, configured to perform a pre-creation operation of the second resource container set on the second server.

[0301] For specific embodiments, reference may be made to the examples shown in the above resource allocation method, which will not be described in detail in this example.

[0302] As an optional solution, the device further includes:

[0303] an eighth acquiring unit, configured to acquire, before performing the first preprocessing operation on the first server according to the first resource allocation information, a first quantity corresponding to each type of resource container preconfigured for the first server and a concurrency corresponding to each type of resource container, where the concurrency represents the number of requests or operations processed by the resource container within the same time interval;

[0304] The first processing unit includes:

[0305] A third processing module is configured to perform a pre-creation operation of a resource container of the concurrent amount on the first server when the concurrent amount is greater than the first amount;

[0306] A fourth processing module, configured to perform a pre-creation operation of a first number of resource containers on the first server when the concurrency is less than the first number;

[0307] The device also includes:

[0308] a ninth acquiring unit, configured to acquire, before performing a second preprocessing operation on the second server according to the second resource allocation information, a second quantity and a concurrency corresponding to each type of resource container preconfigured for the second server;

[0309] The second processing unit includes:

[0310] A fifth processing module, configured to perform a pre-creation operation of a resource container of the concurrent amount on the second server when the concurrent amount is greater than the second amount;

[0311] The sixth processing module is configured to pre-create a second number of resource containers on the second server when the concurrency is less than the second number.

[0312] For specific embodiments, reference may be made to the examples shown in the above resource allocation method, which will not be described in detail in this example.

[0313] As an optional solution, the first processing unit includes: a first sending module, configured to send a first preprocessing request to the first server, wherein the first preprocessing request is used to instruct to perform a first preprocessing operation on the first server, the first preprocessing request carries first resource allocation information, and the first server is configured to prohibit responding to preprocessing requests carrying the same resource allocation information;

[0314] The second processing unit includes: a second sending module, configured to send a second preprocessing request to the second server, wherein the second preprocessing request is used to instruct a second preprocessing operation to be performed on the second server, and the second preprocessing request carries second resource allocation information.

[0315] For specific embodiments, reference may be made to the examples shown in the above resource allocation method, which will not be described in detail in this example.

[0316] As an optional solution, the allocating unit 1206 includes: a first allocating module, configured to allocate M resource containers to the first server and the second server according to the first index and the second index, where M is a positive integer;

[0317] The device also includes:

[0318] A first determining unit 1204 is configured to, after allocating M resource containers to the first server and the second server according to the first index and the second index, determine P unfilled containers from the M resource containers, where P is a positive integer less than M;

[0319] The second determining unit is configured to, after allocating M resource containers to the first server and the second server according to the first index and the second index, determine at least one unfull container from the P unfull containers, and use the at least one unfull container as a candidate allocation target, wherein the candidate allocation target is set to prioritize receiving the addition of the load object.

[0320] For specific embodiments, reference may be made to the examples shown in the above resource allocation method, which will not be described in detail in this example.

[0321] As an optional solution, the device further includes:

[0322] a tenth obtaining unit, configured to, after randomly determining at least one unfull container from the P unfull containers and selecting the at least one unfull container as a candidate allocation target, obtain an average number of load objects added to the candidate allocation target per unit time and a preset delay duration;

[0323] an eleventh obtaining unit, configured to randomly determine at least one unfull container from the P unfull containers and use the at least one unfull container as a candidate allocation target, and then obtain an estimated number of load objects that will be added to the candidate allocation target in a future time period by averaging the number and the delay time;

[0324] The prohibition unit is used to prohibit new load objects from being added to the candidate allocation target if the sum of the estimated number and the number of load objects that have been added to the candidate allocation target is greater than the upper limit of the number of load objects of the candidate allocation target after randomly determining at least one unfull container from P unfull containers and using the at least one unfull container as a candidate allocation target.

[0325] For specific embodiments, reference may be made to the examples shown in the above resource allocation method, which will not be described in detail in this example.

[0326] As an optional solution, the device further includes:

[0327] a twelfth obtaining unit configured to, after determining at least one unfull container from the P unfull containers and selecting the at least one unfull container as a candidate allocation target, obtain container occupancy information of the candidate allocation target in response to a join request triggered by a new load object, wherein the container occupancy information indicates a load object to which the candidate allocation target has been added;

[0328] An updating unit is configured to, after determining at least one unfull container from the P unfull containers and selecting the at least one unfull container as a candidate allocation target, add a new load object to the unfull resource container if the container occupancy information indicates that there are unfull resource containers among the candidate allocation targets, and update the container occupancy information.

[0329] For specific embodiments, reference may be made to the examples shown in the above resource allocation method, which will not be described in detail in this example.

[0330] As an optional solution, the allocating unit 1206 includes:

[0331] The second allocation module is used to preferentially allocate resources with a lower load in the dimension corresponding to the first index to the first server, and preferentially allocate resources with a lower load in the dimension corresponding to the second index to the second server.

[0332] For specific embodiments, reference may be made to the examples shown in the above resource allocation method, which will not be described in detail in this example.

[0333] According to another aspect of the embodiment of the present application, an electronic device for implementing the above resource allocation method is also provided. The electronic device can be, but is not limited to, Figure 1 The user device 102 or server 112 shown in FIG. 1 is used as an example to illustrate the embodiment. Figure 13 As shown, the electronic device includes a memory 1302 and a processor 1304. The memory 1302 stores a computer program, and the processor 1304 is configured to execute the steps in any of the above method embodiments through the computer program.

[0334] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0335] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:

[0336] S1, obtaining N first load indexes of a first server in N dimensions, and obtaining N second load indexes of a second server in N dimensions, where N is an integer greater than 1;

[0337] S2, determining a first index from the N first load indices, and determining a second index from the N second load indices, wherein the first index is an index among the N first load indices indicating the maximum load pressure on the first server, and the second index is an index among the N second load indices indicating the maximum load pressure on the second server;

[0338] S3. Allocate virtual resources to the first server and the second server according to the first index and the second index.

[0339] Alternatively, those skilled in the art will appreciate that Figure 13 The structure shown is for illustration only. Figure 13 It does not limit the structure of the above electronic device. For example, the electronic device may also include Figure 13More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 13 Different configurations shown.

[0340] Among them, the memory 1302 can be used to store software programs and modules, such as the program instructions / modules corresponding to the resource allocation method and device in the embodiment of the present application. The processor 1304 executes various functional applications and data processing by running the software programs and modules stored in the memory 1302, that is, realizing the above-mentioned resource allocation method. The memory 1302 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1302 may further include a memory remotely located relative to the processor 1304, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned networks include but are not limited to the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 1302 can be used to store, but is not limited to, information such as a first load index, a second load index, a first index, and a second index. As an example, if Figure 13 As shown, the memory 1302 may include, but is not limited to, the first acquisition unit 1202, the first determination unit 1204, and the allocation unit 1206 in the resource allocation apparatus. Furthermore, it may also include, but is not limited to, other module units in the resource allocation apparatus, which will not be described in detail in this example.

[0341] Optionally, the transmission device 1306 is configured to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one embodiment, the transmission device 1306 includes a network interface controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In one embodiment, the transmission device 1306 is a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.

[0342] In addition, the electronic device further includes: a display 1308 for displaying information such as the first load index, the second load index, the first index, and the second index; and a connection bus 1310 for connecting various module components in the electronic device.

[0343] In other embodiments, the user device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting multiple nodes via network communication. The nodes may form a peer-to-peer network, and any computing device, such as a server, user device, or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.

[0344] According to one aspect of the present application, a computer program product is provided, comprising a computer program / instructions containing program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication component and / or installed from a removable medium. When the computer program is executed by a central processing unit, the various functions provided in the embodiments of the present application are performed.

[0345] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0346] It should be noted that the computer system of the electronic device is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0347] A computer system includes a central processing unit (CPU), which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) or programs loaded from the storage unit into random access memory (RAM). The RAM also stores various programs and data required for system operation. The CPU, the read-only memory, and the RAM are connected to each other via a bus. Input / output interfaces (I / O interfaces) are also connected to the bus.

[0348] The following components are connected to the input / output interface: an input section including a keyboard, mouse, etc.; an output section including a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section including a hard disk; and a communication section including a network interface card such as a local area network card and a modem. The communication section performs communication processing via a network such as the Internet. A drive is also connected to the input / output interface as needed. Removable media such as magnetic disks, optical disks, magneto-optical disks, semiconductor memories, etc. are installed in the drive as needed so that computer programs read from them can be installed into the storage section as needed.

[0349] In particular, according to an embodiment of the present application, the processes described in the various method flow charts can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the methods shown in the flow charts. In such an embodiment, the computer program can be downloaded and installed from a network via a communication portion, and / or installed from a removable medium. When the computer program is executed by a central processing unit, the various functions defined in the system of the present application are performed.

[0350] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional implementations described above.

[0351] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0352] S1, obtaining N first load indexes of a first server in N dimensions, and obtaining N second load indexes of a second server in N dimensions, where N is an integer greater than 1;

[0353] S2, determining a first index from the N first load indices, and determining a second index from the N second load indices, wherein the first index is an index among the N first load indices indicating the maximum load pressure on the first server, and the second index is an index among the N second load indices indicating the maximum load pressure on the second server;

[0354] S3. Allocate virtual resources to the first server and the second server according to the first index and the second index.

[0355] Alternatively, in the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0356] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the electronic device through a program, and the program may be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0357] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0358] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above-mentioned computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application.

[0359] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0360] In the several embodiments provided in this application, it should be understood that the disclosed user equipment can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0361] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0362] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0363] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A resource allocation method, characterized in that: include: Obtaining N first load indexes of the first server in N dimensions, and obtaining N second load indexes of the second server in the N dimensions, where N is an integer greater than 1; Determining a first index from the N first load indices, and determining a second index from the N second load indices, wherein the first index is an index among the N first load indices indicating the maximum load pressure on the first server, and the second index is an index among the N second load indices indicating the maximum load pressure on the second server; Virtual resources are allocated to the first server and the second server according to the first index and the second index.

2. The method according to claim 1, characterized in that The obtaining of N first load indexes of the first server in N dimensions includes: Obtaining a first load value of the first server in a first dimension, a second load value of the first server in a second dimension, an upper limit of the first load value of the first server in the first dimension, and an upper limit of the second load value of the first server in the second dimension, wherein the N dimensions include the first dimension and the second dimension; Obtaining a first ratio between the first load value and the first load value upper limit, and a second ratio between the second load value and the second load value upper limit, and determining the first ratio and the second ratio as the first load value; The obtaining of N second load indexes of the second server in the N dimensions includes: Obtaining a third load value of the second server in the first dimension, a fourth load value of the second server in the second dimension, an upper limit of the third load value of the second server in the first dimension, and an upper limit of the fourth load value of the second server in the second dimension; A third ratio between the third load value and the third load value upper limit, and a fourth ratio between the fourth load value and the fourth load value upper limit are obtained, and the third ratio and the fourth ratio are determined as the second load value.

3. The method according to claim 2, characterized in that The obtaining of a first load value of the first server in the first dimension, a second load value of the first server in the second dimension, an upper limit of the first load value of the first server in the first dimension, and an upper limit of the second load value of the first server in the second dimension includes: Obtaining a first virtual resource allocated to the first server and a first expected consumption value of the first virtual resource in at least one test dimension, wherein the first expected consumption value is a resource consumption value obtained when the first virtual resource is subjected to a performance test, the at least one test dimension includes the first dimension, and the first expected consumption value includes the first load value; Obtaining a first actual consumption value of the first server in at least one real dimension, wherein the first actual consumption value is a resource consumption value obtained by the first server during actual operation, the at least one real dimension includes the second dimension, and the first actual consumption value includes the second load value; Obtaining a first expected consumption upper limit of the first server in the at least one test dimension and a first actual consumption upper limit of the first server in the at least one real dimension, wherein the first expected consumption upper limit includes the first load upper limit, and the first actual consumption upper limit includes the second load upper limit; The obtaining of a third load value of the second server in the first dimension, a fourth load value of the second server in the second dimension, an upper limit of the third load value of the second server in the first dimension, and an upper limit of the fourth load value of the second server in the second dimension includes: Obtaining a second virtual resource allocated to the second server and a second expected consumption value of the second virtual resource in at least one test dimension, wherein the second expected consumption value is a resource consumption value obtained when the second virtual resource is subjected to a performance test, and the second expected consumption value includes the third load value; Obtaining a second actual consumption value of the second server in the at least one real dimension, wherein the second actual consumption value is a resource consumption value obtained when the second server is actually running, and the second actual consumption value includes the fourth load value; Obtain the second expected consumption numerical upper limit of the second server in the at least one test dimension, and the second actual consumption numerical upper limit of the second server in the at least one real dimension, wherein the second expected consumption numerical upper limit includes the third load numerical upper limit, and the second actual consumption numerical upper limit includes the fourth load numerical upper limit.

4. The method according to claim 1, wherein In the case where the virtual resource is a resource container, the method further includes: Acquire first resource allocation information of a first resource container allocated by the first server; performing a first preprocessing operation on the first server according to the first resource allocation information, wherein the first preprocessing operation includes pre-creating a new resource container on the first server and pre-destroying the first resource container on the first server; and, Acquire second resource allocation information of a second resource container allocated by the second server; A second preprocessing operation is performed on the second server according to the second resource allocation information, wherein the second preprocessing operation includes pre-creating a new resource container on the second server and pre-destroying the second resource container on the second server.

5. The method according to claim 4, characterized in that Before performing a first preprocessing operation on the first server according to the first resource allocation information, the method further includes: Obtaining a first quantity corresponding to each type of resource container preconfigured for the first server, a first available space allowed to be allocated by the first server, and a consumption weight corresponding to each type of resource container, wherein the consumption weight is used to represent resource consumption corresponding to the resource container; Obtaining a first expected consumption value corresponding to the first server and a first actual consumption value corresponding to the first server, wherein the first expected consumption value is the product of the first quantity and the consumption weight, and the first actual consumption value is the consumption value corresponding to the first available space; If the first expected consumption value is greater than the first actual consumption value, proportionally reduce the resource containers of each type preconfigured on the first server until the expected consumption value corresponding to the obtained first resource container set is less than or equal to the first actual consumption value; The performing a first preprocessing operation on the first server according to the first resource allocation information includes: performing a pre-creation operation on the first server of the first resource container set; Before performing a second preprocessing operation on the second server according to the second resource allocation information, the method further includes: Obtaining a second quantity corresponding to each type of resource container preconfigured for the second server, a second available space allowed to be allocated by the second server, and the consumption weight; Obtaining a second expected consumption value corresponding to the second server and a second actual consumption value corresponding to the second server, wherein the second expected consumption value is the product of the second quantity and the consumption weight, and the second actual consumption value is the consumption value corresponding to the second available space; If the second expected consumption value is greater than the second actual consumption value, proportionally reduce the resource containers of each type preconfigured on the second server until the expected consumption value corresponding to the reduced second resource container set is less than or equal to the second actual consumption value; The performing a second preprocessing operation on the second server according to the second resource allocation information includes: performing a pre-creation operation of the second resource container set on the second server.

6. The method according to claim 4, characterized in that Before performing a first preprocessing operation on the first server according to the first resource allocation information, the method further includes: Obtaining a first quantity corresponding to each type of resource container preconfigured for the first server and a concurrency corresponding to each type of resource container, wherein the concurrency is used to represent the number of requests or operations processed by the resource container within the same time interval; The performing a first preprocessing operation on the first server according to the first resource allocation information includes: When the concurrency is greater than the first number, pre-create a resource container of the concurrency on the first server; When the concurrency is less than the first number, pre-create the first number of resource containers on the first server; Before performing a second preprocessing operation on the second server according to the second resource allocation information, the method further includes: Obtaining a second quantity corresponding to each type of resource container preconfigured for the second server and the concurrency; The performing a second preprocessing operation on the second server according to the second resource allocation information includes: When the concurrency is greater than the second number, pre-create a resource container of the concurrency on the second server; When the concurrency is less than the second number, a pre-creation operation of the second number of resource containers is performed on the second server.

7. The method according to claim 4, characterized in that The performing a first preprocessing operation on the first server according to the first resource allocation information includes: sending a first preprocessing request to the first server, wherein the first preprocessing request is used to instruct the first preprocessing operation to be performed on the first server, the first preprocessing request carries the first resource allocation information, and the first server is configured to prohibit responding to preprocessing requests carrying the same resource allocation information; The performing a second preprocessing operation on the second server according to the second resource allocation information includes: sending a second preprocessing request to the second server, wherein the second preprocessing request is used to instruct to perform the second preprocessing operation on the second server, and the second preprocessing request carries the second resource allocation information.

8. The method according to claim 1, characterized in that Allocating virtual resources to the first server and the second server according to the first index and the second index includes: allocating M resource containers to the first server and the second server according to the first index and the second index, where M is a positive integer; After allocating M resource containers to the first server and the second server according to the first index and the second index, the method further includes: Determine P unfilled containers from the M resource containers, where P is a positive integer less than M; At least one unfull container is determined from the P unfull containers, and the at least one unfull container is used as a candidate allocation target, wherein the candidate allocation target is set to preferentially accept the addition of the load object.

9. The method according to claim 8, characterized in that After randomly determining at least one unfull container from the P unfull containers and using the at least one unfull container as a candidate allocation target, the method further includes: Obtaining an average number of the load objects added to the candidate allocation target per unit time and a preset delay duration; Obtaining an estimated number of the load objects that will be added to the candidate allocation targets in a future time period based on the average number and the delay duration; When the sum of the estimated number and the number of load objects that have been added to the candidate allocation target is greater than the upper limit of the number of load objects of the candidate allocation target, new load objects are prohibited from being added to the candidate allocation target.

10. The method according to claim 8, characterized in that After determining at least one unfull container from the P unfull containers and using the at least one unfull container as a candidate allocation target, the method further includes: In response to a join request triggered by a new load object, obtaining container occupancy information of the candidate allocation target, wherein the container occupancy information is used to indicate a load object status to which the candidate allocation target has joined; In a case where the container occupancy information indicates that there are unfull resource containers in the candidate allocation targets, the new load object is added to the unfull resource container, and the container occupancy information is updated.

11. The method according to any one of claims 1 to 10, characterized in that Allocating virtual resources to the first server and the second server according to the first index and the second index includes: Resources with a lower load in the dimension corresponding to the first index are preferentially allocated to the first server, and resources with a lower load in the dimension corresponding to the second index are preferentially allocated to the second server.

12. A resource allocation device, characterized in that: include: A first acquiring unit, configured to acquire N first load indexes of the first server in N dimensions, and acquire N second load indexes of the second server in the N dimensions, where N is an integer greater than 1; a first determining unit, configured to determine a first index from the N first load indices, and determine a second index from the N second load indices, wherein the first index is an index among the N first load indices indicating a maximum load pressure on the first server, and the second index is an index among the N second load indices indicating a maximum load pressure on the second server; An allocating unit is configured to allocate virtual resources to the first server and the second server according to the first index and the second index.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein the program is executed by an electronic device to perform the method according to any one of claims 1 to 11.

14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

15. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 11 through the computer program.