Memory management method and system based on public cloud technology

By monitoring and scheduling memory usage in real time through a cloud management platform, the problem of non-shared memory resources in cloud computing is solved, achieving efficient memory utilization and optimized resource allocation, thereby improving server availability and overall resource utilization.

CN122111634APending Publication Date: 2026-05-29HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
Filing Date
2024-11-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In cloud computing environments, low utilization of server memory resources leads to memory waste and resource imbalance. In particular, due to the inconsistency between server model design and actual resource requirements, memory resources cannot be shared, resulting in memory being stranded or idle.

Method used

By monitoring server memory usage in real time through a cloud management platform, memory scheduling strategies can be formulated to enable memory sharing and scheduling between different servers, including borrowing or returning memory, in order to meet the dynamic memory needs of the servers and improve memory utilization.

Benefits of technology

It improves server memory utilization, reduces memory risk, enhances server availability and overall resource utilization, and reduces memory waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122111634A_ABST
    Figure CN122111634A_ABST
Patent Text Reader

Abstract

The application discloses a memory management method and system based on public cloud technology, and belongs to the technical field of cloud services. The method comprises the following steps: acquiring a real-time condition of memory usage of a first server, the first server being one of a plurality of servers; obtaining a memory scheduling strategy of the first server based on the real-time condition of memory usage of the first server, the memory scheduling strategy being used for indicating one or more of the following: allocating memory of one or more second servers to the first server for use, canceling the allocation of the memory of the one or more second servers to the first server for use, canceling the allocation of the memory of the first server to one or more second servers for use, the second server being one of the plurality of servers other than the first server; and scheduling memory for the first server based on the memory scheduling strategy. The application improves the memory utilization rate of the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud service technology, and in particular to a memory management method and system based on public cloud technology. Background Technology

[0002] In the era of cloud computing, many customers deploy workloads to cloud data centers in the form of virtual machines or containers, eliminating the need to manage and maintain on-premises data centers and servers. For cloud providers and operators, the physical multi-tenancy model in the cloud ensures the optimal utilization of physical hardware resources. Improving resource utilization while guaranteeing business performance remains the biggest challenge for cloud providers.

[0003] Currently, dynamic random access memory (DRAM) has become a major component of cloud data center hardware costs, sometimes accounting for up to 50% of server costs. Analysis from major cloud vendors indicates that memory resource sitting is a primary source of memory waste and also a potential source of significant cost savings. However, due to the inconsistency between server design and the dynamic changes in actual resource demands, some aspects of server resources may become sitting. For example, when all central processing unit (CPU) cores of a server are leased (i.e., allocated to customer virtual machines), but there is still unallocated memory capacity that cannot be leased to tenants, memory resources become sitting. Another example is that many customers, fearing insufficient resources during peak business periods, often overpurchase resources, resulting in a large amount of idle and unusable memory resources, further contributing to memory waste.

[0004] Therefore, there is an urgent need to propose a solution to improve memory resource utilization. Summary of the Invention

[0005] This application provides a memory management method and system based on public cloud technology. This application enables memory sharing between different servers, effectively utilizing memory fragmentation and idle memory within the server, thereby improving server memory utilization. The technical solution provided by this application is as follows:

[0006] Firstly, this application provides a memory management method based on public cloud technology. This method is executed by a cloud management platform. The cloud management platform is used to manage the infrastructure providing cloud services. The infrastructure includes multiple servers. The multiple servers are used to deploy cloud instances that implement tenant services. All multiple servers are configured with memory. The method includes: obtaining real-time information on the memory usage of a first server, where the first server is one of the multiple servers; based on the real-time information on the memory usage of the first server, obtaining a memory scheduling policy for the first server, the memory scheduling policy indicating one or more of the following: allocating memory from one or more second servers to the first server, canceling the allocation of memory from one or more second servers to the first server, or canceling the allocation of memory from the first server to one or more second servers, where the second server is one of the multiple servers other than the first server; and scheduling memory for the first server based on the memory scheduling policy.

[0007] As can be seen from the above, in this application, the memory scheduling strategy for the first server is derived based on the real-time memory usage of the first server. This is equivalent to deciding whether to borrow memory from other servers, return borrowed memory to other servers, or reclaim memory borrowed from other servers based on the real-time memory usage of the first server. After scheduling memory for the first server according to this decision, the required memory can be allocated to the server on demand, ensuring that the server's memory usage needs are met, reducing the probability of memory-related risks, and improving server availability. Furthermore, by scheduling memory between different servers, memory can be shared among them, effectively utilizing memory fragmentation and idle memory, thus improving server memory utilization.

[0008] In one possible implementation, a memory scheduling strategy for the first server is obtained based on the real-time memory usage of the first server, including: determining the memory scheduling type and the target memory amount to be scheduled for the first server based on the real-time memory usage of the first server, wherein the memory scheduling type indicates one or more of the following: allocating memory from other servers to the first server, canceling the allocation of memory from other servers to the first server, and canceling the allocation of memory from the first server to other servers; and among multiple servers, determining one or more second servers that match the memory scheduling type and the target memory amount, and the amount of memory to be scheduled by the one or more second servers for the first server.

[0009] By first determining the memory scheduling type of the first server, then filtering multiple servers based on the memory scheduling type, and finally determining one or more second servers from the filtered servers, the complexity of determining one or more second servers can be reduced.

[0010] In one possible implementation, the memory scheduling policy indicates that memory from one or more second servers should be allocated to the first server, provided that the sum of the memory available for allocation by the one or more second servers to other servers is not less than the target memory amount, in accordance with the memory scheduling type. Here, "matching the memory scheduling type" means that the memory scheduling type of the second servers is compatible with the memory scheduling type of the first server. The requirement that the sum of the memory available for allocation by the one or more second servers to other servers is not less than the target memory amount means that the sum of the memory available for allocation by the one or more second servers to other servers must satisfy the memory usage requirements of the first server.

[0011] Optionally, in this case, the one or more second servers also satisfy the following condition: the communication cost between each of the one or more second servers and the first server is less than the communication cost between any of the first remaining servers and the first server. The first remaining servers are those servers, excluding the one or more second servers, that match the memory scheduling type. This requires that the one or more second servers be those servers with the lowest communication cost with the first server among all servers capable of allocating their own memory to other servers. That is, the cloud management platform sorts the servers in ascending order of their communication cost with the first server. In this way, allocating the memory of one or more second servers to the first server ensures that the first server incurs low communication costs while using the memory of the one or more second servers, thus guaranteeing the performance of the first server using the memory of the one or more second servers.

[0012] In one possible implementation, memory is scheduled for the first server based on a memory scheduling strategy, including mapping memory addresses of memory that one or more second servers can allocate to other servers to the first server.

[0013] In one possible implementation, a memory scheduling policy is used to instruct: cancel the allocation of memory from one or more second servers to the first server, provided that the one or more second servers meet the following conditions: they match the memory scheduling type, and the sum of the memory already allocated to the first server is less than or equal to the target memory amount. Here, "matching the memory scheduling type" means that the memory scheduling type of the second server is compatible with the memory scheduling type of the first server. This memory scheduling policy instructs the first server to return the memory already allocated to it by the second servers. The amount of memory that the first server can return is the target memory amount; to ensure the memory usage needs of the first server, the total amount of memory returned by the first server should not exceed the target memory amount.

[0014] Optionally, in this case, the one or more second servers also satisfy the following condition: the amount of memory allocated to the first server by each of the one or more second servers is less than the amount of memory allocated to the first server by any second remaining server. The second remaining server is any server other than the one or more second servers among all servers that have allocated memory to the first server. This requires that the one or more second servers be the servers with the smaller amount of memory allocated to the first server among all servers that can allocate their own memory to other servers. That is, the cloud management platform sorts the multiple servers in ascending order of the amount of memory allocated to the first server. In this way, when the target amount of memory that the first server can return is a certain value, the first server can return memory to as many second servers as possible, minimizing the total number of second servers that allocate memory to the first server. This avoids excessive fragmentation of memory used by the first server and also prevents the failure rate of the first server from increasing due to too many second servers providing memory to the first server.

[0015] Optionally, in this case, the one or more second servers also satisfy the following condition: the communication cost between each of the one or more second servers and the first server is greater than the communication cost between any of the third remaining servers and the first server. The third remaining servers are those servers other than the one or more second servers that have allocated memory to the first server. This requires that the one or more second servers be those servers with the highest communication cost to the first server among all servers capable of allocating their own memory to other servers. That is, the cloud management platform sorts the servers in descending order of their communication cost to the first server. In this way, even if some servers still allocate their memory to the first server after the first server returns the memory of one or more second servers, the communication cost incurred by the first server in using the server's memory can be kept low, ensuring the performance of the first server in using the server's memory.

[0016] In one possible implementation, memory is scheduled for the first server based on a memory scheduling strategy, including: unmapping the memory addresses of one or more second servers from being mapped to the first server.

[0017] In one possible implementation, a memory scheduling policy is used to instruct: cancel the allocation of memory from the first server to one or more second servers, provided that the sum of the memory already allocated by the first server to the one or more second servers, matching the memory scheduling type, is greater than or equal to a target memory amount. This memory scheduling policy instructs the first server to reclaim the memory already allocated to the second servers. The amount of memory that the first server can reclaim is the target memory amount. To ensure the memory usage needs of the first server, the total amount of memory already allocated by the first server to the second servers should be greater than or equal to the target memory amount.

[0018] Optionally, in this case, any one of the one or more second servers also satisfies the following condition: the communication cost between any second server and the first server is greater than the communication cost between any fourth remaining server and any second server. The fourth remaining server is any server other than the first server among those to which memory has been allocated to any second server. This requires that the one or more second servers be those to which the first server has allocated memory and which have the highest communication cost with the first server. That is, the cloud management platform sorts the servers in descending order of their communication cost with the first server. In this way, even if the first server continues to allocate memory to other servers after reclaiming the memory allocated to one or more second servers, it can still ensure that the communication cost incurred by servers using the first server's memory is low, thus guaranteeing the performance of servers using the first server's memory.

[0019] In one possible implementation, memory is scheduled for the first server based on a memory scheduling strategy, including: unmapping the memory addresses of the first server from being mapped to one or more second servers.

[0020] Secondly, this application provides a memory management system based on public cloud technology. The device is deployed on a cloud management platform. The cloud management platform is used to manage the infrastructure providing cloud services. The infrastructure includes multiple servers. The multiple servers are used to deploy cloud instances to implement tenant services. All multiple servers are configured with memory. The device includes: an acquisition module for acquiring real-time information on the memory usage of a first server, where the first server is one of the multiple servers; a processing module for obtaining a memory scheduling policy for the first server based on the real-time information on the memory usage of the first server, the memory scheduling policy indicating one or more of the following: allocating memory from one or more second servers to the first server, canceling the allocation of memory from one or more second servers to the first server, or canceling the allocation of memory from the first server to one or more second servers, where the second server is one of the multiple servers other than the first server; and a scheduling module for scheduling memory for the first server based on the memory scheduling policy.

[0021] In one possible implementation, the processing module is specifically configured to: determine the memory scheduling type of the first server and the target amount of memory to be scheduled based on the real-time situation of memory usage of the first server, wherein the memory scheduling type indicates one or more of the following: allocating memory from other servers to the first server, canceling the allocation of memory from other servers to the first server, and canceling the allocation of memory from the first server to other servers; and, among multiple servers, determine one or more second servers that match the memory scheduling type and the target amount of memory, and the amount of memory to be scheduled by the one or more second servers for the first server.

[0022] In one possible implementation, the memory scheduling policy is used to indicate that memory from one or more second servers is allocated to the first server, wherein the one or more second servers satisfy the following conditions: the sum of the amounts of memory that can be allocated to other servers is not less than the target amount of memory, which matches the memory scheduling type.

[0023] Optionally, in this case, the one or more second servers also satisfy the following: the communication cost between each of the one or more second servers and the first server is less than the communication cost between any of the first remaining servers and the first server, wherein the first remaining servers are servers that, in addition to the one or more second servers, match the memory scheduling type.

[0024] In one possible implementation, the scheduling module is specifically used to map memory addresses that one or more second servers can allocate to other servers to the first server.

[0025] In one possible implementation, the memory scheduling policy is used to indicate: cancel the allocation of memory from one or more second servers to the first server, wherein the one or more second servers satisfy: matching the memory scheduling type, the sum of the amounts of memory already allocated to the first server is less than or equal to the target amount of memory.

[0026] Optionally, in this case, the one or more second servers also satisfy the following condition: the amount of memory allocated to the first server by each of the one or more second servers is less than the amount of memory allocated to the first server by any second remaining server, wherein the second remaining server is any server other than the one or more second servers among all servers that have been allocated memory to the first server.

