Memory allocation method, device, equipment and storage medium
By deploying memory allocation tools in server clusters and using shared memory for dynamic memory allocation, the problem of poor memory management flexibility in the existing technology is solved, improving memory utilization and extending the service life of the server.
Patent Information
- Application Number
- CN202311288052.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-07
- Publication Date
- 2025-04-08
AI Technical Summary
The flexibility of memory management methods in the prior art leads to low memory utilization.
By deploying memory allocation tools in the server cluster, using shared memory for dynamic memory allocation, and memory allocation from shared memory according to the needs of each server to be allocated.
It improves the flexibility of memory management methods, effectively avoids fragmentation of memory resources, improves memory utilization, and extends the service life of each server in the server cluster.
Smart Images

Figure CN119781948A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a memory allocation method, device, equipment and storage medium. Background Art
[0002] Memory is the space used by the server to store and access data, usually composed of a series of continuous storage units. In computer systems, memory management has always been one of the key issues in server configuration.
[0003] In the related art, when managing memory, a fixed-size memory is usually pre-allocated before the server is powered on to support data transmission and communication between multiple processes.
[0004] However, the memory management method in the related art has poor flexibility and has the problem of low memory utilization. Summary of the invention
[0005] Based on this, it is necessary to provide a memory allocation method, device, equipment and storage medium to address the above technical problems, so as to improve the flexibility of memory management and thereby improve memory utilization.
[0006] In a first aspect, the present application provides a memory allocation method, which is applied to any target server in a server cluster, and the method comprises:
[0007] In response to the memory allocation instruction, the shared memory of the server cluster and the memory required to be allocated to at least one server to be allocated in the server cluster are obtained; the shared memory is the memory jointly constituted by the servers in the server cluster;
[0008] According to the memory required by each server to be allocated, memory is allocated to each server to be allocated from the shared memory through the deployed memory allocation tool.
[0009] In the technical solution provided by the embodiment of the present application, any target server in the server cluster responds to the memory allocation instruction, first obtains the shared memory of the server cluster and the memory required to be allocated by at least one server to be allocated in the server cluster, and then allocates memory to each server to be allocated from the shared memory through the deployed memory allocation tool according to the memory required to be allocated by each server to be allocated. Among them, the shared memory is the memory jointly constituted by each server in the server cluster. In this method, the target server responds to the memory allocation instruction, and on the basis of obtaining the memory jointly constituted by each server in the server cluster, the memory allocation tool is used to allocate memory to the server to be allocated. Since the shared memory is the memory jointly constituted by each server in the server cluster, including multiple memories of different types and capacities of each server, the shared memory is more comprehensive and rich. On this basis, the target server allocates memory to the server to be allocated according to the shared memory, which is also richer and more flexible, thereby effectively avoiding the fragmentation of memory resources and improving memory utilization. In addition, the target server allocates memory online through the memory allocation tool to avoid multiple disassembly of each server, which can extend the service life of each server in the server cluster to a certain extent.
[0010] In one of the embodiments, a computing high-speed link switching interface is deployed on each server in the server cluster, and the servers are connected through the computing high-speed link switching interface to perform memory sharing between the servers in the server cluster.
[0011] In the technical solution provided in the embodiment of the present application, the servers in the server cluster are connected by computing a high-speed link switching interface to build a shared memory including the memory of each server in the server cluster. While realizing memory sharing between the servers in the server cluster, the diversity and comprehensiveness of the shared memory are improved.
[0012] In one embodiment, obtaining the shared memory of the server cluster includes:
[0013] Use the memory allocation tool to read the memory information of each server in the server cluster to obtain the model information, particle information, and capacity information of the memory in each server;
[0014] According to the model information, particle information and capacity information of the memory of each server, the memory of each server is classified and summarized to obtain the shared memory of the server cluster.
[0015] In the technical solution provided in the embodiment of the present application, memory information is read from the memory of all servers in the server cluster, and the read memory information is classified according to model information, particle information and capacity information, so as to achieve unified integration of all memories, so as to clearly present the shared memory of the server cluster, facilitate the target server to allocate and manage the shared memory, and thus improve the memory allocation efficiency.
[0016] In one embodiment, obtaining memory required to be allocated to at least one server to be allocated in a server cluster includes:
[0017] Obtain the memory configuration information entered by the user on the target server;
[0018] The memory configuration information is parsed by a memory allocation tool to determine the memory required to be allocated to at least one server to be allocated in the server cluster.
[0019] In the technical solution provided by the embodiment of the present application, the memory of at least one server to be allocated in the server cluster is determined based on the memory configuration information input by the user, which is equivalent to the memory configuration tool automatically determining the required memory and completing the directional allocation according to the different memory configuration requirements of the user. Since the memory configuration information is input by the user, it can fully reflect the user's personalized and diversified allocation requirements for the server memory configuration, and the memory of the server to be allocated determined in this way is also more accurate, so as to better adapt to different user application scenarios and user-specific customization requirements.
[0020] In one embodiment, the memory configuration information is parsed by a memory allocation tool to determine the memory required to be allocated to the server to be allocated, including:
[0021] Determine a target configuration policy that matches the memory configuration information from a set of preset configuration policies of the server cluster;
[0022] The servers indicated in the target configuration policy are determined as the servers to be allocated, and the memory corresponding to each server indicated in each target configuration policy is determined as the memory required to be allocated to each server to be allocated.
[0023] In the technical solution provided in the embodiment of the present application, a target configuration policy is determined by matching multiple configuration policies in a preset configuration policy set with memory configuration information, and the server to be allocated and the allocated memory are simultaneously obtained according to the indication information of the target configuration policy, thereby improving the efficiency of memory allocation for the target server.
[0024] In one embodiment, the memory configuration information includes a server identifier of a server to be allocated and corresponding memory information. The memory configuration information is parsed by a memory allocation tool to determine the memory required to be allocated to the server to be allocated, including:
[0025] In the server cluster, servers with the same server identifier are determined as servers to be allocated; and memory information corresponding to the server identifier is determined as memory required to be allocated to each server to be allocated.
[0026] In the technical solution provided in the embodiment of the present application, the memory required to be allocated to the server to be allocated is determined according to the server identification of the server to be allocated indicated in the memory configuration information and the corresponding memory information, so that the memory allocation plan can be determined intuitively and quickly, thereby improving the speed of targeted and quantitative memory allocation to the target server.
[0027] In one embodiment, the memory allocation tool includes an adaptive interface for adapting to different types of servers.
[0028] In the technical solution provided in the embodiment of the present application, the memory allocation tool includes an adaptive interface, which means that the memory allocation tool can be deployed on a server cluster including multiple types of memory to provide memory allocation services for the server. In addition, compared with the offline memory disassembly method in the related art, the online memory allocation method using the memory allocation tool in the embodiment of the present application has a higher degree of automation and a more objective allocation method.
[0029] In a second aspect, the present application further provides a memory allocation device, the device comprising:
[0030] An acquisition module, used to acquire the shared memory of the server cluster and the memory required to be allocated to at least one server to be allocated in the server cluster in response to the memory allocation instruction; the shared memory is the memory jointly constituted by the servers in the server cluster;
[0031] The allocation module is used to allocate memory to each server to be allocated from the shared memory according to the memory required by each server to be allocated.
[0032] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in any one of the embodiments of the first aspect when executing the computer program.
[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method in any one of the embodiments of the first aspect.
[0034] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the method in any one of the embodiments of the first aspect are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 is an internal structure diagram of a server in one embodiment;
[0037] Figure 2 A schematic diagram of a flow chart of a memory allocation method in one embodiment;
[0038] Figure 3 A schematic diagram of a server cluster framework in one embodiment;
[0039] Figure 4 A schematic diagram of a flow chart of a memory acquisition step in an embodiment;
[0040] Figure 5 A schematic diagram of a flow chart of a memory acquisition step in another embodiment;
[0041] Figure 6 A schematic diagram of a flow chart of a memory determination step in one embodiment;
[0042] Figure 7 A schematic diagram of a flow chart of a memory allocation method in one embodiment;
[0043] Figure 8 FIG. 4 is a structural block diagram of a memory allocation device in one embodiment. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] The memory allocation method provided in the embodiment of the present application can be applied to any server in a server cluster, and the internal structure diagram of the server can be as follows: Figure 1As shown. The server includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store memory allocation data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a memory allocation method is implemented.
[0046] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0047] In computer systems, memory management has always been one of the key issues in server configuration. Traditional memory allocation methods usually use static allocation, that is, a certain amount of memory space is pre-allocated before the server is powered on. However, this method requires repeated memory removal, and each replacement of the memory will affect the life of the server motherboard and the clips on the motherboard, thereby increasing the risk of damage to the memory and server motherboard. In addition, replacing the memory consumes manpower and material resources, and it is difficult to adjust the memory size.
[0048] Based on this, in the embodiment of the present application, the server manages the shared memory of the server cluster online through the deployed memory allocation tool, dynamically adjusts the memory of the server to be allocated according to demand, and improves the utilization rate of the shared memory.
[0049] In an exemplary embodiment, Figure 2 As shown, a memory allocation method is provided, and the method is applied to any target server in a server cluster as an example for explanation, including:
[0050] S201, in response to a memory allocation instruction, obtaining a shared memory of a server cluster and a memory required to be allocated to at least one server to be allocated in the server cluster; the shared memory is a memory jointly constructed by the servers in the server cluster.
[0051] The server cluster includes at least two servers, and each server may include multiple memories. On this basis, the shared memory of the server cluster constructed according to the memory of each server in the server cluster includes the memory of each server in the server cluster. In the embodiment of the present application, there is no restriction on the construction method of the shared memory.
[0052] Shared memory can be used by all servers in a server cluster, and can be allocated to any target server in the server cluster, for example, the memory on a server can be allocated to one or more other servers to be allocated.
[0053] The servers to be allocated are servers in the server cluster to which memory needs to be allocated, and may include other servers in the server cluster except the target server, or may include the target server.
[0054] In addition, considering the operation cost and work efficiency of the server cluster, all servers in the server cluster may not need to be used at the same time, so it is not necessary to allocate memory to all servers. Therefore, the number of servers to be allocated can be one, two, more or all.
[0055] When a server in the server cluster needs to use the memory, a memory allocation instruction on the target server is triggered to instruct the target server to allocate memory to the server to be allocated in the server cluster according to the shared memory.
[0056] In one scenario, a memory allocation instruction carries a sharing identifier and a pending task. The target server responds to the memory allocation instruction and extracts shared memory from a storage database according to the sharing identifier in the memory allocation instruction. The target server determines the number of servers to be allocated in the server cluster and the corresponding memory to be allocated according to the workload of the pending task in the memory allocation instruction, the required number of processes, etc.
[0057] It should be noted that the target server can obtain the shared memory of the server cluster and the memory required to be allocated to the server to be allocated at the same time, or it can obtain the shared memory of the server cluster and the memory required to be allocated to the server to be allocated in sequence. The embodiment of the present application does not limit the order of obtaining the above two.
[0058] S202, allocating memory to each server to be allocated from a shared memory by using a deployed memory allocation tool according to the memory required to be allocated to each server to be allocated.
[0059] Among them, the memory allocation tool refers to a tool that has the function of allocating shared memory. In the embodiment of the present application, the memory allocation tool is deployed on the target server.
[0060] During the memory allocation process, the memory allocation tool can modify the memory of each server in the server cluster without changing the server hardware, and allocate the memory in the shared memory in a targeted and quantitative manner to the servers to be allocated that require this memory.
[0061] The target server runs the memory allocation tool to obtain the memory required to be allocated to each server to be allocated from the shared memory, and allocates the memory to the corresponding server to be allocated.
[0062] In an embodiment of the present application, the target server responds to the memory allocation instruction, obtains the shared memory of the server cluster and the memory required to be allocated to at least one server to be allocated in the server cluster, and allocates memory to each server to be allocated from the shared memory through the deployed memory allocation tool according to the memory required to be allocated to each server to be allocated. Among them, the shared memory is the memory jointly constituted by each server in the server cluster. In this method, the target server responds to the memory allocation instruction, and on the basis of obtaining the memory jointly constituted by each server in the server cluster, the memory allocation tool is used to allocate memory to the server to be allocated. Since the shared memory is the memory jointly constituted by each server in the server cluster, including multiple memories of different types and capacities of each server, the shared memory is more comprehensive and rich. On this basis, the target server is more comprehensive and flexible in the way that the memory is allocated to the server to be allocated according to the shared memory, thereby effectively avoiding the fragmentation of memory resources and improving memory utilization. In addition, the target server allocates memory online through the memory allocation tool to avoid multiple disassembly of each server, which can extend the service life of each server in the server cluster to a certain extent.
[0063] In the above embodiments, there is no restriction on the method of constructing the shared memory of the server cluster, that is, the servers in the server cluster can be aggregated in a variety of ways to obtain the shared memory. Based on this, an achievable method of constructing the shared memory is described below through an embodiment.
[0064] In an exemplary embodiment, a computing high-speed link switching interface is deployed on each server in the server cluster, and the servers are connected through the computing high-speed link switching interface to perform memory sharing among the servers in the server cluster.
[0065] In a server cluster, each server carries a Compute Express Link (CXL) switching interface, which is a physical interface for data cables. The servers in the server cluster are connected through the Compute Express Link switching interface, supporting efficient data transmission and communication between servers, achieving interconnection and shared memory.
[0066] In one scenario, based on the deployment of CXL Switch interfaces on each server, the servers are connected in sequence according to geographical locations and / or server numbers to build a server cluster.
[0067] For example, a server cluster consists of four servers. Figure 3 , Figure 3 A schematic diagram of a server cluster. Figure 3 In the embodiment, computing high-speed link conversion interfaces are deployed on the four servers, and each server is connected to two adjacent servers through the computing high-speed link conversion interfaces to perform data transmission and communication, thereby constructing a shared memory including the four servers.
[0068] In an embodiment of the present application, the servers in the server cluster are connected by computing a high-speed link switching interface to construct a shared memory including the memory of each server in the server cluster. While realizing memory sharing between the servers in the server cluster, the diversity and comprehensiveness of the shared memory are improved.
[0069] As can be seen from the above embodiments, the target server performs memory allocation based on the target server obtaining shared memory and the memory required to be allocated by the server to be allocated. Based on this, an achievable method of obtaining shared memory is described below through an embodiment.
[0070] In an exemplary embodiment, Figure 4 As shown, get the shared memory of the server cluster, including:
[0071] S401, reading memory information of each server in the server cluster through a memory allocation tool to obtain model information, particle information, and capacity information of the memory in each server.
[0072] It should be noted that each server in the server cluster can be equipped with multiple physical memories of different models, different particles, and different capacities.
[0073] For any memory in the server, the memory has corresponding model information, particle information and capacity information. Specifically, the model information is used to characterize the manufacturer identification of the memory, the particle information is used to characterize the manufacturing process level, chip design and overclocking performance of the memory, and the capacity information is used to characterize the capacity of the memory.
[0074] The target server reads the memory information of each server (including the target server) in the server cluster through the deployed memory allocation tool to obtain the model information, particle information and capacity information of all physical memory of each server.
[0075] S402, classify and aggregate the memory of each server according to the model information, particle information and capacity information of the memory of each server to obtain the shared memory of the server cluster.
[0076] After obtaining the model information, particle information, and capacity information of all memories in the server cluster, first classify and aggregate the memories with the same model information according to the model information, then classify multiple memories with different particle information under the same model according to the particle information, and finally classify multiple memories with the same particle information according to the capacity information, until all memories in the server cluster are classified to obtain the shared memory of the server cluster.
[0077] In an embodiment of the present application, memory information is read from the memory of all servers in the server cluster, and the read memory information is classified according to model information, particle information and capacity information to achieve unified integration of all memories, so as to clearly present the shared memory of the server cluster, facilitate the target server to allocate and manage the shared memory, and thus improve the memory allocation efficiency.
[0078] As can be seen from the above embodiments, the target server performs memory allocation based on the target server obtaining shared memory and the memory required to be allocated to the server to be allocated. Based on this, a method for obtaining the memory required to be allocated to the server to be allocated is described below through an embodiment.
[0079] In an exemplary embodiment, Figure 5 As shown, obtaining the memory required to be allocated to at least one server to be allocated in the server cluster includes:
[0080] S501, obtaining memory configuration information input by a user on a target server.
[0081] The target server provides a visual operation interface through which users upload tasks to be processed and input memory configuration information of each server in the server cluster.
[0082] The memory configuration information may be a personalized requirement input by a user, or may be determined by the user from a plurality of candidate memory configuration information provided by a visual operation interface.
[0083] S502: parse the memory configuration information using a memory allocation tool to determine the memory required to be allocated to at least one server to be allocated in the server cluster.
[0084] Based on the memory configuration information, the target server parses the memory configuration information through a memory allocation tool to determine at least one server to be allocated and at least one group of memory information that matches the memory configuration information. The number of servers to be allocated is the same as the number of groups of memory information. Then, the servers to be allocated and the memory information are combined to determine the memory required to be allocated to the servers to be allocated.
[0085] In the embodiment of the present application, the memory of at least one server to be allocated in the server cluster is determined based on the memory configuration information input by the user, which is equivalent to the memory configuration tool automatically determining the required memory and completing the directional allocation according to the different memory configuration requirements of the user. Since the memory configuration information is input by the user, it can fully reflect the user's personalized and diversified allocation requirements for the server memory configuration, and the memory of the server to be allocated determined in this way is also more accurate, so as to better adapt to different user application scenarios and user-specific customization requirements.
[0086] An achievable method for determining server memory to be allocated is described below through an embodiment.
[0087] In an exemplary embodiment, Figure 6 As shown, the memory configuration information is parsed through the memory allocation tool to determine the memory required to be allocated to the server to be allocated, including:
[0088] S601, determining a target configuration policy that matches memory configuration information from a preset configuration policy set of a server cluster.
[0089] The memory configuration information may be the user's demand information for server memory input in the server cluster based on the application dimension, such as demand for memory price, demand for memory performance, demand for special customization, etc.
[0090] The preset configuration strategy set includes multiple configuration strategies, each of which can be set based on experience values or can be a historical configuration strategy.
[0091] In this case, according to the memory configuration information, the matching degree between each configuration strategy in the preset configuration strategy set and the memory configuration information is calculated, and the configuration strategy with the highest matching degree is determined as the target configuration strategy.
[0092] S602: Determine the servers indicated in the target configuration policy as the servers to be allocated, and determine the memory corresponding to the servers indicated in each target configuration policy as the memory required to be allocated to the servers to be allocated.
[0093] The target configuration policy is a detailed description of the memory configuration of each server in the server cluster, indicating the memory of at least one server.
[0094] When the target configuration policy is determined, the servers and corresponding memories in the target configuration policy are obtained, and the servers in the target configuration policy are determined as the servers to be allocated, and the memory corresponding to each server indicated in each target configuration policy is determined as the memory required to be allocated to each server to be allocated.
[0095] In an embodiment of the present application, a target configuration policy is determined by matching multiple configuration policies in a preset configuration policy set with memory configuration information, and the server to be allocated and the allocated memory are simultaneously obtained according to the indication information of the target configuration policy, thereby improving the efficiency of memory allocation for the target server.
[0096] Another achievable method of determining the server memory to be allocated is described below through an embodiment parallel to the above embodiment.
[0097] In an exemplary embodiment, the memory configuration information includes a server identifier of a server to be allocated and corresponding memory information. The memory configuration information is parsed by a memory allocation tool to determine the memory required to be allocated to the server to be allocated, including:
[0098] In the server cluster, servers with the same server identifier are determined as servers to be allocated; and memory information corresponding to the server identifier is determined as memory required to be allocated to each server to be allocated.
[0099] The memory configuration information may be the user's demand information for server memory input in the server cluster based on the configuration environment of the server.
[0100] The memory configuration information includes a server identifier of a server to be allocated and corresponding memory information. Specifically, the server identifier is used to specify the server to be allocated, and the memory information is used to specify the memory model, memory granules, and memory capacity of the server to be allocated.
[0101] The target server extracts the server identifier of the memory configuration information through the memory allocation tool, and determines the server corresponding to the server identifier in the server cluster as the server to be allocated; at the same time, according to the memory information corresponding to the server identifier in the memory configuration information, the model information, particle information and capacity information of the server to be allocated are determined.
[0102] In an embodiment of the present application, the memory required to be allocated to the server to be allocated is determined based on the server identifier of the server to be allocated indicated in the memory configuration information and the corresponding memory information, which can intuitively and quickly determine the memory allocation plan and improve the speed of targeted and quantitative memory allocation to the target server.
[0103] As can be seen from the above embodiments, the target server performs memory allocation through a memory allocation tool, that is, the target server needs to deploy a memory allocation tool and have a platform that supports the memory allocation tool to implement the function of the memory allocation tool. Based on this, the corresponding relationship between the memory allocation tool and the server is described below through an embodiment.
[0104] In an exemplary embodiment, the memory allocation tool includes an adaptive interface for adapting to different types of servers.
[0105] The memory allocation tool includes an adaptive interface and supports servers of various operating systems and hardware platforms. The server on which the memory allocation tool is deployed can provide an environment for the memory allocation tool to run, so that the memory allocation tool can perform memory allocation, thereby providing memory allocation services for large-scale, multi-type server clusters.
[0106] In the embodiment of the present application, the memory allocation tool includes an adaptive interface, which means that the memory allocation tool can be deployed on a server cluster including multiple types of memory to provide memory allocation services for the server. In addition, compared with the offline memory disassembly method in the related art, the online memory allocation method using the memory allocation tool in the embodiment of the present application has a higher degree of automation and a more objective allocation method.
[0107] In one embodiment, a memory allocation method is provided, comprising the following steps:
[0108] (1) In response to a memory allocation instruction, a memory allocation tool is used to read memory information of each server in the server cluster to obtain model information, particle information, and capacity information of the memory in each server.
[0109] (2) According to the model information, particle information, and capacity information of the memory of each server, the memory of each server is classified and summarized to obtain the shared memory of the server cluster.
[0110] Among them, a computing high-speed link switching interface is deployed on each server in the server cluster, and the servers are connected through the computing high-speed link switching interface to share memory between the servers in the server cluster.
[0111] (3) Obtain the memory configuration information entered by the user on the target server.
[0112] (4) Determine a target configuration policy that matches the memory configuration information from a set of preset configuration policies of the server cluster.
[0113] (5) The servers indicated in the target configuration policy are determined as the servers to be allocated, and the memory corresponding to each server indicated in each target configuration policy is determined as the memory required to be allocated to each server to be allocated.
[0114] (6) According to the memory required by each server to be allocated, memory is allocated to each server to be allocated from the shared memory through the deployed memory allocation tool.
[0115] Among them, the memory allocation tool includes an adaptive interface for adapting to different types of servers.
[0116] In an embodiment of the present application, the target server responds to the memory allocation instruction, obtains the shared memory of the server cluster and the memory required to be allocated to at least one server to be allocated in the server cluster, and allocates memory to each server to be allocated from the shared memory through the deployed memory allocation tool according to the memory required to be allocated to each server to be allocated. Among them, the shared memory is the memory jointly constituted by each server in the server cluster. In this method, the target server responds to the memory allocation instruction, and on the basis of obtaining the memory jointly constituted by each server in the server cluster, the memory allocation tool is used to allocate memory to the server to be allocated. Since the shared memory is the memory jointly constituted by each server in the server cluster, including multiple memories of different types and capacities of each server, the shared memory is more comprehensive and rich. On this basis, the target server is more comprehensive and flexible in the way that the memory is allocated to the server to be allocated according to the shared memory, thereby effectively avoiding the fragmentation of memory resources and improving memory utilization. In addition, the target server allocates memory online through the memory allocation tool to avoid multiple disassembly of each server, which can extend the service life of each server in the server cluster to a certain extent.
[0117] In one embodiment, Figure 7 As shown, in the case where each server in a server cluster is inserted with memory, the types of all memories are divided into type A and type B, the particles are divided into particle m and particle n, and the capacities are divided into capacity 1 and capacity 2. As an example, a memory allocation method is provided, and the method includes:
[0118] S701, read the memory information of each server through a memory allocation tool to obtain the memory information of all memories.
[0119] Among them, each server in the server cluster is connected through a high-speed computing link conversion interface, supporting each server in the server cluster to share memory.
[0120] The memory information of each memory includes type A / type B, particle m / particle n, and capacity 1 / capacity 2.
[0121] S702, classify and aggregate each memory according to type information, particle information and capacity information to obtain a shared memory.
[0122] Among them, each type of memory in the shared memory can be used independently, and the memory allocation tool can be called online.
[0123] S703: Perform directional and quantitative allocation of the shared memory according to the user's memory configuration information.
[0124] In the embodiment of the present application, memory sharing between servers in a server cluster is achieved through high-speed computing link sharing technology, and the memory on a server is allocated to a specific server based on individual user needs, supporting dynamic adjustment of memory allocation strategies according to customer needs, so as to better adapt to different user application scenarios and user-specific customized needs. In addition, the memory allocation method provided in the embodiment of the present application provides a memory allocation tool for online allocation, which reduces interference with the server operating environment to a certain extent.
[0125] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0126] Based on the same inventive concept, the embodiment of the present application also provides a memory allocation device for implementing the memory allocation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more memory allocation device embodiments provided below can refer to the limitations on the memory allocation method above, and will not be repeated here.
[0127] In an exemplary embodiment, Figure 8 As shown, a memory allocation device is provided, including: an acquisition module 801 and an allocation module 802, wherein:
[0128] The acquisition module 801 is used to obtain the shared memory of the server cluster and the memory required to be allocated to at least one server to be allocated in the server cluster in response to the memory allocation instruction; the shared memory is the memory jointly constituted by the servers in the server cluster;
[0129] The allocation module 802 is used to allocate memory to each server to be allocated from the shared memory according to the memory required to be allocated to each server to be allocated.
[0130] In one embodiment, a computing high-speed link switching interface is deployed on each server in the server cluster, and the servers are connected through the computing high-speed link switching interface to perform memory sharing among the servers in the server cluster.
[0131] In one embodiment, the acquisition module 801 includes a reading unit and a summarizing unit, wherein:
[0132] A reading unit is used to read the memory information of each server in the server cluster through a memory allocation tool to obtain the model information, particle information and capacity information of the memory in each server;
[0133] The summarizing unit is used to classify and summarize the memory of each server according to the model information, particle information and capacity information of the memory of each server to obtain the shared memory of the server cluster.
[0134] In one embodiment, the acquisition module 801 further includes a configuration unit and a parsing unit, wherein:
[0135] A configuration unit, used to obtain memory configuration information input by a user on a target server;
[0136] The parsing unit is used to parse the memory configuration information through a memory allocation tool to determine the memory required to be allocated to at least one server to be allocated in the server cluster.
[0137] In one embodiment, the parsing unit includes a policy matching subunit and a first determining subunit, wherein:
[0138] A policy matching subunit, used to determine a target configuration policy that matches the memory configuration information from a preset configuration policy set of the server cluster;
[0139] The first determining subunit is used to determine the servers indicated in the target configuration policy as the servers to be allocated, and to determine the memory corresponding to the servers indicated in each target configuration policy as the memory required to be allocated to the servers to be allocated.
[0140] In one embodiment, the parsing unit further includes a second determining subunit, which is used to determine servers with the same server identifier as the servers to be allocated in the server cluster; and determine memory information corresponding to the server identifier as the memory required to be allocated to each server to be allocated.
[0141] In one embodiment, the memory allocation tool includes an adaptive interface for adapting to different types of servers.
[0142] Each module in the above-mentioned memory allocation device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0143] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0144] In response to the memory allocation instruction, the shared memory of the server cluster and the memory required to be allocated to at least one server to be allocated in the server cluster are obtained; the shared memory is the memory jointly constituted by the servers in the server cluster;
[0145] According to the memory required by each server to be allocated, memory is allocated to each server to be allocated from the shared memory through the deployed memory allocation tool.
[0146] In one embodiment, a computing high-speed link switching interface is deployed on each server in the server cluster, and the servers are connected through the computing high-speed link switching interface to perform memory sharing among the servers in the server cluster.
[0147] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0148] Use the memory allocation tool to read the memory information of each server in the server cluster to obtain the model information, particle information, and capacity information of the memory in each server;
[0149] According to the model information, particle information and capacity information of the memory of each server, the memory of each server is classified and summarized to obtain the shared memory of the server cluster.
[0150] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0151] Obtain the memory configuration information entered by the user on the target server;
[0152] The memory configuration information is parsed by a memory allocation tool to determine the memory required to be allocated to at least one server to be allocated in the server cluster.
[0153] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0154] Determine a target configuration policy that matches the memory configuration information from a set of preset configuration policies of the server cluster;
[0155] The servers indicated in the target configuration policy are determined as the servers to be allocated, and the memory corresponding to each server indicated in each target configuration policy is determined as the memory required to be allocated to each server to be allocated.
[0156] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0157] In the server cluster, servers with the same server identifier are determined as servers to be allocated; and memory information corresponding to the server identifier is determined as memory required to be allocated to each server to be allocated.
[0158] In one embodiment, the memory allocation tool includes an adaptive interface for adapting to different types of servers.
[0159] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0160] In response to the memory allocation instruction, the shared memory of the server cluster and the memory required to be allocated to at least one server to be allocated in the server cluster are obtained; the shared memory is the memory jointly constituted by the servers in the server cluster;
[0161] According to the memory required by each server to be allocated, memory is allocated to each server to be allocated from the shared memory through the deployed memory allocation tool.
[0162] In one embodiment, a computing high-speed link switching interface is deployed on each server in the server cluster, and the servers are connected through the computing high-speed link switching interface to perform memory sharing among the servers in the server cluster.
[0163] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0164] Use the memory allocation tool to read the memory information of each server in the server cluster to obtain the model information, particle information, and capacity information of the memory in each server;
[0165] According to the model information, particle information and capacity information of the memory of each server, the memory of each server is classified and summarized to obtain the shared memory of the server cluster.
[0166] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0167] Obtain the memory configuration information entered by the user on the target server;
[0168] The memory configuration information is parsed by a memory allocation tool to determine the memory required to be allocated to at least one server to be allocated in the server cluster.
[0169] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0170] Determine a target configuration policy that matches the memory configuration information from a set of preset configuration policies of the server cluster;
[0171] The servers indicated in the target configuration policy are determined as the servers to be allocated, and the memory corresponding to each server indicated in each target configuration policy is determined as the memory required to be allocated to each server to be allocated.
[0172] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0173] In the server cluster, servers with the same server identifier are determined as servers to be allocated; and memory information corresponding to the server identifier is determined as memory required to be allocated to each server to be allocated.
[0174] In one embodiment, the memory allocation tool includes an adaptive interface for adapting to different types of servers.
[0175] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0176] In response to the memory allocation instruction, the shared memory of the server cluster and the memory required to be allocated to at least one server to be allocated in the server cluster are obtained; the shared memory is the memory jointly constituted by the servers in the server cluster;
[0177] According to the memory required by each server to be allocated, memory is allocated to each server to be allocated from the shared memory through the deployed memory allocation tool.
[0178] In one embodiment, a computing high-speed link switching interface is deployed on each server in the server cluster, and the servers are connected through the computing high-speed link switching interface to perform memory sharing among the servers in the server cluster.
[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0180] Use the memory allocation tool to read the memory information of each server in the server cluster to obtain the model information, particle information, and capacity information of the memory in each server;
[0181] According to the model information, particle information and capacity information of the memory of each server, the memory of each server is classified and summarized to obtain the shared memory of the server cluster.
[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0183] Obtain the memory configuration information entered by the user on the target server;
[0184] The memory configuration information is parsed by a memory allocation tool to determine the memory required to be allocated to at least one server to be allocated in the server cluster.
[0185] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0186] Determine a target configuration policy that matches the memory configuration information from a set of preset configuration policies of the server cluster;
[0187] The servers indicated in the target configuration policy are determined as the servers to be allocated, and the memory corresponding to each server indicated in each target configuration policy is determined as the memory required to be allocated to each server to be allocated.
[0188] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0189] In the server cluster, servers with the same server identifier are determined as servers to be allocated; and memory information corresponding to the server identifier is determined as memory required to be allocated to each server to be allocated.
[0190] In one embodiment, the memory allocation tool includes an adaptive interface for adapting to different types of servers.
[0191] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0192] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0193] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0194] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A memory allocation method, characterized in that: Applied to any target server in a server cluster, the method comprises: In response to the memory allocation instruction, the shared memory of the server cluster and the memory required to be allocated to at least one server to be allocated in the server cluster are acquired; the shared memory is the memory jointly constituted by the servers in the server cluster; According to the memory required to be allocated to each of the servers to be allocated, memory is allocated to each of the servers to be allocated from the shared memory through a deployed memory allocation tool.
2. The method according to claim 1, characterized in that A computing high-speed link switching interface is deployed on each server in the server cluster, and the servers are connected through the computing high-speed link switching interface to perform memory sharing among the servers in the server cluster.
3. The method according to claim 1 or 2, characterized in that: The step of obtaining the shared memory of the server cluster includes: Reading memory information of each server in the server cluster through the memory allocation tool to obtain model information, particle information and capacity information of the memory in each server; According to the model information, particle information and capacity information of the memory of each server, the memory of each server is classified and aggregated to obtain the shared memory of the server cluster.
4. The method according to claim 1 or 2, characterized in that: The obtaining of memory required to be allocated to at least one server to be allocated in the server cluster includes: Obtaining memory configuration information input by a user on the target server; The memory configuration information is parsed by the memory allocation tool to determine the memory required to be allocated to at least one server to be allocated in the server cluster.
5. The method according to claim 4, characterized in that The step of parsing the memory configuration information by the memory allocation tool to determine the memory required to be allocated to the server to be allocated includes: Determining a target configuration policy that matches the memory configuration information from a set of preset configuration policies of the server cluster; The servers indicated in the target configuration policy are determined as the servers to be allocated, and the memory corresponding to each server indicated in each target configuration policy is determined as the memory required to be allocated to each server to be allocated.
6. The method according to claim 4, characterized in that The memory configuration information includes a server identifier of a server to be allocated and corresponding memory information, and the memory configuration information is parsed by a memory allocation tool to determine the memory required to be allocated to the server to be allocated, including: In the server cluster, servers with the same server identifier as the server are determined as the servers to be allocated; and memory information corresponding to the server identifier is determined as the memory required to be allocated to the servers to be allocated.
7. The method according to claim 1 or 2, characterized in that: The memory allocation tool includes an adaptive interface for adapting to different types of servers.
8. A memory allocation device, characterized in that: The device comprises: An acquisition module, configured to acquire, in response to a memory allocation instruction, a shared memory of a server cluster and a memory required to be allocated to at least one server to be allocated in the server cluster; the shared memory is a memory jointly constituted by all servers in the server cluster; The allocation module is used to allocate memory to each of the servers to be allocated from the shared memory according to the memory required to be allocated to each of the servers to be allocated.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.