Memory sharing method, and device
By selecting appropriate memory sharing strategies for computing nodes through management nodes, the problem of insufficient flexibility in memory sharing between computing nodes is solved, and more efficient memory utilization is achieved.
Patent Information
- Application Number
- PCT/CN2025/084371
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-28
- Filing Date
- 2025-03-24
- Publication Date
- 2025-10-02
AI Technical Summary
In the prior art, memory sharing between computing nodes has poor flexibility. Computing nodes can only borrow memory from fixed computing nodes according to fixed strategies, resulting in insufficient flexibility.
The compute node determines the borrowing strategy through the management node, selects the compute node that meets the borrowing requirements, and shares memory with it. The management node provides multiple borrowing strategies to improve flexibility.
By dynamically selecting computing nodes for memory sharing, the flexibility and success rate of memory borrowing are improved, and the memory utilization efficiency of the computing cluster is improved.
Smart Images

Figure CN2025084371_02102025_PF_FP_ABST
Abstract
Description
Memory sharing method and device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of the People's Republic of China on March 28, 2024, with application number 202410377554.7 and application name "A Memory Sharing Method and Device", the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of storage technology, and in particular to a memory sharing method and device. Background Art
[0004] When computing nodes are running, memory is one of the most heavily used physical resources. However, due to cost and hardware constraints, the memory resources of a single computing node are limited and fixed in capacity, often resulting in insufficient or wasted memory resources. To address this issue, memory sharing between computing nodes has gradually emerged to achieve efficient memory utilization. In other words, a computing node can lend its memory to other computing nodes with insufficient memory resources, thereby improving computing node performance.
[0005] However, in the solutions of the prior art, when a computing node is short of memory and needs to borrow memory, it can only borrow memory from a fixed computing node according to a fixed strategy, which has poor flexibility. Summary of the Invention
[0006] The present application provides a memory sharing method and device to improve the flexibility of memory sharing between multiple computing nodes.
[0007] In the first aspect, the present application provides a memory sharing method, which is applied to a computing cluster. Specifically, the method includes: when a first computing node in the computing cluster determines that it needs to borrow memory, it sends a first request to a management node, wherein the first request includes a borrowing requirement; then, the management node determines a borrowing strategy based on the borrowing requirement, and determines information about a second computing node that meets the borrowing requirement based on the borrowing strategy, and sends the information about the second computing node to the first computing node, wherein the management node includes multiple borrowing strategies; then, the first computing node determines a third computing node that provides borrowed memory for itself based on the information about the second computing node, and sends a second request to the third computing node; finally, the third computing node provides memory for the first computing node based on the second request.
[0008] Through the above technical solution, when the computing nodes in the computing cluster determine that they need to borrow memory, they can send a request to the management node. The management node determines the borrowing strategy based on the borrowing demand, and then determines the computing nodes in the computing cluster that meet the borrowing demand based on the borrowing strategy, and sends the computing nodes that meet the borrowing demand to the nodes that need to borrow memory. The computing nodes that need to borrow memory can then determine which computing node to borrow memory from and request to borrow memory from the corresponding computing node. This can avoid the problem of poor flexibility caused by the computing nodes being able to borrow memory from fixed computing nodes when they need to borrow memory.
[0009] In a possible implementation, the second computing node information includes information of multiple second computing nodes that meet the borrowing requirement;
[0010] The first computing node determines the third computing node that provides borrowed memory to the first computing node based on the information of the second computing node, including: the first computing node determines the third computing node information from the plurality of second computing node information according to a preset rule.
[0011] Through the above technical solution, a computing node that needs to borrow memory can select a node to borrow from among multiple computing nodes that meet the borrowing requirements, which can improve the flexibility of memory borrowing.
[0012] In a possible implementation, the second computing node information includes information of at least one second computing node that meets the borrowing requirement;
[0013] The first computing node determines, based on the information of the second computing node, a third computing node that provides borrowed memory for the first computing node, including: the first computing node determines the at least one second computing node information as the third computing node information.
[0014] Through the above technical solution, the first computing node can borrow memory from at least one computing node, which can improve the success rate of memory borrowing.
[0015] In a possible implementation, the multiple borrowing strategies of the management node include different priorities, the management node determines the borrowing strategy according to the borrowing requirement, and the information of the second computing node that meets the borrowing requirement is determined according to the borrowing strategy, including:
[0016] The management node determines, according to the borrowing demand, a computing node that meets the borrowing demand using a borrowing strategy with the highest priority;
[0017] When multiple computing nodes that meet the borrowing requirement are determined according to the highest priority policy, the borrowing policy is gradually lowered until the at least one second computing node information is determined;
[0018] When the multiple borrowing strategies are all used up, and the information of the multiple second computing nodes that meet the borrowing requirements is also included, the information of the multiple second computing nodes that meet the borrowing requirements is sent to the first computing node.
[0019] Through the above technical solution, the management node can determine the computing nodes that meet the borrowing needs based on the priority of the borrowing strategy, which can improve flexibility.
[0020] In a second aspect, the present application provides a memory sharing device, which includes a module for implementing the method provided by the above-mentioned first aspect or any possible implementation method of the first aspect. Exemplarily, the memory sharing device may include a transceiver module, a processing module and a memory providing module. Among them, the transceiver module is used to send a first request to the management node when the first computing node in the computing cluster determines that it needs to borrow memory, and the first request includes a borrowing demand; the processing module is used to determine a borrowing strategy according to the borrowing demand, and determine the information of the second computing node that meets the borrowing demand according to the borrowing strategy; the transceiver module is also used to send the information of the second computing node to the first computing node, wherein the management node includes multiple borrowing strategies; the processing module is also used to determine the second computing node that provides the borrowed memory to the first computing node according to the information of the second computing node; the transceiver module is also used to send a second request to the third computing node; the memory providing module is used to provide memory to the first computing node according to the second request.
[0021] In a third aspect, the present application provides a computing device cluster comprising at least one computing device, each computing device comprising a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs the method provided in the first aspect or any possible implementation of the first aspect.
[0022] In a fourth aspect, the present application provides a computer program product comprising instructions, which, when executed by a computing device cluster, enables the computing device cluster to execute the method provided in the first aspect or any possible implementation of the first aspect.
[0023] In a fifth aspect, the present application provides a computer-readable storage medium comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method provided in the first aspect or any possible implementation of the first aspect.
[0024] For each of the above-mentioned aspects from the second to the fifth aspects and the technical effects that may be achieved by each of the aspects, please refer to the above-mentioned description of the technical effects that can be achieved by various possible solutions in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] FIG1 is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0026] FIG2 is a flow chart of a memory sharing method provided in an embodiment of the present application;
[0027] FIG3 is a flow chart of a memory sharing method provided in an embodiment of the present application;
[0028] FIG4 is a flow chart of another memory sharing method provided in an embodiment of the present application;
[0029] FIG5 is a flow chart of another memory sharing method provided in an embodiment of the present application;
[0030] FIG6 is a schematic diagram of a memory sharing device provided in an embodiment of the present application;
[0031] FIG7 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0032] FIG8 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0033] FIG9 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In the description of the embodiments of this application, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to." The term "based on" should be understood as "based at least in part on." The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment." The terms "first," "second," etc. can refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0035] In this application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: including the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0036] For example, as shown in Figure 1, a schematic diagram of an application scenario provided by an embodiment of the present application is shown. Referring to Figure 1, the application scenario may include computing nodes 10, computing nodes 20, computing nodes 30, computing nodes 40, and management nodes 50.
[0037] It should be understood that this application scenario may also include more or fewer computing nodes. FIG1 is merely an example of a computing cluster including four computing nodes and one management node. In other scenario examples, the computing cluster may also include only the four computing nodes shown in the figure. That is, the management node 50 is an optional node. In addition, the memory sharing method in the embodiments of the present application can be applied between different computing nodes in the same computing cluster, and can also be applied between different computing clusters, and this application does not limit this.
[0038] That is, the four computing nodes shown in Figure 1 can be different computing nodes in the same computing cluster, or they can be computing nodes in different computing clusters. It should be understood that when different computing clusters are put together, they can also be considered as a new cluster. For ease of description, the embodiments of this application are described as an example of multiple computing nodes in a large computing cluster.
[0039] In an embodiment of the present application, computing node 10, computing node 20, computing node 30, and computing node 40 can respectively register their own node topology information and available memory capacity information (or, can also be referred to as: available memory information) with the management node 50. It should be understood that when computing nodes belong to different computing clusters, the computing nodes can register their own topology information and available memory capacity information with the management node in the computing cluster where they are located. When a computing node, such as computing node 10, needs to borrow memory, computing node 10 can send a request containing a borrowing demand to the management node 50. Accordingly, after receiving the request, the management node 50 can determine a corresponding borrowing strategy from a plurality of borrowing strategies based on the borrowing demand of computing node 10, and then determine the computing node information that meets the borrowing demand of computing node 10 based on the determined borrowing strategy. In addition, the management node 50 can send the computing node information that meets the borrowing demand of computing node 10 to computing node 10.
[0040] Computing node 10 then determines a computing node, such as computing node 20, to provide memory to itself based on the computing node information that meets its borrowing requirements, and sends a request to computing node 20. After receiving the request, computing node 20 may provide memory to computing node 10. The borrowing policy may be pre-configured in the management node or configured by an administrator on a configuration interface, and this application does not specifically limit this.
[0041] As a possible implementation method, for each computing node, the computing node that meets its own borrowing requirements can also be selected by the user on the configuration interface.
[0042] For example, if compute node 10 needs to borrow memory, in some embodiments, management node 50 can determine, based on the borrowing policy, information about a compute node that meets compute node 10's borrowing needs, such as information about compute node 20. Management node 50 can then send information about compute node 20 to compute node 10, and compute node 10 can determine that the compute node that can provide the borrowed memory is compute node 20. Computing node 10 then sends a request to compute node 20, and compute node 20 can provide memory to compute node 10 based on the request.
[0043] In other embodiments, there may be multiple computing nodes that meet the borrowing requirements of the computing node 10, and the computing node 10 may use multiple computing nodes as computing nodes for providing borrowed memory. In other words, the computing node 10 may borrow memory from at least one computing node.
[0044] In yet other embodiments, management node 50 may determine information about multiple computing nodes that meet the borrowing requirements of computing node 10, and send the information about the multiple computing nodes (e.g., information about computing node 20 and information about computing node 30) to computing node 10. Computing node 10 may then determine, from the information about computing node 20 and information about computing node 30, a computing node to provide borrowed memory, such as computing node 20. Computing node 10 may then send a request to computing node 20, and computing node 20 may provide borrowed memory to computing node 10 upon receiving the request.
[0045] In addition, in an embodiment of the present application, when the computing node topology or memory available capacity information in the computing cluster changes, the management node 50 can configure new computing node information that meets the borrowing requirements based on the new topology and memory available capacity information (for example, it can be recorded as: a list of nodes that can borrow memory). Then, the management node 50 can send the new computing node information that meets the borrowing requirements to the corresponding computing node. For example, after a computing node exits the computing cluster where it is located, the management node 50 can send new computing node information that meets the borrowing requirements to the corresponding computing node that needs to borrow the computing node, so as to avoid the situation where the device that borrows memory cannot successfully borrow memory due to a change in the state of the computing cluster. Of course, in an embodiment of the present application, computing node information that meets the borrowing requirements can also be sent to each computing node at fixed time intervals or non-fixed time intervals, and this application does not make specific limitations on this.
[0046] FIG2 is a flow chart of a memory sharing method provided in an embodiment of the present application. Referring to FIG2 , the method may include the following steps:
[0047] In step 201 , when the computing node 10 determines that it needs to borrow memory, it sends a first request to the management node 50 .
[0048] The first request includes a borrowing request. In an embodiment of the present application, when the available capacity information of the computing node 10 is less than a set threshold, it can be determined that memory borrowing is required, and the first request can be sent to the management node 50, so that the management node 50 determines a computing node that can borrow memory based on the borrowing request in the first request.
[0049] In step 202 , the management node 50 determines a borrowing strategy according to the borrowing requirement, and determines information of a target computing node that meets the borrowing requirement according to the borrowing strategy.
[0050] The management node 50 includes multiple borrowing policies. After receiving the first request, the management node 50 may determine a borrowing policy from the multiple borrowing policies based on the borrowing requirements in the first request, and then determine information about a target computing node that meets the borrowing requirements based on the borrowing policies. It should be understood that the target computing node information may include information about at least one computing node.
[0051] Step 203 : The management node 50 sends the information of the target computing node to the computing node 10 .
[0052] In the embodiment of the present application, the target computing node information sent by the management node 50 to the computing node 10 may include the following situations:
[0053] Scenario 1: The management node 50 determines, based on the borrowing policy, that there is only one target computing node that meets the borrowing requirement of the computing node 10 , and then may send information about the only target computing node to the computing node 10 .
[0054] Scenario 2: The management node 50 determines multiple target computing nodes that meet the borrowing requirements of the computing node 10 based on the borrowing strategy. When the management node 50 cannot continue to filter out the computing node that provides borrowed memory from the multiple target nodes based on the borrowing strategy, the management node 50 can send the information of the multiple target computing nodes to the computing node 10, and the computing node 10 selects the computing node that provides borrowed memory from the information of the multiple target computing nodes.
[0055] Scenario 3: Management node 50 identifies multiple compute nodes that meet compute node 10's memory borrowing requirements and then sends information about these multiple compute nodes to compute node 10. Computing node 10 then determines these multiple compute nodes as the nodes from which to borrow memory. In other words, compute node 10 can borrow memory from multiple compute nodes. For more details on these three scenarios, please refer to the detailed descriptions in the specific embodiments of Figures 3, 4, and 5 below.
[0056] In step 204 , the computing node 10 determines the computing node 20 that provides borrowed memory to the computing node 10 based on the information of the target computing node.
[0057] It should be understood that in the embodiment of the present application, there can be at least one computing node providing borrowed memory. In the embodiment shown in FIG2 , only one computing node, such as computing node 20, is used as an example of a computing node providing borrowed memory.
[0058] After receiving the target computing node information, computing node 10 can determine the computing node that provides memory to computing node 10. When there is only one target computing node information, such as computing node 20 information, computing node 10 can determine that computing node 20 provides memory to computing node 10. When there are multiple target computing nodes information, computing node 10 can determine the computing node that provides borrowed memory from the multiple target computing nodes information according to preset rules.
[0059] Exemplarily, the preset rules may include at least one of the following rules:
[0060] Rule 1: Select nodes that can borrow memory in descending order of distance from the current node.
[0061] Rule 2: Select nodes that can borrow memory based on the remaining available capacity information in descending order.
[0062] Rule 3: Nodes whose distance to this node is within the set range and whose available capacity information meets the set threshold
[0063] It should be understood that the above rules are merely illustrative, and the embodiments of the present application may also include other rules, which are not limited to this.
[0064] Optionally, in some embodiments, a configuration interface may be provided, where the administrator may configure corresponding rules for each computing node, and the computing node may then obtain the rules configured by the administrator on the configuration interface.
[0065] It should be understood that the rules used by different computing nodes when determining the computing node that provides borrowed memory may be the same or different, and this application does not limit this.
[0066] Step 205 : Computing node 10 sends a second request to computing node 20 .
[0067] The second request may include quota information of borrowed memory, time information of borrowed memory, etc.
[0068] Step 206 : The computing node 20 provides memory to the computing node 10 according to the second request.
[0069] After computing node 10 requests memory from computing node 20 , computing node 20 may provide memory to computing node 10 based on the second request, thereby enabling computing node 10 and computing node 20 to share memory.
[0070] The following first describes the process of implementing memory sharing between computing nodes 10 and 20 by management node 50 in scenario 1, such as computing node 20, to determine a node that provides memory to computing node 10. FIG3 shows a flow chart of a memory sharing method provided in an embodiment of the present application. Referring to FIG3 , the method may include the following steps:
[0071] Step 301: The computing node 10 detects its own available capacity information.
[0072] In some embodiments, each computing node in the computing cluster can detect its own available capacity information in real time. Of course, the computing node can also detect its own available capacity information periodically, or can also detect its own available capacity information aperiodically.
[0073] For the convenience of description, the embodiment of the present application takes the computing node 10 in the application scenario shown in Figure 1 as an example for introduction. The memory borrowing method implementation of other computing nodes can refer to the computing node 10, and no further details are given here.
[0074] Optionally, as a possible implementation, the management node 50 may also monitor the available capacity information of each computing node included in the computing cluster in real time, so as to promptly trigger memory borrowing when a change in the available capacity information of a computing node is detected. Of course, the management node does not need to monitor the available capacity information of each computing node included in the computing cluster in real time; for example, the monitoring may be performed periodically or aperiodically, and this application is not limited thereto.
[0075] Optionally, as another possible implementation, the computing node may also send a request message to the management node 50 to request to query its own available capacity information.
[0076] It should be understood that in the embodiments of the present application, the management node 50 can manage the status information of the computing cluster, manage the quota information of the memory that can be borrowed by each computing node, and configure the node set that can borrow memory for each computing node. The status information of the computing cluster may include the available capacity information of each computing node, the status information of each computing node, topology information, etc. In other words, all computing nodes in the computing cluster are uniformly managed by the management node 50.
[0077] Step 302 : When the computing node 10 detects that its own available capacity information is less than a set threshold, it sends a first request to the management node 50 .
[0078] The first request is a memory borrowing request. Specifically, the first request may include memory borrowing requirements, such as the distance between the node from which the memory is borrowed and the user's own distance being within a set range, the available capacity of the node from which the memory is borrowed being greater than a set threshold, and memory borrowing quota information.
[0079] In some embodiments, if the computing node 10 detects that its own available capacity information is less than a set threshold, the computing node 10 may send a first request to the management node 50 to request the management node 50 to allocate a node from which memory can be borrowed.
[0080] Optionally, as a possible implementation method, when the management node 50 detects that the available capacity information of a computing node in the computing cluster, such as the computing node 10 in the application scenario shown in Figure 1, is less than a set threshold, it can be determined that the computing node 10 needs to borrow memory, and a notification message can be sent to the computing node 10, which is used to notify the computing node 10 to initiate a memory borrowing request.
[0081] In step 303 , the management node 50 determines a borrowing strategy according to the borrowing requirement, and determines information of the computing node 20 that meets the borrowing requirement according to the borrowing strategy.
[0082] The management node 50 may include multiple borrowing strategies. For example, the borrowing strategies may include the following possible strategies:
[0083] Strategy 1: Borrowing from neighboring nodes
[0084] Strategy 2: Borrow the maximum remaining available capacity
[0085] Strategy 3: Affinity Node Borrowing
[0086] It should be understood that the above strategies are merely examples; actual product implementations may include more or fewer strategies. Furthermore, borrowing strategies can be user-specified or system-configured. Multiple borrowing strategies may have different priorities, e.g., strategy 1 having the highest priority, strategy 2 having a lower priority than strategy 1, etc. The embodiments of this application do not specify which strategy has the highest priority.
[0087] For example, the borrowing requirements in the first request sent by compute node 10 include: borrowed memory capacity (200MB) and the intended borrowing node (or, alternatively, affinity node) (e.g., compute node 30). After receiving the first request, management node 50 can determine whether the intended borrowing node can be borrowed based on the borrowing requirements. If compute node 30 has insufficient remaining memory capacity, strategy 3 is unavailable. In this case, other borrowing strategies can be used to determine a compute node that meets the borrowing requirements.
[0088] As another example, suppose the borrowing request in the first request sent by computing node 10 includes the borrowed memory capacity (200MB). After receiving the first request, management node 50 can determine computing node information that meets the borrowing request based on strategy 1 (i.e., neighboring nodes). Of course, computing node information that meets the borrowing request can also be determined based on strategy 2. Alternatively, computing node information that meets the borrowing request can be determined based on both strategies 1 and 2.
[0089] In an embodiment of the present application, the management node 50 may determine, based on the borrowing strategy, that there is at least one computing node information that meets the borrowing requirement, and in the embodiment shown in FIG3 , one is taken as an example. For example, assuming that the borrowing requirement in the first request sent by the computing node 10 includes: borrowed memory capacity (200MB), after receiving the first request, the management node 50 may select the strategy with the highest priority based on the borrowing requirement, such as strategy 1 (i.e., the neighboring node) that determines that there is only one computing node that meets the borrowing requirement, such as computing node 20. Alternatively, when the strategy with the highest priority is selected based on the borrowing requirement, such as strategy 1 (i.e., the neighboring node) that determines that there are two computing nodes that meet the borrowing requirement, the computing node information that meets the borrowing requirement may continue to be determined in the two computing nodes according to the next strategy (e.g., strategy 2), such as determining computing node 20.
[0090] In step 304 , the management node 50 sends the information of the computing node 20 to the computing node 10 .
[0091] In some embodiments, after determining a computing node that meets the borrowing requirement, the management node 50 may feed back information about the computing node that meets the borrowing requirement to the computing node 10. For example, the management node 50 may feed back identification information of the computing node that meets the borrowing requirement to the computing node 10. Of course, the management node 50 may also feed back memory information, etc., of the computing node that meets the borrowing requirement to the computing node 10, which is not specifically limited in this application.
[0092] Step 305 : Computing node 10 sends a second request to computing node 20 .
[0093] The second request may include source computing node information of memory borrowing, quota information of memory borrowing (for example, the quota information may be the first memory), and time information of memory borrowing.
[0094] In some embodiments, computing node 10 may send a second borrowing request to computing node 20, requesting to borrow the memory of computing node 20. Then, computing node 20 may provide memory to computing node 10.
[0095] Step 306: The computing node 20 provides memory to the computing node 10 according to the second request.
[0096] In some embodiments, the management node 50 acts as a manager. When the computing node 10 needs to borrow memory, the management node 50 borrows the memory allocated to the computing node 20 for the computing node 10 according to the borrowing request of the computing node 10. In this way, the computing node 10 can directly initiate memory borrowing from the computing node 20, thereby sharing memory with the computing node 20.
[0097] Through the above embodiment, when a computing node needs to borrow memory, the management node 50 can act as a decision node to determine the corresponding node that meets the borrowing demand for the computing node that needs to borrow memory, and send the node information that meets the borrowing demand to the computing node that needs to borrow memory. In this way, the computing node that needs to borrow memory can directly initiate memory borrowing from the node whose memory is to be borrowed that meets the borrowing demand, which can improve the efficiency of memory borrowing and improve the flexibility of memory borrowing.
[0098] The following describes the implementation process of scenario 2 in which the management node 50 determines multiple computing nodes that meet the borrowing needs of computing node 10 based on multiple strategies, sends them to computing node 10, and then computing node 10 decides by itself which computing node needs to borrow memory, such as computing node 20, thereby realizing shared memory between computing node 10 and computing node 20.
[0099] FIG4 is a flowchart of another memory sharing method provided in an embodiment of the present application. Referring to FIG4 , the method may include the following steps:
[0100] Step 401: The computing node 10 detects its own available capacity information.
[0101] Step 402 : When the computing node 10 detects that its own available capacity information is less than a set threshold, it sends a first request to the management node 50 .
[0102] In step 403 , the management node 50 determines a borrowing strategy according to the borrowing requirement, and determines information of multiple computing nodes that meet the borrowing requirement according to the borrowing strategy.
[0103] It should be understood that for an example of the borrowing strategy, reference may be made to the description in step 303 in the embodiment shown in FIG3 , and details will not be repeated here.
[0104] In some embodiments, the management node 50 can first use the borrowing strategy with the highest priority to determine the computing node that meets the borrowing demand based on the borrowing demand. If multiple computing nodes are determined using the strategy with the highest priority, the computing node that can borrow memory can be determined from the multiple computing nodes according to the next borrowing strategy. If all borrowing strategies are used up in the above manner, the screened computing nodes still include multiple computing nodes. At this time, the information of multiple computing nodes that meet the borrowing demand can be sent to the computing node 10.
[0105] In step 404 , the management node 50 sends information of multiple computing nodes that meet the borrowing requirement to the computing node 10 .
[0106] After the management node 50 determines multiple computing nodes that meet the borrowing requirements of the computing node 10, the information of the multiple computing nodes can be sent to the computing node 10 so that the computing node 10 can select the computing node from which it wants to borrow memory from the information of the multiple computing nodes that meet the borrowing requirements.
[0107] In step 405 , the computing node 10 determines the computing node 20 from information of multiple computing nodes that meet the borrowing requirement according to a preset rule.
[0108] It should be understood that the preset rules can refer to the relevant description in step 204 in the embodiment shown in FIG2 , and will not be repeated here.
[0109] For example, assuming that the management node 50 determines, based on multiple borrowing policies, that the computing nodes that meet the borrowing requirements include computing node 20, computing node 30, and computing node 40, the information of computing node 20, computing node 30, and computing node 40 can be sent to computing node 10. Accordingly, computing node 10 can select one or more computing nodes from these three computing nodes for memory borrowing. For example, computing node 10 can select the node with the largest remaining available capacity, such as computing node 20, for memory borrowing.
[0110] Step 406 : Computing node 10 sends a second request to computing node 20 .
[0111] Step 407 : The computing node 20 provides memory to the computing node 10 according to the second request.
[0112] It should be understood that the specific implementation of steps 401, 402, 406 and 407 in the embodiment shown in FIG4 can refer to the detailed description of steps 301, 302, 305 and 306 in the embodiment shown in FIG3, and will not be repeated here.
[0113] Through the above embodiment, the management node 50 can screen out multiple computing nodes that meet the borrowing requirements for the computing node that needs to borrow memory based on multiple borrowing strategies. Then the computing node that needs to borrow memory can further decide the computing node from which the memory is to be borrowed based on the multiple computing nodes that meet the borrowing requirements, and initiate memory borrowing to it. This can improve the efficiency of memory borrowing and improve the flexibility of memory borrowing.
[0114] The following describes the implementation process of computing node 10 borrowing memory from multiple computing nodes, such as computing node 20 and computing node 30, in scenario 3.
[0115] FIG5 is a flowchart of another memory sharing method provided in an embodiment of the present application. Referring to FIG5 , the method may include the following steps:
[0116] Step 501: The computing node 10 detects its own available capacity information.
[0117] Step 502 : When the computing node 10 detects that its own available capacity information is less than a set threshold, it sends a first request to the management node 50 .
[0118] In step 503 , the management node 50 determines a borrowing strategy according to the borrowing requirement, and determines information of multiple computing nodes that meet the borrowing requirement according to the borrowing strategy.
[0119] It should be understood that the difference between the multiple computing nodes that meet the borrowing requirements in the embodiment shown in Figure 5 and the multiple computing nodes that meet the borrowing requirements in the embodiment shown in Figure 4 is that the multiple computing nodes in the embodiment shown in Figure 4 all meet the borrowing requirements, while the embodiment shown in Figure 5 requires multiple computing nodes to meet the borrowing requirements.
[0120] For example, if the borrowing requirement of computing node 10 is to borrow 200MB of memory, the management node 50 uses multiple borrowing strategies to determine whether computing node 20 and computing node 30 can meet the borrowing requirement based on the borrowing requirement of computing node 10. For example, computing node 20 can provide 100MB of memory to computing node 10, and computing node 30 can also provide 100MB of memory to computing node 10.
[0121] In step 504 , the management node 50 sends the information of the computing node 20 and the information of the computing node 30 to the computing node 10 .
[0122] After management node 50 determines multiple computing nodes that meet the borrowing requirement, it may send information about the multiple computing nodes to computing node 10. For example, it may send identification information of computing node 20 and computing node 30 to computing node 10, and may also send information about the memory quota (100 MB) that can be borrowed from computing node 20 and the memory quota (100 MB) that can be borrowed from computing node 30 to computing node 10.
[0123] In step 505 , computing node 10 sends a second request to computing node 20 and computing node 30 respectively.
[0124] The second request may include the borrowed memory quota. For example, compute node 10 may send a request to borrow 100MB of memory to compute node 20 and another request to borrow 100MB of memory to compute node 30. It should be understood that the schematic diagram shown in FIG5 merely illustrates that requests can be sent to these two compute nodes and does not limit the order in which they are sent.
[0125] In step 506 , computing node 20 and computing node 30 respectively provide memory for computing node 10 according to the second request.
[0126] It should be understood that the specific implementation of steps 501 and 502 in the embodiment shown in Figure 5, as well as the specific implementation of the borrowing strategy, how to use the borrowing strategy and other related contents can be found in the detailed introduction of steps 301 and 302 in the embodiment shown in Figure 3, and will not be repeated here.
[0127] Through this embodiment, the computing node 10 can borrow memory from multiple computing nodes, which can improve the success rate of memory borrowing and enhance the flexibility of memory borrowing.
[0128] In the embodiments shown in Figures 2 to 5, the management node 50 can determine the computing nodes that meet the borrowing requirements based on the borrowing requirements and the borrowing strategy. Therefore, as a possible implementation method, when the status information of the computing cluster changes, such as the node topology structure in the computing cluster, the available capacity information of the computing nodes, or the status information of the computing nodes, the management node 50 can update the information of the computing nodes that meet the borrowing requirements corresponding to the computing nodes that need to borrow memory, and send the updated information of the computing nodes that meet the borrowing requirements to the corresponding computing nodes to avoid borrowing failures due to changes in the status information of the computing cluster, thereby improving the utilization efficiency of the computing cluster memory and reducing memory costs.
[0129] The present application also provides a memory sharing device 600 , as shown in FIG6 , comprising: a transceiver module 601 , a processing module 602 , and a memory providing module 603 .
[0130] For example, when the memory sharing device 600 is used to execute the method of the embodiment shown in FIG2 , each module can be used to execute the following steps:
[0131] The transceiver module 601 is used to send a first request to the management node when the computing node 10 in the computing cluster determines that it needs to borrow memory, and the first request includes a borrowing requirement; the processing module 602 is used to determine a borrowing strategy based on the borrowing requirement, and determine the information of the target computing node that meets the borrowing requirement based on the borrowing strategy; the transceiver module 601 is also used to send the information of the target computing node to the computing node 10, wherein the management node includes multiple borrowing strategies; the processing module 602 is also used to determine the computing node 20 that provides borrowed memory to the computing node 10 based on the information of the target computing node; the transceiver module 601 is also used to send a second request to the computing node 20; the memory provision module 603 is used to provide memory to the computing node 10 according to the second request.
[0132] When the memory sharing device 600 is used to execute the method of the embodiment shown in FIG3 , each module can be specifically configured to execute the following steps:
[0133] The processing module 602 is used to detect the available capacity information of the computing node 10; the transceiver module 601 is used to send a first request to the management node 50 when the computing node 10 detects that its own available capacity information is less than a set threshold; the processing module 602 is also used to determine a borrowing strategy based on the borrowing demand, and determine the information of the computing node 20 that meets the borrowing demand based on the borrowing strategy; the transceiver module 601 is also used to send the information of the computing node 20 to the computing node 10; the transceiver module is also used to send a second request to the computing node 20; the memory provision module 603 is used to provide memory for the computing node 10 according to the second request.
[0134] When the memory sharing device 600 is used to execute the method of the embodiment shown in FIG4 , each module can be specifically configured to execute the following steps:
[0135] The processing module 602 is used to detect the available capacity information of the computing node 10; the transceiver module 601 is used to send a first request to the management node 50 when the computing node 10 detects that its own available capacity information is less than a set threshold; the processing module 602 is also used to determine a borrowing strategy according to the borrowing demand, and determine the information of multiple computing nodes that meet the borrowing demand according to the borrowing strategy; the transceiver module 601 is also used to send the information of multiple computing nodes that meet the borrowing demand to the computing node 10; the processing module 602 is also used to determine the computing node 20 from the information of multiple computing nodes that meet the borrowing demand according to preset rules; the transceiver module is also used to send a second request to the computing node 20; the memory provision module 603 is used to provide memory for the computing node 10 according to the second request.
[0136] When the memory sharing device 600 is used to execute the method of the embodiment shown in FIG5 , each module can be specifically configured to execute the following steps:
[0137] The processing module 602 is used to detect the available capacity information of the computing node 10; the transceiver module 601 is used to send a first request to the management node 50 when the computing node 10 detects that its own available capacity information is less than a set threshold; the processing module 602 is also used to determine a borrowing strategy based on the borrowing demand, and determine the information of multiple computing nodes that meet the borrowing demand based on the borrowing strategy; the transceiver module 601 is also used to send the information of the computing node 20 and the information of the computing node 30 to the computing node 10; the transceiver module 601 is also used to send a second request to the computing node 20 and the computing node 30; the memory provision module 603 is used to provide memory for the computing node 10 according to the second request.
[0138] In the embodiment of the present application, the transceiver module 601, the processing module 602, and the memory provision module 603 in the above-mentioned device 400 can all be implemented by software or hardware. The following uses the processing module 602 as an example to describe the implementation of the processing module 602. Similarly, the implementation of the transceiver module 601 and the memory provision module 603 can refer to the implementation of the processing module 602.
[0139] The module may include code running on a computing instance. The processing module 602 may include code running on a computing instance. The computing instance may be at least one of a physical host (computing device), a virtual machine, a container, and other computing devices. Furthermore, the computing instance may be one or more. For example, the processing module 602 may include code running on multiple hosts, or virtual machines, or containers. It should be noted that the multiple hosts, or virtual machines, or containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0140] Similarly, multiple hosts, virtual machines, or containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a region can include multiple AZs. Typically, a VPC is located within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0141] As an example of a hardware functional unit, processing module 602 may include at least one computing device, such as a server. Alternatively, processing module 602 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0142] The multiple computing devices included in processing module 602 can be distributed in the same AZ or in different AZs. The multiple computing devices included in processing module 602 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in processing module 602 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0143] It should be noted that, in other embodiments, the processing module 602 can be used to execute any step in the method, and the transceiver module 601 and the memory provision module 603 can be used to execute any step in the method. The steps that the transceiver module 601, the processing module 602, and the memory provision module 603 are responsible for implementing can be specified as needed. By having the transceiver module 601, the processing module 602, and the memory provision module 603 respectively implement different steps in the method, the full functionality of the memory sharing device is achieved.
[0144] This application also provides a computing device 700. As shown in Figure 7, computing device 700 includes a bus 702, a processor 704, a memory 706, and a communication interface 708. Processor 704, memory 706, and communication interface 708 communicate with each other via bus 702. Computing device 700 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 700.
[0145] Bus 702 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG7 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 702 may include a path for transmitting information between various components of computing device 700 (e.g., memory 706, processor 704, and communication interface 708).
[0146] The processor 704 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0147] The memory 706 may include volatile memory, such as random access memory (RAM), or non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0148] The memory 706 stores executable program codes, and the processor 704 executes the executable program codes to respectively implement the functions of the multiple modules in the aforementioned apparatus, thereby implementing the method. That is, the memory 706 stores instructions for executing the method.
[0149] The communication interface 708 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 700 and other devices or a communication network.
[0150] This application also provides a computing device cluster, FIG8 is a schematic diagram of which, this computing device cluster can implement the methods in the above embodiments. As shown in FIG8, the computing device cluster includes at least one computing device 700 as shown in FIG7. The computing device 700 can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0151] Instructions for executing the method may be stored in the memory 706 of one or more computing devices 700 in the computing device cluster. When at least one computing device in the computing device cluster executes the instructions, the computing device cluster may implement the memory sharing method described in the embodiment.
[0152] In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also store some instructions for executing the memory sharing method. In other words, the combination of one or more computing devices 700 can jointly execute the instructions for executing the memory sharing method.
[0153] It should be noted that the memory 706 in different computing devices 700 in the computing device cluster can store different instructions, each used to perform part of the functions of the device. In other words, the instructions stored in the memory 706 in different computing devices 700 can implement the functions of one or more modules of the transceiver module 601, processing module 602, and memory provision module 603 in the device.
[0154] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network (WAN) or a local area network (LAN), among others. FIG. 9 illustrates a possible implementation. As shown in FIG. 9 , two computing devices 700A and 700B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 706 in the computing device 700A stores instructions for executing the functions of the processing module 602 in the device. Simultaneously, the memory 706 in the computing device 700B stores instructions for executing the functions of the transceiver module 601 and the memory providing module 603 in the device.
[0155] It should be understood that the functionality of the computing device 700A shown in FIG9 may also be implemented by multiple computing devices 700. Similarly, the functionality of the computing device 700B may also be implemented by multiple computing devices 700.
[0156] The present application also provides a computer program product comprising instructions. The computer program product may be software or a program product comprising instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the memory sharing method.
[0157] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a data storage device such as a data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct a computing device to execute a memory sharing method, or instructs a computing device to execute a memory sharing method.
[0158] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A memory sharing method, characterized in that: Applied to a computing cluster, the method includes: When determining that memory needs to be borrowed, the first computing node in the computing cluster sends a first request to the management node, where the first request includes a borrowing demand; The management node determines a borrowing strategy according to the borrowing requirement, determines information of a second computing node that meets the borrowing requirement according to the borrowing strategy, and sends the information of the second computing node to the first computing node, wherein the management node includes multiple borrowing strategies; The first computing node determines, based on the information of the second computing node, a third computing node that provides borrowed memory for the first computing node, and sends a second request to the third computing node; The third computing node provides memory to the first computing node according to the second request.
2. The method according to claim 1, wherein The second computing node information includes information of multiple second computing nodes that meet the borrowing requirement; The first computing node determines, based on the information of the second computing node, a third computing node that provides borrowed memory for the first computing node, including: The first computing node determines the third computing node information from the plurality of second computing node information according to a preset rule.
3. The method according to claim 1, wherein The second computing node information includes information of at least one second computing node that meets the borrowing requirement; The first computing node determines, based on the information of the second computing node, a third computing node that provides borrowed memory for the first computing node, including: The first computing node determines the at least one second computing node information as the third computing node information.
4. The method according to claim 1, wherein The multiple borrowing strategies of the management node include different priorities. The management node determines the borrowing strategy according to the borrowing requirement, and determines, according to the borrowing strategy, information of the second computing node that meets the borrowing requirement, including: The management node determines, according to the borrowing demand, a computing node that meets the borrowing demand using a borrowing strategy with the highest priority; When multiple computing nodes that meet the borrowing requirement are determined according to the highest priority policy, the borrowing policy is gradually lowered until the at least one second computing node information is determined; When the multiple borrowing strategies are all used up, and the information of the multiple second computing nodes that meet the borrowing requirements is also included, the information of the multiple second computing nodes that meet the borrowing requirements is sent to the first computing node.
5. A memory sharing device, characterized in that: The device comprises: a transceiver module configured to send a first request to a management node when a first computing node in a computing cluster determines that it needs to borrow memory, wherein the first request includes a borrowing demand; a processing module, configured to determine a borrowing strategy according to the borrowing requirement, and determine information of a second computing node that meets the borrowing requirement according to the borrowing strategy; The transceiver module is further configured to send information of the second computing node to the first computing node, wherein the management node includes a plurality of borrowing strategies; The processing module is further configured to determine, based on the information of the second computing node, a second computing node that provides borrowed memory to the first computing node; The transceiver module is further configured to send a second request to the third computing node; A memory providing module is used to provide memory for the first computing node according to the second request.
6. The device according to claim 5, characterized in that The second computing node information includes information of multiple second computing nodes that meet the borrowing requirement; The processing module is specifically configured to determine, according to the information of the second computing node, a second computing node that provides borrowed memory to the first computing node in the following manner: The third computing node information is determined from the plurality of second computing node information according to a preset rule.
7. The device according to claim 5, characterized in that The second computing node information includes information of at least one second computing node that meets the borrowing requirement; The processing module is specifically configured to determine a third computing node that provides borrowed memory to the first computing node based on the information of the second computing node in the following manner: The at least one second computing node information is determined to be the third computing node information.
8. The device according to claim 5, wherein The multiple borrowing strategies of the management node include different priorities; The processing module is specifically configured to determine a borrowing strategy according to the borrowing requirement, and determine information of a second computing node that meets the borrowing requirement according to the borrowing strategy in the following manner: Determine a computing node that meets the borrowing requirement using a borrowing strategy with the highest priority according to the borrowing requirement; When multiple computing nodes that meet the borrowing requirement are determined according to the highest priority policy, the borrowing policy is gradually lowered until the at least one second computing node information is determined; When the multiple borrowing strategies are all used up, and the information of the multiple second computing nodes that meet the borrowing requirements is also included, the information of the multiple second computing nodes that meet the borrowing requirements is sent to the first computing node.
9. A computing device cluster, characterized in that: comprising at least one computing device, each computing device including a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in a memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 4.
10. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster is caused to perform the method according to any one of claims 1 to 4.
11. A computer-readable storage medium, characterized in that The method comprises computer program instructions, and when the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method and system for sharing physical memory among cloud computing host nodes
CN105094997A
Memory management method and device, computer equipment and storage medium
CN114253733A
Resource scheduling method and device, computer readable storage medium and electronic equipment
CN114598665A
Method for sharing memory among cluster system nodes on demand based on RDMA (Remote Direct Memory Access)
CN114756388A
Method, system, and computer program product for allocating physical memory in a distributed shared memory network
US6249802B1