[0027] Optionally, in this case, the one or more second servers also satisfy the following condition: the communication cost between each of the one or more second servers and the first server is greater than the communication cost between any third remaining server and the first server, wherein the third remaining server is any server other than the one or more second servers that has been allocated memory to the first server.

[0028] In one possible implementation, the scheduling module is specifically used to: cancel the mapping of memory addresses of one or more second servers to the first server.

[0029] In one possible implementation, the memory scheduling policy is used to indicate: cancel the allocation of memory from the first server to one or more second servers, where the one or more second servers satisfy: matching the memory scheduling type, the sum of the amount of memory already allocated by the first server to one or more second servers is greater than or equal to the target amount of memory.

[0030] Optionally, in this case, any one of the one or more second servers also satisfies the following condition: the communication cost between any second server and the first server is greater than the communication cost between any fourth remaining server and any second server, wherein the fourth remaining server is any server other than the first server among the servers whose memory has been allocated to any second server.

[0031] In one possible implementation, the scheduling module is specifically used to: cancel the mapping of the memory address of the first server to one or more second servers.

[0032] Thirdly, this application provides a computing device including a memory and a processor, the memory storing program instructions, and the processor executing the program instructions to perform the methods provided in the first aspect of this application and any possible implementation thereof.

[0033] Fourthly, this application provides a computing device cluster, including multiple computing devices, each computing device including multiple processors and multiple memories, the multiple memories storing program instructions, and the multiple processors executing the program instructions, causing the computing device cluster to perform the methods provided in the first aspect of this application and any possible implementation thereof.

[0034] Fifthly, this application provides a computer-readable storage medium that is a non-volatile computer-readable storage medium, which includes program instructions that, when executed on a computing device, cause the computing device to perform the methods provided in the first aspect of this application and any of its possible implementations.

[0035] Sixthly, this application provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the methods provided in the first aspect of this application and any possible implementation thereof. Attached Figure Description

[0036] Figure 1This is a schematic diagram of the implementation scenario of a memory management method based on public cloud technology provided in this application embodiment;

[0037] Figure 2 This is a schematic diagram illustrating the deployment of basic resources provided in an embodiment of this application;

[0038] Figure 3 This is a schematic diagram of the structure of a memory management system based on public cloud technology provided in an embodiment of this application;

[0039] Figure 4 This is a schematic diagram of another memory management system based on public cloud technology provided in an embodiment of this application;

[0040] Figure 5 This is a schematic diagram illustrating the operation of a memory management system based on public cloud technology, provided in an embodiment of this application.

[0041] Figure 6 This is a flowchart illustrating a memory management method based on public cloud technology provided in an embodiment of this application;

[0042] Figure 7 This is a flowchart illustrating how a memory scheduling strategy for a first server is derived based on real-time data on memory usage of that first server, according to an embodiment of this application.

[0043] Figure 8 This is a schematic diagram illustrating the process of obtaining the memory scheduling strategy of the first server based on the real-time memory usage of the first server, as provided in an embodiment of this application.

[0044] Figure 9 This is a flowchart illustrating how to determine one or more second servers among multiple servers that match the memory scheduling type and target memory amount, according to an embodiment of this application.

[0045] Figure 10 This is a flowchart illustrating another method for determining one or more second servers among multiple servers that match the memory scheduling type and target memory amount, as provided in an embodiment of this application.

[0046] Figure 11 This is a flowchart illustrating another method for determining one or more second servers among multiple servers that match the memory scheduling type and target memory amount, as provided in an embodiment of this application.

[0047] Figure 12 This is a flowchart illustrating another method for determining one or more second servers among multiple servers that match the memory scheduling type and target memory amount, as provided in an embodiment of this application.

[0048] Figure 13This is a flowchart of another memory management method based on public cloud technology provided in an embodiment of this application;

[0049] Figure 14 This is a schematic diagram of a memory management system based on public cloud technology provided in an embodiment of this application;

[0050] Figure 15 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application;

[0051] Figure 16 This is a schematic diagram of the structure of a computing device cluster provided in an embodiment of this application;

[0052] Figure 17 This is a schematic diagram of another computing device cluster structure provided in an embodiment of this application. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0054] To facilitate understanding, the technologies and background involved in the embodiments of this application will be introduced below.

[0055] Cloud computing is a type of distributed computing that refers to a network that centrally manages and schedules a large number of computing and storage resources to provide on-demand services to users. These computing and storage resources are provided through clusters of computing devices located in data centers. Furthermore, cloud computing can provide users with various types of services, such as Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS). Infrastructure as a Service provides virtual machines or other resources as a service to tenants. Platform as a Service provides a development platform as a service to tenants. Software as a Service provides applications (Apps) as a service to customers.

[0056] An Internet Data Center (IDC) is a facility and related service system that provides operation and maintenance for equipment that centrally collects, stores, processes, and transmits data, based on the Internet. Conceptually, it can be understood as a public, commercial Internet "server room," and it is also a professional IT service and a crucial infrastructure for the IT industry. IDC is not only a service concept but also a network concept; it constitutes part of the network infrastructure resources, like backbone networks and access networks, providing high-end data delivery and high-speed access services. Generally, a tenant's on-premises IDC can be understood as their physical server room, where the tenant utilizes existing Internet communication lines and bandwidth resources to establish a standardized, telecommunications-grade server room environment to provide comprehensive services such as server hosting, leasing, and related value-added services. A cloud data center is an Internet data center deployed using the infrastructure resources owned by cloud vendors.

[0057] A resource pool is a collection of various hardware and software resources involved in a cloud data center. Typically, resources in a resource pool can be categorized by type, such as computing resources, storage resources, and network resources.

[0058] A physical machine (PM) is the physical resource used to host virtualization technology. It is also called a physical server or physical host. Typically, a physical server is used to deploy virtual instances. A physical machine has multiple physical devices, such as processors and memory. Multiple virtual instances can be deployed on a single physical machine, sharing the machine's physical resources. Depending on the use case, multiple virtual instances deployed on a single physical machine can belong to the same tenant or to different tenants.

[0059] Virtualization is a resource management technology. Virtualization abstracts and transforms various physical resources of a host, such as computing, network, and storage resources, breaking down the indivisible barriers between the host's physical structures. This allows tenants to utilize these resources in a better way than the original configuration. Resources obtained through virtualization are called virtualized resources, and virtualized resources are not limited by the existing physical resource deployment methods, geographical location, or physical configuration.

[0060] Virtualized resources are typically provided to tenants in the form of virtual instances. Virtual instances utilize the host's hardware resources and run on the host's operating system (OS). Applications run within the virtual instance to implement the tenant's business logic. The host's hardware resources can be allocated to one or more tenants at the virtual instance level. Different virtual instances are isolated from each other, allowing tenants to use physical resources conveniently and flexibly while maintaining security and isolation, and significantly improving the utilization of physical resources. Typically, virtual instances can be virtual machines, containers, or independent processes (such as functions). Virtual instances can also be called Elastic Compute Service (ECS) or Elastic Instances (different cloud service providers may use different names).

[0061] A virtual machine (VM) is a complete computer system with full hardware system functionality, simulated using virtualization technology and running in a completely isolated environment. A subset of the instructions in a VM can be processed on the host machine, while other instructions can be executed in a simulated manner. A VM is also called a virtual server. A VM can be viewed as a collection of virtual devices, which possess full hardware system functionality and run in a completely isolated environment. Virtual devices are created by virtualizing physical devices that can share resources. For example, a virtual processor, created by virtualizing a processor, is a virtual device. Similarly, a training card, created by virtualizing a field-programmable gate array (FPGA), is also a virtual device. For instance, the VM in this application can be a kernel-based virtual machine (KVM). Any task that can be performed on a server can also be performed in a VM. When creating a virtual machine on a server, a portion of the physical machine's hard drive and memory capacity is used as the virtual machine's hard drive and memory capacity. Each virtual machine has its own independent hard drive and operating system, and virtual machine tenants can operate the virtual machine as if it were a server. The runtime environments (such as virtual machine applications, operating systems, and virtual hardware) in different virtual machines are completely isolated, and communication between different virtual machines requires the virtual machine manager to forward network packets.

[0062] Containers utilize the namespace and cgroup technologies supported by the Linux kernel to isolate application processes and their dependencies (the runtime environment's bins / libs, specifically all files required to run the application) within an independent runtime environment. Containers provide a lightweight virtual runtime environment. Containers are created by packaging all the code, libraries, and dependencies of a tenant's application into an image. When the image is executed, it runs in a virtual runtime environment. At this point, the container is a runtime instance of the image, similar to a lightweight sandbox, which can be started, stopped, and deleted. The infrastructure for containers can be server hardware or virtual machines in the cloud (i.e., containers can also be deployed within virtual machines). The operating system uses the Linux kernel and supports namespaces and cgroups. Namespaces are used to isolate processes, while cgroups are used to allocate process resources, specifically virtual processors and memory allocated to the process. The container engine, similar to a virtual machine manager, runs within the operating system and is used to manage containers. Compared to virtual machines, which come with their own operating system, containers do not have an operating system. Instead, containers run as processes within the host machine's operating system. As a result, containers start up faster than virtual machines, making them particularly suitable for lightweight applications. Furthermore, a single host machine can run thousands of containers (processes) simultaneously.

[0063] Direct memory access (DMA), also known as direct memory operation or group data transfer, is a data exchange mode that directly accesses and retrieves data from a computer's memory without going through the computer's central processing unit (CPU). In DMA mode, the computer's CPU issues instructions to the DMA controller, instructing it to control the data transfer. After completing the data transfer, the DMA controller sends a completion message back to the CPU. It can be seen that during DMA data transfer, the computer's CPU does not need to perform the transfer operation, saving the CPU's instruction fetching, data fetching, and data transfer operations, reducing CPU resource consumption, and conserving system resources.

[0064] DMA can include remote direct memory access (RDMA) and local DMA. RDMA refers to data transfer directly from the memory of one computer to the memory of another computer over a network, without the intervention of the operating systems of both computers. Local DMA refers to data transfer without the need for a network. Protocols used by RDMA include, for example, Ethernet-based RDMA (RDMA over converged Ethernet, RoCE).

[0065] Peripheral Component Interconnect Express (PCIe) bus: a high-speed serial computer expansion bus standard.

[0066] Network interface card (NIC): also known as network interface controller, network adapter, or local area network receiver, is a type of computer hardware designed to allow hosts or computing devices to communicate over a network.

[0067] Memory (RAM): Also known as internal memory or main memory, its function is to temporarily store the data processed by the CPU, as well as the data exchanged with external storage devices such as hard drives.

[0068] Quality of Service (QoS) is a technology for effectively managing network resources. QoS provides end-to-end quality of service guarantees to meet the diverse needs of various services. With limited bandwidth resources, QoS allows different traffic flows to compete for network resources unequally, enabling better service capabilities for specific network communications. For example, voice, video, and critical data applications can receive priority service in network devices.

[0069] Resource pooling refers to integrating various computing and storage resources into a unified resource pool for unified dynamic allocation and management. Resource pooling enables high resource sharing, improves resource utilization, simplifies resource management, and provides users with flexible on-demand allocation services.

[0070] Memory domain: A domain that divides the memory of different hosts within a cluster. Hosts within the same memory domain are usually interconnected via a high-speed network. The latency of the network interconnection between nodes is basically on the same order of magnitude as the latency of the CPU and memory interaction.

[0071] In the era of cloud computing, many customers deploy workloads to cloud data centers in the form of virtual machines or containers, eliminating the need to manage and maintain on-premises data centers and physical servers. For cloud providers and operators, the multi-tenant model of physical resources in the cloud ensures optimal utilization of physical hardware resources. Improving resource utilization while guaranteeing business performance remains the biggest challenge for cloud providers.

[0072] Currently, dynamic random access memory (DRAM) has become a major component of cloud data center hardware costs, sometimes accounting for up to 50% of server costs. Analysis from major cloud vendors indicates that memory resource sitting is a primary source of memory waste, but also a potential source of significant cost savings. However, due to the inconsistency between server design and the dynamic changes in actual resource demands, resource sitting can occur in certain aspects of the server, leading to waste. For example, when all central processing unit (CPU) cores of a server are leased (i.e., allocated to customer virtual machines), but there is still unallocated memory capacity that cannot be leased to tenants, memory resources become sitting. Another example is that many customers, concerned about insufficient resources during peak business periods, often overpurchase resources, resulting in a large amount of idle and unusable memory resources, further contributing to memory waste.

[0073] In public cloud scenarios, each server's memory resources are independent and cannot be shared with other servers, leading to the so-called "memory wall." The existence of the memory wall makes resource imbalance unavoidable. Although server memory utilization can be improved by over-selling memory resources, fluctuations in business load can still cause a surge in memory usage. In such cases, the total memory required by virtual machines after over-selling may exceed the actual total memory available on the server, leading to memory usage risks. Even if other servers in the cloud data center have idle memory, the server at memory usage risk remains unusable. Only randomly selected services can be shut down to free up memory to meet the sudden increase in demand.

[0074] Furthermore, the data access speed in memory is far faster than other storage media. Frequent data access leads to a significantly higher probability of memory failure compared to other hardware. This can result in a situation where a single server's memory failure renders other server resources unusable. In traditional scenarios, when a server experiences a memory failure, virtual machine services on that machine will struggle to function properly. This necessitates a high-availability system to identify the fault and restart the virtual machine services running on the faulty server from a new, functioning server. However, this process interrupts service availability.

[0075] Therefore, there is an urgent need to propose a solution to improve memory resource utilization. For example, an architecture and technology that allows memory to be shared and reused across hosts could be developed to break down memory barriers, improve the overall resource utilization and reliability of cloud data centers, and simultaneously ensure business operations.

[0076] In view of this, embodiments of this application provide a memory management method based on public cloud technology. This method is executed by a cloud management platform. The cloud management platform is used to manage the infrastructure providing cloud services. The infrastructure includes multiple servers. The multiple servers are used to deploy cloud instances that implement tenant services. All multiple servers are configured with memory. The method includes: obtaining real-time information on the memory usage of a first server; then, based on the real-time information on the memory usage of the first server, obtaining a memory scheduling policy for the first server; and then, scheduling memory for the first server based on the memory scheduling policy.

[0077] In this system, the first server is one of multiple servers, and the second server is one of the multiple servers excluding the first server. The memory scheduling policy indicates one or more of the following: allocating memory from one or more second servers to the first server; canceling the allocation of memory from one or more second servers to the first server; or canceling the allocation of memory from the first server to one or more second servers. Allocating memory from one or more second servers to the first server is equivalent to borrowing memory from one or more second servers for the first server. Canceling the allocation of memory from one or more second servers to the first server is equivalent to returning the memory borrowed from one or more second servers to other servers. Canceling the allocation of memory from the first server to one or more second servers is equivalent to reclaiming the memory borrowed by the first server from one or more second servers.

[0078] In this application, a memory scheduling strategy for the first server is derived based on its real-time memory usage. This is equivalent to deciding whether to borrow memory from other servers, return borrowed memory, or reclaim memory borrowed from other servers based on the first server's real-time memory usage. By scheduling memory for the first server according to this decision, the required memory can be allocated on demand, ensuring that the server's memory needs are met, reducing the probability of memory-related risks, and improving server availability. Furthermore, by scheduling memory between different servers, memory can be shared, effectively utilizing memory fragmentation and free memory, thus improving server memory utilization.

[0079] This article provides a detailed introduction to the technical solution of this application from multiple perspectives, including implementation scenarios, methods and processes, hardware devices, and software devices.

[0080] The following are examples illustrating the implementation scenarios of the embodiments of this application.

[0081] Figure 1This is a structural diagram illustrating an implementation scenario of a memory management method based on public cloud technology provided in this application embodiment. For example... Figure 1 As shown, the implementation scenario includes: data center 1 and client 2. Data center 1 and client 2 can establish a communication connection via a network. Optionally, this network can be the Internet, or other networks; this embodiment is not limited to any particular network. Tenants can interact with data center 1 through client 2. For example, a tenant can send cloud service requests and other information to data center 1 through client 2. Data center 1 responds based on the information sent by client 2.

[0082] Data Center 1 houses a large amount of infrastructure owned by the cloud service provider, such as computing resources, storage resources, and network resources. For example, computing resources can be computing devices (such as servers) capable of providing computing power. Figure 1 As shown, data center 1 includes a cloud management platform and infrastructure ( Figure 1 (Not shown in the image). The cloud management platform and infrastructure are connected via an internal data center network. The cloud management platform manages the infrastructure. The infrastructure provides public cloud services. The infrastructure includes multiple servers. Cloud services are optionally deployed on the servers. Cloud services are implemented by running virtual instances, hence also referred to as virtual instances deployed on servers to implement tenant business. Tenants can send cloud service requests and related information to the server through their client 2. The server can process the cloud service requests and related information and provide cloud services to the tenant based on the processed cloud service requests and related information.

[0083] The cloud management platform can be logically divided into: tenant console, compute management service, network management service, storage management service, authentication service, and image management service. The tenant console provides a user interface or application programming interface (API) for interaction with tenants. The compute management service manages servers running virtual instances and bare metal servers. The network management service manages network services (such as gateways and firewalls). The storage management service manages storage services (such as data bucket services). The authentication service manages tenant accounts and passwords. The image management service manages virtual instance images.

[0084] exist Figure 1In the illustrated implementation scenario, a data center contains multiple servers. The servers consist of a hardware layer and a software layer. The hardware layer comprises the standard server configuration, including processors, memory, network interface cards (NICs), disks, and buses. The software layer includes the operating system installed and running on the server. This operating system, relative to the virtual machine, can be called the host operating system. The host operating system runs a virtual machine manager (also known as a hypervisor). The hypervisor's role is to implement compute virtualization, network virtualization, and storage virtualization, and to manage the virtual machines.

[0085] The virtual machine manager runs a cloud management platform client. This client receives control plane commands from the cloud management platform, creates virtual instances on the server based on these commands, and manages the virtual instances throughout their lifecycle. For example, the client can monitor the hardware resource usage of the server in real time and report it to the cloud management platform. When the cloud management platform confirms that a virtual instance needs to be created on a specific server, it sends a virtual instance creation command to the client on that server. Upon receiving the command, the client creates the virtual instance on that server. In this way, tenants can create, manage, log in to, and operate virtual instances within the data center through the cloud management platform.

[0086] Servers can run virtual machines of different specifications. Virtual machine specifications are categorized as: general-purpose computing, memory-optimized, ultra-large memory, etc., with specific specifications under each type. After a tenant selects a virtual machine specification, the cloud management platform selects a server in the data center that supports that specification and ensures sufficient idle hardware resources on that server. Then, it creates and configures the virtual machine with that specification on that server. Configuring servers through the cloud management platform allows for the analysis and planning of server hardware resources. Based on the server's hardware performance, it plans the corresponding computing products for the physical hardware, such as planning virtual machines of different specifications, to meet the diverse needs of different tenants. Furthermore, differentiated pricing strategies can be implemented based on the performance differences of virtual machines of different specifications. For example, high-performance virtual instances can be sold at a higher price, while ordinary performance virtual instances can be sold at a lower price, allowing tenants to purchase virtual instances as needed.

[0087] In one implementation, such as Figure 2As shown, the location of basic resources in a data center can be described using cloud resource deployment regions (regions) and availability zones (AZs). Tenants can choose to deploy cloud services based on resources within a specific region or AZ. A region is defined by geographical location and network latency. Using the same resource pool within the same region can be understood as sharing common services such as elastic computing, block storage, object storage, virtual private cloud (VPC) networks, elastic internet protocol (EIP) addresses, and images. Regions are divided into general-purpose regions and dedicated regions. A general-purpose region refers to a region that provides general cloud services to public tenants. A dedicated region refers to a region that hosts the same type of business or provides business services to specific tenants. A region typically includes multiple AZs. Multiple AZs within a region are connected via high-speed fiber optic cables to meet the needs of tenants building high-availability systems across AZs. An AZ is one or more... Figure 2 The data center shown is a collection of data centers. Within an Availability Zone (AZ), computing, networking, and storage resources are logically divided into multiple clusters.

[0088] Tenants can send instructions to the cloud management platform through their client 2 to create, manage, log in to, and operate virtual instances on the server, and use the cloud services provided by these virtual instances. For example, the cloud management platform can provide an access interface. This interface can be provided either as a user interface or an API. Tenants can operate their client to remotely access the access interface to register a cloud account and password on the cloud management platform, and then log in using these accounts and passwords. The cloud management platform can also authenticate the cloud account and password. After successful authentication, the tenant can further select and purchase a virtual instance with specific specifications (processor, memory, disk) on the cloud management platform. After the tenant successfully purchases the virtual instance, the cloud management platform provides the tenant with a remote login account and password for the purchased virtual instance. The tenant can use the remote login account and password to remotely log in to the virtual instance on their client, install and run their application within the virtual instance, and use the application to implement their business operations.

[0089] Client 2 can be selected from computers, personal computers, laptops, mobile phones, smartphones, tablets, cloud servers, portable mobile terminals, multimedia players, e-book readers, wearable devices, smart home appliances, artificial intelligence devices, smart wearable devices, smart in-vehicle devices, or Internet of Things devices, etc.

[0090] In one implementation, the memory management method based on public cloud technology provided in this application embodiment can be implemented by running an executable program on a computing device in data center 1. Optionally, the memory management method based on public cloud technology provided in this application embodiment can be applied to a memory management system based on public cloud technology. This memory management system is deployed on a server managed by a cloud management platform. The memory management system can implement the memory management method based on public cloud technology provided in this application embodiment by running the executable program of the memory management method based on public cloud technology provided in this application embodiment. Furthermore, the executable program implementing the memory management method based on public cloud technology can be presented in the form of an application installation package. After the server installs the application installation package, it can implement the memory management method based on public cloud technology provided in this application embodiment by running the executable program therein.

[0091] As one possible implementation of this application, the memory management method based on public cloud technology provided by this application can be used to provide memory sharing services to tenants, selling fragmented or idle memory in servers managed by the cloud management platform to tenants for purchase. After a tenant purchases memory, the cloud management platform can bind the purchased memory to the tenant's cloud instance for use by the tenant's cloud instance. As another possible implementation of this application, the memory management method based on public cloud technology provided by this application can be used to manage the memory of servers owned by the cloud management platform, so as to facilitate memory sharing among servers. As yet another possible implementation of this application, the memory management method based on public cloud technology provided by this application can be sold to tenants in the form of managed cloud services. After a tenant purchases the managed cloud service, the cloud management platform can manage the memory resources of the tenant's servers, etc., based on the managed cloud server, to improve the utilization and availability of the memory resources of the tenant's servers, etc. It should be noted that the memory management method based on public cloud technology provided in the embodiments of this application can also be provided in other ways, which are not exemplified in this embodiment.

[0092] It should be understood that the above content is an exemplary description of the implementation scenarios of the memory management method based on public cloud technology provided in the embodiments of this application, and does not constitute a limitation on the implementation scenarios of the memory management method based on public cloud technology. Those skilled in the art will understand that, as business needs change, the implementation scenarios can be adjusted according to application requirements, and the embodiments of this application do not specifically limit them. Furthermore, when the memory management method based on public cloud technology provided in the embodiments of this application is applied to other scenarios, the executable program of the method can also be presented in the form of an application installation package or in other ways, and the embodiments of this application do not list them all.

[0093] The implementation process of the memory management method based on public cloud technology provided in this application embodiment is illustrated below. This method is executed by a cloud management platform. The cloud management platform is used to manage the infrastructure providing cloud services. The infrastructure includes multiple servers. These multiple servers are used to deploy cloud instances that implement tenant services. All multiple servers are configured with memory.

[0094] In one possible implementation, a memory management system is deployed in the cloud management platform, and the method can be executed by the memory management system. Figure 3 and Figure 4 These are schematic diagrams illustrating two possible structures of a memory management system based on public cloud technology, as provided in the embodiments of this application. For example... Figure 3 As shown, the memory management system includes a memory monitoring unit and a decision-making unit. Figure 5 As shown, the memory monitoring unit is used to collect real-time information on the server's memory usage and provide this information to the decision-making unit. In this case, the memory monitoring unit is also called the memory qoSmonitor (MQM). The decision-making unit, based on the real-time memory usage of the first server, determines the memory scheduling strategy for the first server. In this case, the decision-making unit is also called the memory decision controller (MPM).

[0095] In this application, the operation of scheduling memory for the server can be implemented in several ways. In one implementation, such as Figure 3 As shown, the memory scheduling operation for the server is performed by the memory management unit (MMU) configured in the server. If the memory scheduling policy indicates that the memory scheduling operation should be performed on the first server, the decision unit, after obtaining the memory scheduling policy of the first server, also provides that policy to the first server. The memory management unit of the first server then performs the memory scheduling operation based on that policy to achieve the purpose of scheduling memory for the first server. If the memory scheduling policy indicates that the memory scheduling operation should be performed on another server (such as the second server), the decision unit, after obtaining the memory scheduling policy of the first server, also provides that policy to the other server. The memory management unit of the other server then performs the memory scheduling operation based on that policy to achieve the purpose of scheduling memory for the first server.

[0096] In another implementation, such as Figure 4As shown, the memory management system further includes a first memory management unit. Each server is configured with a second memory management unit. The operation of scheduling memory for the servers is jointly executed by the first and second memory management units. If the memory scheduling policy indicates that the memory scheduling operation should be performed on the first server, the decision unit, after obtaining the memory scheduling policy of the first server, also provides the memory scheduling policy to the first memory management unit. The first memory management unit provides the memory scheduling policy to the second memory management unit of the first server and instructs the second memory management unit of the first server to perform the memory scheduling operation based on the memory scheduling policy. The second memory management unit of the first server performs the memory scheduling operation based on the memory scheduling policy to achieve the purpose of scheduling memory for the first server. If the memory scheduling policy indicates that the memory scheduling operation should be performed on another server (such as the second server), the decision unit, after obtaining the memory scheduling policy of the first server, also provides the memory scheduling policy to the first memory management unit. The first memory management unit provides the memory scheduling policy to the second memory management unit of the other server and instructs the second memory management unit of the other server to perform the memory scheduling operation based on the memory scheduling policy. The second memory management unit of the other server is used to perform memory scheduling operations based on the memory scheduling policy, so as to achieve the purpose of scheduling memory for the first server.

[0097] Optionally, the memory scheduling strategy can also be derived from the server's configuration information. For example... Figure 3 and Figure 4 As shown, the memory management system also includes an information acquisition unit. The information acquisition unit acquires configuration information of the first server and provides this configuration information to the decision unit. Correspondingly, the decision unit determines a memory scheduling strategy for the first server based on its configuration information and real-time memory usage. For example, the memory scheduling strategy can also be derived based on the communication cost between servers. The information acquisition unit acquires the communication cost between the first server and other servers and provides this communication cost to the decision unit. When the communication cost between servers is derived based on the topology information between servers, such as... Figure 5 As shown, the information acquisition unit is used to acquire topology information between servers and provide this topology information to the decision-making unit. The decision-making unit uses this topology information to determine the communication cost between servers, and based on the communication cost and real-time memory usage, it determines the memory scheduling strategy for the first server. Here, the information acquisition unit is also called the hardware topology manager (HTM). The decision-making unit uses the real-time memory usage of the first server and the communication cost between the first server and other servers to determine the memory scheduling strategy for the first server.

[0098] Furthermore, the server's configuration information can be obtained by the information acquisition unit, or it can be obtained by the information acquisition unit from other functional units. For example, such as... Figure 3 and Figure 4 As shown, the memory management system also includes a device management unit. The device management unit collects server configuration information and provides it to the information acquisition unit. For example, the device management unit obtains server configuration information based on the deployment plan of the infrastructure managed by the cloud management platform. And / or, the device management unit obtains server configuration information by performing collection operations within the infrastructure. For instance, the device management unit can tag packets and track their transmission paths based on the tags to obtain information such as the number of hops, latency, and bandwidth traversed during transmission. In one possible implementation, the information acquisition unit can subscribe to the device management unit for the required configuration information. Upon receiving the subscription request from the information acquisition unit, the device management unit provides the required configuration information to the information acquisition unit. Furthermore, the device management unit can periodically check the configuration information and provide the information acquisition unit with the updated configuration information after changes to the configuration information subscribed to by the information acquisition unit, ensuring that the information acquisition unit obtains the latest and most accurate configuration information.

[0099] The decision-making unit can be deployed centrally, and supports multi-cluster deployment by slicing according to the management scope. The information acquisition unit can also be deployed centrally, and supports multi-cluster deployment by slicing according to the management scope. For example... Figure 3 and Figure 4 As shown, the memory monitoring unit includes a central control subunit and multiple monitoring subunits. These monitoring subunits are deployed on multiple servers. Each monitoring subunit deployed on any server collects real-time data on the server's memory usage and provides this data to the central control subunit. The central control subunit can optionally be deployed in a centralized manner. The central control subunit controls the monitoring subunits, receives the real-time data from the monitoring subunits, and provides the decision-making unit with the real-time data on the server's memory usage. This deployment method of the central control subunit and multiple monitoring subunits in the memory monitoring unit is called a layered deployment method.

[0100] Figure 6 This is a flowchart illustrating a memory management method based on public cloud technology provided in an embodiment of this application. For example... Figure 6 As shown, the method includes the following steps:

[0101] Step 601: Obtain the real-time memory usage of the first server, which is one of multiple servers.

[0102] The cloud management platform's operation of scheduling memory for the first server typically begins when the real-time memory usage of the first server meets specified trigger conditions. For example, if the first server has excessive remaining memory, the cloud management platform schedules memory for it to allocate to other servers, thereby improving memory utilization. Alternatively, if the first server has insufficient remaining memory, the cloud management platform schedules memory for it to prevent insufficient memory from impacting its performance. Therefore, the cloud management platform needs to obtain the real-time memory usage of the first server to determine whether memory scheduling is necessary. Furthermore, the cloud management platform can obtain the real-time memory usage of each of multiple servers to allocate memory to each server based on its own real-time memory usage. Optionally, the cloud management platform can obtain the real-time memory usage of servers periodically or when specified trigger conditions occur; this embodiment does not specifically limit this.

[0103] The real-time memory usage of the primary server can be reflected by a variety of performance metrics. In some possible implementations, the real-time memory usage of the primary server can be reflected by one or more of the following: memory usage, memory utilization rate, memory bandwidth, memory latency, or the ratio of correctable errors (CE) to uncorrectable errors (UCE).

[0104] When obtaining the memory usage of the first server, the cloud management platform can selectively obtain memory usage at multiple sampling points within a specified time period. Then, it can calculate a memory usage value reflecting the usage within the specified time period based on the usage values ​​obtained from these multiple sampling points. This memory usage value can be equal to the average of the usage values ​​obtained from the multiple sampling points, the maximum of the usage values ​​obtained from the multiple sampling points, the minimum of the usage values ​​obtained from the multiple sampling points, the usage value at a specified percentile among the usage values ​​obtained from the multiple sampling points, a weighted sum of the usage values ​​obtained from the multiple sampling points, or a value obtained after processing the usage values ​​obtained from the multiple sampling points in other ways.

[0105] When obtaining the memory usage of the first server, the cloud management platform can selectively collect memory usage data at multiple sampling points within a specified time period. It then calculates the ratio of memory usage at each sampling point to the total memory usage, and finally obtains the memory usage rate based on these ratios. The memory usage rate can be equal to the average of the ratios across multiple sampling points, the maximum value among the ratios, the minimum value among the ratios, the ratio at a specified percentile, a weighted average of the ratios, or a value obtained by processing the ratios in other ways.

[0106] When obtaining the memory bandwidth of the first server, the cloud management platform can selectively acquire the memory bandwidth at multiple sampling points within a specified time period. Then, it can obtain a memory bandwidth reflecting the bandwidth situation within the specified time period based on the bandwidth obtained from multiple sampling points. The memory bandwidth reflecting the bandwidth situation within the specified time period can be equal to the average bandwidth obtained from multiple sampling points, the maximum bandwidth obtained from multiple sampling points, the minimum bandwidth obtained from multiple sampling points, the bandwidth at a specified percentile among the bandwidth obtained from multiple sampling points, a weighted value of the bandwidth obtained from multiple sampling points, or a value obtained after processing the bandwidth obtained from multiple sampling points in other ways.

[0107] When acquiring the memory latency of the first server, the cloud management platform can optionally acquire the memory latency at multiple sampling points within a specified duration. Then, it can obtain a memory latency reflecting the latency situation within the specified duration based on the latency obtained from multiple sampling points. The memory latency reflecting the latency situation within the specified duration can be equal to the average latency obtained from multiple sampling points, the maximum latency obtained from multiple sampling points, the minimum latency obtained from multiple sampling points, the latency at a specified percentile among the latency obtained from multiple sampling points, a weighted value of the latency obtained from multiple sampling points, or a value obtained after processing the latency obtained from multiple sampling points in other ways.

[0108] When the cloud management platform obtains the ratio of correctable to uncorrectable memory errors of the first server, it can optionally obtain the total number of correctable and uncorrectable memory errors within a specified time period, and then calculate the ratio of the total number of correctable memory errors within the specified time period to the total number of uncorrectable memory errors within the specified time period, thereby obtaining the ratio of correctable to uncorrectable memory errors within the specified time period.

[0109] Step 602: Based on the real-time memory usage of the first server, obtain the memory scheduling policy of the first server. The memory scheduling policy is used to indicate one or more of the following: allocate memory of one or more second servers to the first server, cancel the allocation of memory of one or more second servers to the first server, or cancel the allocation of memory of the first server to one or more second servers. The second server is one of the multiple servers other than the first server.

[0110] When the real-time memory usage of the primary server reaches a trigger condition, the cloud management platform decides on a memory scheduling strategy for the primary server. Various trigger conditions can be selected based on different memory management needs. For example, trigger conditions include: the primary server's memory is at risk of capacity loss, the primary server's memory is wasting capacity, the primary server's memory is experiencing bandwidth bottlenecks, the primary server's memory latency is too high, the primary server's memory is malfunctioning, and the primary server itself is malfunctioning. The primary server's memory at risk of capacity loss could be defined as either insufficient remaining memory or excessively high memory utilization. Insufficient remaining memory can be determined by comparing memory usage with a first capacity threshold. Excessively high memory utilization can be determined by comparing memory utilization with a first utilization threshold. When the primary server experiences a memory capacity risk, it can be referred to as a red byte point. For example, when the primary server's memory utilization exceeds 80%, it indicates insufficient remaining memory, which can be called a red byte point. At this point, if the super-division instance coverage on the primary server continues to increase, there is a risk of insufficient memory on the primary server. The first server may experience memory wastage, for example, if it has excessive remaining memory or its memory utilization is too low. Excessive remaining memory can be determined by comparing the current memory usage with a second capacity threshold. Similarly, insufficient memory utilization can be determined by comparing the current memory usage with a second utilization threshold. When the first server experiences memory wastage, it can be called a surplus node. For example, if the memory utilization of the first server is below 40%, it indicates a large amount of memory is available, and the first server can be called a surplus node. Similarly, if the memory utilization is between 40% and 80%, it indicates that the memory is in a balanced state. The first server may experience memory bandwidth bottlenecks, for example, if its memory bandwidth is too low. Insufficient memory bandwidth can be determined by comparing the actual memory bandwidth with a bandwidth threshold. Excessive memory latency can be determined by comparing the memory latency with a latency threshold. The first server may experience memory failures, for example, if the ratio of correctable to uncorrectable errors in the first server's memory is too low. Whether the ratio of correctable to uncorrectable errors is too small can be determined by comparing the actual ratio of correctable to uncorrectable errors in memory with a ratio threshold. The impact of a first server experiencing a memory bandwidth bottleneck, excessive memory latency, memory failure, or a failure of the first server on memory usage primarily manifests as a risk to memory capacity. It should be noted that the threshold values ​​used in the above triggering conditions can be determined based on memory management requirements, and this application embodiment does not specifically limit them. Furthermore, the triggering conditions can have other implementation methods, which are not listed in this application embodiment.

[0111] When the real-time memory usage of the first server reaches a trigger condition, the cloud management platform obtains a memory scheduling policy for the first server based on this real-time memory usage data. This policy is then used to allocate memory to the first server. There are several ways for the cloud management platform to obtain the memory scheduling policy. One possible implementation is as follows: Figure 7 As shown, the implementation process of step 602 includes:

[0112] Step 6021: Based on the real-time memory usage of the first server, determine the memory scheduling type and the target amount of memory to be scheduled for the first server. The memory scheduling type indicates one or more of the following: allocate memory from other servers to the first server, cancel the allocation of memory from other servers to the first server, and cancel the allocation of memory from the first server to other servers.

[0113] When determining the memory scheduling strategy for the first server, the cloud management platform can first determine the memory scheduling type and the target memory amount to be scheduled for the first server, and then search among multiple servers for servers that match the memory scheduling type and meet the target memory amount. For example... Figure 8 As shown, determining the memory scheduling type of the first server is equivalent to determining whether the first server needs to borrow memory from other servers, return memory originally borrowed from other servers, or reclaim memory already borrowed from other servers. When the first server needs to borrow memory from other servers, its memory scheduling type indicates: allocate the memory from other servers to the first server. When the first server needs to return memory originally borrowed from other servers, its memory scheduling type indicates: cancel the allocation of memory from other servers to the first server. When the first server needs to reclaim memory already borrowed from other servers, its memory scheduling type indicates: cancel the allocation of memory from other servers to the first server.

[0114] In one possible implementation, when determining the memory scheduling type of the first server based on its real-time memory usage, if the real-time memory usage indicates a capacity risk, the first server is at a red byte point and requires more memory to meet its memory needs. Furthermore, if the first server is not currently borrowing memory from other servers, it means it cannot reclaim the memory already borrowed to meet its own need for more memory; therefore, to satisfy its memory requirements, the first server needs to borrow memory from other servers. If the first server is currently borrowing memory from other servers, it means it can reclaim the memory already borrowed to meet its own need for more memory; therefore, to satisfy its memory requirements, the first server needs to reclaim the memory already borrowed. If reclaiming the memory already borrowed by the first server is sufficient to meet its need for more memory, then the first server no longer needs to borrow memory from other servers. If the memory that the first server has reclaimed from other servers is still insufficient to meet the first server's need for more memory, then the first server will need to borrow memory from other servers again. That is, when the first server is a red byte, its memory scheduling type may indicate, depending on its actual memory usage, that memory from other servers is allocated to the first server, and / or that memory allocation from the first server is cancelled.

[0115] If the real-time memory usage of the first server indicates wasted memory, it means the first server is a surplus node with available memory. Furthermore, if the first server is not currently borrowing memory from other servers, it can lend its memory to those servers. If the first server is currently borrowing memory from other servers, it can choose to first return the memory originally borrowed. If the first server still has surplus memory after returning the borrowed memory, it can then lend it to other servers. If the first server has no surplus memory after returning all its surplus memory, it cannot lend it to other servers. In other words, when the first server is a surplus node, its memory scheduling type may indicate allocating its memory to other servers, and / or canceling the allocation of memory from other servers to the first server, depending on its actual memory usage.

[0116] When determining the target amount of memory that the first server needs to schedule, this amount can be estimated based on the real-time memory usage of the first server. In one possible implementation, when the first server is at a red-byte point, the target amount of memory needed to meet the first server's memory usage requirements is estimated based on the actual remaining memory. For example, the target amount of memory needed to meet the first server's memory usage requirements is equal to the difference between a first capacity threshold and the actual remaining memory. When the real-time memory usage of the first server is represented by memory utilization rate, the first capacity threshold can be calculated based on a first utilization rate threshold. For example, the product of the first capacity threshold and the total memory capacity equals the first capacity threshold. In another possible implementation, when the first server is at a red-byte point, the target amount of memory needed to meet the first server's memory usage requirements is estimated based on the actual remaining memory and the memory required by the first server in future periods. For example, the target amount of memory needed to meet the first server's memory usage requirements is equal to the first capacity threshold minus the difference between the actual remaining memory and the additional memory required in future periods. In this scenario, when the real-time memory usage of the first server is represented by its memory utilization rate, the first capacity threshold can also be calculated based on the first utilization rate threshold. The amount of memory required by the first server in future timeframes can be estimated based on its historical memory usage during runtime.

[0117] Step 6022: Among multiple servers, determine one or more second servers that match the memory scheduling type and target memory amount, and the scheduled memory amount that the one or more second servers schedule for the first server.

[0118] After determining the memory scheduling type and target memory amount for the first server, the cloud management platform can identify one or more second servers from among multiple servers that match the memory scheduling type and target memory amount. Corresponding to different memory scheduling types, the cloud management platform needs to use different memory scheduling strategies to schedule memory for the first server. For example, when the memory scheduling type is to allocate memory from other servers to the first server, the memory scheduling strategy is to allocate memory from one or more second servers to the first server. When the memory scheduling type is to cancel the allocation of memory from other servers to the first server, the memory scheduling strategy is to cancel the allocation of memory from one or more second servers to the first server. Similarly, when the memory scheduling type is to cancel the allocation of memory from the first server to other servers, the memory scheduling strategy is to cancel the allocation of memory from the first server to one or more second servers. Accordingly, the implementation process of step 6022 differs depending on the different memory scheduling types and strategies. The implementation process of step 6022 will be explained below using the following three memory scheduling strategies as examples.

[0119] In the first memory scheduling strategy, the strategy instructs that memory from one or more second servers be allocated to the first server. This means the one or more second servers must meet the following condition: the sum of the memory available for allocation to other servers is not less than the target memory amount, matching the memory scheduling type. Once the cloud management platform determines the condition that one or more second servers must meet, it can filter through multiple servers to find those that meet the condition. For example, the cloud management platform can sort multiple servers in a specified order, then iterate through the servers according to the sorting result, checking whether each server meets the condition during the iteration, until one or more matching second servers are found. The specified order can be determined based on memory management requirements.

[0120] Here, "matching the memory scheduling type of the second server" means that the memory scheduling type of the second server is compatible with the memory scheduling type of the first server. For example, corresponding to the first memory scheduling strategy, if the memory scheduling type of the first server indicates that the memory of other servers should be allocated to the first server for use, then the memory scheduling type of the second server indicates that the memory of the second server can be allocated to other servers for use.

[0121] The requirement that the sum of the memory that one or more second servers can allocate to other servers is not less than the target memory amount means that the sum of the memory that one or more second servers can allocate to other servers can meet the memory usage requirements of the first server. The amount of memory that a second server can allocate to other servers can be estimated based on the real-time memory usage of the second servers. In one possible implementation, the amount of memory that a second server can allocate to other servers is estimated based on the actual memory used by the second server. For example, the amount of memory that a second server can allocate to other servers is equal to the difference between a first capacity threshold and the actual memory used by the second server. When the real-time memory usage of the second server is represented by a memory utilization rate, the first capacity threshold can be converted from a first utilization rate threshold. For example, the product of the first capacity threshold and the total memory capacity equals the first capacity threshold. In another possible implementation, the amount of memory that a second server can allocate to other servers can be estimated based on the actual memory used by the second server and the memory required by the second server in future periods. For example, the amount of memory that a second server can allocate to other servers is equal to the first capacity threshold minus the difference between the actual memory used by the second server and the additional memory required in future periods. In this scenario, when the real-time memory usage of the second server is represented by its memory utilization rate, the first capacity threshold can also be calculated based on the first utilization rate threshold. The amount of memory required by the second server in future periods can be estimated based on its historical memory usage. It should be noted that the amount of memory the second server can allocate to other servers can be greater than a specified threshold to avoid allocating insufficient memory to the first server, thus ensuring the performance of the first server's memory usage. For example, if the amount of memory the second server can allocate to other servers is less than the specified threshold, frequent memory scheduling may be required in subsequent processes; therefore, the amount of memory the second server can allocate to other servers can be set to be greater than the specified threshold. The value of this specified threshold can be determined based on the application requirements for memory management; for example, the specified threshold can be 1 gigabyte (GB).

[0122] In one possible implementation, the one or more second servers further satisfy the following condition: the communication cost between each of the one or more second servers and the first server is less than the communication cost between any of the first remaining servers and the first server. The first remaining servers are those servers, excluding the one or more second servers, that match the memory scheduling type. The communication cost between two servers indicates the expense incurred for communication between them. This requires that the one or more second servers be those servers with the lowest communication cost with the first server among all servers capable of allocating their own memory to other servers. That is, the cloud management platform sorts the servers in ascending order of their communication cost with the first server. In this way, allocating the memory of one or more second servers to the first server ensures that the communication cost incurred by the first server in using the memory of the one or more second servers is minimized, thus guaranteeing the performance of the first server using the memory of the one or more second servers.

[0123] At this point, the cloud management platform also obtains the memory sharing strategy of the first server based on the communication cost between servers. Correspondingly, before step 602, the method further includes: obtaining the communication cost between multiple servers. Optionally, the communication cost between two servers is obtained based on one or more topology information, including the link hop count, link latency, and link bandwidth between the two servers. Therefore, obtaining the communication cost between multiple servers includes: obtaining the topology information of multiple servers, and obtaining the communication cost between multiple servers based on the topology information. The topology information of any server can indicate one or more characteristics of that server, and the cloud management platform can obtain the communication cost between multiple servers based on these one or more characteristics. For example, the communication cost between two servers can optionally be positively correlated with the link hop count and link latency between the two servers, and negatively correlated with link bandwidth. For example, the communication cost between two servers is a function that is positively correlated with the link hop count and link latency between the two servers, and negatively correlated with link bandwidth. The topology information between servers can be stored using a topology view or a two-dimensional array, etc. For example, the topology information between servers can be stored in a database using a topology view. The communication cost between servers can be stored using two-dimensional data or a table, etc. For example, Tables 1 and 2 provide examples of two communication costs provided in this application. Here, Nodei represents server i, and the value at the intersection of the row containing Nodei and the column containing Nodej represents the communication cost between Nodei and Nodej. For instance, in Table 1, a value of 1 at the intersection of the row containing Node0 and the column containing Node1 indicates that the communication cost between Node0 and Node1 is 1.

[0124] Table 1

[0125] distance / latency Node0 Node1 Node2 Node3 Node0 0 1 2 2 Node1 1 0 2 2 Node2 2 2 0 1 Node3 2 2 1 0

[0126] Table 2

[0127] distance / latency Node0 Node1 Node2 Node3 Node0 0 11 12 12 Node1 11 0 2 2 Node2 12 0 0 1 Node3 12 2 1 0

[0128] The following example illustrates the implementation process of determining one or more second servers that match the memory scheduling type and target memory amount among multiple servers, using the example of one or more second servers satisfying the following conditions: matching the memory scheduling type, the sum of memory that can be allocated to other servers is not less than the target memory amount, and the communication cost between each of the one or more second servers and the first server is less than the communication cost between any of the first remaining servers and the first server. Figure 9 As shown, its implementation process includes:

[0129] Step a1: Identify one or more servers to be filtered among multiple third servers. The memory scheduling type of the servers to be filtered indicates that the memory of the servers to be filtered can be allocated to other servers. The third servers are servers other than the first server among the multiple servers.

[0130] Corresponding to the first memory scheduling strategy, the server matching the memory scheduling type is the server that can allocate its own memory to other servers. Therefore, when the cloud management platform determines one or more second servers, it can first filter among multiple third servers to find servers that can allocate their own memory to other servers, resulting in one or more servers to be filtered. For example, as described above, if the memory of a surplus node can be allocated to other servers, then surplus nodes can be filtered among multiple third servers, and the filtered surplus nodes are the servers to be filtered.

[0131] Step a2: According to the communication cost between the server to be screened and the first server from low to high, accumulate the first memory amount that can be allocated to other servers for one or more servers to be screened, and determine one or more servers to be screened that first reach or exceed the target memory amount as one or more second servers.

[0132] After identifying one or more servers to be screened, the cloud management platform can accumulate the first amount of memory that can be allocated to other servers for one or more servers in order of increasing communication cost between the servers to be screened and the first server, until the accumulation result first reaches or exceeds the target memory amount and then stops accumulating. Then, the one or more servers to be screened to which the accumulated first memory amount belongs are identified as one or more second servers.

[0133] It should be noted that the process of filtering third servers can also be performed during the accumulation process. In one possible implementation, the cloud management platform can traverse the third servers in ascending order of communication cost between the third servers and the first server. During the traversal, the first memory amount of the third servers that can be allocated to other servers is accumulated until the accumulation result first reaches or exceeds the target memory amount. Then, one or more third servers to which the accumulated first memory amount belongs are identified as one or more second servers. For example, when the communication cost between two servers equals the number of hops in the link between the two servers, the cloud management platform can first find the nearest surplus node based on the number of hops. If the sum of the first memory amount that the nearest surplus node can allocate to other servers does not reach the target memory amount, the search for surplus nodes is increased hop by hop until the sum of the first memory amount that the surplus nodes can allocate to other servers reaches the target memory amount. Furthermore, during the accumulation process, if multiple surplus nodes have the same communication cost with the first server, the surplus nodes can be sorted in descending order of the amount of first memory they can allocate to other servers. Then, the amount of first memory that each surplus node can allocate to other servers is accumulated according to this sorting. This minimizes the total number of second servers allocating memory to the first server. On the one hand, this avoids excessive memory fragmentation for the first server; on the other hand, it prevents an increase in the first server's failure rate due to too many second servers providing memory to it.

[0134] In the above implementation process, by first determining the memory scheduling type of the first server, then filtering multiple servers according to the memory scheduling type, and then determining one or more second servers from the filtered servers, the complexity of determining one or more second servers can be reduced.

[0135] After determining one or more second servers that will schedule memory for the first server, the cloud management platform also needs to determine the amount of scheduled memory scheduled from these second servers for the first server. The amount of scheduled memory scheduled by the second servers for the first server is determined based on the amount of memory that each second server can allocate to other servers, and is less than or equal to that amount. For example, when the sum of the memory that one or more second servers can allocate to other servers equals the target memory amount that the first server needs to schedule, then the amount of scheduled memory scheduled by any one of the one or more second servers for the first server is equal to the amount of memory that any single second server can allocate to other servers. Conversely, when the sum of the memory that one or more second servers can allocate to other servers exceeds the target memory amount that the first server needs to schedule, then the amount of scheduled memory scheduled by some of the one or more second servers for the first server is equal to the amount of memory that each second server can allocate to other servers, while the amount of scheduled memory scheduled by the remaining second servers for the first server is less than the amount of memory that each second server can allocate to other servers. For example, when the sum of the memory that n second servers can allocate to other servers is greater than the target memory that the first server needs to schedule, and the sum of the memory that n-1 second servers can allocate to other servers is less than the target memory that the first server needs to schedule, then the amount of memory that any of the n-1 second servers schedules for the first server is equal to the amount of memory that the second server can allocate to other servers, and the amount of memory that the remaining second server schedules for the first server is equal to the difference between the target memory and the sum of the amount of memory that n-1 second servers schedule for the first server.

[0136] In the second memory scheduling strategy, the memory scheduling strategy is used to indicate: cancel the allocation of memory from one or more second servers to the first server. One or more second servers meet the following condition: matching the memory scheduling type, the sum of memory already allocated to the first server is less than or equal to the target memory amount. After determining the condition that one or more second servers must meet, the cloud management platform can filter through multiple servers to obtain one or more second servers. For example, the cloud management platform can sort multiple servers in a specified order, then traverse the multiple servers according to the sorting result, determining whether each traversed server meets the condition during the traversal, until one or more second servers that meet the condition are found. The specified order here can be determined based on memory management requirements.

[0137] Here, "matching the memory scheduling type with the second server" means that the memory scheduling type of the second server is compatible with the memory scheduling type of the first server. For example, corresponding to this second memory scheduling strategy, if the memory scheduling type of the first server indicates that memory from other servers is canceled for use by the first server, then the memory scheduling type of the second server indicates that memory from the second server has been allocated to the first server.

[0138] The second memory scheduling strategy instructs the first server to return the memory that the second server has already allocated to the first server. The amount of memory the first server can return is the target memory amount. To ensure the first server's memory usage needs are met, the total amount of memory returned by the first server should not exceed the target memory amount. Therefore, the second memory scheduling strategy indicates that the sum of the memory allocated to the first server by one or more second servers is less than or equal to the target memory amount. The amount of memory allocated to the first server by the second server can be obtained based on historical scheduling processes. For example, when a cloud management platform schedules memory for a server, it records the amount of memory scheduled and the scheduling object. The cloud management platform can then obtain the amount of memory allocated to the first server by the second server by querying the records.

[0139] In one possible implementation, one or more second servers further satisfy the following condition: the amount of memory allocated to the first server by each of the one or more second servers is less than the amount of memory allocated to the first server by any second remaining server. The second remaining server is any server other than the one or more second servers among all servers that have allocated memory to the first server. This requires that the one or more second servers be among the servers that can allocate their own memory to other servers and have allocated less memory to the first server. That is, the cloud management platform sorts the servers in ascending order of the amount of memory allocated to the first server. In this way, when the target amount of memory that the first server can return is a certain value, the first server can return memory to as many second servers as possible, minimizing the total number of second servers allocating memory to the first server. This avoids excessive fragmentation of memory used by the first server and also prevents an increase in the failure rate of the first server due to too many second servers providing memory to it.

[0140] At this point, the cloud management platform is essentially determining the memory sharing policy of the first server based on the amount of memory allocated by the third server to the first server. Accordingly, before step 602, the method further includes: obtaining the amount of memory allocated by multiple third servers to the first server. Optionally, as described above, the cloud management platform can obtain the amount of memory allocated by the third servers to the first server by querying records.

[0141] The following example illustrates the implementation process of determining one or more second servers that match the memory scheduling type and target memory amount among multiple servers, using the example of one or more second servers satisfying the following conditions: matching the memory scheduling type, the sum of memory allocated to the first server being less than or equal to the target memory amount, and the memory allocated to the first server by each of the one or more second servers being less than the memory allocated to the first server by any of the remaining second servers. Figure 10 As shown, its implementation process includes:

[0142] Step b1: Obtain one or more servers to be filtered that have allocated memory to the first server, and the second amount of memory allocated by the servers to be filtered to the first server.

[0143] Corresponding to the second memory scheduling strategy, the servers matching the memory scheduling type are those that have already allocated memory to the first server. Therefore, when determining one or more second servers, the cloud management platform can first filter among multiple third servers to find servers that have already allocated memory to the first server, resulting in one or more servers to be filtered. For example, as described above, the cloud management platform can obtain servers that have already allocated memory to the first server by querying records; the servers obtained through this query are the servers to be filtered.

[0144] Step b2: In order of increasing second memory allocation from the servers to be filtered to the first server, accumulate the second memory allocation from one or more servers to be filtered to the first server. The one or more servers corresponding to the accumulated second memory before the accumulated result first reaches or exceeds the target memory amount are identified as one or more second servers.

[0145] After identifying one or more servers to be screened, the cloud management platform can accumulate the second memory allocated to the first server by the one or more servers to be screened in ascending order of the second memory amount allocated to the first server, until the accumulation result first reaches or exceeds the target memory amount and then stop accumulating. Then, the one or more servers to be screened whose second memory amount was accumulated before the accumulation result first reaches or exceeds the target memory amount are identified as one or more second servers.

[0146] Optionally, one or more second servers further satisfy the following condition: the communication cost between each of the one or more second servers and the first server is greater than the communication cost between any of the third remaining servers and the first server. The third remaining servers are those servers other than the one or more second servers that have allocated memory to the first server. The communication cost between two servers indicates the expense incurred for communication between them. This requires that the one or more second servers be those servers with the highest communication cost to the first server among all servers capable of allocating their own memory to other servers. In other words, the cloud management platform sorts the servers in descending order of their communication cost to the first server. In this way, even if some servers still allocate their memory to the first server after the first server returns the memory to the second servers, the communication cost incurred by the first server in using the server's memory is minimized, ensuring the performance of the first server in using the server's memory.

[0147] At this point, the cloud management platform also determines the memory sharing strategy of the first server based on the communication costs between servers. Accordingly, before step 602, the method further includes: obtaining the communication costs between multiple servers. Optionally, the communication cost between two servers is obtained based on one or more topology information, including the link hop count, link latency, and link bandwidth. Therefore, obtaining the communication costs between multiple servers includes: obtaining the topology information of multiple servers, and obtaining the communication costs between multiple servers based on the topology information. The implementation process is described in the relevant section of the first memory scheduling strategy; it will not be elaborated here.

[0148] The following example illustrates the implementation process of determining one or more second servers that match the memory scheduling type and target memory amount among multiple servers, using the example of one or more second servers satisfying the following conditions: matching the memory scheduling type, the sum of memory allocated to the first server being less than or equal to the target memory amount, and the communication cost between each of the one or more second servers and the first server being greater than the communication cost between any of the remaining third servers and the first server. Figure 11 As shown, its implementation process includes:

[0149] Step c1: Obtain one or more servers to be filtered that have allocated memory to the first server, and the second amount of memory allocated by the servers to be filtered to the first server.

[0150] Corresponding to the second memory scheduling strategy, the servers matching the memory scheduling type are those that have already allocated memory to the first server. Therefore, when determining one or more second servers, the cloud management platform can first filter among multiple third servers to find servers that have already allocated memory to the first server, resulting in one or more servers to be filtered. For example, as described above, the cloud management platform can obtain servers that have already allocated memory to the first server by querying records; the servers obtained through this query are the servers to be filtered.

[0151] Step c2: According to the order of communication cost between the server to be filtered and the first server from high to low, accumulate the second memory amount allocated by one or more servers to be filtered to the first server, and determine one or more servers to be filtered corresponding to the second memory amount accumulated before the accumulation result first reaches or exceeds the target memory amount as one or more second servers.

[0152] After identifying one or more servers to be screened, the cloud management platform can accumulate the second memory allocated to the first server by one or more servers to be screened in descending order of communication cost between the servers to be screened and the first server, until the accumulation result first reaches or exceeds the target memory amount and then stop accumulating. Then, the one or more servers to be screened that have accumulated the second memory amount before the accumulation result first reaches or exceeds the target memory amount are identified as one or more second servers.

[0153] It should be noted that during the accumulation process, if multiple servers to be filtered have the same communication cost with the first server, the servers to be filtered can first be sorted in ascending order of the amount of second memory allocated by each server to the first server. Then, the amount of second memory allocated by each server to the first server is accumulated according to this order. This minimizes the total number of second servers allocating memory to the first server. On the one hand, this avoids excessive fragmentation of memory used by the first server; on the other hand, it prevents the first server from experiencing increased failure rates due to too many second servers providing memory to it.

[0154] Furthermore, for the second memory scheduling strategy, the second server can be determined by combining the amount of second memory allocated to the first server by the servers to be screened and the communication cost between the servers to be screened and the first server. In this case, the second server can be selected from the servers to be screened with the smallest possible amount of second memory allocated to the first server and the largest possible communication cost with the first server. In this way, the total number of second servers allocating memory to the first server can be minimized, and the performance of the first server's use of server memory can be optimized from the perspective of communication cost with the first server.

[0155] After identifying one or more second servers that will allocate memory to the first server, the cloud management platform also needs to determine the amount of allocated memory that the first server needs to return to each of the one or more second servers. The amount of allocated memory returned by the first server to each second server is determined based on the target memory amount that the first server can return, and the sum of the allocated memory amounts returned by the first server to all second servers is less than or equal to the target memory amount that the first server can return. For example, when the sum of the memory allocated to the first server by one or more second servers equals the target memory amount that the first server can return, then the amount of allocated memory returned by the first server to any one of the one or more second servers is equal to the amount of memory that any one of the second servers has allocated to the first server. For instance, when the sum of the memory allocated to the first server by one or more second servers is greater than the target memory amount that the first server can return, then the amount of memory returned by the first server to some of the one or more second servers is the amount of allocated memory that second server has allocated to the first server, and the amount of memory returned by the first server to the remaining second servers is the difference between the first server's target memory amount and the sum of the memory allocated to the first server by the servers among the one or more second servers excluding the remaining second servers. For example, when the sum of the memory allocated to the first server by the n second servers is greater than the target memory amount that the first server needs to schedule, and the sum of the memory allocated to the first server by the n-1 second servers is less than the target memory amount that the first server needs to schedule, then the amount of scheduled memory returned by the first server to any of the n-1 second servers is equal to the amount of memory that second server has already allocated to the first server, and the amount of scheduled memory returned by the first server to the remaining second server is equal to the difference between the target memory amount of the first server and the sum of the memory allocated to the first server by the n-1 second servers.

[0156] In the third memory scheduling strategy, the memory scheduling strategy is used to indicate: cancel the allocation of memory from the first server to one or more second servers. One or more second servers meet the following condition: matching the memory scheduling type, the sum of the memory already allocated by the first server to one or more second servers is greater than or equal to the target memory amount. After the cloud management platform determines the condition that one or more second servers must meet, it can filter through multiple servers to obtain one or more second servers. For example, the cloud management platform can sort multiple servers in a specified order, then traverse the multiple servers according to the sorting result, determining whether each traversed server meets the condition during the traversal, until one or more second servers that meet the condition are found. The specified order here can be determined based on memory management requirements.

[0157] Here, "matching the memory scheduling type of the second server" means that the memory scheduling type of the second server is compatible with the memory scheduling type of the first server. For example, corresponding to this third memory scheduling strategy, if the memory scheduling type of the first server indicates that the memory of the first server is canceled from being allocated to other servers, then the memory scheduling type of the second server indicates that the memory of the first server has been allocated to the second server.

[0158] The third memory scheduling strategy instructs the first server to reclaim the memory already allocated to the second server. The amount of memory the first server can reclaim is the target memory amount. To ensure the first server's memory usage needs, the total amount of memory already allocated by the first server to the second server should be greater than or equal to the target memory amount. Therefore, the second memory scheduling strategy instructs that the sum of the memory already allocated by the first server to one or more second servers is greater than or equal to the target memory amount. The amount of memory already allocated by the first server to the second server can be obtained based on historical scheduling processes. For example, when a cloud management platform schedules memory for a server, it records the amount of memory scheduled and the scheduling objects. The cloud management platform can then query these records to obtain the amount of memory already allocated by the first server to the second server.

[0159] In one possible implementation, any one of the one or more second servers further satisfies the following condition: the communication cost between any second server and the first server is greater than the communication cost between any fourth remaining server and any second server. The fourth remaining server is any server other than the first server among those to which memory has been allocated for use by any second server. The communication cost between two servers indicates the expense incurred for communication between them. This requires that the one or more second servers be those to which the first server has allocated memory and have a higher communication cost with the first server. That is, the cloud management platform sorts multiple servers in descending order of their communication cost with the first server. In this way, even if the first server continues to allocate memory to other servers after reclaiming the memory allocated to one or more second servers, it can still ensure that the communication cost incurred by servers using the first server's memory is low, thus guaranteeing the performance of servers using the first server's memory.

[0160] At this point, the cloud management platform also determines the memory sharing strategy of the first server based on the communication costs between servers. Accordingly, before step 602, the method further includes: obtaining the communication costs between multiple servers. Optionally, the communication cost between two servers is obtained based on one or more topology information, including the link hop count, link latency, and link bandwidth. Therefore, obtaining the communication costs between multiple servers includes: obtaining the topology information of multiple servers, and obtaining the communication costs between multiple servers based on the topology information. The implementation process is described in the relevant section of the first memory scheduling strategy; it will not be elaborated here.

[0161] The following example illustrates the implementation process of determining one or more second servers that match the memory scheduling type and target memory amount among multiple servers, using the following scenario: one or more second servers satisfy the following conditions: matching the memory scheduling type; the sum of memory allocated by the first server to one or more second servers is greater than or equal to the target memory amount; and the communication cost between any second server and the first server is greater than the communication cost between any fourth remaining server and any second server. Figure 12 As shown, its implementation process includes:

[0162] Step d1: Obtain one or more servers to be filtered that are using the memory of the first server, and the third amount of memory allocated by the first server to the servers to be filtered.

[0163] Corresponding to the third memory scheduling strategy, the servers that match the memory scheduling type are those to which the first server has allocated memory. Therefore, when determining one or more second servers, the cloud management platform can first filter among multiple third servers to find servers to which the first server has allocated memory, resulting in one or more servers to be filtered. For example, as described above, the cloud management platform can obtain servers to which the first server has allocated memory by querying records; the servers obtained through this query are the servers to be filtered.

[0164] Step d2: According to the order of communication cost between the server to be screened and the first server from high to low, accumulate the third memory amount allocated by the first server to one or more servers to be screened, and determine one or more servers to be screened that first reach or exceed the target memory amount as one or more second servers.

[0165] After identifying one or more servers to be screened, the cloud management platform can accumulate the third memory allocated by the first server to one or more servers to be screened in descending order of communication cost between the servers to be screened and the first server, until the accumulation result first reaches or exceeds the target memory amount and then stops accumulating. Then, the one or more servers to be screened that belong to the third memory amount accumulated when the accumulation result first reaches or exceeds the target memory amount are identified as one or more second servers.

[0166] It should be noted that during the accumulation process, if multiple servers to be filtered have the same communication cost with the first server, the servers to be filtered can first be sorted in ascending order of the amount of third memory allocated by the first server to them. Then, the amount of third memory allocated by the first server to the servers to be filtered is accumulated according to this sorting. In this way, the total number of servers to which the first server allocates third memory can be minimized. This avoids excessive fragmentation of the first server's memory and also prevents the failure rate of the first server from being increased due to too many servers using the memory provided by the first server.

[0167] As described above, the implementation methods for determining one or more second servers using the three memory scheduling strategies are all equivalent to first determining the memory scheduling type of the first server, then filtering multiple servers based on the memory scheduling type, and finally determining one or more second servers from the filtered servers. This method of determining one or more second servers reduces the complexity of first narrowing down the pool of candidate second servers and then selecting one or more from that narrowed pool.

[0168] After determining that the first server needs to reclaim memory allocated to it from one or more second servers, the cloud management platform also needs to determine the amount of scheduled memory the first server should reclaim from each of the one or more second servers. The amount of scheduled memory reclaimed by the first server from each second server is determined based on the target memory amount that the first server can reclaim, and the sum of the scheduled memory reclaimed by the first server from all second servers must be greater than or equal to the target memory amount that the first server can reclaim, to ensure the first server's memory usage needs are met. For example, when the sum of the memory allocated by the first server to one or more second servers is greater than or equal to the target memory amount that the first server can reclaim, then the amount of scheduled memory reclaimed by the first server from any one of the one or more second servers is equal to the amount of memory that the first server allocated to that any one of the second servers.

[0169] Optionally, corresponding to the third memory scheduling strategy, after determining the memory scheduling strategy for the first server, the cloud management platform can also determine a memory scheduling strategy for one or more second servers. For example... Figure 13 As shown, the method also includes:

[0170] Step 604: Determine one or more fourth servers among multiple servers that will be reassigned to use memory by one or more second servers, and the amount of scheduled memory that one or more fourth servers will schedule for each second server.

[0171] At this point, the second server needs to borrow memory from other servers. Its role is equivalent to that of the first server in the first memory scheduling strategy. The implementation method of the memory scheduling strategy for it can be referred to the first memory scheduling strategy, and will not be elaborated here.

[0172] Step 603: Based on the memory scheduling strategy, schedule memory for the first server.

[0173] After obtaining the memory scheduling policy of the first server, the cloud management platform can allocate memory to the first server based on that policy. For example, when the memory scheduling policy indicates that memory from one or more second servers should be allocated to the first server, step 603 includes mapping the memory addresses of memory that the one or more second servers can allocate to other servers to the first server. For instance, under the instruction of the cloud management platform, the memory management unit of the first server can call the underlying memory management interface to initiate a memory borrowing request to the memory management interface of the second servers, causing the second servers' memory management interface to map the memory addresses of the specified memory amount to the first server. After mapping the memory addresses of memory that the one or more second servers can allocate to other servers to the first server, the first server can store its data in the memory of the one or more second servers. Optionally, when the first server stores data in the memory of the second servers, it can selectively store the data. For example, the first server can obtain the memory access frequency of the data it needs to store, storing hot data in its local memory and storing cold data in memory borrowed by the second servers from the first server, thereby improving the performance of the first server's memory usage.

[0174] When the memory scheduling policy indicates that the allocation of memory from one or more second servers to the first server should be cancelled, step 603 includes cancelling the mapping of memory addresses of one or more second servers to the first server. For example, under the instruction of the cloud management platform, the memory management unit of the first server may invoke the underlying memory management interface to initiate a memory return request to the memory management interface of the second servers, causing the memory management interface of the second servers to cancel the mapping of memory addresses of a specified amount of memory to the first server. After cancelling the mapping of memory addresses of one or more second servers to the first server, the first server can no longer store its data in the memory of one or more second servers.

[0175] When the memory scheduling policy indicates that the allocation of memory from the first server to one or more second servers should be cancelled, step 603 includes cancelling the mapping of the memory addresses of the first server to one or more second servers. For example, under the instruction of the cloud management platform, the memory management unit of the second server may invoke the underlying memory management interface to initiate a memory return request to the memory management interface of the first server, causing the memory management interface of the first server to cancel the mapping of the memory addresses of the specified amount of memory to the second server. After cancelling the mapping of the memory addresses of the first server to the second server, the second server can no longer store its data in the memory of the first server.

[0176] Optionally, corresponding to the third memory scheduling strategy, the cloud management platform determines one or more fourth servers among multiple servers to be reallocated memory to one or more second servers, and the amount of scheduled memory allocated by the one or more fourth servers to each second server. For example... Figure 13 As shown, the method also includes:

[0177] Step 605: Allocate memory for one or more fourth servers to one or more second servers.

[0178] When the memory scheduling policy indicates that the memory of the first server should not be allocated to one or more second servers, the implementation process of steps 603 and 605 may include: calling the memory management unit of the second server to borrow memory from the fourth server; calling the memory management interface of the memory management unit of the first server to transfer the data stored in the memory of the first server from the second server to the fourth server; and then calling the memory management unit of the second server to return the borrowed memory from the first server. Borrowing memory can be achieved by mapping memory addresses, and returning memory can be achieved by unmapping the memory address mapping.

[0179] When the above memory management method is executed through a memory management system deployed in a cloud management platform, the above steps can be executed by corresponding functional units within the memory management system. For example, the memory monitoring unit is used to execute step 601. The decision-making unit is used to execute steps 602 and 604. The first memory management unit and the second memory management unit are used to jointly execute steps 603 and 605, wherein the second memory management unit performs specific operations under the instruction of the first memory management unit. The information acquisition unit is used to acquire the communication cost between servers and provide this communication cost to the decision-making unit. The implementation process of each functional unit executing its corresponding steps is described in the relevant sections above and will not be elaborated upon here.

[0180] As can be seen from the above, in the memory management method provided in this application, the cloud management platform obtains the memory scheduling strategy for the first server based on the real-time memory usage of the first server. This is equivalent to deciding, based on the real-time memory usage of the first server, whether to borrow memory from other servers, return borrowed memory to other servers, or reclaim the memory borrowed by the first server. After scheduling memory for the first server according to the decision, the required memory can be scheduled for the server on demand, ensuring that the server's memory usage needs are met, reducing the probability of memory risks, and improving server availability. Furthermore, by scheduling memory between different servers, the memory of different servers can be shared, effectively utilizing memory fragmentation and idle memory on the servers, improving server memory utilization, breaking down memory barriers, enhancing the overall resource utilization and reliability of the cloud data center, and ensuring business performance.

[0181] It should be noted that the order of steps in the memory management method based on public cloud technology provided in this application embodiment can be appropriately adjusted, and steps can also be added or removed as needed. Any variations that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application, and therefore will not be elaborated further.

[0182] The following describes an example of a virtual device in an embodiment of this application.

[0183] The above describes a memory management method based on public cloud technology according to embodiments of this application. Corresponding to the above method, embodiments of this application also provide a memory management system based on public cloud technology. Figure 14 This is a schematic diagram of the structure of a memory management system based on public cloud technology provided in an embodiment of this application. Based on Figure 14 The following are several components shown, which Figure 14The public cloud-based memory management system shown is capable of performing the above... Figure 6 or Figure 13 The system may include all or part of the operations shown. It should be understood that the system may include additional components beyond those shown, or may omit some of the shown components; this application embodiment does not impose limitations in this regard. Optionally, the public cloud-based memory management system may be deployed on a cloud management platform. The cloud management platform is used to manage the infrastructure providing cloud services. The infrastructure includes multiple servers. These multiple servers are used to deploy cloud instances that implement tenant services. All multiple servers are configured with memory. Figure 14 As shown, the public cloud-based memory management system 140 includes:

[0184] The acquisition module 1401 is used to acquire the real-time memory usage of the first server, which is one of multiple servers.

[0185] Processing module 1402 is used to obtain a memory scheduling policy for the first server based on the real-time situation of memory usage of the first server. The memory scheduling policy is used to indicate one or more of the following: allocating memory of one or more second servers to the first server for use, canceling the allocation of memory of one or more second servers to the first server for use, and canceling the allocation of memory of the first server to one or more second servers for use. The second server is one of a plurality of servers other than the first server.

[0186] The scheduling module 1403 is used to schedule memory for the first server based on a memory scheduling strategy.

[0187] In one possible implementation, the processing module 1402 is specifically configured to: determine the memory scheduling type of the first server and the target amount of memory to be scheduled based on the real-time situation of memory usage of the first server, wherein the memory scheduling type indicates one or more of the following: allocating memory from other servers to the first server, canceling the allocation of memory from other servers to the first server, and canceling the allocation of memory from the first server to other servers; and, among multiple servers, determine one or more second servers that match the memory scheduling type and the target amount of memory, and the amount of memory to be scheduled by the one or more second servers for the first server.

[0188] In one possible implementation, the memory scheduling policy is used to indicate that memory from one or more second servers is allocated to the first server, wherein the one or more second servers satisfy the following conditions: the sum of the amounts of memory that can be allocated to other servers is not less than the target amount of memory, which matches the memory scheduling type.

[0189] Optionally, in this case, the one or more second servers also satisfy the following: the communication cost between each of the one or more second servers and the first server is less than the communication cost between any of the first remaining servers and the first server, wherein the first remaining servers are servers that, in addition to the one or more second servers, match the memory scheduling type.

[0190] In one possible implementation, the scheduling module 1403 is specifically used to: map the memory addresses of memory that one or more second servers can allocate to other servers to the first server.

[0191] In one possible implementation, the memory scheduling policy is used to indicate: cancel the allocation of memory from one or more second servers to the first server, wherein the one or more second servers satisfy: matching the memory scheduling type, the sum of the amounts of memory already allocated to the first server is less than or equal to the target amount of memory.

[0192] Optionally, in this case, the one or more second servers also satisfy the following condition: the amount of memory allocated to the first server by each of the one or more second servers is less than the amount of memory allocated to the first server by any second remaining server, wherein the second remaining server is any server other than the one or more second servers among all servers that have been allocated memory to the first server.

[0193] Optionally, in this case, the one or more second servers also satisfy the following condition: the communication cost between each of the one or more second servers and the first server is greater than the communication cost between any third remaining server and the first server, wherein the third remaining server is any server other than the one or more second servers that has been allocated memory to the first server.

[0194] In one possible implementation, the scheduling module 1403 is specifically used to: cancel the mapping of memory addresses of one or more second servers to the first server.

[0195] In one possible implementation, the memory scheduling policy is used to indicate: cancel the allocation of memory from the first server to one or more second servers, where the one or more second servers satisfy: matching the memory scheduling type, the sum of the amount of memory already allocated by the first server to one or more second servers is greater than or equal to the target amount of memory.

[0196] Optionally, in this case, any one of the one or more second servers also satisfies the following condition: the communication cost between any second server and the first server is greater than the communication cost between any fourth remaining server and any second server, wherein the fourth remaining server is any server other than the first server among the servers whose memory has been allocated to any second server.

[0197] In one possible implementation, the scheduling module 1403 is specifically used to: cancel the mapping of the memory address of the first server to one or more second servers.

[0198] Here, the detailed working process of the acquisition module 1401, processing module 1402, and scheduling module 1403 is described in the preceding method embodiments. For example, the acquisition module 1401 uses the aforementioned step 601 to acquire the real-time memory usage of the first server. The processing module 1402 uses the aforementioned step 602 to obtain the memory scheduling strategy of the first server based on the real-time memory usage of the first server. The processing module 1402 uses the aforementioned step 603 to schedule memory for the first server based on the memory scheduling strategy. The embodiments of this application will not be described again here.

[0199] The acquisition module 1401, processing module 1402, and scheduling module 1403 can all be implemented in software or in hardware. For example, the implementation of the acquisition module 1401 will be described below. Similarly, the implementation of the processing module 1402 and the scheduling module 1403 can refer to the implementation of the acquisition module 1401.

[0200] As an example of a software functional unit, the acquisition module 1401 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the aforementioned computing instance may be one or more. For example, the acquisition module 1401 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Further, 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 cloud data center or multiple geographically proximate cloud data centers. Typically, a region may include multiple AZs.

[0201] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.

[0202] As an example of a hardware functional unit, the acquisition module 1401 may include at least one computing device, such as a server. Alternatively, the acquisition module 1401 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.

[0203] The multiple computing devices included in the acquisition module 1401 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the acquisition module 1401 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the acquisition module 1401 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0204] It should be noted that, in other embodiments, any one of the acquisition module 1401, processing module 1402, and scheduling module 1403 can be used to execute any step in the memory management method based on public cloud technology. The steps implemented by the acquisition module 1401, processing module 1402, and scheduling module 1403 can be specified as needed. By implementing different steps in the memory management method based on public cloud technology through the acquisition module 1401, processing module 1402, and scheduling module 1403, all functions of the memory management system based on public cloud technology can be achieved.

[0205] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of each component described above can be referred to the corresponding content in the foregoing method embodiments, and will not be repeated here.

[0206] The following provides examples illustrating the basic hardware structures involved in the embodiments of this application.

[0207] This application also provides a computing device 1500. For example... Figure 15 As shown, the computing device 1500 includes a bus 1502, a processor 1504, a memory 1506, and a communication interface 1508. The processor 1504, the memory 1506, and the communication interface 1508 communicate with each other via the bus 1502. The computing device 1500 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 the computing device 1500.

[0208] Bus 1502 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 15 The bus 1502 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 1502 may include a path for transmitting information between various components of the computing device 1500 (e.g., memory 1506, processor 1504, communication interface 1508).

[0209] Processor 1504 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).

[0210] The memory 1506 may include volatile memory, such as random access memory (RAM). The processor 1504 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0211] The memory 1506 stores executable program code, and the processor 1504 executes this executable program code to implement the functions of the aforementioned acquisition module 1401, processing module 1402, and scheduling module 1403, thereby realizing the memory management method based on public cloud technology. That is, the memory 1506 stores instructions for executing the memory management method based on public cloud technology.

[0212] The communication interface 1508 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between the computing device 1500 and other devices or communication networks.

[0213] This application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device 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.

[0214] like Figure 16 As shown, the computing device cluster includes at least one computing device 1500. The memory 1506 in one or more computing devices 1500 within the computing device cluster may store the same instructions for executing memory management methods based on public cloud technology.

[0215] In some possible implementations, the memory 1506 of one or more computing devices 1500 in the computing device cluster may also store partial instructions for executing memory management methods based on public cloud technology. In other words, a combination of one or more computing devices 1500 can jointly execute instructions for executing memory management methods based on public cloud technology.

[0216] It should be noted that the memory 1506 in different computing devices 1500 within the computing device cluster can store different instructions, which are used to execute certain functions of the memory management system based on public cloud technology. That is, the instructions stored in the memory 1506 of different computing devices 1500 can implement the functions of one or more modules among the acquisition module 1401, processing module 1402, and scheduling module 1403.

[0217] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN), a local area network (LAN), or similar. Figure 17 One possible implementation is shown. For example... Figure 17As shown, the two computing devices 1500A and 1500B are connected via a network. Specifically, they are connected to the network through the communication interfaces in each computing device. In this possible implementation, the memory 1506 in computing device 1500A stores instructions for executing the functions of the acquisition module 1401. Simultaneously, the memory 1506 in computing device 1500B stores instructions for executing the functions of the processing module 1402 and the scheduling module 1403.

[0218] Figure 17 The connection method between the computing device clusters shown can be that, considering that the memory management method based on public cloud technology provided in this application requires a large amount of data storage, the functions implemented by the processing module 1402 and the scheduling module 1403 are delegated to the computing device 1500B for execution.

[0219] It should be understood that Figure 17 The functions of computing device 1500A shown can also be performed by multiple computing devices 1500. Similarly, the functions of computing device 1500B can also be performed by multiple computing devices 1500.

[0220] This application also provides another computing device cluster. The connection relationships between the computing devices in this computing device cluster can be similarly referred to... Figure 16 and Figure 17 The connection method of the computing device cluster. The difference is that the memory 1506 in one or more computing devices 1500 in this computing device cluster can store the same instructions for executing memory management methods based on public cloud technology.

[0221] In some possible implementations, the memory 1506 of one or more computing devices 1500 in the computing device cluster may also store partial instructions for executing memory management methods based on public cloud technology. In other words, a combination of one or more computing devices 1500 can jointly execute instructions for executing memory management methods based on public cloud technology.

[0222] This application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions capable of running on a computing device or stored on any available medium. When the computer program product runs on at least one computing device, it causes the at least one computing device to perform a memory management method based on public cloud technology.

[0223] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to perform a memory management method based on public cloud technology, or instruct the computing device to perform a memory management method based on public cloud technology.

[0224] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0225] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the raw data and executable code involved in this application were obtained with full authorization.

[0226] In the embodiments of this application, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The term "at least one" refers to one or more, and the term "multiple" refers to two or more, unless otherwise expressly defined.

[0227] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0228] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A memory management method based on public cloud technology, characterized in that, The method is executed by a cloud management platform, which manages the infrastructure providing cloud services. The infrastructure includes multiple servers, which are used to deploy cloud instances that implement tenant services. Each of the multiple servers is configured with memory. The method includes: Obtain real-time information on memory usage of the first server, which is one of the plurality of servers; Based on the real-time memory usage of the first server, a memory scheduling policy for the first server is obtained. The memory scheduling policy is used to indicate one or more of the following: allocating memory of one or more second servers to the first server for use, canceling the allocation of memory of the one or more second servers to the first server for use, and canceling the allocation of memory of the first server to the one or more second servers for use, wherein the second server is one of the plurality of servers other than the first server. Based on the memory scheduling strategy, memory is scheduled for the first server.

2. The method as described in claim 1, characterized in that, The process of obtaining the memory scheduling strategy for the first server based on the real-time memory usage of the first server includes: Based on the real-time memory usage of the first server, the memory scheduling type of the first server and the target amount of memory to be scheduled are determined. The memory scheduling type indicates one or more of the following: allocate memory from other servers to the first server, cancel the allocation of memory from other servers to the first server, and cancel the allocation of memory from the first server to other servers. Among the plurality of servers, one or more second servers that match the memory scheduling type and the target memory amount are determined, and the one or more second servers schedule the memory amount for the first server.

3. The method as described in claim 2, characterized in that, The memory scheduling policy is used to indicate that the memory of one or more second servers is allocated to the first server for use, wherein the one or more second servers meet the following conditions: they match the memory scheduling type, and the sum of the amount of memory that can be allocated to other servers is not less than the target amount of memory.

4. The method as described in claim 3, characterized in that, The one or more second servers further satisfy the following condition: the communication cost between each of the one or more second servers and the first server is less than the communication cost between any first remaining server and the first server, wherein the first remaining server is a server among the plurality of servers other than the one or more second servers and that matches the memory scheduling type.

5. The method as described in claim 3 or 4, characterized in that, The step of scheduling memory for the first server based on the memory scheduling strategy includes: Map the memory addresses of the memory that the one or more second servers can allocate to other servers to the first server.

