WO2024255366A1 - 面向云计算的内存分配方法、内存获取方法、装置和设备 - Google Patents
面向云计算的内存分配方法、内存获取方法、装置和设备 Download PDFInfo
- Publication number
- WO2024255366A1 WO2024255366A1 PCT/CN2024/082277 CN2024082277W WO2024255366A1 WO 2024255366 A1 WO2024255366 A1 WO 2024255366A1 CN 2024082277 W CN2024082277 W CN 2024082277W WO 2024255366 A1 WO2024255366 A1 WO 2024255366A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- node
- nodes
- remote memory
- contributing
- memory
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/146—Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/52—Network services specially adapted for the location of the user terminal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Definitions
- the present application relates to the field of computers, and in particular to a memory allocation method, memory acquisition method, device and equipment for cloud computing.
- Cloud computing is usually composed of dozens, hundreds, or even tens of thousands of computer server nodes. Most of these server nodes are commercial standard servers with their own independent processors, memory, and hard disk storage space. With the development of big data analysis and artificial intelligence, applications require more and more memory. A single server node cannot meet the memory needs of applications, so consider using the remote memory of other server nodes and reasonably and efficiently select one or more nodes from a large number of nodes as contributors to provide memory resources for the requesting node.
- a method of allocating remote memory is mainly to find contributing nodes based on the distance from the requester node to the farthest distance, and allocate remote memory to the requester node.
- this method will cause multiple memory contributing nodes with close communication distance to jointly meet the needs of a memory requester node, causing complex system management.
- this method needs to allocate memory to the memory requester nodes one by one, and does not consider the subsequent memory allocation of other memory requester nodes and contributors, resulting in poor overall allocation results of the system.
- 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 allocating remote memory resources to the requesting node resulting in poor allocation effect.
- the present application 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 comprising: 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, determining a contributing node set for each requesting node, each contributing node set comprising at least one contributing node; establishing a matching relationship between different requesting nodes and contributing nodes in different contributing node sets, generating at least two valid matching combinations, wherein each valid matching combination comprises multiple matching relationships, each matching relationship being a binding relationship between a requesting node and a contributing node providing remote memory resources for it; calculating an evaluation index value for each valid matching combination, and comparing all evaluation indexes; determining a target evaluation index based on the evaluation index value, and providing remote memory
- the nodes in the cluster are screened for communication performance based on the identifier of the requesting node and the requested remote memory resource size, 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, and obtaining a first contributing node set.
- 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 contributing node set is determined for the requesting node, including: screening one or more contributing nodes that meet the remote memory resource size required by the current requesting node in the first contributing node set, and sorting the screened one or more contributing nodes according to preset rules to obtain a second contributing node set.
- one or more contributing nodes that meet the communication performance requirements are screened out in the node topology information table of the cluster according to 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 nodes, communication delay parameters between nodes, communication bandwidth parameters, and memory resources that can be contributed by the nodes; determining the location of the requesting node according to the identifier of the requesting node; and screening in the node topology information table according to the location of the requesting node.
- One or more contributing nodes that meet the communication performance requirements and the communication distance requirements are selected.
- 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.
- the communication distance is the sum of the communication distances of each hop route between the current requesting node and the current contributing node, and the communication distance of each hop route is the product of the communication delay parameter and the communication bandwidth parameter of this section.
- a matching relationship is established between different requester nodes and contributing nodes in at least one contributing node set, and at least one set of valid matching combinations is generated, including: obtaining the remote memory resource size E i requested by the i-th requester node, and the contributing node set screened for the i-th requester node, the contributing node set including m contributing nodes, the memory resource size of any one of the m nodes is P j , m ⁇ 1 and is a positive integer; using an enumeration method to establish two or more matching relationships according to the remote memory resource E i requested by the i-th requester node and the memory resource P j of the contributing node according to the rules, and generating at least two valid matching combinations.
- an enumeration method is used to establish two or more matching relationships according to a rule based on the remote memory resource E i requested by the i-th requester node and the memory resource P j of the contributor node, including: establishing a matching relationship according to the remote memory resource E i requested by the i-th requester node and the memory resource P j of the contributor according to the following rule:
- the remote memory resource size E i is allocated to the i-th requesting node.
- the remote memory resource size P j is allocated to the i-th requester node.
- calculating the evaluation index value of each valid matching combination includes: calculating the evaluation index value of each valid matching combination according to the remote memory resource E i applied for by the i-th requesting node and the actually allocated remote memory R i , as well as the number of communication routing hops.
- the evaluation index value of each valid matching combination is calculated according to the remote memory resource E i applied for by the i-th requesting node and the actually allocated remote memory R i , as well as the number of communication route hops, including: calculating the evaluation index value of each valid matching combination using a preset relationship; the preset relationship is:
- Ok is the evaluation index value corresponding to the kth valid matching combination
- Ei is the size of the remote memory resource requested by the i-th requester node
- Ri is the size of the remote memory resource actually allocated by the i-th requester node
- Wi is the number of routing hops between the remote memory requester node and the remote memory contributor node
- n is the number of matching relationships.
- the node topology information table 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, where the index is the node number of each node; and generating a node topology map based on the array unit of each node, the index of each array unit, and the node connection relationship.
- the method also includes: periodically communicating with each node in the cluster, and obtaining the size of 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.
- the method also includes: if P j ⁇ 1.2E i and P j -E i ⁇ 1G, the memory resource P j of the contributing node is split into two or more parts, wherein a part of the memory resources is used to provide to the current requesting node, and the remaining memory resources are used to provide to other requesting nodes.
- 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 a node topology information table.
- 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 comprising: 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, determining a contributing node set for each requesting node, each contributing node set comprising at least one contributing node; establishing a matching relationship between different requesting nodes and contributing nodes in different contributing node sets, generating at least two valid matching combinations, 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 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.
- the present application also provides a memory acquisition method for cloud computing, the method comprising: a first node generates a first request message, the first request message comprising: an identifier of the first node and the size of remote memory resources requested by the first node; the first node sends the first request message to a controller; the first node receives a target effective matching combination fed back by the controller based on the first request message, the target effective combination comprising a binding relationship between the first node and a contributing node that provides remote memory resources for it; the first node obtains the remote memory resources provided by the contributing node based on the target effective matching combination.
- the present application also provides a memory acquisition method for cloud computing, the method comprising: a second node generates a second request message, the second request message comprising: an identifier of the second node and the size of remote memory resources requested by the second node; the second node sends a second request message to a 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 the requesting node; 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 based on the target valid matching combination.
- 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 respectively 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 The method 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 the requester node; the
- 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 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 second determination module, configured to screen the nodes in the cluster 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, 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, and each matching relationship is a binding relationship between a requesting node and a contributing node that provides remote memory resources for it; a second sending module, configured to send at least two valid matching combinations to different requesting nodes, so that each
- the present application further provides a memory allocation system, the system comprising a controller and a computer cluster, the computer cluster comprising a plurality of nodes, some of the plurality of nodes being requester nodes and some being contributor nodes; one or more requester nodes sending a request message to the controller, each request message being used to request remote memory resources, each request message comprising: an identifier of the requester node and a remote memory resource being requested; source size; the controller receives request messages from different nodes within a preset time period, and screens the nodes in the cluster for communication performance and memory resource size according to the identifier of the requesting node and the requested remote memory resource size, and determines a contributing node set for each requesting node, each contributing node set includes at least one contributing node; the controller establishes a matching relationship between different requesting nodes and contributing nodes in different contributing node sets, and generates at least two valid matching combinations, wherein each valid matching combination includes multiple matching relationships, and each matching relationship is a binding
- the first node among multiple requesting nodes receives a target valid matching combination fed back by the controller based on a first request message, wherein 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 acquires the remote memory resources provided by the contributing node based on the target valid matching combination.
- 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, communication delay parameters and communication bandwidth parameters between the nodes, node types, and memory that the nodes can contribute.
- the present application provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to execute the memory allocation method for cloud computing of the above-mentioned first aspect or second aspect and any corresponding implementation manner.
- the processor when executing computer instructions, the processor also executes the cloud computing-oriented memory acquisition method of the third and fourth aspects mentioned above.
- 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 implementation manner, or execute the cloud computing-oriented memory acquisition method of the above-mentioned third aspect and fourth aspect.
- 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 multiple matching relationships of the contributing nodes screened for all requesting nodes, and then calculates an evaluation index value for each valid matching combination; compares all evaluation index values to determine a target valid matching combination, and provides remote memory resources for different requesting nodes according to the target valid matching combination.
- This method solves the problem of matching multiple remote memory contribution nodes with multiple remote memory request nodes within a large number of nodes, 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.
- 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.
- FIG1 is a schematic diagram of a flow chart of a memory allocation method for cloud computing provided in an embodiment of the present application
- FIG2 is a schematic diagram of a process for selecting contributing nodes for a requesting node according to an embodiment of the present application
- FIG3 is a schematic diagram of another process of screening contributing nodes for a requesting node provided by an embodiment of the present application.
- FIG4 is a flow chart of another memory allocation method for cloud computing provided in an embodiment of the present application.
- FIG5a is a node topology diagram provided in an embodiment of the present application.
- FIG5b is a schematic diagram of a node topology information table provided in an embodiment of the present application.
- FIG6 is a schematic diagram of a flow chart of a memory acquisition method according to an embodiment of the present application.
- FIG7 is a flow chart of another memory acquisition method provided in an embodiment of the present application.
- FIG8 is a structural block diagram of a memory allocation device and a memory acquisition device provided in an embodiment of the present application.
- FIG. 9 is a structural block diagram of another memory allocation device and memory acquisition device provided in an embodiment of the present application.
- FIG10 is a structural block diagram of another memory allocation device provided in an embodiment of the present application.
- FIG. 11 is a schematic diagram of the hardware structure of a computer device provided in an embodiment of the present application.
- the technical solution of the present application is applied to an application scenario of a computer cluster, such as a cloud computing platform, or other network platforms, etc.
- the application scenario includes a controller and a computer cluster, and the computer cluster includes multiple nodes, and these nodes can be used as requester nodes to request remote memory from a server or controller, and can also be used as contributor nodes to provide remote memory resources for requester nodes.
- 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.
- 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 to allocate remote memory, the requester is taken as the center and the nodes that can serve as contributors are searched from near to far according to the distance, and the remote memory is allocated to the requester.
- the distance of the above scheme is the number of routing hops from other nodes to the requesting node.
- the first-hop surrounding nodes are searched first.
- 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 needs of the requester, the second hop is searched again and again until the needs of the memory requester are met.
- This solution simplifies the remote memory allocation problem into a remote memory demand allocation problem for each memory requester, and at the same time, considers the communication distance as an important factor.
- the remote direct memory access RDMA (Remote Direct Memory Access) communication network is a CPU-ByPass (Central Processing Unit Bypass) technology.
- This solution only considers the influence of communication distance, which may lead to the situation where multiple memory contributor nodes with close communication distances meet the needs of a memory requester node, but it will cause the system management to be too complicated.
- the technical solution of the embodiment of the present application can be applied to the matching of remote memory requesters and contributors of the RDMA technology, and the matching of memory demanders and memory contributors of the CXL technology.
- it can also be applied to other methods or technologies other than the technical fields of RDMA and CXL (Compute Express Link, a new type of high-speed interconnect technology), which is not limited by the embodiment of the present application.
- CXL is a new type of high-speed interconnection technology.
- the present application proposes an efficient remote memory allocation method and a memory acquisition method to solve the problem of matching memory allocation of 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.
- a memory allocation method embodiment 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.
- 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:
- Step S101 receiving request messages from different nodes within a preset time, each request message being used to request to obtain remote memory resources.
- Each request message includes: the identifier of the requesting node and the size of the requested remote memory resource. In addition, it may also include information such as the location and communication status of the requesting node.
- 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.
- Step S102 According to 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.
- 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.
- the memory resource requirement refers to the memory resource size required by the requesting node
- the communication performance conditions include communication distance and other conditions.
- an optional implementation includes the following:
- Step S102-1 one or more contributing nodes meeting the communication performance requirements are screened out from the node topology information table of the cluster according to the identifier of the requesting node, to obtain a first contributing node set.
- 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 a preset rule to obtain a second contributing node set.
- 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.
- the second contribution node set is a contribution node set determined for the current node in the aforementioned step S102.
- the number of contributing nodes in the second contributing node set does not exceed 10.
- 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.
- 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 remote memory resources for it.
- each valid combination includes matching relationships between all requester nodes and matching contributor nodes.
- the matching method can adopt an enumeration method.
- a requesting node can correspond to a contributing node set to provide memory resources for it, and each contributing node set can include one or more contributing nodes.
- the contributing node set corresponding to node 1 includes nodes ⁇ 3,4 ⁇ , and nodes 3 and 4 can both provide remote memory resources for node 1.
- 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 for node 2.
- a matching relationship is established when node 3 is a contributing node of requesting node 1, and node 1 and node 3 are in a matching relationship.
- node 4 is a contributing node of node 2, and node 2 and node 4 are in another matching relationship.
- the first valid matching combination is: node 1 and node 3, node 2 and node 4.
- a second valid matching combination and a third valid matching combination can also be generated, and the second valid matching combination is: node 1 and node 4, node 2 and node 3.
- the third valid matching combination is: node 1 and node 4, node 2 and node 5.
- Step S104 Calculate the evaluation index value of each valid matching combination and compare all evaluation index values.
- a method for calculating an evaluation index value of each valid matching combination includes:
- a preset relationship may be used to calculate the evaluation index value of each valid matching combination; the preset relationship is:
- Ok is the evaluation index value corresponding to the kth valid matching combination
- Ei is the size of the remote memory resource requested by the i-th requester node
- Ri is the size of the remote memory resource actually allocated by the i-th requester node
- Wi is the number of routing hops between the remote memory requester node and the remote memory contributor node
- n is the number of matching relationships.
- Step S105 determining a target effective matching combination according to the evaluation index value, and providing remote memory resources for each requesting node according to the target effective matching combination.
- an optional implementation is to compare all evaluation index values and select the smallest one among all evaluation index values, and 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.
- the controller provides remote memory resources to each requesting node according to the determined remote memory resource allocation scheme.
- 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, 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 improves the overall system effect.
- step S102 in the above step S102, as shown in FIG3, it also includes:
- Step S1021 Create a node topology information table.
- 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 types, and the size of memory resources that the nodes can contribute.
- the node topology information table may be obtained and generated before receiving the request message sent by the requesting node.
- Step S1022 Determine the location of the requesting node according to the identifier of the requesting node.
- 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.
- step S1023 is: according to the location of the requesting node and the communication performance requirements, searching for contributing nodes that can provide remote memory in the node topology information table, and establishing a remote memory contributing node linked list.
- the remote memory contributing node linked list includes at least one memory contributing node.
- step S1023 may adopt steps S102-1 and S102-2 as shown in FIG. 2 , which will not be described in detail in this embodiment.
- the above method also includes: if it is detected that at least one of the node information, node connection relationship, communication delay parameter, communication bandwidth parameter, node type and node contributable memory has changed, then 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.
- the above-mentioned searching for contributing nodes that can provide remote memory in the node topology information table according to 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 according to the communication delay parameters and communication bandwidth parameters of the nodes in the node topology information table.
- 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 and the communication bandwidth parameter of that segment.
- L is the sum of the routing communication distances of each hop between the above-mentioned remote memory contribution node and the requesting node
- L max is the preset communication distance
- a ij is the communication delay parameter
- b ij is the communication bandwidth parameter
- a ij b ij is the product of the communication delay parameter a ij and the communication bandwidth parameter b ij .
- the method provided in the embodiment of the present application first screens one or more contributing nodes that meet the conditions according to the communication performance requirements, and then selects Among all the contributing nodes, the nodes that meet the requirements of the current requesting node are screened by memory size, and finally the matching between the requesting node and the contributing node is calculated, at least two valid matching combinations are constructed, and the evaluation index values of the valid matching combinations are calculated, so that the performance of the screened contributing nodes is optimal and the efficiency of providing remote memory resources is the highest.
- 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.
- 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, and at least two valid matching combinations are generated, including:
- an enumeration method is used to establish a matching relationship according to the remote memory resource E i requested by the i-th requester node and the memory resource P j of the contributing node according to the rule, and at least two valid matching combinations are generated, including:
- E i is the size of the memory resource requested by the i-th requester node
- P j is the size of the remote memory resource that the j-th contributor node can contribute.
- i and j are constants used to identify the requester node and the contributor node.
- the matching determination algorithm is also called a remote memory matching method, which includes but is not limited to CXL technology.
- the matching determination algorithm can also be other matching algorithms, and can be used with matching methods/algorithm models of other inter-machine memory sharing technologies.
- the first part of the memory resource size is E i to the remote memory requester node Mi
- the second part (P j -E i ) of the remote memory continues to be the contributable memory of the node; otherwise, the contributable remote memory P j of the remote memory contribution node K j is all allocated to the remote memory requester node Mi.
- 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 a requested remote memory resource size.
- the step S201 is the same as the step S101 in the above embodiment.
- Step S202 According to 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.
- Each contributing node set includes at least one contributing node.
- the step S202 is the same as the step S102 of the above embodiment.
- Step S203 Establish matching relationships between different requester nodes and contributing nodes in at least one contributing node set, generating at least two Valid matching combinations.
- the step S203 is the same as the step S103 in the above embodiment.
- Step S204 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.
- 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.
- 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 the 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.
- the controller directly determines the target effective matching combination for the requesting node according to the memory requirements of the requesting node, and provides remote memory resources for the requesting node according to the target effective matching combination scheme.
- the controller sends all multiple remote memory resource allocation schemes to the requesting node, allowing the requesting node to choose which scheme to use.
- the second method is selected by the requesting node of the user/client, which is more flexible than the first allocation scheme.
- the remote memory resource allocation method includes the following method flow:
- the first step is to establish a node topology information table.
- Figure 5a is a node topology diagram
- Figure 5b is a schematic diagram of a node topology information table.
- the node topology diagram includes 14 nodes in total, and the node numbers are 0-13.
- an array is established, and the index of the array is the node number.
- Each array unit includes a linked list pointer, the size of the free memory that can be contributed, the node type, and other required information.
- the linked list pointer plist in the array unit points to a linked list, as shown in FIG5b, which records all nodes adjacent to the node.
- Each linked list unit records the node number and the communication delay parameter a ij and the communication bandwidth parameter b ij between the two nodes.
- the array unit of array index 2 records the relevant information of node 2
- 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.
- the second step is to periodically communicate with each node to update the size of each node's contributable memory space, as well as whether there is a remote memory request and its size.
- the query cycle is set to 1 minute, and the cycle interval can be set according to the characteristics of the memory working set prediction algorithm.
- the node topology information table is updated to record the latest status of each node's contributable memory space; and the remote memory request node and the required remote memory size during this cycle are recorded, ready to match with the remote memory contributor.
- a set of available remote memory contribution nodes is established for the remote memory requesting node in this cycle.
- search the node topology information table established above and establish a list of optional remote memory contribution nodes, which is sorted by the size of the memory that can be contributed.
- the optional remote memory contribution node must meet the system's requirements for communication distance.
- 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 ⁇ Lmax .
- a set of remote memory contribution nodes that can be actually allocated is established on the above basis.
- the optional remote memory contribution node linked list corresponding to the node is searched in order from small to large to perform a matching judgment.
- the matching judgment between the remote memory contribution node denoted as K j and the remote memory requesting node Mi is as follows:
- the remote memory contribution node set of the remote memory requesting node Mi is empty, the error and reason are directly returned to the remote memory requesting node, and the remote memory requesting node determines whether to split the remote memory request and re-initiate the request, and sets the request of the remote memory requesting node Mi to invalid and not consider it.
- an enumeration method is used to construct an effective matching combination for the remote memory request node and the remote memory contribution node, and at least two effective matching combinations are generated.
- each effective matching combination is defined as finding a suitable remote memory contribution node Kj for the remote memory request node Mi , where Kji ⁇ Qi , and the remote memory contribution nodes matched by different remote memory request nodes Mi in the combination are different.
- Wi is the number of routing hops between the remote memory request node and the remote memory contribution node
- the matching effect evaluation index value of the hypothetical combination k in the effective matching combination is calculated by the following relationship:
- the fourth step is to compare the evaluation index values of each effective matching combination, and select the matching effective combination with the smallest O k value to confirm it as the optimal remote memory matching combination, that is, the target effective matching combination.
- 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.
- the embodiment of the present application further provides a memory acquisition method for cloud computing, which can be applied to any of the aforementioned request nodes, such as the first node. As shown in FIG6 , the method includes:
- Step S301 a first node generates a first request message, where the first node is a requesting node, and 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.
- the memory acquisition method for cloud computing is applied to a second node, where the second node is any requesting node, and the method includes:
- Step S401 The second node generates a second request message, the second node is a requesting node, and the second request message includes: an identifier of the second node and the size of the remote memory resource requested by the second node, which is the same as the aforementioned step S301.
- Step S402 The second node sends a second request message to the controller, which is the same as the above step S302.
- 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.
- Step S404 the second node determines a target effective matching combination from at least two effective matching combinations, and acquires the remote memory resources provided by the contributing node according to the target effective matching combination.
- an embodiment of 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.
- the method includes:
- One or more requesting nodes send one or more request messages to the controller, each request message is used to request to obtain remote memory resources, and each request message includes: an identifier of the current requesting node and a requested remote memory resource size.
- the controller receives request messages from different nodes within a preset time, and screens 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 resource, and determines a contributing node set for each requesting node, each contributing node set including at least one contributing node; establishes a matching relationship between different requesting nodes and contributing nodes in different contributing node sets, and generates at least two valid matching combinations; calculates the evaluation index value of each valid matching combination, and compares all the evaluation index values; determines the target valid matching combination according to the evaluation index value, and provides remote memory resources for each requesting node according to the target valid matching combination. For example, the target valid matching combination is sent to the first node.
- the first node receives a target valid matching combination fed back by the controller according to the first request message, wherein the target valid matching combination includes a binding relationship between the first node and a contributing node that provides remote memory resources for the first node; and then obtains the remote memory resources provided by the contributing node according to the target valid matching combination.
- the first node is one of the multiple requesting nodes.
- the controller in 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.
- 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.
- 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, finds the optimal matching combination for remote memory contribution nodes and remote memory request nodes from 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 improves the overall system performance effect.
- a memory allocation device for cloud computing is also provided, which is configured to implement the above embodiments and optional implementation modes, and the descriptions that have been made will not be repeated.
- the term "module” can implement software of predetermined functions, and/or a combination of hardware.
- the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
- the embodiment of the present application 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.
- the device may also include other modules, such as a storage module, etc., which are not limited in the embodiment of the present application.
- 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 to obtain remote memory resources, and each request message includes: an identifier of the requesting node and a requested remote memory resource size;
- the first determination module 802 is configured to screen the nodes in the cluster for communication performance and memory resource size respectively 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.
- the first matching module 803 is configured to establish a matching relationship between different requester nodes and contributing nodes in at least one contributing node set, and generate at least one set of valid matching combinations.
- 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.
- the first determination module 802 is further configured to determine a target effective matching combination according to the evaluation index value, and provide remote memory resources for each requesting node according to the target effective matching combination.
- FIG8 also includes a memory acquisition device for cloud computing, which is applied to the aforementioned first node, and the device includes:
- the first generating module 805 is configured to generate a first request message, the first request message including: an identifier of the first node and a size of a remote memory resource requested by the first node;
- a first sending module 806 is configured to send a first request message to the controller
- 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;
- 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.
- the first acquisition module of the memory acquisition device receives the target effective matching combination, it acquires 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.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请公开了一种面向云计算的内存分配方法、内存获取方法、装置和设备,该方法包括:接收在预设时间内来自不同节点的请求消息,根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,建立不同请求方节点与不同贡献节点集合内的贡献方节点之间的匹配关系,生成至少两个有效匹配组合,计算集合中每个有效匹配组合的评价指标值;确定目标有效匹配组合,并按照目标有效匹配组合为每个请求方节点提供远程内存资源。本方法为远程内存贡献节点与请求节点找到最优的内存资源分配组合,避免远程内存碎片化,使得远程内存空间高效利用、系统综合效果较优。
Description
相关申请的交叉引用
本申请要求于2023年06月13日提交中国专利局,申请号为202310695558.5,申请名称为“面向云计算的内存分配方法、内存获取方法、装置和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及计算机领域,尤其是涉及一种面向云计算的内存分配方法、内存获取方法、装置和设备。
云计算通常是由数十台、数百台、甚至上万台计算机服务器节点组成,这些服务器节点大部分是采用商用标准服务器,它们拥有各自独立的处理器、内存和硬盘存储空间。随着大数据分析和人工智能的发展,应用程序需要的内存越来越大。单台服务器节点无法满足应用程序对内存的需要,因此考虑使用其他服务器节点的远程内存,从众多的节点范围内合理、高效地选择一个或多个节点作为贡献方为请求方节点提供内存资源。
目前,采用的一种分配远程内存的方法,主要是以请求方节点为中心、根据距离由近及远寻找可以作为贡献方节点,并为请求方节点分配远程内存。但这种方法会导致多个通信距离近的内存贡献方节点一起共同满足一个内存请求方节点的需求的情况,引起系统管理复杂。另外,该方法需逐个对内存请求方节点进行内存分配,并不考虑后续的其他内存请求方节点和贡献方的内存分配情况,导致系统整体分配结果效果不佳。
发明内容
有鉴于此,本申请提供了一种面向云计算的内存分配方法、装置、设备及非易失性可读存储介质,以解决上述为请求方节点分配远程内存资源导致分配效果不佳的问题。
第一方面,本申请提供了一种面向云计算的内存分配方法,该方法包括:接收在预设时间内来自不同节点的请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:请求方节点的标识和请求远程内存资源大小;根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,每个贡献节点集合中包括至少一个贡献方节点;建立不同请求方节点与不同贡献节点集合内的贡献方节点之间的匹配关系,生成至少两个有效匹配组合,其中,每个有效匹配组合包括多个匹配关系,每个匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系;计算每个有效匹配组合的评价指标值,比较所有评价指标;根据评价指标值确定目标评价指标,以及根据目标有效匹配组合为不同节点请求方节点提供远程内存资源。
结合第一方面,在第一方面的一种可选的实施方式中,根据请求方节点的标识和请求远程内存资源大小,对集群中的节点进行通信性能的筛选,包括:根据请求方节点的标识在集群的节点拓扑信息表中筛选出符合通信性能要求的一个或多个贡献方节点,得到第一贡献节点集合。
结合第一方面,在第一方面的另一种可选的实施方式中,根据请求方节点请求的远程资源内存大小,对集群中的节点进行内存资源大小的筛选,为请求方节点确定出一个贡献节点集合,包括:在第一贡献节点集合中筛选满足当前请求方节点所需的远程内存资源大小的一个或多个贡献方节点,并对筛选的一个或多个贡献方节点按照预设规则排序得到第二贡献节点集合。
结合第一方面,在第一方面的又一种可选的实施方式中,根据请求方节点的标识在集群的节点拓扑信息表中筛选出符合通信性能要求的一个或多个贡献方节点,包括:建立节点拓扑信息表,节点拓扑信息表包括:集群中每个节点的节点信息、各个节点之间的连接关系、节点之间的通信延迟参数、通信带宽参数和节点可贡献的内存资源;根据请求方节点的标识确定请求方节点的位置;根据请求方节点的位置在节点拓扑信息表中筛选
出符合通信性能要求,并且符合通信距离要求的一个或多个贡献方节点。
结合第一方面,在第一方面的又一种可选的实施方式中,筛选出符合通信性能要求的一个或多个贡献方节点,包括:筛选当前请求方节点与当前贡献方节点之间的通信距离不超过预设通信距离。
其中,通信距离为当前请求方节点与当前贡献方节点的每一跳路由通信距离和,每一跳路由的通信距离为该段通信延迟参数与通信带宽参数之积。
结合第一方面,在第一方面的又一种可选的实施方式中,建立不同请求方节点与至少一个贡献节点集合内的贡献方节点之间的匹配关系,生成至少一个有效匹配组合的集合,包括:获取第i个请求方节点所请求的远程内存资源大小Ei,以及为第i个请求方节点筛选的贡献节点集合,贡献节点集合中包括m个贡献方节点,m个节点中的任一个节点的内存资源大小为Pj,m≥1且为正整数;采用枚举法根据第i个请求方节点所请求的远程内存资源Ei和贡献方节点的内存资源Pj按照规则建立两个或两个以上匹配关系,生成至少两个有效匹配组合。
结合第一方面,在第一方面的又一种可选的实施方式中,采用枚举法根据第i个请求方节点所请求的远程内存资源Ei和贡献方节点的内存资源Pj按照规则建立两个或两个以上匹配关系,包括:按照以下规则根据第i个请求方节点所请求的远程内存资源Ei和贡献方的内存资源Pj建立匹配关系:
如果满足Pj≥1.2Ei,且Pj-Ei≥1G,则为第i个请求方节点分配远程内存资源大小为Ei,
如果不满足Pj≥1.2Ei,且Pj-Ei≥1G,则为第i个请求方节点分配远程内存资源大小为Pj。
结合第一方面,在第一方面的又一种可选的实施方式中,计算每个有效匹配组合的评价指标值,包括:根据第i个请求方节点申请的远程内存资源Ei和实际分配远程内存Ri,以及通信路由跳数计算每个有效匹配组合的评价指标值。
结合第一方面,在第一方面的又一种可选的实施方式中,根据第i个请求方节点申请的远程内存资源Ei和实际分配远程内存Ri,以及通信路由跳数计算每个有效匹配组合的评价指标值,包括:利用预设关系式计算每个有效匹配组合的评价指标值;预设关系式为:
其中,Ok为第k个有效匹配组合对应的评价指标值,Ei为第i个请求方节点所请求的远程内存资源大小,Ri为第i个请求方节点实际分配的远程内存资源大小,Wi为远程内存请求方节点与远程内存贡献方节点之间的路由跳数,n为匹配关系数。
结合第一方面,在第一方面的又一种可选的实施方式中,建立节点拓扑信息表之后,还包括:建立集群中包括每个节点的数组单元,其中每个数组单元中包括:一个链表指针、可贡献内存资源的大小、节点类型;设置每个数组单元的索引,索引为每个节点的节点号;根据每个节点的数组单元和每个数组单元的索引以及节点连接关系,生成节点拓扑图。
结合第一方面,在第一方面的又一种可选的实施方式中,方法还包括:周期性地与集群中各个节点通信,并获取每个节点的可贡献内存资源大小以及是否有远程内存需求;如果贡献方节点的内存资源发生变化,或有远程内存需求,则记录并更新节点拓扑信息表。
结合第一方面,在第一方面的又一种可选的实施方式中,方法还包括:如果满足Pj≥1.2Ei,且Pj-Ei≥1G,则将贡献方节点的内存资源Pj拆分成两个或两个以上部分,其中,一部分内存资源用于提供给当前请求方节点,剩余部分内存资源用于提供给其他请求方节点。
结合第一方面,在第一方面的又一种可选的实施方式中,方法还包括:将目标有效分配组合的指示消息发送给不同的请求方节点和对应的各个贡献方节点,以及记录和更新节点拓扑信息表。
第二方面,本申请还提供了一种面向云计算的内存分配方法,方法包括:接收在预设时间内来自不同节点的请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:请求方节点的标识和请求远程内存资源大小;根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,每个贡献节点集合中包括至少一个贡献方节点;建立不同请求方节点与不同贡献节点集合内的贡献方节点之间的匹配关系,生成至少两个有效匹配组合,其中,每个有效匹配组合包括多个匹配关系,每个匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系;将至少两个有效匹配组合发送至不同的请求方节点,以使每个请求方节点选择目标有效匹配组合并获取远程内存资源。
第三方面,本申请还提供了一种面向云计算的内存获取方法,方法包括:第一节点生成第一请求消息,第一请求消息包括:第一节点的标识和第一节点请求获取的远程内存资源大小;第一节点发送第一请求消息给控制器;第一节点接收控制器根据第一请求消息反馈的目标有效匹配组合,目标有效组合包括第一节点与为其提供远程内存资源的贡献方节点之间的绑定关系;第一节点根据目标有效匹配组合获取贡献方节点提供的远程内存资源。
第四方面,本申请还提供了一种面向云计算的内存获取方法,方法包括:第二节点生成第二请求消息,第二请求消息包括:第二节点的标识和第二节点请求获取的远程内存资源大小;第二节点发送第二请求消息给控制器;第二节点接收控制器根据第二请求消息反馈的至少两个有效匹配组合,其中,每个有效匹配组合包括多个匹配关系,每个匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系;第二节点在至少两个有效匹配组合中确定目标有效匹配组合,并根据目标有效匹配组合获取贡献方节点提供的远程内存资源。
第五方面,本申请还提供了一种面向云计算的内存分配装置,装置包括:第一接收模块,被配置为接收在预设时间内来自不同节点的请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:请求方节点的标识和请求远程内存资源大小;第一确定模块,被配置为根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,贡献节点集合中包括至少一个贡献方节点;第一匹配模块,被配置为建立不同请求方节点与不同贡献节点集合内的两个或两个以上贡献方节点之间的匹配关系,生成至少两个有效匹配组合的集合,其中,每个有效匹配组合包括多个匹配关系,每个匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系;第一计算模块,被配置为计算每个有效匹配组合的评价指标值,并比较所有评价指标值;第一确定模块,还被配置为根据评价指标值确定目标有效匹配组合,以及根据目标有效匹配组合为每个请求方节点提供远程内存资源。
第六方面,本申请还提供了一种面向云计算的内存分配装置,装置包括:第二接收模块,被配置为接收在预设时间内来自不同节点的请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:请求方节点的标识和请求远程内存资源大小;第二确定模块,被配置为根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,每个贡献节点集合中包括至少一个贡献方节点;第二匹配模块,被配置为建立不同请求方节点与不同贡献节点集合内的贡献方节点之间的匹配关系,生成至少两个有效匹配组合,其中,每个有效匹配组合包括多个匹配关系,每个匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系;第二发送模块,被配置为将至少两个有效匹配组合发送至不同的请求方节点,以使每个请求方节点选择目标有效匹配组合并获取远程内存资源。
第七方面,本申请还提供了一种内存分配系统,系统包括控制器和计算机集群,计算机集群中包括多个节点,多个节点中的部分节点为请求方节点,部分节点为贡献方节点;一个或多个请求方节点向控制器发送请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:请求方节点的标识和请求远程内存资
源大小;控制器接收在预设时间段内来自不同节点的请求消息,根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,每个贡献节点集合中包括至少一个贡献方节点;控制器建立不同请求方节点与不同贡献节点集合内的贡献方节点之间的匹配关系,生成至少两个有效匹配组合,其中,每个有效匹配组合包括多个匹配关系,每个匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系;以及将至少两个有效匹配组合发送至不同的请求方节点。
多个请求方节点中的第一节点接收控制器根据第一请求消息反馈的目标有效匹配组合,该目标有效组合包括第一节点与为其提供远程内存资源的贡献方节点之间的绑定关系;并根据目标有效匹配组合获取贡献方节点提供的远程内存资源。
结合第七方面,在第七方面的一种可选的实施方式中,控制器还建立节点拓扑信息表,节点拓扑信息表中包括:计算机集群中相连的每个节点信息、各节点之间的连接关系、节点之间的通讯延迟参数和通信带宽参数、节点类型以及节点可贡献内存。
第八方面,本申请提供了一种计算机设备,包括:存储器和处理器,存储器和处理器之间互相通信连接,存储器中存储有计算机指令,处理器通过执行计算机指令,从而执行上述第一方面或第二方面及其对应的任一实施方式的面向云计算的内存分配方法。
另外,该处理器在执行计算机指令时,还执行上述第三方面和第四方面的面向云计算的内存获取方法。
可选的,本申请提供了一种计算机非易失性可读存储介质,该计算机非易失性可读存储介质上存储有计算机指令,计算机指令用于使计算机执行上述第一方面或第二方面及其对应的任一实施方式的面向云计算的内存分配方法,或者执行前述第三方面和第四方面的面向云计算的内存获取方法。
本申请提供了一种面向云计算的内存分配方法、内存获取方法、装置和设备,先通过对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,然后建立不同请求方节点与不同贡献方节点之间的匹配关系,为所有请求方节点筛选的贡献方节点的多个匹配关系形成至少两个有效匹配组合,再计算每个有效匹配组合的评价指标值;比较所有评价指标值确定目标有效匹配组合,并按照该目标有效匹配组合为不同请求方节点提供远程内存资源。
本方法解决了在众多的节点范围内多远程内存贡献节点与多远程内存请求节点的匹配问题,从系统综合效果为远程内存贡献节点与远程内存请求节点找到最优的匹配组合,避免了逐个匹配引起的不合理分配结果,采用一个远程内存贡献节点满足一个远程内存请求,避免了远程内存碎片化,使得远程内存空间高效利用、系统综合效果较优。
另外,本方法在筛选贡献方节点的过程中,不仅考虑与请求方节点的距离,还考虑节点间的通信性能和可贡献的内存资源大小,所以为不同请求方节点筛选出的相匹配的贡献方节点能更有效、更便捷地提供远程资源服务。
为了更清楚地说明本申请具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种面向云计算的内存分配方法的流程示意图;
图2是本申请实施例提供的一种为请求方节点筛选贡献方节点的流程示意图;
图3是本申请实施例提供的另一种为请求方节点筛选贡献方节点的流程示意图;
图4是本申请实施例提供的另一种面向云计算的内存分配方法的流程示意图;
图5a是本申请实施例提供的一种节点拓扑图;
图5b是本申请实施例提供的一种节点拓扑信息表的示意图;
图6是本申请实施例的一种内存获取方法的流程示意图;
图7是本申请实施例提供另一种内存获取方法的流程示意图;
图8是本申请实施例提供的一种内存分配装置和内存获取装置的结构框图;
图9是本申请实施例提供的另一种内存分配装置和内存获取装置的结构框图;
图10是本申请实施例提供的又一种内存分配装置的结构框图;
图11是本申请实施例提供的一种计算机设备的硬件结构示意图。
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的技术方案应用于一种计算机集群的应用场景,比如云计算平台,或其他网络平台等。该应用场景中包括控制器和计算机集群,计算机集群中包括多个节点,且这些节点既可以作为请求方节点,用于向服务器或控制器请求远程内存,又可以作为贡献方节点,用于为请求方节点提供远程内存资源。
应理解,控制器包括但不限于是一种控制装置或控制模块,还可以是全局内存管理器或全局内存控制器等,本申请实施例对此不予限制。
目前对于远程内存资源的分配方法,首先是建立节点分布表,该节点分布表包括每个节点可贡献内存大小以及各节点之间的连接关系,如果有内存请求者请求分配远程内存,则在以请求者为中心、根据距离由近及远寻找可以作为贡献者的节点并为请求者分配远程内存。
上述方案的距离为其他节点到请求方节点的路由跳数,在分配远程内存时,首先搜索第一跳周边节点,当第一跳周边节点的空闲内存总和可以满足请求者的需求时,则将一个或多个周边节点的内存分配给请求方节点,如果第一跳周边节点的空闲内存总和不可以满足请求者的需求时则继续搜索第二跳,逐次进行,直至满足内存请求者的需求。
该方案将远程内存分配问题简化成为每个内存请求方的远程内存需求分配问题,同时,将通信距离作为一项重要的因素来考虑。其中,远程直接内存访问RDMA(Remote Direct Memory Access,远程直接内存访问)通信网络是一种CPU-ByPass(Central Processing Unit Bypass,中央处理器旁路功能)技术,该方案仅考虑通信距离的影响因素可能导致多个通信距离近的内存贡献方节点满足一个内存请求方节点的需求的情况,但会引起系统管理过于复杂。
需要说明的是,本申请实施例的技术方案可以应用于RDMA技术的远程内存请求方和贡献方的匹配,以及CXL技术的内存需求方和内存贡献方的匹配。此外,还可以应用于除RDMA和CXL(Compute Express Link,一种新型的高速互联技术)技术领域之外的其他方法或技术,本申请实施例对此不予限制。
其中,CXL是一种新型的高速互联技术。
另外,在多个远程内存请求方和远程内存贡献方的远程内存需要匹配的情况下,逐个内存请求方进行分配内存分配并不考虑后续的内存请求方节点的分配情况,其分配结果的综合效果不佳。
本申请提出一种高效的远程内存分配方法和内存获取方法,解决在众多的节点范围内匹配内存贡献方节点和内存请求方节点的内存分配的问题,目的是达到远程内存空间高效利用,以及系统综合性能最佳的整体效果。
根据本申请实施例,提供了一种面向云计算的内存分配方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
在本实施例中提供了一种面向云计算的内存分配方法,可用于控制器、全局内存管理器、全局内存控制器或控制中心等网络设备,图1是根据本申请实施例的一种面向云计算的内存分配方法的流程图,如图1所示,
该流程包括如下步骤:
步骤S101:接收在预设时间内来自不同节点的请求消息,每个请求消息用于请求获取远程内存资源。
其中,每个请求消息中包括:请求方节点的标识和请求远程内存资源大小。另外,还可以包括请求方节点的位置、通信情况等信息。
预设时间可以自定义,比如周期性地或基于外部条件主动触发接收请求消息,本申请实施例对此不做限定。
步骤S102:根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合。
其中,每个贡献节点集合中包括至少一个贡献方节点,且至少一个贡献方节点符合请求方节点的内存资源需求和通信性能条件,可选地,内存资源需求是指请求方节点所需的内存资源大小,通信性能条件包括通信距离等条件。
可选地,如图2所示,一种可选的实施方式包括如下:
步骤S102-1:根据请求方节点的标识在集群的节点拓扑信息表中筛选出符合通信性能要求的一个或多个贡献方节点,得到第一贡献节点集合。
步骤S102-2:在第一贡献节点集合中筛选满足请求方节点所需的远程内存资源大小的一个或多个贡献方节点,并对筛选的一个或多个贡献方节点按照预设规则排序得到第二贡献节点集合。
其中,预设规则排序可以是按照内存资源从大到小的顺序排序,或者还可以其他自定义规则,本申请实施例对此不做限制。
并且第二贡献节点集合为前述步骤S102中为当前节点确定的一个贡献节点集合。
可选的,第二贡献节点集合中贡献方节点的数量不超过10个。
步骤S103:建立不同请求方节点与不同贡献节点集合内的贡献方节点之间的匹配关系,生成至少两个有效匹配组合。
其中,每个有效匹配组合包括多个匹配关系,每个匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系。可选地,每个有效组合中包括所有请求方节点与相匹配的贡献方节点之间的匹配关系。此外,匹配方式可以采用枚举法。
一个请求方节点可对应一个贡献节点集合为其提供内存资源,每个贡献节点集合中可以包括一个或多个贡献方节点。例如节点1对应的贡献节点集合中包括节点{3,4},节点3和节点4都可以为节点1提供远程内存资源。类似的,节点2对应的贡献节点集合为{3,4,5},表示节点3、节点4和节点5都可以为节点2提供远程内存资源。
建立一种匹配关系是,节点3为请求方节点1的贡献方节点,则节点1与节点3之间为一个匹配关系,同理地,节点4为节点2的贡献方节点,则节点2与节点4为另一个匹配关系,则第一有效匹配组合为:节点1与节点3,节点2与节点4。同样,还可以生成第二有效匹配组合和第三有效匹配组合,该第二有效匹配组合为:节点1与节点4,节点2与节点3。第三有效匹配组合为:节点1与节点4,节点2与节点5。轮询所有节点匹配关系后,生成至少两个有效匹配组合。
步骤S104:计算每个有效匹配组合的评价指标值,并比较所有评价指标值。
可选地,一种计算每个有效匹配组合的评价指标值,包括:
根据第i个请求方节点申请的远程内存资源Ei和实际分配远程内存Ri,以及通信路由跳数计算每个有效匹配组合的评价指标值;
可选地,可利用预设关系式计算每个有效匹配组合的评价指标值;预设关系式为:
其中,Ok为第k个有效匹配组合对应的评价指标值,Ei为第i个请求方节点所请求的远程内存资源大小,Ri为第i个请求方节点实际分配的远程内存资源大小,Wi为远程内存请求方节点与远程内存贡献方节点之间的路由跳数,n为匹配关系数。
步骤S105:根据评价指标值确定目标效匹配组合,以及根据目标有效匹配组合为每个请求方节点提供远程内存资源。
可选地,一种可选的实施方式是,比较所有评价指标值,并选择所有评价指标值中最小的一个,该最小评价指标值对应的有效匹配组合为目标有效匹配组合,该目标有效匹配组合包括为每个请求方节点提供的至少一个贡献方节点的远程内存资源分配方案。
控制器按照该确定的远程内存资源分配方案为每个请求方节点提供远程内存资源。
本申请实施例提供的方法解决了在众多的节点范围内多远程内存贡献节点与多远程内存请求节点的匹配问题,从系统综合效果为远程内存贡献节点与远程内存请求节点找到最优的匹配组合,避免了逐个匹配引起的不合理分配结果,采用一个远程内存贡献节点满足一个远程内存请求,避免了远程内存碎片化,使得远程内存空间高效利用、系统综合效果较优。
在本申请实施例的一种可选的实施方式中,在上述步骤S102中,如图3所示,还包括:
步骤S1021:建立节点拓扑信息表。
节点拓扑信息表中包括:集群中相连的每个节点的节点信息、各个节点之间的连接关系、节点之间的通信延迟参数和通信带宽参数、节点类型以及节点可贡献内存资源大小。
其中,该节点拓扑信息表可在接收请求方节点发送的请求消息之前获取,并生成。
步骤S1022:根据请求方节点的标识确定请求方节点的位置。
步骤S1023:根据请求方节点的位置在节点拓扑信息表中筛选出符合通信性能要求,并且符合通信距离要求的一个或多个贡献方节点。
可选地,步骤S1023的一种可选的实施方式是:根据请求方节点的位置,以及通信性能的要求,在节点拓扑信息表中搜索可提供远程内存的贡献方节点,并建立远程内存贡献节点链表。其中,远程内存贡献节点链表中包括至少一个内存贡献节点。
可选地,上述步骤S1023的具体实施方式可以采用如图2所示的步骤S102-1和S102-2,本实施例此处不再赘述。
此外,上述方法还包括:如果检测到有节点信息、节点的连接关系、通信延迟参数、通信带宽参数、节点类型和节点可贡献内存中的至少一项发生变化,则根据发生变化项更新节点拓扑信息表,并利用更新后的节点拓扑信息表为请求方节点筛选可提供远程内存资源的贡献方节点。
可选地,上述根据请求方节点的位置,以及通信性能的要求,在节点拓扑信息表中搜索可提供远程内存的贡献方节点,包括:根据节点拓扑信息表中节点的通讯延迟参数和通信带宽参数,查找满足通信性能的要求的一个或多个可提供远程内存的贡献方节点。
本申请实施例中,在确定的远程内存贡献节点链表中至少一个内存贡献节点还满足通信距离的要求;通信距离为远程内存贡献节点与请求方节点的每一跳路由通信距离之和,通信距离要求通信距离之和不超过预设通信距离,每一跳路由的通信距离为该段通信延迟参数与通信带宽参数之积。
通过公式表示为:L≤Lmax,
L=∑ai-jbi-j,
L=∑ai-jbi-j,
其中,L为上述远程内存贡献节点与请求方节点的每一跳路由通信距离之和,Lmax为预设通信距离,ai-j为通信延迟参数,bi-j为通信带宽参数,ai-jbi-j为通信延迟参数ai-j与通信带宽参数bi-j之积。
本申请实施例提供的方法,先通过通信性能要求筛选符合条件的一个或多个贡献方节点,然后再在筛选出
的所有贡献方节点中通过内存大小筛选符合当前请求方节点需求的节点,最后计算执行请求方节点和贡献方节点匹配,构建至少两个有效匹配组合,并计算有效匹配组合的评价指标值,从而使得筛选的贡献方节点性能最优、提供远程内存资源效率最高。
另外,本方法在筛选贡献方节点的过程中,不仅考虑与请求方节点的距离,还考虑节点间的通信性能和可贡献的内存资源大小,所以为不同请求方节点筛选出的相匹配的贡献方节点能更有效、更便捷地提供远程资源服务。
可选地,一种可选的实施方式是,设第i个请求方节点所请求的远程内存资源大小为Ei;上述步骤S103中,建立不同请求方节点与不同贡献节点集合内的贡献方节点之间的匹配关系,生成至少两个有效匹配组合,包括:
对第i个请求方节点筛选的贡献方节点数量为m个,其中,m个节点中的任一个节点的内存资源大小为Pj,m≥1且为正整数;
采用枚举法根据第i个请求方节点所请求的远程内存资源Ei和贡献方节点的内存资源Pj按照规则建立匹配关系,生成至少两个有效匹配组合。
可选地,采用枚举法根据第i个请求方节点所请求的远程内存资源Ei和贡献方节点的内存资源Pj按照规则建立匹配关系,生成至少两个有效匹配组合,包括:
按照以下规则根据第i个请求方节点所请求的远程内存资源Ei和贡献方的内存资源Pj建立匹配关系:
如果满足Pj≥1.2Ei,且Pj-Ei≥1G,则为第i个请求方节点分配远程内存资源大小为Ei;如果不满足Pj≥1.2Ei,且Pj-Ei≥1G,则为第j个请求方节点提供的远程内存资源大小为Pj。
其中,Ei为第i个请求方节点请求的内存资源大小,Pj为第j个贡献方节点可贡献的远程内存资源大小。i,j为常数,用于标识请求方节点和贡献方节点。
其中,匹配判定算法或者称为远程内存匹配方法,该算法包括但不仅限于CXL技术。此外匹配判定算法还可以是其他匹配算法,用于与其他机间内存共享技术的匹配方法/算法模型都可使用。
可选地,上述方法还包括:当满足Pj≥1.2Ei,且Pj-Ei≥1G条件时,将第j个贡献方节点可贡献的内存资源Pj拆分成两个或两个以上部分,其中,一部分内存资源用于提供给当前请求方节点,剩余部分内存资源用于提供给其他请求方节点。例如拆分成第一部分和第二补充,第一部分资源大小为Ei,第二部分资源大小为Pj-Ei。
例如,将第一部分内存资源大小为Ei给远程内存的请求方节点Mi,将第二部分(Pj-Ei)远程内存继续作为该节点的可贡献内存;否则该远程内存贡献节点Kj的可贡献远程内存Pj全部分配给远程内存请求方节点Mi。
在本申请实施例的另一可选的实施方式中,上述步骤S104,确定目标有效匹配组合之后,还包括:将目标有效分配组合的指示消息发送给不同的请求方节点和对应的各个贡献方节点,以及记录和更新节点拓扑信息表,从而使节点拓扑信息表为最新表。
可选的,在可选的实施例中,还提供了一种内存资源分配方案,如图4所示,该方法包括:
步骤S201:接收在预设时间内来自不同节点的请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:请求方节点的标识和请求远程内存资源大小。
该步骤S201同前述实施例的步骤S101。
步骤S202:根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合。
其中,每个贡献节点集合中包括至少一个贡献方节点。
该步骤S202同前述实施例的步骤S102。
步骤S203:建立不同请求方节点与至少一个贡献节点集合内的贡献方节点之间的匹配关系,生成至少两
个有效匹配组合。
该步骤S203同前述实施例的步骤S103。
步骤S204:将至少两个有效匹配组合发送至不同的请求方节点,以使每个请求方节点选择目标有效匹配组合并获取远程内存资源。
与前述实施例的步骤S104不同,该步骤中,控制器将多个有效匹配组合发送给不同的请求方节点,比如第一节点或第二节点,然后由接收端的请求方节点自行确定目标有效匹配组合,然后按照该目标有效匹配组合获取贡献节点的远程内存资源。
一种确定目标有效匹配组合的方式是,采用前述步骤S104的方法,计算每个有效匹配组合集合的评价指标值,并从所有评价指标值中选择做小的一个作为目标评价指标值,再确定该目标评价指标值所对应的有效匹配组合为目标有效匹配组合。
具体地确定过程可参见前述实施例的描述,本实施例此处不再赘述。
本申请实施例中提供两种方案,一种是,控制器直接根据请求方节点的内存需求为其确定目标有效匹配组合,并按照该目标有效匹配组合的方案为请求方节点提供远程内存资源。另一种是,控制器将多个远程内存资源分配方案全部发送给请求方节点,使请求方节点自己选择确定使用哪一种方案。第二种方法由用户/客户端的请求方节点选择,相比于第一种分配方案更灵活。
下面结合一可选实施例对本申请的技术方案进行详细说明。
基于前述实施例的描述,本申请实施例提供的远程内存资源分配方法包括以下方法流程:
第一步,建立节点拓扑信息表。使用邻接表记录节点拓扑分布图即该节点相连的每个节点信息以及各节点之间的连接关系,节点之间的通信延迟参数ai-j和通信带宽参数bi-j,节点的类型以及节点可贡献内存,其中ai-
j=aj-i,bi-j=bj-i。如图5a和5b所示,其中,图5a为一种节点拓扑图,图5b为一种节点拓扑信息表的示意图。
如图5a所示,该节点拓扑图中共包括有14个节点,节点编号分别为0-13。首先建立一个数组,数组的索引即为节点编号,每个数组单元包括一个链表指针、可贡献空闲内存的大小、节点类型以及其他需要的信息。数组单元中的链表指针plist指向一个链表,如图5b所示,该链表记录与该节点相邻的所有节点,每个链表单元记录节点号以及两节点之间的通信延迟参数ai-j和通信带宽参数bi-j。如数组索引2的数组单元记录节点2的相关信息,链表指针记录与节点2相邻的节点6、12、1、11、5的在数组中的索引号,以及这些节点之间的通信延迟参数和通信带宽参数。
第二步,周期性地与各节点通信更新各节点的可贡献内存空间大小,以及是否有远程内存请求及大小。查询周期设为1分钟,周期间隔可以根据内存工作集预测算法的特点进行设定。在该周期内更新节点拓扑信息表记录最新的各节点可贡献内存空间情况;并且将在该周期内远程内存请求节点及需要的远程内存大小记录下来,准备与远程内存贡献方进行匹配。
然后,依照系统对于通信性能的要求,为该周期远程内存请求节点建立可用远程内存贡献节点集合。设该周期内共有n个远程内存请求节点,第i个远程内存请求方节点表示为Mi(i=1,2,…,n),其请求的远程内存大小为Ei(i=1,2,…,n)。对于每一个远程内存请求节点搜索前述建立的节点拓扑信息表,建立可选远程内存贡献节点链表,该链表按可贡献内存大小进行排序。可选远程内存贡献节点必须满足系统对于通信距离的要求,通信距离为远程内存贡献节点与远程内存请求节点的每一跳路由通信距离和,每一跳路由的通信距离为ai-jbi-j,因此远程内存贡献节点与远程内存请求节点的通信距离为:L=∑ai-jbi-j。
其中,可选的远程内存贡献节点与远程内存请求节点的通信距离不能超过预设通信距离Lmax。公式表示为:
L≤Lmax。
依据远程内存请求节点的内存请求,在上述基础上建立可实际分配的远程内存贡献节点集合。设对于第i个远程内存请求节点的可选远程内存贡献节点有m个,第j个可选远程内存贡献节点记为Kj(j=1,2,…,m),其可贡献内存记为Pj(j=1,2,…,m)。对于远程内存请求方节点Mi节点按照由小至大顺序搜索该节点对应的可选远程内存贡献节点链表,进行匹配判定。由于远程内存请求方节点Mi节点请求的内存大小与远程内存贡献节点的可贡献内存大小并不完全一致,因此远程内存贡献节点记为Kj与远程内存请求方节点Mi的匹配判定如下:
(1)当Pj<Ei,(i=1,2,......,n,j=1,2,......,m)时,远程内存贡献节点Kj不能为远程内存请求方节点Mi分配远程内存;
(2)当Pj≥Ei,(i=1,2,......,n,j=1,2,......,m)时,确定远程内存贡献节点Kj可以为远程内存请求方节点Mi分配远程内存。
可选地,为了避免远程内存空间浪费,当Pj≥1.2Ei,且Pj-Ei≥1G时,远程内存贡献节点Kj将远程内存拆成两部分,其中大小为Ei的远程内存分配给远程内存的请求方节点Mi,剩余Pj-Ei远程内存继续作为该节点的可贡献内存。否则该远程内存贡献节点Kj的可贡献远程内存Pj全部分配给远程内存请求方节点Mi。
可选的,为了加快远程内存的匹配速度和降低算法复杂度,每一个周期的远程内存匹配过程中单个节点的可贡献内存只能拆分一次为两部分。
通过上述匹配判定算法,为每一个远程内存请求节点,找出既满足内存大小又满足通信距离的远程内存贡献节点集合。将远程内存请求方节点Mi的远程内存贡献节点集合记为Qi。为了降低计算复杂度,本申请实施例中限制Qi最多拥有10个远程内存贡献节点(即按小至大顺序找出既满足内存大小又满足通信距离的远程贡献节点个数≤10)。
如果远程内存请求方节点Mi的远程内存贡献节点集合为空,则直接向远程内存请求节点返回错误及原因,由远程内存请求节点自己判断是否拆分远程内存请求重新发起请求,并将该远程内存请求方节点Mi的请求置为无效不予考虑。
本申请实施例中,构建匹配效果评价函数的一种可选的实施方式是:采用枚举法为远程内存请求节点与远程内存贡献节点构建有效匹配组合,并计算该有效匹配组合所对应的评价指标值。
当远程内存贡献节点Kj在Pj≥1.2Ei,且Pj-Ei≥1G时远程内存会进行拆分。可选的,1G(Gigabyte,千兆字节)还是其他值可以根据实际情况设定,本申请实施例对此不做限制,因此实际分配的远程内存并不一定等于远程内存贡献节点的可贡献内存大小。本申请实施例将实际分配给第i个远程内存请求节点的远程内存大小为Ri(i=1,2…,n)。
第三步,采用枚举法为远程内存请求节点与远程内存贡献节点构建有效匹配组合,并生成至少两个有效匹配组合。其中,每个有效匹配组合的定义为对于远程内存请求方节点Mi,寻找到一个合适的远程内存贡献节点Kj,其中Kji∈Qi,组合内不同的远程内存请求方节点Mi匹配的远程内存贡献节点的不相同。综合考虑远程内存空间的有效利用情况和通信距离对性能的影响。Wi为远程内存请求方节点与远程内存贡献方节点的路由跳数,
有效匹配组合中假设组合k的匹配效果评价指标值通过如下关系式计算:
其中,约束条件如下:
第四步,比较各个有效匹配组合的评价指标值,选择Ok值最小的匹配有效组合确认为最优的远程内存匹配组合,即目标有效匹配组合。
第五步,将该目标有效匹配组合的远程内存匹配结果记录,并通知各远程内存请求方节点以及远程内存贡献方节点,同时更新节点拓扑信息表。
至此,一个周期的远程内存请求节点以及远程内存贡献节点的匹配过程结束。该方法为远程内存贡献节点与请求节点找到最优的内存资源分配组合,避免远程内存碎片化,使得远程内存空间高效利用、系统综合效果较优。
在可选的实施例中,与前述的内存分配方法相对应,本申请实施例还提供一种面向云计算的内存获取方法,该方法可应用于前述的任一请求节点,比如第一节点,如图6所示,该方法包括:
步骤S301:第一节点生成第一请求消息,第一节点为一请求方节点,第一请求消息包括:第一节点的标识和第一节点请求获取的远程内存资源大小。
步骤S302:第一节点发送第一请求消息给控制器。对应前述实施例的步骤S101。
步骤S303:第一节点接收控制器根据第一请求消息反馈的目标有效匹配组合,目标有效组合包括第一节点与为其提供远程内存资源的贡献方节点之间的绑定关系。
具体过程参见前述实施例的步骤S101至S105,本实施例此处不再赘述。
步骤S304:第一节点根据目标有效匹配组合获取贡献方节点提供的远程内存资源。
在可选的实施例中,对应于前述如图4所示的方法步骤,如图7所示,该面向云计算的内存获取方法,该方法应用于第二节点,第二节点为任一请求方节点,方法包括:
步骤S401:第二节点生成第二请求消息,第二节点为请求方节点,第二请求消息包括:第二节点的标识和第二节点请求获取的远程内存资源大小。同前述步骤S301。
步骤S402:第二节点发送第二请求消息给控制器。同前述步骤S302。
步骤S403:第二节点接收控制器根据第二请求消息反馈的至少两个有效匹配组合,每个有效匹配组合包括多个匹配关系,每个匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系。
具体过程与前述实施例的步骤S101至S103的方法过程相同,本实施例此处不再赘述。
步骤S404:第二节点在至少两个有效匹配组合中确定目标有效匹配组合,并根据目标有效匹配组合获取贡献方节点提供的远程内存资源。
一种可选的实施方式是,确定过程与前述步骤S104和S105方法相同,参见前述实施例的描述,此处不再赘述。
另外,本申请实施例还提供一种内存分配系统,该系统包括控制器和计算机集群,计算机集群中包括多个节点,多个节点中的部分节点为请求方节点,部分节点为贡献方节点。
以请求方节点为例,方法包括:
一个或多个请求方节点向控制器发送一个或多个请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:当前请求方节点的标识和请求远程内存资源大小。
控制器接收在预设时间内来自不同节点的请求消息,根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,每个贡献节点集合中包括至少一个贡献方节点;建立不同请求方节点与不同贡献节点集合内的贡献方节点之间的匹配关系,生成至少两个有效匹配组合;计算每个有效匹配组合的评价指标值,并比较所有评价指标值;根据评价指标值确定目标有效匹配组合,以及根据目标有效匹配组合为每个请求方节点提供远程内存资源。比如将该目标有效匹配组合发送给第一节点。
第一节点接收控制器根据第一请求消息反馈的目标有效匹配组合,该目标有效组合包括第一节点与为第一节点提供远程内存资源的贡献方节点之间的绑定关系;然后根据目标有效匹配组合获取该贡献方节点提供的远程内存资源。其中,第一节点是多个请求方节点之一。
此外,在周期性请求远程内存资源的过程中,控制器还建立节点拓扑信息表,并利用节点拓扑信息表,以及每个请求方节点的标识和请求远程内存资源大小,通过匹配判定算法为每个请求方节点确定贡献节点集合。
其中,拓扑信息表中包括:计算机集群中相连的每个节点信息、各节点之间的连接关系、节点之间的通讯延迟参数和通信带宽参数、节点类型以及节点可贡献内存。
本申请实施例提供的系统解决了在众多的节点范围内,多远程内存贡献节点与多远程内存请求节点的匹配问题,从系统综合效果为远程内存贡献节点与远程内存请求节点找到最优的匹配组合,避免了逐个匹配引起的不合理分配结果,采用一个远程内存贡献节点满足一个远程内存请求,避免了远程内存碎片化,使得远程内存空间高效利用、系统综合性能效果较优。
下面介绍与上述方法实施例对应的装置实施例。
在本申请实施例中还提供了一种面向云计算的内存分配装置,该装置被配置为实现上述实施例及可选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件,和/或,硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
本申请实施例提供一种面向云计算的内存分配装置,如图8所示,该装置包括:第一接收模块801、第一确定模块802、第一匹配模块803和第一计算模块804。此外,该装置中还可以包括其他模块,比如存储模块等,本申请实施例对此不做限制。
其中,第一接收模块801,被配置为接收在预设时间内来自不同节点的请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:请求方节点的标识和请求远程内存资源大小;
第一确定模块802,被配置为根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,每个贡献节点集合中包括至少一个贡献方节点。
第一匹配模块803,被配置为建立不同请求方节点与至少一个贡献节点集合内的贡献方节点之间的匹配关系,生成至少一个有效匹配组合的集合。
第一计算模块804,被配置为计算集合内每个有效匹配组合集合的评价指标值,并比较所有评价指标值。
第一确定模块802,还被配置为根据评价指标值确定目标有效匹配组合,以及根据目标有效匹配组合为每个请求方节点提供远程内存资源。
此外,在图8中还包括一种面向云计算的内存获取装置,应用于前述第一节点,该装置包括:
第一生成模块805,被配置为生成第一请求消息,第一请求消息包括:第一节点的标识和第一节点请求获取的远程内存资源大小;
第一发送模块806,被配置为发送第一请求消息给控制器;
第三接收模块807,被配置为接收控制器根据第一请求消息反馈的目标有效匹配组合,目标有效组合包括第一节点与为其分配远程内存资源的贡献方节点之间的绑定关系;
第一获取模块808,被配置为根据目标有效匹配组合获取贡献方节点提供的远程内存资源。
其中,内存获取装置被配置为向内存分配装置发送请求消息,比如第一请求消息,然后内存分配装置通过前述方法实施例的流程确定出目标有效匹配组合,并将该目标有效匹配组合发送给内存获取装置,内存获取装置的第一获取模块接收该目标有效匹配组合后,按照该目标有效匹配组合获取远程内存资源,从而实现了远程内存空间高效利用、系统综合效果较优的有益效果。
可选的,上述内存分配装置和内存获取装置还被配置为实现前述方法实施例的其他方法步骤,本实施例此处不再赘述。
另外,在可选实施例中,如图9所示,还公开了另一种面向云计算的内存分配装置和内存获取装置,其中,该内存分配装置包括:
第二接收模块901,被配置为接收在预设时间内来自不同节点的请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:请求方节点的标识和请求远程内存资源大小。
第二确定模块902,被配置为根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,每个贡献节点集合中包括至少一个贡献方节点。
第二匹配模块903,被配置为建立不同请求方节点与至少一个贡献节点集合内的贡献方节点之间的匹配关系,生成至少两个有效匹配组合。
其中,每个有效匹配组合包括多个匹配关系,每个匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系。
第二发送模块904,被配置为将至少两个有效匹配组合发送至不同的请求方节点,以使每个请求方节点选择目标有效匹配组合并获取远程内存资源。
另外,内存获取装置可以是另一种请求方节点,比如第二节点,该内存获取装置包括:
第二生成模块905,被配置为生成第二请求消息,第二节点为请求方节点,第二请求消息包括:第二节点的标识和第二节点请求获取的远程内存资源大小。
第三发送模块906,被配置为发送第二请求消息给控制器。
第四接收模块907,被配置为接收控制器根据第二请求消息反馈的至少两个有效匹配组合,每个有效匹配组合包括一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系。
第二获取模块908,被配置为在至少两个有效匹配组合中确定目标有效匹配组合,并根据目标有效匹配组合获取贡献方节点提供的远程内存资源。
本申请实施例中的内存分配装置是以功能单元的形式来呈现,这里的单元是指ASIC(Application-Specific Integrated Circuit,特定应用集成电路)电路,执行一个或多个软件或固定程序的处理器和存储器,和/或,其他可以提供上述功能的器件。
上述各个模块和单元的更进一步的功能描述与上述请求方节点实施例相同,在此不再赘述。
在硬件实现层面,本申请实施例上述远程内存需求方节点或请求方节点,包括:CPU(Central Processing Unit,中央处理器)处理器、主内存管理器、多个内存管理器和内存组、多个远端内存控制器和通信单元1。CPU处理器与主内存管理器连接,主内存管理器与多个内存控制器和远端内存控制器连接,内存控制器与内存控制组连接,远端内存控制器与通信单元连接。
本申请实施例采用了远程直接数据访问技术,每一个服务器节点都安装了一块或多块专用网卡(高端以太网卡或者IB网卡(InfiniBand Network Interface Card,无限带网卡))。服务器之间通过RDMA技术可以实现
内存的远程共享。
另外,本申请还提出了另一种内存分配装置,如图10所示,该装置包括通讯单元、周期通信单元、节点拓扑信息记录单元、内存请求处理单元、有效贡献节点筛选单元1、有效贡献节点筛选单元2、最优组合确定单元和匹配结果通知与记录单元。
可选地,通讯单元负责与服务器节点进行数据通信,按照通信协议要求完成数据的收发工作。
周期通信单元,负责按照指定周期间隔与服务器节点进行通信,获取服务器节点可贡献内存大小信息、远程内存释放信息、远程内存请求信息以及故障信息等。
远程内存匹配装置,与某个服务器节点不能正常通信,则判定其该服务器为故障。周期通信单元,根据获取的最新可贡献内存信息更新至节点拓扑信息记录单元;然后,处理远程内存释放信息将其发送给匹配结果通知与记录单元,匹配结果通知与记录单元将更改远程内存供求双方的绑定记录信息,同时通知远程内存供求双方的服务器节点,服务器最新的可贡献远程内存信息在下一个通信周期由服务器节点报上来;最后处理远程内存请求,将请求发往内存请求处理单元。
内存请求处理单元,被配置为将一个周期内的内存请求节点按节点拓扑信息记录单元的顺序进行排序组织好,然后将该数据发送给有效贡献节点筛选单元1。
有效贡献节点筛选单元1,负责查询节点拓扑信息记录为内存请求节点搜索符合通信距离的有效远程内存贡献节点,利用邻接表构建可选远程内存贡献节点链表,然后将该数据发给有效贡献节点筛选单元2。
有效贡献节点筛选单元2,负责查询节点拓扑信息记录为内存请求节点搜索可贡献内存满足需求的有效远程内存贡献节点并按可贡献内存大小进行排序,构建新的可选远程内存贡献节点链表,然后将该数据发给最优组合确定单元。
最优组合确定单元,被配置为采用枚举法穷举每一个有效组合,并按照评价函数计算匹配效果评价指标值,最后选取评价指标值最小的组合确定为最优有效匹配组合;然后将最优有效匹配组合发给匹配通知与记录单元。
匹配通知与记录单元,被配置为将最优有效匹配组合绑定关系记录下来,同时更新远程内存贡献节点的可贡献内存信息,最后通过通讯单元发送数据通知服务器节点远程内存的匹配关系及远程内存大小,至此完成一次匹配过程。
本申请实施例还提供一种计算机设备,具有上述图8至图10所示的远程内存分配装置。
请参阅图11,图11是本申请可选实施例提供的一种计算机设备的结构示意图,如图9所示,该计算机设备包括:一个或多个处理器10、存储器20,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相通信连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在计算机设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI(Graphical User Interface,图形用户界面)的图形信息的指令。
在一些可选的实施方式中,若需要,可以将多个处理器,和/或,多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个计算机设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器系统)。图11中以一个处理器10为例。
处理器10可以是中央处理器,网络处理器或其组合。其中,处理器10还可以包括硬件芯片。上述硬件芯片可以是专用集成电路,可编程逻辑器件或其组合。上述可编程逻辑器件可以是复杂可编程逻辑器件,现场可编程逻辑门阵列,通用阵列逻辑或其任意组合。
其中,存储器20存储有可由至少一个处理器10执行的指令,以使至少一个处理器10执行实现上述实施例示出的方法。
存储器20可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据一种小程序落地页的展现的计算机设备的使用所创建的数据等。此外,存储器20可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、
或其他非瞬时固态存储器件。在一些可选的实施方式中,存储器20可选包括相对于处理器10远程设置的存储器,这些远程存储器可以通过网络连接至该计算机设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
存储器20可以包括易失性存储器,例如,随机存取存储器;存储器也可以包括非易失性存储器,例如,快闪存储器,硬盘或固态硬盘;存储器20还可以包括上述种类的存储器的组合。
该计算机设备还包括通信接口30,被配置为该计算机设备与其他设备或通信网络通信。
本申请实施例还提供了一种计算机非易失性可读存储介质,上述根据本申请实施例的方法可在硬件、固件中实现,或者被实现为可记录在非易失性可读存储介质,或者被实现通过网络下载的原始存储在远程非易失性可读存储介质或非易失性可读存储介质中并将被存储在本地非易失性可读存储介质中的计算机代码,从而在此描述的方法可被存储在使用通用计算机、专用处理器或者可编程或专用硬件的非易失性可读存储介质上的这样的软件处理。
其中,非易失性可读存储介质可为磁碟、光盘、只读存储记忆体、随机存储记忆体、快闪存储器、硬盘或固态硬盘等;可选地,非易失性可读存储介质还可以包括上述种类的存储器的组合。可以理解,计算机、处理器、微处理器控制器或可编程硬件包括可存储或接收软件或计算机代码的存储组件,当软件或计算机代码被计算机、处理器或硬件访问且执行时,实现上述实施例示出的远程内存分配方法、内存获取方法。
虽然结合附图描述了本申请的实施例,但是本领域技术人员可以在不脱离本申请的精神和范围的情况下做出各种修改和变型,这样的修改和变型均落入由所附权利要求所限定的范围之内。
Claims (22)
- 一种面向云计算的内存分配方法,其特征在于,所述方法包括:接收在预设时间内来自不同节点的请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:请求方节点的标识和请求远程内存资源大小;根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,每个贡献节点集合中包括至少一个贡献方节点;建立不同请求方节点与不同贡献节点集合内的贡献方节点之间的匹配关系,生成至少两个有效匹配组合,其中,每个有效匹配组合包括多个匹配关系,每个所述匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系;计算每个有效匹配组合的评价指标值,并比较所有评价指标值;根据评价指标值确定目标有效匹配组合,以及根据所述目标有效匹配组合为每个请求方节点提供远程内存资源。
- 根据权利要求1所述的方法,其特征在于,根据请求方节点的标识和请求远程内存资源大小,对集群中的节点进行通信性能的筛选,包括:根据请求方节点的标识在集群的节点拓扑信息表中筛选出符合通信性能要求的一个或多个贡献方节点,得到第一贡献节点集合。
- 根据权利要求2所述的方法,其特征在于,根据请求方节点请求的远程资源内存大小,对集群中的节点进行内存资源大小的筛选,为请求方节点确定出一个贡献节点集合,包括:在所述第一贡献节点集合中筛选满足当前请求方节点所需的远程内存资源大小的一个或多个贡献方节点,并对所述筛选的一个或多个贡献方节点按照预设规则排序得到第二贡献节点集合。
- 根据权利要求2或3所述的方法,其特征在于,根据请求方节点的标识在集群的节点拓扑信息表中筛选出符合通信性能要求的一个或多个贡献方节点,包括:建立节点拓扑信息表,节点拓扑信息表包括:集群中每个节点的节点信息、各个节点之间的连接关系、节点之间的通信延迟参数、通信带宽参数和节点可贡献的内存资源;根据请求方节点的标识确定请求方节点的位置;根据请求方节点的位置在所述节点拓扑信息表中筛选出符合通信性能要求,并且符合通信距离要求的一个或多个贡献方节点。
- 根据权利要求4所述的方法,其特征在于,筛选出符合通信性能要求的一个或多个贡献方节点,包括:筛选当前请求方节点与当前贡献方节点之间的通信距离不超过预设通信距离;其中,通信距离为当前请求方节点与当前贡献方节点的每一跳路由通信距离和,每一跳路由的通信距离为通信延迟参数与通信带宽参数之积。
- 根据权利要求4所述的方法,其特征在于,建立不同请求方节点与至少一个贡献节点集合内的贡献方节点之间的匹配关系,生成至少一个有效匹配组合的集合,包括:获取第i个请求方节点所请求的远程内存资源大小Ei,以及为所述第i个请求方节点筛选的贡献节点集合,所述贡献节点集合中包括m个贡献方节点,m个节点中的任一个节点的内存资源大小为Pj,m≥1且为正整数;采用枚举法根据所述第i个请求方节点所请求的远程内存资源Ei和贡献方节点的内存资源Pj按照规则建立两个或两个以上匹配关系,生成至少两个有效匹配组合。
- 根据权利要求6所述的方法,其特征在于,采用枚举法根据所述第i个请求方节点所请求的远程内存资源Ei和贡献方节点的内存资源Pj按照规则建立两个或两个以上匹配关系,包括:按照以下规则根据第i个请求方节点所请求的远程内存资源Ei和贡献方的内存资源Pj建立匹配关系;如果满足Pj≥1.2Ei,且Pj-Ei≥1G,则为第i个请求方节点分配远程内存资源大小为Ei;如果不满足Pj≥1.2Ei,且Pj-Ei≥1G,则为第j个贡献方节点提供的远程内存资源大小为Pj。
- 根据权利要求6所述的方法,其特征在于,计算每个有效匹配组合的评价指标值,包括:根据第i个请求方节点申请的远程内存资源Ei和实际分配远程内存Ri,以及通信路由跳数计算每个有效匹配组合的评价指标值。
- 根据权利要求8所述的方法,其特征在于,根据第i个请求方节点申请的远程内存资源Ei和实际分配远程内存Ri,以及通信路由跳数计算每个有效匹配组合的评价指标值,包括:利用预设关系式计算每个有效匹配组合的评价指标值;预设关系式为:
其中,Ok为第k个有效匹配组合对应的评价指标值,Ei为第i个请求方节点所请求的远程内存资源大小,Ri为第i个请求方节点实际分配的远程内存资源大小,Wi为远程内存请求方节点与远程内存贡献方节点之间的路由跳数,n为匹配关系数。 - 根据权利要求4所述的方法,其特征在于,建立节点拓扑信息表之后,所述方法还包括:建立集群中包括每个节点的数组单元,其中每个数组单元中包括:一个链表指针、可贡献内存资源的大小、节点类型;设置每个数组单元的索引,索引为每个节点的节点号;根据每个节点的数组单元和每个数组单元的索引以及节点连接关系,生成节点拓扑图。
- 根据权利要求4所述的方法,其特征在于,所述方法还包括:周期性地与集群中各个节点通信,并获取每个节点的可贡献内存资源大小以及是否有远程内存需求;如果贡献方节点的内存资源发生变化,或有远程内存需求,则记录并更新节点拓扑信息表。
- 根据权利要求7所述的方法,其特征在于,所述方法还包括:如果满足Pj≥1.2Ei,且Pj-Ei≥1G,则将贡献方节点的内存资源Pj拆分成两个或两个以上部分,其中,一部分内存资源用于提供给当前请求方节点,剩余部分内存资源用于提供给其他请求方节点。
- 根据权利要求1-3任一项所述的方法,其特征在于,所述方法还包括:将目标有效分配组合的指示消息发送给不同的请求方节点和对应的各个贡献方节点,以及记录和更新节点拓扑信息表。
- 一种面向云计算的内存分配方法,其特征在于,所述方法包括:接收在预设时间内来自不同节点的请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:请求方节点的标识和请求远程内存资源大小;根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,每个贡献节点集合中包括至少一个贡献方节点;建立不同请求方节点与不同贡献节点集合内的贡献方节点之间的匹配关系,生成至少两个有效匹配组合,其中,每个有效匹配组合包括多个匹配关系,每个所述匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系;将所述至少两个有效匹配组合发送至不同的请求方节点,以使每个请求方节点选择目标有效匹配组合并获取远程内存资源。
- 一种面向云计算的内存获取方法,其特征在于,所述方法包括:第一节点生成第一请求消息,所述第一请求消息包括:第一节点的标识和第一节点请求获取的远程内存资源大小;所述第一节点发送所述第一请求消息给控制器;所述第一节点接收所述控制器根据所述第一请求消息反馈的目标有效匹配组合,所述目标有效组合包括所述第一节点与为其提供远程内存资源的贡献方节点之间的绑定关系;第一节点根据所述目标有效匹配组合获取所述贡献方节点提供的远程内存资源。
- 一种面向云计算的内存获取方法,其特征在于,所述方法包括:第二节点生成第二请求消息,所述第二请求消息包括:第二节点的标识和第二节点请求获取的远程内存资源大小;所述第二节点发送所述第二请求消息给控制器;所述第二节点接收所述控制器根据所述第二请求消息反馈的至少两个有效匹配组合,其中,每个有效匹配组合包括多个匹配关系,每个所述匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系;所述第二节点在所述至少两个有效匹配组合中确定目标有效匹配组合,并根据所述目标有效匹配组合获取贡献方节点提供的远程内存资源。
- 一种面向云计算的内存分配装置,其特征在于,所述装置包括:第一接收模块,被配置为接收在预设时间内来自不同节点的请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:请求方节点的标识和请求远程内存资源大小;第一确定模块,被配置为根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,每个贡献节点集合中包括至少一个贡献方节点;第一匹配模块,被配置为建立不同请求方节点与不同贡献节点集合内的两个或两个以上贡献方节点之间的匹配关系,生成至少两个有效匹配组合的集合,其中,每个有效匹配组合包括多个匹配关系,每个所述匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系;第一计算模块,被配置为计算每个有效匹配组合的评价指标值,并比较所有评价指标值;所述第一确定模块,还被配置为根据评价指标值确定目标有效匹配组合,以及根据所述目标有效匹配组合为每个请求方节点提供远程内存资源。
- 一种面向云计算的内存分配装置,其特征在于,所述装置包括:第二接收模块,被配置为接收在预设时间内来自不同节点的请求消息,每个请求消息用于请求获取远程内存资源,每个请求消息中包括:请求方节点的标识和请求远程内存资源大小;第二确定模块,被配置为根据请求方节点的标识和请求远程内存资源大小,对集群中的节点分别进行通信性能和内存资源大小的筛选,为每个请求方节点确定出一个贡献节点集合,每个贡献节点集合中包括至少一个贡献方节点;第二匹配模块,被配置为建立不同请求方节点与不同贡献节点集合内的贡献方节点之间的匹配关系,生成至少两个有效匹配组合,其中,每个有效匹配组合包括多个匹配关系,每个所述匹配关系为一个请求方节点与为其提供远程内存资源的一个贡献方节点之间的绑定关系;第二发送模块,被配置为将所述至少两个有效匹配组合发送至不同的请求方节点,以使每个请求方节点选择目标有效匹配组合并获取远程内存资源。
- 一种计算机设备,其特征在于,包括存储器和处理器,所述存储器和所述处理器之间互相通信连接,所述存储器中存储有计算机指令,所述处理器通过执行计算机指令,从而执行权利要求1至13中任一项,或者权利要求14中所述的面向云计算的内存分配方法。
- 一种计算机设备,其特征在于,包括存储器和处理器,所述存储器和所述处理器之间互相通信连接,所述存储器中存储有计算机指令,所述处理器通过执行计算机指令,从而执行权利要求15或16中所 述的面向云计算的内存获取方法。
- 一种计算机非易失性可读存储介质,其特征在于,所述计算机非易失性可读存储介质上存储有计算机指令;所述计算机指令用于使计算机执行权利要求1至13中任一项,或者权利要求14中所述的面向云计算的内存分配方法。
- 一种计算机非易失性可读存储介质,其特征在于,所述计算机非易失性可读存储介质上存储有计算机指令;所述计算机指令用于使计算机执行权利要求15或16中所述的面向云计算的内存获取方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310695558.5A CN116436978B (zh) | 2023-06-13 | 2023-06-13 | 面向云计算的内存分配方法、内存获取方法、装置和设备 |
| CN202310695558.5 | 2023-06-13 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024255366A1 true WO2024255366A1 (zh) | 2024-12-19 |
Family
ID=87083654
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/082277 Ceased WO2024255366A1 (zh) | 2023-06-13 | 2024-03-18 | 面向云计算的内存分配方法、内存获取方法、装置和设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN116436978B (zh) |
| WO (1) | WO2024255366A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116436978B (zh) * | 2023-06-13 | 2023-08-29 | 苏州浪潮智能科技有限公司 | 面向云计算的内存分配方法、内存获取方法、装置和设备 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104571934A (zh) * | 2013-10-18 | 2015-04-29 | 华为技术有限公司 | 一种内存访问的方法、设备和系统 |
| CN108845877A (zh) * | 2013-05-17 | 2018-11-20 | 华为技术有限公司 | 管理内存的方法、装置和系统 |
| US10761752B1 (en) * | 2017-05-23 | 2020-09-01 | Kmesh, Inc. | Memory pool configuration for allocating memory in a distributed network |
| CN116436978A (zh) * | 2023-06-13 | 2023-07-14 | 苏州浪潮智能科技有限公司 | 面向云计算的内存分配方法、内存获取方法、装置和设备 |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104166597B (zh) * | 2013-05-17 | 2018-07-03 | 华为技术有限公司 | 一种分配远程内存的方法及装置 |
-
2023
- 2023-06-13 CN CN202310695558.5A patent/CN116436978B/zh active Active
-
2024
- 2024-03-18 WO PCT/CN2024/082277 patent/WO2024255366A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108845877A (zh) * | 2013-05-17 | 2018-11-20 | 华为技术有限公司 | 管理内存的方法、装置和系统 |
| CN104571934A (zh) * | 2013-10-18 | 2015-04-29 | 华为技术有限公司 | 一种内存访问的方法、设备和系统 |
| US10761752B1 (en) * | 2017-05-23 | 2020-09-01 | Kmesh, Inc. | Memory pool configuration for allocating memory in a distributed network |
| CN116436978A (zh) * | 2023-06-13 | 2023-07-14 | 苏州浪潮智能科技有限公司 | 面向云计算的内存分配方法、内存获取方法、装置和设备 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN116436978B (zh) | 2023-08-29 |
| CN116436978A (zh) | 2023-07-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10657106B2 (en) | Method, computing device, and distributed file system for placement of file blocks within a distributed file system | |
| CN108431796B (zh) | 分布式资源管理系统和方法 | |
| US10291503B2 (en) | File block placement in a distributed network | |
| US11637889B2 (en) | Configuration recommendation for a microservice architecture | |
| CN104092756B (zh) | 一种基于dht机制的云存储系统的资源动态分配方法 | |
| US8176037B2 (en) | System and method for SQL query load balancing | |
| US20130031559A1 (en) | Method and apparatus for assignment of virtual resources within a cloud environment | |
| KR20160024747A (ko) | 네트워크 흐름을 처리 리소스로 정렬하는 기술 | |
| US12613738B2 (en) | Method and system for dynamic selection of policy priorities for provisioning an application in a distributed multi-tiered computing environment | |
| CN115802321B (zh) | 服务功能编排的方法、系统、电子设备及存储介质 | |
| CN119225921A (zh) | 一种传输路径的确定方法及计算设备 | |
| CN114298431A (zh) | 一种网络路径选择方法、装置、设备及存储介质 | |
| CN112433850A (zh) | 一种任务全局调度的方法、装置、设备及可读介质 | |
| WO2024255366A1 (zh) | 面向云计算的内存分配方法、内存获取方法、装置和设备 | |
| WO2021249023A1 (zh) | 集合通信系统中控制报文处理方法、装置、设备及系统 | |
| CN112261132B (zh) | 数据中心机群中的处理分配 | |
| US11082319B1 (en) | Workload scheduling for data collection | |
| JP5577745B2 (ja) | クラスタシステム、プロセス配置方法、及びプログラム | |
| CN118827583A (zh) | 云网环境的资源配置方法、装置及电子设备 | |
| CN118377425A (zh) | 文件系统配额管理方法、装置、设备及存储介质 | |
| US20230333897A1 (en) | Method and system for performing device level management in a distributed multi-tiered computing environment | |
| CN112965807B (zh) | 一种任务调度方法、装置、设备及介质 | |
| CN119718386B (zh) | 固件升级方法、系统、装置、计算机设备和存储介质 | |
| CN110971676B (zh) | 设备状态检测方法、装置、电子设备及存储介质 | |
| CN117370012A (zh) | 算力节点选择方法、装置、电子设备和可读存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24822323 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |