Cloud computing-oriented memory allocation method and apparatus, cloud computing-oriented memory acquisition method and apparatus, and device
By filtering and matching the communication performance and memory resources of cloud computing nodes and establishing an evaluation index system, the problem of poor remote memory allocation in cloud computing is solved, and efficient utilization of remote memory and improvement of system comprehensive performance is achieved.
Patent Information
- Application Number
- PCT/CN2024/082277
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-13
- Filing Date
- 2024-03-18
- Publication Date
- 2024-12-19
AI Technical Summary
The existing remote memory allocation method in cloud computing leads to complex system management and poor allocation effect, and fails to effectively consider subsequent memory requests and the allocation of contributors, resulting in low remote memory space utilization.
By receiving request messages from different nodes, filter out a collection of contributing nodes that meet communication performance and memory resource size, establish a matching relationship, calculate the evaluation index value, and select the optimal matching combination to provide remote memory resources for the requesting nodes to ensure the overall system effect optimization.
The optimal matching between the remote memory contribution node and the requesting node within the multi-node range is achieved, which avoids remote memory fragmentation, and improves the efficient utilization of remote memory space and comprehensive system performance.
Smart Images

Figure CN2024082277_19122024_PF_FP_ABST
Abstract
Description
Memory allocation method, memory acquisition method, device and equipment for cloud computing
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on June 13, 2023, with application number 202310695558.5, and entitled “Memory allocation method, memory acquisition method, device and equipment for cloud computing”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of computers, and in particular to a memory allocation method, memory acquisition method, apparatus, and device for cloud computing. Background Art
[0004] Cloud computing typically consists of dozens, hundreds, or even tens of thousands of computer server nodes. Most of these server nodes are commercial standard servers, each with its own independent processor, memory, and hard disk storage space. With the development of big data analytics and artificial intelligence, applications are increasingly demanding more memory. A single server node cannot meet the memory needs of an application. Therefore, it is considered to utilize the remote memory of other server nodes. One or more nodes from a large pool of nodes can be rationally and efficiently selected as contributors to provide memory resources to the requesting node.
[0005] Currently, a method for allocating remote memory primarily uses the requesting node as the center, searching for contributing nodes based on distance from the requesting node and then allocating remote memory to the requesting node. However, this method can lead to multiple contributing nodes within a short communication distance jointly fulfilling the needs of a single requesting node, complicating system management. Furthermore, this method requires memory allocation for each requesting node individually, without considering the subsequent memory allocations of other requesting nodes and contributors, resulting in poor overall system allocation results.
[0006] Summary of the Invention
[0007] In view of this, the present application provides a memory allocation method, apparatus, device and non-volatile readable storage medium for cloud computing to solve the above-mentioned problem of poor allocation effect caused by allocating remote memory resources to the requesting node.
[0008] In the first aspect, the present application provides a memory allocation method for cloud computing, which includes: receiving request messages from different nodes within a preset time, each request message is used to request remote memory resources, and each request message includes: an identifier of the requesting node and the size of the requested remote memory resources; based on the identifier of the requesting node and the size of the requested remote memory resources, the nodes in the cluster are screened for communication performance and memory resource size, and a contributing node set is determined for each requesting node, each contributing node set includes at least one contributing node; establishing a matching relationship between different requesting nodes and contributing nodes in different contributing node sets, and generating at least two valid matching combinations, wherein each valid matching combination includes multiple matching relationships, and each matching relationship is a binding relationship between a requesting node and a contributing node that provides remote memory resources for it; calculating the evaluation index value of each valid matching combination, and comparing all evaluation indicators; determining the target evaluation index based on the evaluation index value, and providing remote memory resources for different node requesting nodes based on the target valid matching combination.
[0009] In combination with the first aspect, in an optional implementation of the first aspect, the nodes in the cluster are screened for communication performance based on the identifier of the requesting node and the size of the requested remote memory resources, including: screening one or more contributing nodes that meet the communication performance requirements in the node topology information table of the cluster based on the identifier of the requesting node to obtain a first contributing node set.
[0010] In combination with the first aspect, in another optional implementation of the first aspect, the memory resource size of the nodes in the cluster is screened according to the remote resource memory size requested by the requesting node, and a contribution node set is determined for the requesting node, including: screening one or more contributor nodes in the first contribution node set that meet the remote memory resource size required by the current requesting node, and sorting the screened one or more contributor nodes according to preset rules to obtain a second contribution node set.
[0011] In combination with the first aspect, in another optional implementation of the first aspect, one or more contributing nodes that meet the communication performance requirements are screened out in the node topology information table of the cluster based on the identifier of the requesting node, including: establishing a node topology information table, the node topology information table including: node information of each node in the cluster, connection relationships between each node, communication delay parameters between nodes, communication bandwidth parameters and memory resources that can be contributed by the node; determining the location of the requesting node based on the identifier of the requesting node; and screening out one or more contributing nodes that meet the communication performance requirements and the communication distance requirements in the node topology information table based on the location of the requesting node.
[0012] In combination with the first aspect, in another optional implementation of the first aspect, screening out one or more contributing nodes that meet the communication performance requirements includes: screening so that the communication distance between the current requesting node and the current contributing node does not exceed a preset communication distance.
[0013] The communication distance is the sum of the communication distances of each hop between the current requesting node and the current contributing node, and the communication distance of each hop is the product of the communication delay parameter and the communication bandwidth parameter of that section.
[0014] In combination with the first aspect, in another optional implementation of the first aspect, a matching relationship is established between different requester nodes and contributing nodes in at least one contributing node set, and a set of at least one valid matching combination is generated, including: obtaining the remote memory resource size E requested by the i-th requester node i , and the contributing node set screened for the i-th requesting node, the contributing node set includes m contributing nodes, and the memory resource size of any node among the m nodes is P j , m≥1 and is a positive integer; the remote memory resource E requested by the i-th requesting node is enumerated. i and the memory resources P of the contributing node j Establish two or more matching relationships according to the rules to generate at least two valid matching combinations.
[0015] In combination with the first aspect, in another optional implementation of the first aspect, an enumeration method is used according to the remote memory resource E requested by the i-th requesting node. i and the memory resources P of the contributing node j Establish two or more matching relationships according to the rules, including: according to the following rules based on the remote memory resource E requested by the i-th requesting node i and the contributor's memory resources P j Establish a matching relationship:
[0016] If P is satisfied j ≥1.2E i , and P j -E i ≥1G, then allocate remote memory resources of size E to the i-th requesting node i ,
[0017] If P is not satisfied j ≥1.2E i , and P j -E i ≥1G, then allocate remote memory resources of size P to the i-th requesting node j .
[0018] In combination with the first aspect, in another optional implementation of the first aspect, calculating the evaluation index value of each valid matching combination includes: calculating the remote memory resource E applied for by the i-th requesting node according to ... i and actually allocate remote memory R i , and the communication routing hop count to calculate the evaluation index value of each valid matching combination.
[0019] In combination with the first aspect, in another optional implementation of the first aspect, according to the remote memory resource E requested by the i-th requesting node i and actually allocate remote memory R i , and the communication route hop count to calculate the evaluation index value of each valid matching combination, including: using a preset relationship to calculate the evaluation index value of each valid matching combination; the preset relationship is:
[0020] Among them, O k is the evaluation index value corresponding to the kth effective matching combination, E i is the size of the remote memory resource requested by the i-th requester node, R i The size of remote memory resources actually allocated to the i-th requester node, W i is the number of routing hops between the remote memory requester node and the remote memory contributor node, and n is the number of matching relationships.
[0021] In combination with the first aspect, in another optional implementation of the first aspect, after establishing the node topology information table, it also includes: establishing an array unit including each node in the cluster, wherein each array unit includes: a linked list pointer, the size of the memory resources that can be contributed, and the node type; setting the index of each array unit, the index being the node number of each node; generating a node topology graph based on the array unit of each node and the index of each array unit and the node connection relationship.
[0022] In combination with the first aspect, in another optional implementation of the first aspect, the method also includes: periodically communicating with each node in the cluster and obtaining the size of the contributable memory resources of each node and whether there is a remote memory requirement; if the memory resources of the contributing node change, or there is a remote memory requirement, recording and updating the node topology information table.
[0023] In combination with the first aspect, in another optional implementation of the first aspect, the method further includes: if P is satisfied j ≥1.2E i , and P j -E i ≥1G, then the memory resource P of the contributing node will be jSplit into two or more parts, where one part of the memory resources is used to provide to the current requester node, and the remaining part of the memory resources is used to provide to other requester nodes.
[0024] In combination with the first aspect, in another optional implementation of the first aspect, the method further includes: sending an indication message of the target valid allocation combination to different requesting nodes and corresponding contributing nodes, and recording and updating the node topology information table.
[0025] On the second aspect, the present application also provides a memory allocation method for cloud computing, the method comprising: receiving request messages from different nodes within a preset time, each request message being used to request remote memory resources, and each request message including: an identifier of the requesting node and the size of the requested remote memory resources; based on the identifier of the requesting node and the size of the requested remote memory resources, screening the nodes in the cluster for communication performance and memory resource size respectively, and determining a contributing node set for each requesting node, each contributing node set including at least one contributing node; establishing a matching relationship between different requesting nodes and contributing nodes in different contributing node sets, and generating at least two valid matching combinations, wherein each valid matching combination includes multiple matching relationships, and each matching relationship is a binding relationship between a requesting node and a contributing node that provides it with remote memory resources; sending at least two valid matching combinations to different requesting nodes, so that each requesting node selects a target valid matching combination and obtains remote memory resources.
[0026] On the third aspect, the present application also provides a memory acquisition method for cloud computing, the method including: the first node generates a first request message, the first request message including: the identifier of the first node and the size of the remote memory resource requested by the first node; the first node sends the first request message to the controller; the first node receives the target effective matching combination fed back by the controller based on the first request message, the target effective combination including the binding relationship between the first node and the contributor node that provides it with remote memory resources; the first node obtains the remote memory resources provided by the contributor node based on the target effective matching combination.
[0027] In a fourth aspect, the present application also provides a memory acquisition method for cloud computing, the method comprising: the second node generates a second request message, the second request message comprising: the identifier of the second node and the size of the remote memory resource requested by the second node; the second node sends the second request message to the controller; the second node receives at least two valid matching combinations fed back by the controller based on the second request message, wherein each valid matching combination comprises multiple matching relationships, each matching relationship being a binding relationship between a requesting node and a contributing node that provides remote memory resources for it; the second node determines a target valid matching combination among the at least two valid matching combinations, and obtains the remote memory resources provided by the contributing node based on the target valid matching combination.
[0028] In a fifth aspect, the present application also provides a memory allocation device for cloud computing, the device comprising: a first receiving module, configured to receive request messages from different nodes within a preset time, each request message is used to request remote memory resources, and each request message includes: an identifier of the requesting node and the size of the requested remote memory resources; a first determining module, configured to screen the nodes in the cluster for communication performance and memory resource size according to the identifier of the requesting node and the size of the requested remote memory resources, and determine a contributing node set for each requesting node, the contributing node set including at least one contributing node; a first matching module, configured to It is configured to establish a matching relationship between different requester nodes and two or more contributing nodes in different contributing node sets, and generate a set of at least two valid matching combinations, wherein each valid matching combination includes multiple matching relationships, and each matching relationship is a binding relationship between a requester node and a contributing node that provides remote memory resources for it; the first calculation module is configured to calculate the evaluation index value of each valid matching combination and compare all evaluation index values; the first determination module is further configured to determine the target valid matching combination according to the evaluation index value, and provide remote memory resources for each requester node according to the target valid matching combination.
[0029] In a sixth aspect, the present application also provides a memory allocation device for cloud computing, the device comprising: a second receiving module, configured to receive request messages from different nodes within a preset time, each request message being used to request remote memory resources, and each request message including: an identifier of the requesting node and the size of the requested remote memory resources; a second determination module, configured to screen the nodes in the cluster based on the identifier of the requesting node and the size of the requested remote memory resources, and determine a contributing node set for each requesting node, each contributing node set including at least one contributing node; a second matching module, configured to establish a matching relationship between different requesting nodes and contributing nodes in different contributing node sets, and generate at least two valid matching combinations, wherein each valid matching combination includes multiple matching relationships, each matching relationship being a binding relationship between a requesting node and a contributing node that provides it with remote memory resources; a second sending module, configured to send at least two valid matching combinations to different requesting nodes, so that each requesting node selects a target valid matching combination and obtains remote memory resources.
[0030] In the seventh aspect, the present application also provides a memory allocation system, which includes a controller and a computer cluster, wherein the computer cluster includes multiple nodes, some of the multiple nodes are requester nodes, and some of the nodes are contributor nodes; one or more requester nodes send a request message to the controller, each request message is used to request remote memory resources, and each request message includes: an identifier of the requester node and the requested remote memory resource size; the controller receives request messages from different nodes within a preset time period, and screens the nodes in the cluster based on communication performance and memory resource size according to the identifier of the requester node and the requested remote memory resource size, and determines a contributor node set for each requester node, each contributor node set including at least one contributor node; the controller establishes a matching relationship between different requester nodes and contributor nodes in different contributor node sets, and generates at least two valid matching combinations, wherein each valid matching combination includes multiple matching relationships, each matching relationship is a binding relationship between a requester node and a contributor node that provides it with remote memory resources; and sends at least two valid matching combinations to different requester nodes.
[0031] The first node among multiple requesting nodes receives a target valid matching combination fed back by the controller based on the first request message, where the target valid combination includes a binding relationship between the first node and a contributing node that provides remote memory resources for the first node; and obtains the remote memory resources provided by the contributing node based on the target valid matching combination.
[0032] In combination with the seventh aspect, in an optional implementation of the seventh aspect, the controller also establishes a node topology information table, which includes: information about each node connected in the computer cluster, the connection relationship between the nodes, the communication delay parameters and communication bandwidth parameters between the nodes, the node type, and the memory that the node can contribute.
[0033] In an eighth aspect, the present application provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the computer instructions to thereby execute the memory allocation method for cloud computing of the above-mentioned first aspect or second aspect and any corresponding embodiment thereof.
[0034] In addition, when executing computer instructions, the processor also executes the cloud computing-oriented memory acquisition method of the third and fourth aspects mentioned above.
[0035] Optionally, the present application provides a computer non-volatile readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute the cloud computing-oriented memory allocation method of the above-mentioned first aspect or second aspect and any corresponding embodiment, or to execute the cloud computing-oriented memory acquisition method of the above-mentioned third aspect and fourth aspect.
[0036] The present application provides a memory allocation method, a memory acquisition method, an apparatus and a device for cloud computing. The method first screens the nodes in the cluster for communication performance and memory resource size, determines a contributing node set for each requesting node, then establishes a matching relationship between different requesting nodes and different contributing nodes, forms at least two valid matching combinations for the multiple matching relationships of the contributing nodes screened for all requesting nodes, and then calculates the evaluation index value of each valid matching combination; compares all the evaluation index values to determine the target valid matching combination, and provides remote memory resources for different requesting nodes according to the target valid matching combination.
[0037] This method solves the problem of matching multiple remote memory contribution nodes with multiple remote memory request nodes within a large number of nodes. It finds the optimal matching combination for remote memory contribution nodes and remote memory request nodes based on the overall system effect, avoids the unreasonable allocation results caused by matching one by one, uses one remote memory contribution node to satisfy one remote memory request, avoids remote memory fragmentation, and makes efficient use of remote memory space and better overall system effect.
[0038] In addition, in the process of screening contributing nodes, this method not only considers the distance from the requesting node, but also considers the communication performance between nodes and the size of the memory resources that can be contributed. Therefore, the matching contributing nodes screened for different requesting nodes can provide remote resource services more effectively and conveniently. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the specific implementation methods or the description of the prior art. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0040] FIG1 is a flow chart of a memory allocation method for cloud computing provided in an embodiment of the present application;
[0041] FIG2 is a schematic diagram of a process for screening contributing nodes for a requesting node according to an embodiment of the present application;
[0042] FIG3 is a schematic diagram of another process for a requesting node to screen a contributing node according to an embodiment of the present application;
[0043] FIG4 is a flow chart of another memory allocation method for cloud computing provided in an embodiment of the present application;
[0044] FIG5a is a node topology diagram provided in an embodiment of the present application;
[0045] FIG5 b is a schematic diagram of a node topology information table provided in an embodiment of the present application;
[0046] FIG6 is a flow chart of a memory acquisition method according to an embodiment of the present application;
[0047] FIG7 is a flow chart of another memory acquisition method provided in an embodiment of the present application;
[0048] FIG8 is a structural block diagram of a memory allocation device and a memory acquisition device provided in an embodiment of the present application;
[0049] FIG9 is a structural block diagram of another memory allocation device and memory acquisition device provided in an embodiment of the present application;
[0050] FIG10 is a structural block diagram of another memory allocation device provided in an embodiment of the present application;
[0051] FIG11 is a schematic diagram of the hardware structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] To make the purpose, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.
[0053] The technical solution of the present application is applied to a computer cluster application scenario, such as a cloud computing platform or other network platform. The application scenario includes a controller and a computer cluster, which includes multiple nodes. These nodes can act as requester nodes to request remote memory from a server or controller, and can also act as contributor nodes to provide remote memory resources to the requester nodes.
[0054] It should be understood that the controller includes but is not limited to a control device or a control module, and may also be a global memory manager or a global memory controller, etc., and the embodiments of the present application are not limited to this.
[0055] The current method for allocating remote memory resources is to first establish a node distribution table, which includes the amount of memory that each node can contribute and the connection relationship between the nodes. If a memory requester requests the allocation of remote memory, the node that can serve as a contributor is searched for based on the distance from the requester to the farthest node, and the remote memory is allocated to the requester.
[0056] The distance of the above scheme is the number of routing hops from other nodes to the requesting node. When allocating remote memory, the first-hop surrounding nodes are searched first. When the sum of the free memory of the first-hop surrounding nodes can meet the requester's needs, the memory of one or more surrounding nodes is allocated to the requesting node. If the sum of the free memory of the first-hop surrounding nodes cannot meet the requester's needs, the second-hop is searched again and again until the memory requester's needs are met.
[0057] This solution simplifies the remote memory allocation problem into a remote memory demand allocation problem for each memory requester, while also considering communication distance as a key factor. The Remote Direct Memory Access (RDMA) communication network is a CPU-ByPass (Central Processing Unit Bypass) technology. This solution only considers the impact of communication distance, which may result in multiple memory contributor nodes with close communication distances meeting the needs of a single memory requester node. However, this can complicate system management.
[0058] It should be noted that the technical solutions of the embodiments of this application can be applied to matching remote memory requesters and contributors using RDMA technology, as well as matching memory demanders and contributors using CXL technology. Furthermore, the solutions can also be applied to other methods or technologies beyond the RDMA and Compute Express Link (CXL) technology fields, which are not limited by the embodiments of this application.
[0059] Among them, CXL is a new type of high-speed interconnection technology.
[0060] In addition, when the remote memories of multiple remote memory requesters and remote memory contributors need to be matched, allocating memory to each memory requester one by one does not consider the allocation status of subsequent memory requester nodes, and the overall effect of the allocation result is not good.
[0061] This application proposes an efficient remote memory allocation method and memory acquisition method to solve the problem of memory allocation matching memory contributing nodes and memory requesting nodes within a large number of nodes, with the aim of achieving efficient utilization of remote memory space and the best overall effect of system comprehensive performance.
[0062] According to an embodiment of the present application, an embodiment of a memory allocation method for cloud computing is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0063] In this embodiment, a memory allocation method for cloud computing is provided, which can be used in network devices such as a controller, a global memory manager, a global memory controller, or a control center. FIG1 is a flow chart of a memory allocation method for cloud computing according to an embodiment of the present application. As shown in FIG1 , the process includes the following steps:
[0064] Step S101: receiving request messages from different nodes within a preset time, each request message being used to request remote memory resources.
[0065] Each request message includes: the identifier of the requesting node and the requested remote memory resource size. In addition, it may also include information such as the location of the requesting node and communication status.
[0066] The preset time can be customized, such as periodically or based on external conditions to actively trigger the reception of request messages, which is not limited in the embodiments of the present application.
[0067] Step S102: Based on the identifier of the requesting node and the requested remote memory resource size, the nodes in the cluster are screened for communication performance and memory resource size, and a contributing node set is determined for each requesting node.
[0068] Among them, each contributing node set includes at least one contributing node, and at least one contributing node meets the memory resource requirements and communication performance conditions of the requesting node. Optionally, the memory resource requirement refers to the memory resource size required by the requesting node, and the communication performance conditions include communication distance and other conditions.
[0069] Optionally, as shown in FIG2 , an optional implementation includes the following:
[0070] Step S102 - 1 : One or more contributing nodes that meet the communication performance requirements are screened from the node topology information table of the cluster according to the identifier of the requesting node to obtain a first contributing node set.
[0071] Step S102-2: Filter one or more contributing nodes that meet the remote memory resource size required by the requesting node from the first contributing node set, and sort the filtered one or more contributing nodes according to preset rules to obtain a second contributing node set.
[0072] Among them, the preset rule sorting can be sorting in order of memory resources from large to small, or other custom rules can be used, and the embodiments of the present application do not limit this.
[0073] And the second contribution node set is a contribution node set determined for the current node in the aforementioned step S102.
[0074] Optionally, the number of contributing nodes in the second contributing node set does not exceed 10.
[0075] Step S103: establishing matching relationships between different requester nodes and contributing nodes in different contributing node sets, and generating at least two valid matching combinations.
[0076] Each valid matching combination includes multiple matching relationships, each of which is a binding relationship between a requesting node and a contributing node that provides remote memory resources. Optionally, each valid combination includes matching relationships between all requesting nodes and matching contributing nodes. Furthermore, the matching method can be enumeration.
[0077] A requesting node can be assigned a set of contributing nodes, each of which can include one or more contributing nodes. For example, if the contributing node set corresponding to node 1 includes nodes {3, 4}, both nodes 3 and 4 can provide remote memory resources to node 1. Similarly, the contributing node set corresponding to node 2 is {3, 4, 5}, indicating that nodes 3, 4, and 5 can all provide remote memory resources to node 2.
[0078] If node 3 is a contributing node to requesting node 1, then node 1 and node 3 form one matching relationship. Similarly, if node 4 is a contributing node to node 2, then node 2 and node 4 form another matching relationship. The first valid matching combinations are: node 1 and node 3, and node 2 and node 4. Similarly, second and third valid matching combinations can also be generated. The second valid matching combination is: node 1 and node 4, and node 2 and node 3. The third valid matching combination is: node 1 and node 4, and node 2 and node 5. After polling all node matching relationships, at least two valid matching combinations are generated.
[0079] Step S104: Calculate the evaluation index value of each valid matching combination and compare all evaluation index values.
[0080] Optionally, a method for calculating an evaluation index value for each valid matching combination includes:
[0081] According to the remote memory resource E requested by the i-th requester node i and actually allocate remote memory R i , and the communication routing hop count to calculate the evaluation index value of each valid matching combination;
[0082] Optionally, a preset relationship may be used to calculate the evaluation index value of each valid matching combination; the preset relationship is:
[0083] Among them, O k is the evaluation index value corresponding to the kth effective matching combination, E i is the size of the remote memory resource requested by the i-th requester node, R i The size of remote memory resources actually allocated to the i-th requester node, W i is the number of routing hops between the remote memory requester node and the remote memory contributor node, and n is the number of matching relationships.
[0084] Step S105: determining a target effective matching combination according to the evaluation index value, and providing remote memory resources to each requesting node according to the target effective matching combination.
[0085] Optionally, an optional implementation is to compare all evaluation index values and select the smallest one among all evaluation index values. The effective matching combination corresponding to the minimum evaluation index value is the target effective matching combination, and the target effective matching combination includes a remote memory resource allocation plan of at least one contributing node provided for each requesting node.
[0086] The controller provides remote memory resources to each requesting node according to the determined remote memory resource allocation scheme.
[0087] The method provided in the embodiment of the present application solves the problem of matching multiple remote memory contribution nodes with multiple remote memory request nodes within a large number of nodes. It finds the optimal matching combination for remote memory contribution nodes and remote memory request nodes from the perspective of the overall system effect, avoids unreasonable allocation results caused by matching one by one, uses one remote memory contribution node to satisfy one remote memory request, avoids remote memory fragmentation, and makes efficient use of remote memory space and better overall system effect.
[0088] In an optional implementation of the embodiment of the present application, in the above step S102, as shown in FIG3 , the following is further included:
[0089] Step S1021: Create a node topology information table.
[0090] The node topology information table includes: node information of each node connected in the cluster, connection relationships between nodes, communication delay parameters and communication bandwidth parameters between nodes, node type, and the size of memory resources that the node can contribute.
[0091] The node topology information table may be obtained and generated before receiving the request message sent by the requesting node.
[0092] Step S1022: Determine the location of the requesting node according to the identifier of the requesting node.
[0093] Step S1023: One or more contributing nodes that meet the communication performance requirements and the communication distance requirements are screened out from the node topology information table according to the location of the requesting node.
[0094] Alternatively, an optional implementation of step S1023 is: based on the location of the requesting node and the communication performance requirements, searching the node topology information table for contributing nodes that can provide remote memory, and establishing a remote memory contributing node linked list. The remote memory contributing node linked list includes at least one memory contributing node.
[0095] Optionally, the specific implementation of the above step S1023 may adopt steps S102-1 and S102-2 as shown in FIG2 , which will not be described in detail in this embodiment.
[0096] In addition, the above method also includes: if it is detected that at least one of the node information, node connection relationship, communication delay parameters, communication bandwidth parameters, node type and node contributable memory has changed, the node topology information table is updated according to the changed item, and the updated node topology information table is used to filter the contributing nodes that can provide remote memory resources for the requesting node.
[0097] Optionally, the above-mentioned searching for contributing nodes that can provide remote memory in the node topology information table based on the location of the requesting node and the communication performance requirements includes: searching for one or more contributing nodes that can provide remote memory that meet the communication performance requirements based on the communication delay parameters and communication bandwidth parameters of the nodes in the node topology information table.
[0098] In an embodiment of the present application, at least one memory contribution node in the determined remote memory contribution node list also meets the communication distance requirement; the communication distance is the sum of the communication distances of each hop route between the remote memory contribution node and the requesting node, and the communication distance requires that the sum of the communication distances does not exceed the preset communication distance, and the communication distance of each hop route is the product of the communication delay parameter of that segment and the communication bandwidth parameter.
[0099] It can be expressed by the formula: L≤L max , L=∑a i-j b i-j ,
[0100] Where L is the sum of the per-hop routing communication distances between the remote memory contributing node and the requesting node, L max is the preset communication distance, a i-j is the communication delay parameter, b i-j is the communication bandwidth parameter, a i-j b i-j is the communication delay parameter a i-j and the communication bandwidth parameter b i-j The product of.
[0101] The method provided in the embodiment of the present application first screens one or more qualified contributing nodes based on communication performance requirements, and then screens nodes that meet the requirements of the current requesting node based on memory size among all the screened contributing nodes. Finally, the matching of the requesting node and the contributing node is calculated, at least two valid matching combinations are constructed, and the evaluation index value of the valid matching combination is calculated, so that the performance of the screened contributing nodes is optimized and the efficiency of providing remote memory resources is the highest.
[0102] In addition, in the process of screening contributing nodes, this method not only considers the distance from the requesting node, but also considers the communication performance between nodes and the size of the memory resources that can be contributed. Therefore, the matching contributing nodes screened for different requesting nodes can provide remote resource services more effectively and conveniently.
[0103] Alternatively, an optional implementation is to assume that the size of the remote memory resource requested by the i-th requesting node is E i In the above step S103, a matching relationship is established between different requesting nodes and contributing nodes in different contributing node sets to generate at least two valid matching combinations, including:
[0104] The number of contributing nodes screened for the i-th requesting node is m, where the memory resource size of any one of the m nodes is P j , m ≥ 1 and is a positive integer;
[0105] The enumeration method is used to obtain the remote memory resource E requested by the i-th requesting node. i and the memory resources P of the contributing node j Establish a matching relationship according to the rules and generate at least two valid matching combinations.
[0106] Optionally, an enumeration method is used according to the remote memory resource E requested by the i-th requesting node. i and the memory resources P of the contributing node j Establish a matching relationship according to the rules and generate at least two valid matching combinations, including:
[0107] According to the following rules, the remote memory resource E requested by the i-th requester node i and the contributor's memory resources P j Establish a matching relationship:
[0108] If P is satisfied j ≥1.2E i , and P j -E i ≥1G, then allocate remote memory resources of size E to the i-th requesting node i If P is not satisfied j ≥1.2E i , and P j -E i ≥1G, then the size of the remote memory resource provided to the j-th requester node is P j .
[0109] Among them, E i The memory resource size requested by the i-th requester node, P jis the size of remote memory resources that can be contributed by the j-th contributing node. i and j are constants used to identify the requesting node and contributing node.
[0110] The matching determination algorithm, also known as a remote memory matching method, includes but is not limited to CXL technology. Furthermore, the matching determination algorithm may be other matching algorithms, and may be used with matching methods / algorithm models used in other inter-machine memory sharing technologies.
[0111] Optionally, the above method further includes: when P is satisfied j ≥1.2E i , and P j -E i ≥1G, the memory resources P that can be contributed by the j-th contributing node j Split into two or more parts, where a part of the memory resources is used to provide to the current requesting node, and the remaining part of the memory resources is used to provide to other requesting nodes. For example, split into the first part and the second supplement, the size of the first part is E i , the second part of the resource size is P j -E i .
[0112] For example, the first part of the memory resource size is E i To the remote memory requester node M i , the second part (P j -E i ) The remote memory continues to serve as the contributable memory of the node; otherwise, the remote memory contributes to node K j Contributable remote memory P j All allocated to the remote memory requester node M i .
[0113] In another optional implementation of the embodiment of the present application, the above step S104, after determining the target valid matching combination, also includes: sending an indication message of the target valid allocation combination to different requesting nodes and corresponding contributing nodes, and recording and updating the node topology information table, so that the node topology information table is the latest table.
[0114] Optionally, in an optional embodiment, a memory resource allocation scheme is further provided, as shown in FIG4 , the method includes:
[0115] Step S201: receiving request messages from different nodes within a preset time, each request message is used to request remote memory resources, and each request message includes: an identifier of the requesting node and the requested remote memory resource size.
[0116] Step S201 is the same as step S101 in the above embodiment.
[0117] Step S202: Based on the identifier of the requesting node and the requested remote memory resource size, the nodes in the cluster are screened for communication performance and memory resource size, and a contributing node set is determined for each requesting node.
[0118] Each contributing node set includes at least one contributing node.
[0119] Step S202 is the same as step S102 in the aforementioned embodiment.
[0120] Step S203: establishing matching relationships between different requester nodes and contributing nodes in at least one contributing node set, and generating at least two valid matching combinations.
[0121] Step S203 is the same as step S103 in the above embodiment.
[0122] Step S204: sending at least two valid matching combinations to different requesting nodes, so that each requesting node selects a target valid matching combination and obtains remote memory resources.
[0123] Different from step S104 of the aforementioned embodiment, in this step, the controller sends multiple valid matching combinations to different requesting nodes, such as the first node or the second node, and then the requesting node at the receiving end determines the target valid matching combination by itself, and then obtains the remote memory resources of the contributing node according to the target valid matching combination.
[0124] One way to determine the target effective matching combination is to use the method of the aforementioned step S104 to calculate the evaluation index value of each effective matching combination set, and select the smallest one from all evaluation index values as the target evaluation index value, and then determine the effective matching combination corresponding to the target evaluation index value as the target effective matching combination.
[0125] The specific determination process can be found in the description of the aforementioned embodiment, which will not be repeated here in this embodiment.
[0126] The present application provides two solutions. One is that the controller directly determines a target valid matching combination for the requesting node based on the memory requirements of the requesting node and provides remote memory resources to the requesting node according to the target valid matching combination solution. The other is that the controller sends all multiple remote memory resource allocation solutions to the requesting node, allowing the requesting node to select which solution to use. The second method is selected by the user / client's requesting node and is more flexible than the first allocation solution.
[0127] The technical solution of the present application is described in detail below in conjunction with an optional embodiment.
[0128] Based on the description of the aforementioned embodiment, the remote memory resource allocation method provided in the embodiment of the present application includes the following method flow:
[0129] The first step is to establish a node topology information table. Use the adjacency table to record the node topology distribution diagram, that is, the information of each node connected to the node and the connection relationship between the nodes, the communication delay parameter a between the nodes i-j and communication bandwidth parameter b i-j , the type of node and the memory that the node can contribute, where a i- j =a j-i ,b i-j =b j-i As shown in Figures 5a and 5b, Figure 5a is a node topology diagram, and Figure 5b is a schematic diagram of a node topology information table.
[0130] As shown in Figure 5a, the node topology includes 14 nodes, numbered 0-13. First, an array is created. The index of the array is the node number. Each array cell contains a linked list pointer, the amount of free memory that can be contributed, the node type, and other required information. The linked list pointer plist in the array cell points to a linked list, as shown in Figure 5b. This linked list records all nodes adjacent to the node. Each linked list cell records the node number and the communication delay parameter a between the two nodes. i-j and communication bandwidth parameter b i-j For example, the array element at array index 2 records the relevant information of node 2, and the linked list pointer records the index numbers of nodes 6, 12, 1, 11, and 5 adjacent to node 2 in the array, as well as the communication delay parameters and communication bandwidth parameters between these nodes.
[0131] The second step is to periodically communicate with each node to update the amount of memory available for contribution, as well as any remote memory requests and their sizes. The query period is set to 1 minute, and the interval can be adjusted based on the characteristics of the memory working set prediction algorithm. During this period, the node topology information table is updated to record the latest information on each node's available memory. The nodes requesting remote memory and the required remote memory sizes during this period are also recorded, in preparation for matching with remote memory contributors.
[0132] Then, according to the system's requirements for communication performance, a set of available remote memory contributing nodes is established for the remote memory requesting node in this cycle. Suppose there are n remote memory requesting nodes in this cycle, and the i-th remote memory requesting node is represented by M i (i=1,2,…,n), the requested remote memory size is E i(i=1,2,…,n). For each remote memory requesting node, search the node topology information table established above and establish a list of optional remote memory contributing nodes, which is sorted by the size of the contributed memory. The optional remote memory contributing nodes must meet the system's requirements for communication distance. The communication distance is the sum of the per-hop communication distance between the remote memory contributing node and the remote memory requesting node, and the per-hop communication distance is a. i-j b i-j , so the communication distance between the remote memory contributing node and the remote memory requesting node is: L = ∑a i-j b i-j .
[0133] The communication distance between the optional remote memory contribution node and the remote memory request node cannot exceed the preset communication distance L max The formula is: L≤L max .
[0134] Based on the memory request of the remote memory request node, a set of remote memory contribution nodes that can be actually allocated is established on the above basis. Assume that there are m optional remote memory contribution nodes for the i-th remote memory request node, and the j-th optional remote memory contribution node is recorded as K j (j=1,2,…,m), whose contribution memory is denoted as P j (j=1,2,…,m). For remote memory requester node M i The node searches the list of optional remote memory contribution nodes corresponding to the node in ascending order to make a matching decision. i The memory size requested by the node is not completely consistent with the memory size that can be contributed by the remote memory contribution node, so the remote memory contribution node is recorded as K j With remote memory requester node M i The matching determination is as follows:
[0135] (1) When P j <E i ,(i=1,2,......,n,j=1,2,......,m), the remote memory contribution node K j Cannot be a remote memory requester node M i Allocate remote memory;
[0136] (2) When P j ≥E i ,(i=1,2,......,n,j=1,2,......,m), determine the remote memory contribution node K j It can be a remote memory requester node M i Allocate remote memory.
[0137] Optionally, to avoid wasting remote memory space, when P j ≥1.2E i , and P j -E i When ≥1G, remote memory contribution node K j Split the remote memory into two parts, one of which is of size E i The remote memory is allocated to the remote memory requester node M i , the remaining P j -E i The remote memory continues to be the contributing memory of the node. Otherwise, the remote memory contributes to node K j Contributable remote memory P j All allocated to the remote memory requester node M i .
[0138] Optionally, in order to speed up remote memory matching and reduce algorithm complexity, the contributeable memory of a single node can only be split into two parts once during each cycle of remote memory matching.
[0139] Through the above matching judgment algorithm, for each remote memory request node, find the remote memory contribution node set that meets both the memory size and the communication distance. i The remote memory contribution node set is recorded as Q i In order to reduce the computational complexity, the embodiment of the present application limits Q i There are at most 10 remote memory contribution nodes (i.e., find out the number of remote contribution nodes that meet both memory size and communication distance ≤ 10 in ascending order).
[0140] If the remote memory requester node M i If the remote memory contribution node set is empty, the error and reason are returned directly to the remote memory request node, and the remote memory request node determines whether to split the remote memory request and re-initiate the request, and sends the remote memory request node M to the remote memory request node. i The request will be invalidated and not considered.
[0141] In an embodiment of the present application, an optional implementation method for constructing a matching effect evaluation function is: using an enumeration method to construct a valid matching combination for the remote memory request node and the remote memory contribution node, and calculating the evaluation index value corresponding to the valid matching combination.
[0142] When the remote memory contribution node K j In P j ≥1.2E i , and P j -E iWhen the size is ≥1G, the remote memory will be split. Optionally, 1G (Gigabyte) or other values can be set according to the actual situation. The embodiment of the present application does not limit this. Therefore, the remote memory actually allocated is not necessarily equal to the contributable memory size of the remote memory contributing node. The embodiment of the present application sets the remote memory size actually allocated to the i-th remote memory request node as R i (i=1,2…,n).
[0143] The third step is to use the enumeration method to build a valid matching combination for the remote memory request node and the remote memory contribution node, and generate at least two valid matching combinations. Each valid matching combination is defined as the remote memory request node M i , find a suitable remote memory contribution node K j , where K ji ∈Q i , different remote memory requester nodes M in the combination i The matching remote memory contribution nodes are different. Comprehensively consider the effective utilization of remote memory space and the impact of communication distance on performance. i is the number of routing hops between the remote memory requester node and the remote memory contributor node. The matching effect evaluation index value of the hypothetical combination k in the effective matching combination is calculated by the following relationship:
[0144] The constraints are as follows:
[0145] The fourth step is to compare the evaluation index values of each effective matching combination and select O k The matching valid combination with the smallest value is confirmed as the optimal remote memory matching combination, that is, the target valid matching combination.
[0146] The fifth step is to record the remote memory matching result of the target valid matching combination, notify each remote memory requester node and remote memory contributor node, and update the node topology information table at the same time.
[0147] This concludes the matching process for remote memory requesting nodes and remote memory contributing nodes for one cycle. This method finds the optimal memory resource allocation combination for remote memory contributing nodes and requesting nodes, avoiding remote memory fragmentation and enabling efficient use of remote memory space and achieving better overall system performance.
[0148] In an optional embodiment, corresponding to the aforementioned memory allocation method, an embodiment of the present application further provides a memory acquisition method for cloud computing. The method can be applied to any of the aforementioned requesting nodes, such as the first node. As shown in FIG6 , the method includes:
[0149] Step S301: a first node generates a first request message, where the first node is a requesting node. The first request message includes: an identifier of the first node and a size of a remote memory resource that the first node requests to obtain.
[0150] Step S302: The first node sends a first request message to the controller, which corresponds to step S101 of the above embodiment.
[0151] Step S303: the first node receives the target valid matching combination fed back by the controller according to the first request message, where the target valid combination includes a binding relationship between the first node and a contributing node that provides remote memory resources for the first node.
[0152] The specific process refers to steps S101 to S105 of the aforementioned embodiment, which will not be described again in this embodiment.
[0153] Step S304: The first node obtains the remote memory resources provided by the contributing node according to the target valid matching combination.
[0154] In an optional embodiment, corresponding to the method steps shown in FIG. 4 , as shown in FIG. 7 , the cloud computing-oriented memory acquisition method is applied to a second node, where the second node is any requesting node, and the method includes:
[0155] Step S401: The second node generates a second request message. The second node is the requesting node. The second request message includes: the identifier of the second node and the size of the remote memory resource requested by the second node. This is the same as the aforementioned step S301.
[0156] Step S402: The second node sends a second request message to the controller, which is the same as the above step S302.
[0157] Step S403: The second node receives at least two valid matching combinations fed back by the controller according to the second request message, each valid matching combination includes multiple matching relationships, and each matching relationship is a binding relationship between a requesting node and a contributing node that provides remote memory resources for it.
[0158] The specific process is the same as the method process of steps S101 to S103 of the above embodiment, and will not be repeated here in this embodiment.
[0159] Step S404: the second node determines a target valid matching combination from the at least two valid matching combinations, and acquires the remote memory resources provided by the contributing node according to the target valid matching combination.
[0160] An optional implementation manner is that the determination process is the same as the aforementioned steps S104 and S105. Please refer to the description of the aforementioned embodiment and will not be repeated here.
[0161] In addition, an embodiment of the present application also provides a memory allocation system, which includes a controller and a computer cluster. The computer cluster includes multiple nodes, some of which are requesting nodes and some of which are contributing nodes.
[0162] Taking the requesting node as an example, the method includes:
[0163] One or more requesting nodes send one or more request messages to the controller, each request message is used to request remote memory resources, and each request message includes: an identifier of the current requesting node and a requested remote memory resource size.
[0164] The controller receives request messages from different nodes within a preset time, screens the nodes in the cluster based on their communication performance and memory resource size based on the requester node's identifier and the requested remote memory resource size, determines a contributing node set for each requester node, and each contributing node set includes at least one contributing node. A matching relationship is established between different requester nodes and contributing nodes within different contributing node sets to generate at least two valid matching combinations. An evaluation index value is calculated for each valid matching combination and all evaluation index values are compared. A target valid matching combination is determined based on the evaluation index value, and remote memory resources are provided to each requester node based on the target valid matching combination. For example, the target valid matching combination is sent to the first node.
[0165] The first node receives a target valid matching combination fed back by the controller based on the first request message, the target valid matching combination including a binding relationship between the first node and a contributing node that provides remote memory resources to the first node; and then obtains the remote memory resources provided by the contributing node based on the target valid matching combination. The first node is one of the multiple requesting nodes.
[0166] In addition, during the process of periodically requesting remote memory resources, the controller also establishes a node topology information table, and uses the node topology information table, as well as the identifier of each requesting node and the requested remote memory resource size, to determine the contributing node set for each requesting node through a matching determination algorithm.
[0167] The topology information table includes: information about each node connected in the computer cluster, connection relationships between nodes, communication delay parameters and communication bandwidth parameters between nodes, node types, and memory that can be contributed by nodes.
[0168] The system provided in the embodiment of the present application solves the problem of matching multiple remote memory contribution nodes with multiple remote memory request nodes within a large number of nodes. It finds the optimal matching combination for remote memory contribution nodes and remote memory request nodes based on the overall system effect, avoids unreasonable allocation results caused by matching one by one, uses one remote memory contribution node to satisfy one remote memory request, avoids remote memory fragmentation, and makes efficient use of remote memory space and better overall system performance.
[0169] The following describes an apparatus embodiment corresponding to the above method embodiment.
[0170] In the embodiments of the present application, a memory allocation device for cloud computing is also provided. The device is configured to implement the above-mentioned embodiments and optional implementation methods. The details that have been described will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
[0171] The present embodiment provides a memory allocation device for cloud computing. As shown in FIG8 , the device includes a first receiving module 801, a first determining module 802, a first matching module 803, and a first calculating module 804. Furthermore, the device may include other modules, such as a storage module, which are not limited in the present embodiment.
[0172] The first receiving module 801 is configured to receive request messages from different nodes within a preset time, each request message is used to request remote memory resources, and each request message includes: an identifier of the requesting node and the requested remote memory resource size;
[0173] The first determination module 802 is configured to screen the nodes in the cluster based on the communication performance and memory resource size according to the identifier of the requesting node and the requested remote memory resource size, and determine a contributing node set for each requesting node, each contributing node set including at least one contributing node.
[0174] The first matching module 803 is configured to establish matching relationships between different requesting nodes and contributing nodes in at least one contributing node set, and generate at least one set of valid matching combinations.
[0175] The first calculation module 804 is configured to calculate the evaluation index value of each valid matching combination set in the set and compare all the evaluation index values.
[0176] The first determining module 802 is further configured to determine a target valid matching combination according to the evaluation index value, and provide remote memory resources to each requesting node according to the target valid matching combination.
[0177] In addition, FIG8 also includes a memory acquisition device for cloud computing, which is applied to the aforementioned first node, and includes:
[0178] The first generating module 805 is configured to generate a first request message, where the first request message includes: an identifier of the first node and a size of the remote memory resource requested by the first node;
[0179] A first sending module 806 is configured to send a first request message to the controller;
[0180] The third receiving module 807 is configured to receive a target valid matching combination fed back by the controller according to the first request message, where the target valid combination includes a binding relationship between the first node and a contributing node that allocates remote memory resources to the first node;
[0181] The first acquisition module 808 is configured to acquire the remote memory resources provided by the contributing node according to the target effective matching combination.
[0182] Among them, the memory acquisition device is configured to send a request message, such as a first request message, to the memory allocation device, and then the memory allocation device determines the target effective matching combination through the process of the aforementioned method embodiment, and sends the target effective matching combination to the memory acquisition device. After the first acquisition module of the memory acquisition device receives the target effective matching combination, it obtains the remote memory resources according to the target effective matching combination, thereby achieving the beneficial effect of efficient utilization of remote memory space and better overall system effect.
[0183] Optionally, the memory allocation device and the memory acquisition device are further configured to implement other method steps of the aforementioned method embodiment, which will not be described in detail in this embodiment.
[0184] In addition, in an optional embodiment, as shown in FIG9 , another memory allocation device and memory acquisition device for cloud computing is also disclosed, wherein the memory allocation device includes:
[0185] The second receiving module 901 is configured to receive request messages from different nodes within a preset time, each request message is used to request remote memory resources, and each request message includes: an identifier of the requesting node and a requested remote memory resource size.
[0186] The second determination module 902 is configured to screen the nodes in the cluster based on the communication performance and memory resource size according to the identifier of the requesting node and the requested remote memory resource size, and determine a contributing node set for each requesting node, each contributing node set including at least one contributing node.
[0187] The second matching module 903 is configured to establish matching relationships between different requesting nodes and contributing nodes in at least one contributing node set, and generate at least two valid matching combinations.
[0188] Each valid matching combination includes multiple matching relationships, and each matching relationship is a binding relationship between a requesting node and a contributing node that provides remote memory resources for the requesting node.
[0189] The second sending module 904 is configured to send at least two valid matching combinations to different requesting nodes, so that each requesting node selects a target valid matching combination and obtains remote memory resources.
[0190] In addition, the memory acquisition device may be another requesting node, such as a second node, and the memory acquisition device includes:
[0191] The second generating module 905 is configured to generate a second request message. The second node is the requesting node. The second request message includes: an identifier of the second node and a size of the remote memory resource requested by the second node.
[0192] The third sending module 906 is configured to send a second request message to the controller.
[0193] The fourth receiving module 907 is configured to receive at least two valid matching combinations fed back by the controller according to the second request message, each valid matching combination including a binding relationship between a requesting node and a contributing node providing remote memory resources therefor.
[0194] The second acquisition module 908 is configured to determine a target valid matching combination from the at least two valid matching combinations, and acquire the remote memory resources provided by the contributing node according to the target valid matching combination.
[0195] The memory allocation device in the embodiment of the present application is presented in the form of a functional unit, where the unit refers to an ASIC (Application-Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0196] The further functional description of the above modules and units is the same as that of the above requesting node embodiment and will not be repeated here.
[0197] At the hardware implementation level, the remote memory demander node or requester node in the embodiment of the present application includes: a CPU (Central Processing Unit), a main memory manager, multiple memory managers and memory groups, multiple remote memory controllers, and a communication unit 1. The CPU is connected to the main memory manager, which is connected to multiple memory controllers and remote memory controllers. The memory controllers are connected to the memory control group, and the remote memory controllers are connected to the communication unit.
[0198] The embodiment of the present application adopts remote direct data access technology. Each server node is equipped with one or more dedicated network cards (high-end Ethernet cards or IB network cards (InfiniBand Network Interface Cards)). Remote memory sharing can be achieved between servers through RDMA technology.
[0199] In addition, the present application also proposes another memory allocation device, as shown in Figure 10, which includes a communication unit, a periodic communication unit, a node topology information recording unit, a memory request processing unit, an effective contribution node screening unit 1, an effective contribution node screening unit 2, an optimal combination determination unit and a matching result notification and recording unit.
[0200] Optionally, the communication unit is responsible for data communication with the server node and completes data sending and receiving according to the communication protocol requirements.
[0201] The periodic communication unit is responsible for communicating with the server node at the specified periodic interval to obtain information about the server node's available memory size, remote memory release information, remote memory request information, and fault information.
[0202] If the remote memory matching device cannot communicate properly with a server node, it will determine that the server is faulty. The periodic communication unit updates the node topology information recording unit based on the latest available memory contribution information. It then processes the remote memory release information and sends it to the matching result notification and recording unit. This unit will modify the binding record information of the remote memory supply and demand parties and notify the server nodes of both parties that the server's latest available remote memory contribution information will be reported by the server node during the next communication cycle. Finally, it processes the remote memory request and sends it to the memory request processing unit.
[0203] The memory request processing unit is configured to sort and organize the memory request nodes in a cycle according to the order of the node topology information recording unit, and then send the data to the effective contribution node screening unit 1.
[0204] The effective contribution node screening unit 1 is responsible for querying the node topology information record to search for effective remote memory contribution nodes that meet the communication distance for the memory request node, using the adjacency list to build a linked list of optional remote memory contribution nodes, and then sending the data to the effective contribution node screening unit 2.
[0205] The effective contribution node screening unit 2 is responsible for querying the node topology information record to search for effective remote memory contribution nodes that can contribute memory to meet the needs of the memory request node and sort them according to the size of the contributed memory, build a new optional remote memory contribution node list, and then send the data to the optimal combination determination unit.
[0206] The optimal combination determination unit is configured to use an enumeration method to exhaustively enumerate each valid combination, and calculate the matching effect evaluation index value according to the evaluation function, and finally select the combination with the smallest evaluation index value to determine it as the optimal effective matching combination; then the optimal effective matching combination is sent to the matching notification and recording unit.
[0207] The matching notification and recording unit is configured to record the optimal effective matching combination binding relationship, update the contributable memory information of the remote memory contribution node, and finally send data through the communication unit to notify the server node of the matching relationship and remote memory size of the remote memory, thus completing a matching process.
[0208] An embodiment of the present application also provides a computer device having the remote memory allocation device shown in Figures 8 to 10 above.
[0209] Please refer to Figure 11, which is a structural diagram of a computer device provided by an optional embodiment of the present application. As shown in Figure 9, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication and can be installed on a common motherboard or in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of a GUI (Graphical User Interface) on an external input / output device (such as a display device coupled to the interface).
[0210] In some alternative embodiments, multiple processors and / or multiple buses may be used with multiple memories and multiple storages, if desired. Similarly, multiple computer devices may be connected, each providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). FIG11 illustrates a single processor 10 as an example.
[0211] The processor 10 may be a central processing unit (CPU), a network processor (NPU), or a combination thereof. The processor 10 may also include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device (PLD) may be a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a general purpose array logic (GAL), or any combination thereof.
[0212] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.
[0213] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created based on the use of a computer device for displaying a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0214] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0215] The computer device further comprises a communication interface 30 configured to enable the computer device to communicate with other devices or a communication network.
[0216] An embodiment of the present application also provides a computer non-volatile readable storage medium. The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a non-volatile readable storage medium, or implemented as a computer code downloaded through a network and originally stored in a remote non-volatile readable storage medium or a non-volatile readable storage medium and will be stored in a local non-volatile readable storage medium, so that the method described herein can be stored in such software processing on a non-volatile readable storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware.
[0217] The non-volatile readable storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc. Optionally, the non-volatile readable storage medium may also include a combination of the aforementioned types of memory. It is understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the remote memory allocation method and memory acquisition method shown in the above embodiments are implemented.
[0218] Although the embodiments of the present application have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations shall fall within the scope defined by the appended claims.
Claims
1. A memory allocation method for cloud computing, characterized in that: The method comprises: Receiving request messages from different nodes within a preset time, each request message is used to request to obtain remote memory resources, and each request message includes: an identifier of the requesting node and a requested remote memory resource size; According to the identifier of the requesting node and the size of the requested remote memory resource, the nodes in the cluster are screened for communication performance and memory resource size, and a contributing node set is determined for each requesting node, each contributing node set includes at least one contributing node; Establishing matching relationships between different requester nodes and contributor nodes in different contributor node sets to generate at least two valid matching combinations, wherein each valid matching combination includes multiple matching relationships, each of which is a binding relationship between a requester node and a contributor node that provides remote memory resources for the requester node; Calculate the evaluation index value of each valid matching combination and compare all evaluation index values; A target effective matching combination is determined according to the evaluation index value, and remote memory resources are provided to each requesting node according to the target effective matching combination.
2. The method according to claim 1, characterized in that Based on the ID of the requesting node and the size of the requested remote memory resource, the communication performance of the nodes in the cluster is screened, including: One or more contributing nodes meeting the communication performance requirements are screened out in the node topology information table of the cluster according to the identifier of the requesting node, to obtain a first contributing node set.
3. The method according to claim 2, characterized in that According to the remote resource memory size requested by the requesting node, the nodes in the cluster are screened for memory resource size, and a contributing node set is determined for the requesting node, including: One or more contributing nodes that meet the remote memory resource size required by the current requesting node are screened from the first contributing node set, and the screened one or more contributing nodes are sorted according to preset rules to obtain a second contributing node set.
4. The method according to claim 2 or 3, characterized in that: One or more contributing nodes that meet the communication performance requirements are selected from the node topology information table of the cluster according to the identifier of the requesting node, including: Establish a node topology information table, which includes: node information of each node in the cluster, connection relationships between nodes, communication delay parameters between nodes, communication bandwidth parameters and memory resources that can be contributed by the node; Determining a location of the requesting node based on an identifier of the requesting node; One or more contributing nodes that meet the communication performance requirements and the communication distance requirements are screened out in the node topology information table according to the location of the requesting node.
5. The method according to claim 4, characterized in that Filter out one or more contributing nodes that meet the communication performance requirements, including: Filter that the communication distance between the current requesting node and the current contributing node does not exceed the preset communication distance; The communication distance is the sum of the per-hop communication distances between the current requesting node and the current contributing node, and the per-hop communication distance is the product of the communication delay parameter and the communication bandwidth parameter.
6. The method according to claim 4, characterized in that Establishing matching relationships between different requester nodes and contributing nodes in at least one contributing node set, and generating at least one set of valid matching combinations, including: Get the remote memory resource size E requested by the i-th requester node i , and a contributing node set screened for the i-th requesting node, wherein the contributing node set includes m contributing nodes, and the memory resource size of any one of the m nodes is P j , m ≥ 1 and is a positive integer; The remote memory resource E requested by the i-th requesting node is obtained by enumeration. i and the memory resources P of the contributing node j Two or more matching relationships are established according to the rules to generate at least two valid matching combinations.
7. The method according to claim 6, characterized in that The remote memory resource E requested by the i-th requesting node is obtained by enumeration. i and the memory resources P of the contributing node j Establish two or more matching relationships according to the rules, including: According to the following rules, the remote memory resource E requested by the i-th requester node i and the memory resource P of the contributor j Establish matching relationships; If P is satisfied j ≥1.2E i , and P j -E i ≥1G, the remote memory resource size allocated to the i-th requesting node is E i ; If P is not satisfied j ≥1.2E i , and P j -E i ≥1G, then the size of the remote memory resource provided by the j-th contributor node is P j .
8. The method according to claim 6, characterized in that Calculate the evaluation index value of each valid matching combination, including: According to the remote memory resource E requested by the i-th requester node i and actually allocate remote memory R i , and the number of communication routing hops to calculate the evaluation index value of each valid matching combination.
9. The method according to claim 8, characterized in that According to the remote memory resource E requested by the i-th requester node i and actually allocate remote memory R i , and the communication route hop count to calculate the evaluation index value of each valid matching combination, including: The evaluation index value of each valid matching combination is calculated using the preset relationship; the preset relationship is: Among them, O k is the evaluation index value corresponding to the kth effective matching combination, E i is the size of the remote memory resource requested by the i-th requester node, R i The size of remote memory resources actually allocated to the i-th requester node, W i is the number of routing hops between the remote memory requester node and the remote memory contributor node, and n is the number of matching relationships.
10. The method according to claim 4, characterized in that After establishing the node topology information table, the method further includes: Establish an array unit including each node in the cluster, where each array unit includes: a linked list pointer, the size of the memory resources that can be contributed, and the node type; Set the index of each array cell, where the index is the node number of each node; A node topology graph is generated according to the array unit of each node, the index of each array unit and the node connection relationship.
11. The method according to claim 4, characterized in that The method further comprises: Periodically communicate with each node in the cluster to obtain the size of each node's available memory resources and whether there is any remote memory demand; If the memory resources of the contributing node change, or there is a remote memory requirement, the node topology information table is recorded and updated.
12. The method according to claim 7, characterized in that The method further comprises: If P is satisfied j ≥1.2E i , and P j -E i ≥1G, the memory resource P of the contributing node j Split into two or more parts, where one part of the memory resources is used to provide to the current requester node, and the remaining part of the memory resources is used to provide to other requester nodes.
13. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: An indication message of the target valid allocation combination is sent to different requester nodes and corresponding contributor nodes, and a node topology information table is recorded and updated.
14. A memory allocation method for cloud computing, characterized in that: The method comprises: Receiving request messages from different nodes within a preset time, each request message is used to request to obtain remote memory resources, and each request message includes: an identifier of the requesting node and a requested remote memory resource size; According to the identifier of the requesting node and the size of the requested remote memory resource, the nodes in the cluster are screened for communication performance and memory resource size, and a contributing node set is determined for each requesting node, each contributing node set includes at least one contributing node; Establishing matching relationships between different requester nodes and contributor nodes in different contributor node sets to generate at least two valid matching combinations, wherein each valid matching combination includes multiple matching relationships, each of which is a binding relationship between a requester node and a contributor node that provides remote memory resources for the requester node; The at least two valid matching combinations are sent to different requester nodes, so that each requester node selects a target valid matching combination and acquires remote memory resources.
15. A memory acquisition method for cloud computing, characterized in that: The method comprises: The first node generates a first request message, wherein the first request message includes: an identifier of the first node and a size of a remote memory resource requested by the first node; The first node sends the first request message to the controller; The first node receives a target valid matching combination fed back by the controller according to the first request message, where the target valid combination includes a binding relationship between the first node and a contributing node that provides remote memory resources for the first node; The first node obtains the remote memory resource provided by the contributing node according to the target effective matching combination.
16. A memory acquisition method for cloud computing, characterized in that: The method comprises: The second node generates a second request message, wherein the second request message includes: an identifier of the second node and a size of a remote memory resource requested by the second node; The second node sends the second request message to the controller; The second node receives at least two valid matching combinations fed back by the controller according to the second request message, wherein each valid matching combination includes multiple matching relationships, and each matching relationship is a binding relationship between a requesting node and a contributing node that provides remote memory resources for the requesting node; The second node determines a target effective matching combination from the at least two effective matching combinations, and acquires the remote memory resource provided by the contributing node according to the target effective matching combination.
17. A memory allocation device for cloud computing, characterized in that: The device comprises: A first receiving module is configured to receive request messages from different nodes within a preset time, each request message is used to request to obtain remote memory resources, and each request message includes: an identifier of the requesting node and a requested remote memory resource size; A first determination module is configured to screen the nodes in the cluster based on communication performance and memory resource size respectively according to the identifier of the requesting node and the size of the requested remote memory resource, and determine a contributing node set for each requesting node, each contributing node set including at least one contributing node; A first matching module is configured to establish matching relationships between different requester nodes and two or more contributing nodes in different contributing node sets, and generate a set of at least two valid matching combinations, wherein each valid matching combination includes a plurality of matching relationships, and each matching relationship is a binding relationship between a requester node and a contributing node that provides remote memory resources for the requester node; A first calculation module is configured to calculate an evaluation index value of each valid matching combination and compare all evaluation index values; The first determination module is further configured to determine a target effective matching combination according to the evaluation index value, and to provide remote memory resources for each requesting node according to the target effective matching combination.
18. A memory allocation device for cloud computing, characterized in that: The device comprises: A second receiving module is configured to receive request messages from different nodes within a preset time, each request message is used to request to obtain remote memory resources, and each request message includes: an identifier of the requesting node and a requested remote memory resource size; The second determination module is configured to screen the nodes in the cluster based on the communication performance and the memory resource size according to the identifier of the requesting node and the requested remote memory resource size, and determine a contributing node set for each requesting node, each contributing node set including at least one contributing node; A second matching module is configured to establish matching relationships between different requester nodes and contributor nodes in different contributor node sets, and generate at least two valid matching combinations, wherein each valid matching combination includes multiple matching relationships, and each matching relationship is a binding relationship between a requester node and a contributor node that provides remote memory resources for the requester node; The second sending module is configured to send the at least two valid matching combinations to different requesting nodes, so that each requesting node selects a target valid matching combination and obtains remote memory resources.
19. A computer device, characterized in that: comprising a memory and a processor, wherein the memory and the processor are communicatively connected to each other, The memory stores computer instructions, and the processor executes any one of claims 1 to 13, or the cloud computing-oriented memory allocation method described in claim 14, by executing the computer instructions.
20. A computer device, characterized in that: comprising a memory and a processor, wherein the memory and the processor are communicatively connected to each other, The memory stores computer instructions, and the processor executes the computer instructions to perform the method of claim 15 or 16. The memory acquisition method for cloud computing is described.
21. A computer non-volatile readable storage medium, characterized in that: The computer non-volatile readable storage medium stores computer instructions; The computer instructions are used to enable a computer to execute any one of claims 1 to 13, or the memory allocation method for cloud computing described in claim 14.
22. A computer non-volatile readable storage medium, characterized in that: The computer non-volatile readable storage medium stores computer instructions; The computer instructions are used to enable a computer to execute the memory acquisition method for cloud computing described in claim 15 or 16.
Citation Information
Patent Citations
Memory access method, equipment and system
CN104571934A
Method, device and system for managing memory
CN108845877A
Cloud computing-oriented memory allocation method, memory acquisition method, device and equipment
CN116436978A
Memory pool configuration for allocating memory in a distributed network
US10761752B1