6. The method as described in claim 2, characterized in that, The memory scheduling policy is used to indicate: cancel the allocation of memory from the one or more second servers to the first server, wherein the one or more second servers satisfy: matching the memory scheduling type, the sum of the memory already allocated to the first server is less than or equal to the target memory amount.

7. The method as described in claim 6, characterized in that, The one or more second servers further satisfy the following condition: the amount of memory allocated to the first server by each of the one or more second servers is less than the amount of memory allocated to the first server by any second remaining server, wherein the second remaining server is any server other than the one or more second servers among all servers that have been allocated memory to the first server.

8. The method as described in claim 6 or 7, characterized in that, The one or more second servers further satisfy the following condition: the communication cost between each of the one or more second servers and the first server is greater than the communication cost between any third remaining server and the first server, wherein the third remaining server is any server other than the one or more second servers that has been allocated memory to the first server.

9. The method as described in any one of claims 6 to 8, characterized in that, The step of scheduling memory for the first server based on the memory scheduling strategy includes: Cancel mapping the memory addresses of the one or more second servers to the first server.

10. The method as described in claim 2, characterized in that, The memory scheduling policy is used to indicate: cancel the allocation of memory from the first server to the one or more second servers, wherein the one or more second servers satisfy: matching the memory scheduling type, the sum of the memory already allocated by the first server to the one or more second servers is greater than or equal to the target memory amount.

11. The method as described in claim 10, characterized in that, Any of the one or more second servers further satisfies the following condition: the communication cost between any second server and the first server is greater than the communication cost between any fourth remaining server and any second server, wherein the fourth remaining server is any server other than the first server among the servers whose memory has been allocated to any second server.

12. The method as described in claim 10 or 11, characterized in that, The step of scheduling memory for the first server based on the memory scheduling strategy includes: Cancel mapping the memory address of the first server to the one or more second servers.

13. A memory management system based on public cloud technology, characterized in that, The device is deployed on a cloud management platform, which manages the infrastructure providing cloud services. The infrastructure includes multiple servers, which are used to deploy cloud instances that implement tenant services. Each server is configured with memory. The device includes: The acquisition module is used to acquire the real-time memory usage of the first server, which is one of the plurality of servers; The processing module is configured to obtain a memory scheduling policy for the first server based on the real-time memory usage of the first server. The memory scheduling policy is configured to indicate one or more of the following: allocating memory of one or more second servers to the first server for use, canceling the allocation of memory of the one or more second servers to the first server for use, and canceling the allocation of memory of the first server to the one or more second servers for use, wherein the second server is one of the plurality of servers other than the first server. The scheduling module is used to schedule memory for the first server based on the memory scheduling strategy.

14. The apparatus as claimed in claim 13, characterized in that, The processing module is specifically used for: Based on the real-time memory usage of the first server, the memory scheduling type of the first server and the target amount of memory to be scheduled are determined. The memory scheduling type indicates one or more of the following: allocate memory from other servers to the first server, cancel the allocation of memory from other servers to the first server, and cancel the allocation of memory from the first server to other servers. Among the plurality of servers, one or more second servers that match the memory scheduling type and the target memory amount are determined, and the one or more second servers schedule the memory amount for the first server.

15. The apparatus as claimed in claim 14, characterized in that, The memory scheduling policy is used to indicate that the memory of one or more second servers is allocated to the first server for use, wherein the one or more second servers meet the following conditions: they match the memory scheduling type, and the sum of the amount of memory that can be allocated to other servers is not less than the target amount of memory.

16. The apparatus as claimed in claim 14, characterized in that, The memory scheduling policy is used to indicate: cancel the allocation of memory from the one or more second servers to the first server, wherein the one or more second servers satisfy: matching the memory scheduling type, the sum of the memory already allocated to the first server is less than or equal to the target memory amount.

17. The apparatus as claimed in claim 14, characterized in that, The memory scheduling policy is used to indicate: cancel the allocation of memory from the first server to the one or more second servers, wherein the one or more second servers satisfy: matching the memory scheduling type, the sum of the memory already allocated by the first server to the one or more second servers is greater than or equal to the target memory amount.

18. A computing device cluster, characterized in that, The system includes multiple computing devices, each comprising multiple processors and multiple memories, the multiple memories storing program instructions, and the multiple processors executing the program instructions to cause the cluster of computing devices to perform the method according to any one of claims 1 to 12.

19. A computer-readable storage medium, characterized in that, Includes program instructions that, when executed on a computing device, cause the computing device to perform the method as described in any one of claims 1 to 12.

20. A computer program product containing instructions, characterized in that, When the instruction is executed by the computing device cluster, the computing device cluster causes the computing device cluster to perform the method as described in any one of claims 1 to 12.